Wednesday, October 7, 2015

Connect the Dots

One of my high school students did paper-and-pencil artwork that looks like this. I wrote this program that we may code together in class. When you connect the dots, the result is a parabola curve along the bottom edge. 

The SVG version does not work with iPad because Safari iOS does not like inline SVG elements. So the following code uses HTML5 canvas. The JavaScript calculations are the same, but the drawing routines are different.


How many lines?
What color?

No comments:

Post a Comment