Hypocycloid Tweet
Hypocycloids are curves that are formed by rotating a circle around the inside of a bigger circle, similar to using a Spirograph toy. An interesting property they have is that a hypocycloid with n cusps (the pointy parts) can move around inside a hypocycloid with n+1 cusps and maintain contact between the inner cusps and the outer curve. https://johncarlosbaez.wordpress.com/2013/12/03/rolling-hypocycloids
Remix it on pico-8-edu.com
This cart is tweetable at just 272 characters.
c=cos
s=sin
l=line
::_::
cls()
k=-10
a = t()/20
::h::
for i=1.1,0,.1/k do
x=k*c(i)+c(k*i)
y=k*s(i)+s(k*i)
for k2=k-1,-10,-1 do
mx=c(a+.5/k2)
my=s(a+.5/k2)
ax=c(a*k2)
ay=s(a*k2)
x,y=x*mx-y*my+ax,x*my+y*mx+ay
end
l(6*x+64,6*y+64,6-k)
end
l()
if(k<-2)k+=1goto h
flip()
goto _
About
See the explainer on GitHub
Acknowledgements
Based on this animation by Greg Egan.
See the Azimuth blog
for more info
Status | Released |
Platforms | HTML5 |
Author | Mini Mech Media |
Genre | Educational |
Made with | PICO-8 |
Leave a comment
Log in with itch.io to leave a comment.