Liouville - a package for doing mathematics in Squeak.


Liouville is a package for symbolic and numerical mathematics. It is written in Squeak. A preliminary version for Squeak 3.7 can be downloaded here.

Liouville can perform symbolic integration:

Enter the searched integral:

and select the option compute. You obtain this result:

The Integral

Liouville offers two-dimensional and three-dimensional graphics:

Here are two examples of a two-dimensional graphic:

A surprisingly simple formula gives a beautiful curve that resembles a Swiss Cross:

ParametricPlot
    ({cos(t) * (3 + cos(t*4)),
      sin(t) * (3 + cos(t*4)) },
     {t, 0.0,     2*pi },
     PlotPoints ->  52  ,
     Axes -> True, Grid -> True)
A Swiss Cross

The following example draws three cycloides into one diagram:

ParametricPlot
    ({{2*t - 3*sin(t),
         2 - 3*cos(t) },
      {2*t - 2.5*sin(t),
         2 - 2.5*cos(t) },
      {2*t - 2.5*sin(t*2),
         2 - 2.5*cos(t*2) }
     },
     {t, 0.0,  5*pi },
     PlotPoints ->  20  ,
     Colors -> {red , green, blue },
     PlotRange -> {{-1, 10*pi + 1}, {-1, 5}},
     XTicks -> {0.0, pi, { pi, ' pi'}},
     Axes -> True, Grid -> True)
Three Cycloides

Three-dimensional graphics are created with OpenGL.

Here you see a torus (in blue) and a tube (in green) around that torus.:

Two Tubes

The red lines on both solids show the torsion, a geometric property of spacial curves.

The code to create this picture is shown here:

ShowGraphics(
  TubePlot({ 8*cos(t), sin(t) * 8, 0},
           { t, 0.0, 2*pi },
           Radius  -> 1.5,
           Texture -> { white, RGB (0.8, 0.8, 0.8) },
           ShowTorsion ->{red, RGB(0.8, 0.0, 0.0) },
           Material -> { shininess -> 1.5,
                         emission -> HSV(240, 0.5, 0.7),
                         specular -> HSV(0, 0.2, 0.4) }
           ),
 TubePlot({(cos(10*t) * 3 + 8) * cos(t),
           (cos(10*t) * 3 + 8) * sin(t),
            sin(10*t)  * 3
          },
          { t, 0.0, 2*pi },
          Radius -> 0.8,
          Texture -> { white, RGB (0.8, 0.8, 0.8) },
          ShowTorsion ->{red, RGB(0.8, 0.0, 0.0) },
          Material -> { shininess -> 1.5,
                        emission -> HSV(120, 0.5, 0.7),
                        specular -> HSV(0, 0.2, 0.4) }
          ),
 LightSources ->
       { DirectionalLight (Direction -> {0, 0, 10},
                           SpecularLight -> HSV(120, 0.9, 0.9)
                          ),
         DirectionalLight (Direction -> {0, 0, -10},
                           SpecularLight -> HSV(360, 1.0, 0.9)
                          ),
         DirectionalLight (Direction -> {-100, 0, -10},
                           SpecularLight -> HSV(240, 1.0, 0.9)
                          ),
         DirectionalLight (Direction -> {100, 0, 10},
                           SpecularLight -> HSV(60, 1.0, 0.9)
                          ),
         DirectionalLight (Direction -> {-10, 0, -100},
                           SpecularLight -> HSV(180, 1.0, 0.9)
                          ),
         DirectionalLight (Direction -> {10, 0, 100},
                           SpecularLight -> HSV(300, 1.0, 0.9)
                          )
     },
 BackColor -> RGB(0.9, 0.9, 0.9))

Back to Squeak Home.