GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — ray/Utility.jl at master · lowrank/ray Expand file tree/ Copy pathUtility.jlMore file actions 39 lines (36 loc) · 916 Bytes / Copy pathUtility.jlFile metadata and controls39 lines (36 loc) · 916 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 function similarity(X, Y) return cos(atan(X[1], X[2]) - atan(Y[1], Y[2])); end # align polar coordinate function alignment(signal) n = length(signal); for i = 2:n if abs(signal[i] - signal[i-1]) > 1.5*π signal[i:n] = signal[i:n] - sign(signal[i] - signal[i-1]) * 2*π; end end return signal end function derivativeCheck(signal) n = length(signal); deriv = (signal[2 : n] - signal[1:n-1]); # detect the largest two jumps in derivative. lo = 1;hi = n; for i = 1:n-2 if abs(deriv[i] - deriv[i+1]) > 0.12 lo = i ; break; end end for i = n-1:-1:2 if abs(deriv[i] - deriv[i-1] ) > 0.12 hi = i+1; break; end end if abs(lo - hi) < n/8 # cheat here. if too close, aperture too small to be true. lo = 1; hi = n; end return lo, hi end |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |