Assignment 3 based on Daniel Shiffman's Polar Rose Pattern example and the Rhodonea Curve Chart in Wikipedia. The value of mouseX will determine number of polygons, although I merely play with these elements in order to help my own understanding. The chart image that I used as a reference:

Full Screen
Code

 

Another version that changes over mouse position (Full Screen):