diff options
| author | jules <jules@okfoc.us> | 2014-01-26 04:38:18 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2014-01-26 04:38:18 -0500 |
| commit | c030a4c619c4fc6182cc9b266241ce1970174a40 (patch) | |
| tree | c093bb285e64946845e2e64a2de700944f7ed205 /js/util.js | |
| parent | c3470d02a57396e92a71d3cfb072e655ccb51780 (diff) | |
try to proxy https as http
Diffstat (limited to 'js/util.js')
| -rw-r--r-- | js/util.js | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -43,6 +43,11 @@ function choice(a){ return a[randint(a.length)] } function deg(n){ return n*180/PI } function rad(n){ return n*PI/180 } function xor(a,b){ a=!!a; b=!!b; return (a||b) && !(a&&b) } +function mod(n,m){ return n-(m * floor(n/m)) } +function dist(x0,y0,x1,y1){ return sqrt(pow(x1-x0,2)+pow(y1-y0,2)) } +function angle(x0,y0,x1,y1){ return atan2(y1-y0,x1-x0) } +function avg(m,n,a){ return (m*(a-1)+n)/a } + function pixel(x,y){ return 4*(mod(y,actual_h)*actual_w+mod(x,actual_w)) } function rgbpixel(d,x,y){ var p = pixel(~~x,~~y) @@ -51,10 +56,7 @@ function rgbpixel(d,x,y){ b = d[p+2] a = d[p+3] } -function mod(n,m){ return n-(m * floor(n/m)) } -function dist(x0,y0,x1,y1){ return sqrt(pow(x1-x0,2)+pow(y1-y0,2)) } -function angle(x0,y0,x1,y1){ return atan2(y1-y0,x1-x0) } -function avg(m,n,a){ return (m*(a-1)+n)/a } +function fit(d,x,y){ rgbpixel(d,x*actual_w/w,y*actual_h/h) } function step(a, b){ return (b >= a) + 0 |
