Ian's SVG PHP Spirograph/Lissajous Figure Program Documemtation
vers 8.0
System Requirements, More Information and Help
System Requirements
This program needs an HTML 5 compatible browser as it uses SVG Graphics.
This means up to date Mozilla Firefox or Google Chrome, or Internet Explorer 9 or more recent or Microsoft Edge.
View Program Source:
Main PHP File , PHP include File
This code runs on the server, not your computer, and is written in PHP.
How to use this program
This program has two modes, spirograph and lissajous figure. You can select which with the radio button on the program demo page.
In spirograph mode it draws epicycles, with one amplitude and one multiplier for the inner and outer circles. This generates the spirograph
patterns.
In lissajous mode it draws lissajous figures. (Lissajous figures are usually associated with plotting sine waves of different but commensurate frequencies on the x and y axes of an oscilloscope.) This program plots sine functions on the x and y axes using one amplitude and one (frequency) multiplier for both.
The amplitude values are pixel size values on the screen and must be +ve. The maximum value is currently set to 250.
Click on the +,- to increase or decrease the values and see the different patterns.
The phase is in degrees, and is ignored if spirograph is selected.
NB:All numerical values must be integers, not fractions. Using a decimal fraction will create an error.
If the number types in is not a valid number (eg. contains non-numerical characters) it will also create an error.
Changing the values or clicking on the +/- links will cause the page to reload, and this will tend to make the image dissapear off the
bottom of the screen. The cure is to go full screen, which you can get by pressing F11 (not Microsoft Edge). This is unavoidable with PHP as the page has to reload each time it changes.
If you want to switch between spirograph and lissajous figures you must click Draw Pattern after you select it or the program won't notice. Same if you change a value by typing it in, not by the +/- links. This is because what the +/- links do is all preset when then page loads and don't change when you change a value in the form by other means. This is because this demo is pure PHP and doesn't use any Javascript. (The dropdown menus are done with Javascript but all the pattern drawing etc. is done solely with PHP.) This means the page isn't as intelligent as it might be.