spirographR | R Documentation |
spirographR
will produce sprirograph-like design as either
a hypotrochoid or an epitrochoid (depending on whether radius A or B is larger).
spirographR( x = 0, y = 0, a.rad = 1, b.rad = -4, bc = -2, rev = 4, n.per.rev = 360 )
x, y |
Center coordinates of stationary circle 'a' |
a.rad |
Radius of stationary circle 'a' |
b.rad |
Radius of circle 'b' travelling around stationary circle 'a' |
bc |
Distance from the center of 'b' to a point 'c' which will turn with b as if attached to a stick. |
rev |
Number of revolutions that 'b' should travel around 'a' |
n.per.rev |
Number of radial increments to be calculated per revolution |
A positive value for 'b' will result in a epitrochoid, while a negative value will result in a hypotrochoid.
op <- par(mar=c(0,0,0,0), bg=1) plot(spirographR(), t="l", col=6, lwd=3) plot(spirographR(a.rad=1, b.rad=3.5, rev=7), t="l", col=7, lwd=3) plot(spirographR(a.rad=4.1, b.rad=-6, rev=100, bc=2.3), t="l", col=5, lwd=1) par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.