Leminscate of Bernoulii

Difference between version 1 and 3 - Previous - Next
[Arjen Markus] (25 november 2020) It is a classic, elegant, curve, which
resembles a figure eight: the ''lemniscate''. You can find a description
on https://mathworld.wolfram.com/Lemniscate.html%|%MathWorld%|% or
https://mathshistory.st-andrews.ac.uk/Curves/Lemniscate/%|%MacTutor%|%
and it was Jacob Bernoulli who named it in 1694.

For the mathematically inclined, here are two equations that describe
the curve:

In cartesian coordinates:
======none
   (x**2 + y**2) ** 2 = a**2 (x**2 - y**2)
======

and in polar coordinates:
======none
   r**2 = a**2 cos(2 theta)
======

But rather than use either of these equations directly, it is more
artistic (in my personal view ;)) to use the construction via the
envelope of circles:

[Lemniscate - picture]

The construction is simple:

   * Draw a rectangular hyperbola
   * Then draw circles with the centres on the hyperbola (both branches) and passing through the origin

The envelope of the circles is the lemniscate.

Here is the code I used for the picture:

======tcl
# lemniscate.tcl --
#     Draw a lemniscate of Bernoulli via the envelope of cicles on a hyperbola
#
#     Note:
#     Draw in the square x: -2 to 2, y: -2 to 2 and then scale the result to fit the
#     canvas.
#
pack [canvas .c -width 800 -height 800]

#
# Draw the hyperbola: x**2 - y**2 = 1
#

set dy [expr {4.0 / 40.0}]
for {set n -20} {$n <= 20} {incr n} {
    if { $n > -20 } {
        set xp $x
        set yp $y
    }

    set y [expr {$dy * $n}]
    set x [expr {sqrt($y**2 + 1.0)}]

    if { $n > -20 } {
        set xpm [expr {-$xp}]
        set xm  [expr {-$x}]
        set ypm [expr {-$yp}]
        set ym  [expr {-$y}]

        .c create line $xp  $yp  $x   $y   -width 2 -fill red
        .c create line $xpm $yp  $xm  $y   -width 2 -fill red
        .c create line $xp  $ypm $x   $ym  -width 2 -fill red
        .c create line $xpm $ypm $xm  $ym  -width 2 -fill red
    }
}

#
# Draw the circles ...
#

for {set n -20} {$n <= 20} {incr n} {
    set y [expr {$dy * $n}]
    set x [expr {sqrt($y**2 + 1.0)}]

    #
    # This is the centre, now determine the bounding box:
    # the circle should pass through the origin
    #
    set radius [expr {hypot($x,$y)}]

    set x1min   [expr { $x - $radius}]
    set x1max   [expr { $x + $radius}]
    set y1min   [expr { $y - $radius}]
    set y1max   [expr { $y + $radius}]

    set x2min   [expr {-$x - $radius}]
    set x2max   [expr {-$x + $radius}]
    set y2min   [expr { $y - $radius}]
    set y2max   [expr { $y + $radius}]

    set x3min   [expr {-$x - $radius}]
    set x3max   [expr {-$x + $radius}]
    set y3min   [expr {-$y - $radius}]
    set y3max   [expr {-$y + $radius}]

    set x4min   [expr { $x - $radius}]
    set x4max   [expr { $x + $radius}]
    set y4min   [expr {-$y - $radius}]
    set y4max   [expr {-$y + $radius}]

    .c create oval $x1min $y1min $x1max $y1max
    .c create oval $x2min $y2min $x2max $y2max
    .c create oval $x3min $y3min $x3max $y3max
    .c create oval $x4min $y4min $x4max $y4max
}

.c scale all 0 0 180 180
.c move  all 400 400
======

Note: to make the calculation of the coordinates easy I simply used the
geometrical coordinate system and relied on the canvas to do the
transformation to the pixel coordinates.

----
'''[anonymous] - 2020-11-28 11:37:14'''

There must be '''Lemniscate''' of '''Bernoulli''' in the title...
----
'''[arjen] - 2020-11-30 09:43:06'''

Indeed a typo! I do not know how to correct a page title though.

----
'''[anonymous] - 2020-11-30 11:45:33'''

Really and truly, there would be nice to have the "Rename the page (by its author)" in the wiki menu.

<<categories>>Mathematics|Toys