aUCBLogo Demos and Tests / toothedwheel
to toothedwheel [radiusi 100][tooths 96][phi 0]
local [x0 y0 dphi]
x0=xCor
y0=yCor
radiusa=radiusi/(1-3/tooths)
dphi=360/(2*tooths)
PolyStart
setXY x0 y0
setxy x0+radiusa*sin phi y0+radiusa*cos phi
phi=phi+dphi
repeat tooths
[ setxy x0+radiusi*sin phi y0+radiusi*cos phi
phi=phi+dphi
setxy x0+radiusa*sin phi y0+radiusa*cos phi
phi=phi+dphi
]
PolyEnd
setxy x0 y0
end