The Computational Beauty of Nature
Source code

henon

plot the phase space of the Henon system

henon -help
  or
henon  [-width  integer] [-height integer] [-skip integer]
       [-swap] [-points integer] [-delay integer] [-A dou-
       ble]  [-B double] [-ulx double] [-uly double] [-lly
       double] [-box integer] [-bulx double]  [-buly  dou-
       ble]  [-blly  double] [-data] [-inv] [-mag integer]
       [-term string]

Plots the phase space of the Hénon map, a two-dimensional system with a fractal shape. Different regions can be zoomed in on.

The phase space of the Henon system, which is described by the equation x(t+1) = A - x(t)^2 + B * x(t - 1), is plotted according to the specified parameters.

Miscellany

The method for choosing the viewable region may seem counter-intuitive at first, but it has some nice properties. In particular, selecting the exact (x, y) coordinates for the upper-left corner and only selecting the lower right y coordinate forces both the x and y scales to be identical since all scales are uniquely determined by these values along with the plot width and height. If you then change the width or height of the plot, the relative scales will still match up. The options for making a box work similarly.

Bugs

No sanity checks are performed to make sure that any of the options make sense.

Options

-widthWidth of the plot in pixels.480
-heightHeight of the plot in pixels.480
-skipNumber of initial points to skip.100
-swapSwap the x and y axis?True
-pointsNumber of points to plot.1000
-delayTime steps to delay for.1
-AValue of the A parameter.1.29
-BValue of the B parameter.0.3
-ulxUpper-left corner x-coordinate.-1.75
-ulyUpper-left corner y-coordinate.1.75
-llyLower-left corner y-coordinate.-1.75
-boxLine width for a box.0
-bulxBox's upper-left x-coordinate.0.0
-bulyBox's upper-left y-coordinate.0.0
-bllyBox's lower-left y-coordinate.0.0
-dataDon't plot, but print points.False
-invInvert all colors?False
-magMagnification factor.1
-termHow to plot points.None

henon.c on GitHub