Use mathematical equations in your scripts!
https://en.wikipedia.org/wiki/Parametric_equation
Kahn academy explanation (if you don´t remember it from high school):
Here´s some curves and also spheres in carthesian and polar coordinates:
09 - Mathematics And Geometry - Polar-Carthesian
And, of course, the funny Crazy polar curve! (Try to create your own equations!):
Crazy_polar_curve
Also, check out some old works from previous students here: http://scripting.cadzone.cz/