Saturday, July 19, 2014

AlgeSurf Parametric Equations: Math in 3D - fast, pretty and easy


The Breather Surface. Use your pointing device to pan rotate and zoom

Some of of best friends are mathematicians. This does not mean I necessarily like what they do. On the contrary, I find the Euler-derived notation difficult to parse, not easy to remember and not really pretty to look at. And then, say you have equations printed on a piece of paper or even displayed in Wikipedia - such as the Frobenius Endomorphism. Now tap or swipe the equation with your fingers. Nothing happens! People spend hours formatting text that just so it ends up sitting still like this. How lame is that?

Thank goodness there are alternatives. One of may favorites is computerese. Just translate the equation into Java or Python or JavaScript and now the number of people that can read what is going on increases from thousands to millions.

And another really nice way of displaying math is via the computer display. The display above is generated by the latest update to AlgeSurf - called AlgeSurf PE. PE stands for parametric equations.

The code for the above can be see in breather-surface.html. A much refined and enhanced version is available via the new Equation Browser.

This new display technique represents a major shift in direction from the previously released AlgeSurf Marching Cubes Builder and Player, Both the the Marching Cubes and the Parametric equations apps serve the same purpose: to provide access a extensive libraries of well-known equations and allow you to display, edit and enhance these in 3D.

The Marching Cubes app enables you to do this by accepting and parsing text you enter into an input box - and the text being as close as possible to the standard mathematicians way of writing things. A lot of time and coding went into this effort - with the emphasis being on hiding the code from your view as much as possible.

In other word, the Marching Cube app aids and abets you trying to behave like an old-timey mathematician.

The Parametric Equations app, however, is all about *coding* math. There are 170+ equations - all derived from Jurgen Meier's wonderful web site full of math tutorials written in Java. Each equation is presented as a stand alone HTML file. The files are about 75 lines short and contain everything need to load and view the equation in real-time 3D.

You are very much encouraged to open up any of the files, change the equation and see what happens. It's a fast, fun and easy way to get going with exploring.

The thing is that math can hard and complex and very time-consuming as well. For this you have the Equation Browser. This app reads the the HTML files and adds many features to the display of the equations. Features include the following:

  • Reads, parses and displays remote Three.js HTML files
  • Support real-time 3D pan, rotate and zoom
  • Adds access and editing to full complement of materials, reflections, lights, shade and shadows
  • Update geometry parameters in real-time
  • Display wireframe, face & vertex normals
  • Select background colors or gradients
And the list of future wish list enhancements is even longer.

And as important as the new features might be for helping progress math and math apps, there is perhaps an even more important aspect. JavaScript and Three.js are not APIs or apps but they are languages - coming out of infancy and into broad application.  Both the Marching Cubes and Parametric Equations routines are demonstrations that these tools can have highly diverse and profound mathematical application. And when you click them, stuff happens.

Links:

AlgeSurf PE Equation Browser
AlgeSurf PE Read Me
AlgeSurf PE Source Code