spirograph(3f) - [M_drawplus] draw a hypotrochoid (LICENSE:MIT)
Synopsis
Description
Options
Example
Author
License
subroutine spirograph(xcenter,ycenter,sunr0,planet0,offset0,radius,ilines,ang,angs,ifill)
real,intent(in) :: xcenter, ycenter real,intent(in) :: sunr0,planet0,offset0 real,intent(in) :: radius integer,intent(in) :: ilines real,intent(in) :: ang real,intent(in) :: angs integer,intent(in) :: ifill
Draw a hypotrochoid generated by a fixed point on a circle rolling inside a fixed circle. It has the parametric equations
x = (R+r)costheta-(r+rho)cos((R+r)/rtheta) y = (R+r)sintheta-(r+rho)sin((R+r)/rtheta)where R is the radius of the fixed circle, r is the radius of the rotating circle, and rho is the offset of the edge of the rotating circle. The figure closes only if R, r, and rho are rational. The equations can also be written
xcenter,ycenter center of curve sunr0 radii of sun, planet, and planet offset planet0 radii of sun, planet, and planet offset offset0 radii of sun, planet, and planet offset radius radius to fit the shape to (no fit if radius is 0) ilines number of points to sample along curve ang angle to rotate the shape by, to orientate it. angs angle to start sampling points at; ccw is +; 0 is East ifill 1 make a filled polygon, 2 make a hatched polygon
John S. Urban
MIT License
Nemo Release 3.1 | spirograph (3) | February 23, 2025 |