Implicit Equation Grapher
For a while now, I’ve been thinking about plotting implicit equations in the back of my head. Mathematica’s method still eludes me—all you do is specify the equation, and the range of x,y values to consider—; the only way I can think of involves finding at least one solution to the equation, and then following the gradient of the function in a way that keeps the value as close to 0 as possible. Besides the obvious drawback of requiring a seed, this technique also diverges from the actual curve, because after the first value, all the points considered to be on the curve are actually not. So it is possible, if you have a convoluted enough expression, that what you end up with looks nothing like the actual curve.
To pass the time today while at a graduation ceremony, I took along a book with me, and I was surprised to see that it had almost the exact same technique I was thinking of for graphing implicit equations, except being on paper, it was more detailed. Supposedly this was gleaned from a research paper; therefore at least some other people who have considered this problem have run into the same dead-end.
Amusingly— considering that using this technique requires having a closed form expression for the gradient—, this was an exercise at the end of the chapter:
Develop a menu-driven, interactive graphics program to draw planar curves that are specified implicitly. Use the method developed in Section 2.3.2. Provide several examples of implicit functions to be drawn.
Interpreting that liberally, that requires the program to parse and calculate derivatives for arbitrary expressions. Of course, you could always take the easy way out and just hardcode in the examples.
Possibly relevant posts:
- Implicit Plotting code for Mathematica (8/30/2007)
- Greens Theorem (9/5/2004)
- Complex Analysis pt. I (11/3/2003)