Skip to content

lorossi/lissajous

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lissajous curve

Generating lissajous curves in Processing

What?

Lissajous curves are a particular set of graphs generated by the parametric formula x = A cos(ax), y = B sin(bx). This already looks boring. Look, I am as bored as you. I mean who even likes math?? (I do, but that's not a story for today). Formulas are lame, but sometimes they are special and generate really interesting outcomes, if you know how to produce them. Luckily, this is one of those instances.

How to run the code

Clone the repository on your pc and open it with Processing. It's as easy as that.

Settings

All the variables inside the file named settings.pde can be changed by the final user (you). Feel free to edit them and to experiment a little bit with the final product. Next to each variable there's a comment describing what it does.

Commands

I programmed the code with a few shortcuts:

  1. Press left and right arrow keys to change the animation duration
  2. Press up and down arrow keys to change the initial angle
  3. Press E to record the animation - the output frames will be saved in folder called frames
  4. Press Q to toggle between black and white and colors
  5. Press W to display the current frames per second on the screen
  6. Press R to change the rotation direction (clockwise or anti-clockwise)
  7. Click on the window to reset the animation

Output

This is what you will see when you run the code:

Video

These are some converted GIFs (they look pretty choppy!). Inside the folder /output/videos/ you will find some higher quality videos (all recorded in as-smooth-as-butter 120 fps).

black and white video
colored final midway

Screenshots

Final images black and white final
colored final

Midway screenshots black and white midway
colored final midway

Licensing

This project is distributed under Attribution 4.0 International (CC BY 4.0) license.