Eggs, melons, and peanuts  Cassini OvalAlso called: Cassinoid or Cassinian EllipseWritten by Paul Bourke April 2001 Introduction
Around 1680 Giovanni Cassini investigated a family of curves which he believed defined the path the Earth takes around the sun. The curves were defined by all the points where the product of the distances from the point to two fixed points (call the separation 2a) were some constant (call this b^{2}). Note an ellipse is defined as the points where the sum of the distances to two fixed points equal some constant. The general appearance of the curve is dictated by the relative values of a and b. If a < b the curve forms a single loop, this loop becomes increasingly pinched as a approaches b. When a > b the curve is made up of two loops, at a = b it is the same as the lemnescate of Bernoulli that was documented about 14 years later. Equations
There are a number of ways to describe the Cassini oval, some of these are given below. Bipolar coordinates
Cartesian description from the definition or equivalently These clearly revert to a circle of radius b for a = 0.
Polar coordinates It is possible to solve for r^{2} using the standard solution for a quadratic. When using this formulation to create the curve in 2D or surfaces of revolution to form solids in 3D be very careful about the range of theta and what the positive and negative solutions mean. The parametric formulation used to create the curves and solids here is based up the following. y(t) = sin(t) sqrt(C) where C = a^{2} cos(2t) +/ sqrt(b^{4}  a^{2} sin^{2}(2t))
Note:
An unexpected way to create a Cassini curve is to slice a torus with a plane parallel to the axis of the torus. As the plane is moved outwards from the centre of the torus there is a transition of Cassini curves from a > b (two loops) to a = b, and finally a < b (single loop). Examples
Sphere, a = 0.1, b = 1
Melon, a = 0.5, b = 1
Peanut, a = 0.9, b = 1
a = 0.99, b = 1
Egg, a = 1.01, b = 1
a = 1.1, b = 1
Sphere, a = 2, b = 1
Source code
The C source code that created the images on this page can be found here: cassini.c. While it creates output geometry in a particular format, the primitives are just lines and 3D polygons so it shouldn't be difficult to modify the code to create geometry in a format for your favourite package. The 3D solids are formed as surfaces of revolution about the x axis. PovRay
For PovRay users here are some examples of Cassini solids and code to create smooth triangle models: povcassini.c. The renderings here used the init file: cassini.ini and the PovRay scene file: cassini.pov. The output of povcassini.c is piped to "cassini.inc".
