Online Example::Lemniscate of Bernoulli

This example illustrates how to animate a sequence of sprites around a figure-8 curve (or infinity symbol), formally known as the Lemniscate of Bernoulli. The equation for the entire curve in rectangular coordinates (for arbitrary parameter, a) is given by

(x^2 + y^2)^2 = a^2(x^2 - y^2)

and in polar form by

r^2 = a^2cos(2t)

With polar coordinates, the curve may be plotted in a single quadrant, using reflection and symmetry to produce the remaining plot. In many applications, a higly accurate plot is not desired. Instead, sprites are animated around the curve. In this case, we can use a closed-loop Catmull-Rom spline to approximate the shape. Arc-length parameterization assures uniform velocity during the animation.

The example illustrates how to animate a sequence of sprites around the 'infinity' shape. Study the code and observe how a small sample of points are obtained in the principal quadrant. These points are reflected to generate the remaining control points. The last control point need not be generated as the C-R spline is automatically closed.

Click the 'Animate' button to view the animation. As an experiment, change the parametrization to UINFORM and note the difference in how the sprites move along the shape.

This example requires the Flash™ 9 player.

You need to upgrade your Flash Player

This example requires the Flash™ 9 player.

For further reading,

:: Catmull-Rom Splines - An introduction to Catmull-Rom Splines.

:: Arc-Length Parameterization - Introduction to curve parameterization and how to reparameterize a curve on arc length. Techniques applied to a Catmull-Rom spline. Examples include how to distribute sprites evenly along a curve and path animation (including path following and orientation).

:: Arc Length of a Catmull-Rom Spline - Arc Length of parametric curves and derivative evaluation, applied to Catmull-Rom splines.

Source Code. Download the Singularity package (this example is in Singularity/demos/CRClosed2.mxml).