From 91ef84313ab4e1288411c247bb23e09af64e13f0 Mon Sep 17 00:00:00 2001 From: Jules Date: Wed, 22 Apr 2015 16:42:05 -0400 Subject: linkz --- index.html | 9 +++++++-- js/util.js | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 090aab5..9de3a6b 100644 --- a/index.html +++ b/index.html @@ -56,12 +56,17 @@ h1 { font-size: 26px; font-weight: normal }

colorcodes

- + +

etc..

@@ -70,7 +75,7 @@ h1 { font-size: 26px; font-weight: normal } - +



diff --git a/js/util.js b/js/util.js index f76fc8e..22f12bc 100644 --- a/js/util.js +++ b/js/util.js @@ -55,7 +55,9 @@ 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 quantize(a,b){ return ~~(a/b)*b } +function quantize(a,b){ return round(a/b)*b } +function quantize_down(a,b){ return floor(a/b)*b } +function quantize_up(a,b){ return ceil(a/b)*b } function pixel(x,y){ return 4*(mod(y,actual_h)*actual_w+mod(x,actual_w)) } function rgbpixel(d,x,y){ -- cgit v1.2.3-70-g09d2