Lemniscate of Bernoulli

Or, a fancy name for a figure-8 or infinty shape.  Some curves do not have simple, closed-form equations for plotting.  In rectangular coordinates, the equation for the Lemniscate of Bernoulli is (x^2 + y^2)^2 = a^2(x^2 – y^2) .  In polor form, the equation is r^2 = a^2cos(2t) .  Because of the radical and the range of the cosine function, the polar form is used in a principal quadrant.  Symmetry and reflection may be used to generate the remainder of the curve. 

What if we were required to animate sprites along the curve? 


Since a highly accurate plot is not desired, it is easy to sample the curve to generate control points for a closed-loop Catmull-Rom spline (automatic closure saves having to generate the final control point).  Arc-length parameterization assures smooth motion during the animation.

This is illustrated in an online demo, which you may view here.  The demo page includes a link to download the entire Singularity package.


2 thoughts on “Lemniscate of Bernoulli

  1. haha too much coincidence in the subject of your post and one of my class new type of tweening! When I release the third demo I’ll explain it well! Nice work with the math it’s the very first base that any flash programmer ever need..

Comments are closed.