A Spirograph is a toy that draws hypotrochoids and epitrochoids. For this challenge, we'll just focus on the hypotrochoids.
A hypotrochoid is a roulette traced by a point attached to a circle of radius r rolling around the inside of a fixed circle of radius R, where the point is a distance d from the center of the interior circle.
The parametric equations for them can be defined as:
Where θ is the angle formed by the horizontal and the center of the rolling circle.
Your task is to write a program that will draw the path traced by the point defined above. As input, you'll be given R, r, and d, all integers between 1 and 200 inclusive.
You can receive this input from stdin, arguments, or user input, but it cannot be hardcoded into the program. You can accept it in whatever form is most convenient for you; as strings, integers, etc.
- Input units are given in pixels.
- R >= r
Output should be a graphical representation of the hypotrochoid defined by the input. No ASCII- or other text-based output is allowed. This image can be saved to a file or displayed on screen. Include a screenshot or image of the output for an input of your choosing.
You can choose any colors you like for the path/background, subject to a contrast restriction. The two colors must have HSV 'Value' component at least half the scale apart. For instance, if you're measuring HSV from
[0...1], there should be at least
0.5 difference. Between
[0...255] there should be a minimum
This is a code golf, minimum size of source code in bytes wins.