040 -- Explicit Curves: (Due W October 25)
Exercises 40 and 41 treat the topics of explicit and implicit curves, respectively. For this exercise, select a 2D curve from the
Mathworld curves site.
I recommend selecting curves whose equations take the standard explicit
form y = f(x), or curves which take the parametric form y = f(t),
x = g(t). See this example for
some code that deals with Polar curves in the form r = f(theta). (For some simple parametric curves to get started with, consider the Spirograph-like roulette curves.) Create a
simple interaction in which the mouseX and mouseY are used to continuously govern two parameters of the curve. You may also want to look at
these interactive applets for some more inspiration.
Connect the shape's internal parameters to the mouse in such a way as to develop a satisfying exploration of the graphic and dynamic possibilities of this shape. You might wish to use a shaping function to change how the curve responds to the mouse. In converting mathematical notations into code, make sure you familiarize yourself with the exp(), pow(), abs(), sqrt(), sq(), log(), and other mathematical functions available in Java. Also, don't forget your trigonometric identities.
Please be sure to use a 2D curve. Later this semester we will use your applet for an in-class exercise involving PDF/DXF output and the computer-controlled laser cutter.