After my Brachistochrone I got the idea of making a scene where you can cut out different trochoids. However I had to dump that idea due to it being impossible to properly cut concave shapes. So instead I made a mathematical drawer of them!
Trochoids are the term used for all curves drawn by a sphere rolling on other geometric object, may it be a plane(like the Brachistochrone), a sphere (like in this scene), or even squares or other polygones.
The trochoids drawn in this scene are Epi- and Hypotrochoids. The first are the result of a circle rolling ON another circle, the latter the result of a sphere rolling IN another one. Normal Trochoids with neither prefix are the result of rolling on a plane, which isn't depicted here. You can adjust the radius and similar by rotating the regulators using the drag tools clockwise to increment and counterclockwise to decrement. Click on the boxes to activate their corresponding function or view the code if you like to know the mathematics. Heres a short explanation of all tools:
"Fixed radius" defines the radius of the stationary sphere around which the other one roles
"Rolling radius" defines the radius of the moving sphere.
"Switch Side" negates the radius, effectively placing the moving sphere inside the stationary and viceversa.
"Tracer Distance" is a percentual distance of the tracer between the center and the rim of the moving sphere. 0% = exactly in the center, 100% exactly at the border, 200% twice the radius distance, 300 3x radius etc...
"Speed" is the rendering speed. Faster speed means quicker results of long time patterns, but more rough curves on high speeds and low framerates.
"Reset Pen" sets the pens length to 0, allowing you to remove all the scribbling that shows up while regulating the values.
By setting the fixed radius to a smaller value than the rolling radius and playing with the Tracer distance, one achives what is commonly known as spirographs, patterns of lines going long arcs before hitting the inner radius again.
Should you have the Epitrochoid mode(rolling outside), there's a mathematical trick to get exactly the picture you want most of the time:
First you imagine the amount of touch-locations that the curve has to the center circle when completing a full period. Now divide it by the amount of lines segments surrounding the sphere during this period(Imagine cutting through the figure like a cake. How often do you cut a line?). So if you want 5 contact points and want 10 lines, you would use 5/10 which is 1/2 which is 0.5 as inner radius while the outer radius is 1, which would result in 1 contact point with 2 parallel lines, since the other ones overlap each other. Would you take 2/7 however, you would get 2 contact locations and actually 7 lines at once. Take 1/1 and you get 1 contact points with 1 line surrounding the center, which gets you the common shape called cardoid.
The spheres are influenced by the values, and are visual displays of the calculation results. The tracer moves independently from the rolling sphere, but always hovers above a fixed point.
Enjoy!
