# Plotting algebraic surfaces using Mayavi Who says math is not beautiful? Anyone who doubts the beauty in math must check out algebraic surfaces.

An implicit functions has the form: $F(x,y,z, ...)=c$

where, $c$ is an arbitrary constant.

For example, the implicit equation of the unit circle is $x^2 + y^2 = 1$ and the equation $x^2 + y^2 + z^2 = 1$ describes a sphere of radius 1.

An algebraic surface is described by an implicit function $F(x,y,z) = c$. It may be rendered using Mayavi by evaluating the expression $F(x,y,z)-c=0$ on a regular (specified) grid, and then generate isosurface of contour value equal to 0.

Here are some examples of algebraic surfaces plotted using Mayavi:

I wrote a quick function called `implicit_plot` for plotting algebraic surfaces using Mayavi. The most important argument to the function is of course the expression $F(x,y,z)-c=0$ as a `string`. It is probably not the best function, but the idea is to show how to plot implicit surfaces. The code snippet is included at the end of this post. Suggestions for improvement are always welcome. My interest in computer generated images and animation goes back to when I was in my 9th grade. Our computer teacher (Miss. Banurekha) wanted me and my dear friend Siddharth Choraria to participate in an inter-school computer graphics competition. I wasn’t any computer rock-star, but she had seen my pencil-sketches on the class notice board and thought that we do something useful. Of course, Siddharth  was a brilliant student and we worked well together.