summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <leonardomtenenbaum@gmail.com>2016-10-16 17:06:31 -0400
committerpommicket <leonardomtenenbaum@gmail.com>2016-10-16 17:06:31 -0400
commit83b39b3c7ae56fba695eebd4288797fcb2ff6a69 (patch)
tree86667a1e0a7e8511d305771baa5401929b71056c
parentadde8a18a5affd01cff261ce540264cf28e8e59c (diff)
Fixed RPN when aspect ratio =/= 1:1
-rw-r--r--js/complexfunctions.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/js/complexfunctions.js b/js/complexfunctions.js
index 688eea0..630cd9a 100644
--- a/js/complexfunctions.js
+++ b/js/complexfunctions.js
@@ -11,7 +11,7 @@ function drawPoints(points)
background(255);
for (var i = 0; i < points.length; i++)
{
- point((points[i][0]/(SCALE*width/750)+0.5)*width, (points[i][1]/(SCALE*height/750)+0.5)*height);
+ point((points[i][0]/(SCALE*width/750)+0.5)*width, (points[i][1]/(SCALE*width/750)+0.5)*height);
}
}
@@ -23,7 +23,7 @@ function drawManyPoints(points)
stroke(colors[f][0], colors[f][1], colors[f][2]);
for (var i = 0; i < points[f].length; i++)
{
- point((points[f][i][0]/SCALE+0.5)*width, (points[f][i][1]/SCALE+0.5)*height);
+ point((points[f][i][0]/(SCALE*width/750)+0.5)*width, (points[f][i][1]/(SCALE*width/750)+0.5)*height);
}
}
}
@@ -87,8 +87,14 @@ function makeCanvas(w, h)
{
for (var j = 0; j < height; j++)
{
- domainPoints.push([(j/width-0.5)*SCALE*width/750, (i/height-0.5)*SCALE*height/750]);
- domainPoints.push([(i/width-0.5)*SCALE*width/750, (j/height-0.5)*SCALE*height/750]);
+ domainPoints.push([(i/width-0.5)*SCALE*width/750, (j/height-0.5)*SCALE*width/750]);
+ }
+ }
+ for (var i = 10; i < height; i += 50)
+ {
+ for (var j = 0; j < width; j++)
+ {
+ domainPoints.push([(j/width-0.5)*SCALE*width/750, (i/height-0.5)*SCALE*width/750]);
}
}
drawPoints(domainPoints);