C Library Functions - spirograph (3)
NAME
spirograph(3f) - [M_drawplus] draw a hypotrochoid
(LICENSE:MIT)
CONTENTS
Synopsis
Description
Options
Example
Author
License
SYNOPSIS
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
DESCRIPTION
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
OPTIONS
|
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
|
|
EXAMPLE
AUTHOR
John S. Urban
LICENSE
MIT License
| Nemo Release 3.1 | spirograph (3) | August 28, 2026 |
Generated by manServer 1.08 from 9ffd1063-f5eb-4178-963c-92534a3b0ce1 using man macros.