diff options
author | pommicket <leonardomtenenbaum@gmail.com> | 2016-10-16 17:12:36 -0400 |
---|---|---|
committer | pommicket <leonardomtenenbaum@gmail.com> | 2016-10-16 17:12:36 -0400 |
commit | 5950b3b50c67d82e870271f71efeda5babc7ecfa (patch) | |
tree | d4e0de24369e8e053ff04d677dfd25a75e7c582f | |
parent | 83b39b3c7ae56fba695eebd4288797fcb2ff6a69 (diff) |
Fixed RPN when aspect ratio =/= 1:1
-rw-r--r-- | js/complexfunctions.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/js/complexfunctions.js b/js/complexfunctions.js index 630cd9a..909882f 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*width/750)+0.5)*height); + point((points[i][0]/(SCALE*width/750)+0.5)*width, (points[i][1]/(SCALE*width/750)+0.5*height/width)*width); } } @@ -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*width/750)+0.5)*width, (points[f][i][1]/(SCALE*width/750)+0.5)*height); + point((points[f][i][0]/(SCALE*width/750)+0.5)*width, (points[f][i][1]/(SCALE*width/750)+0.5*height/width)*width); } } } @@ -87,14 +87,14 @@ function makeCanvas(w, h) { for (var j = 0; j < height; j++) { - domainPoints.push([(i/width-0.5)*SCALE*width/750, (j/height-0.5)*SCALE*width/750]); + domainPoints.push([(i/width-0.5)*SCALE*width/750, (j/width-0.5*height/width)*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]); + domainPoints.push([(j/width-0.5)*SCALE*width/750, (i/width-0.5*height/width)*SCALE*width/750]); } } drawPoints(domainPoints); |