Epicycloids ● SmileBASIC Source

Register
EPICYCLOID OriginX, OriginY, CentralRadius, TangentialRadius, ScaleFactor, Color ```DEF EPICYCLOID X%,Y%,R0#,R1#,SF#,COL% DIM I#, RR# = R0#+R1#, S# = 1/3/R0#/SF# FOR I# = 0 TO PI()*2 STEP S# DIM X0# = RR#*COS(I#) - R1#*COS((RR#*I#)/R1#) DIM Y0# = RR#*SIN(I#) - R1#*SIN((RR#*I#)/R1#) GPSET X0#*SF#+X%, Y0#*SF#+Y%, COL% NEXT I% END``` Epicycloids This is really more of a gimmick than anything practical. As you can see from the Wikipedia page, an epicycloid is a shape drawn by a circle as it rolls around another circle. To get something which looks pretty, try drawing epicycloids where R0 is a multiple of R1 by some arbitrary K value, such that R0 == R1*K is true. An example of this may be `EPICYCLOID 200,120,(5),(1),6,#RED` Where R0=(5) and R1=(1), and R0 == R1*K is satisfied because 5 == 1*(K=5). In other words, make it so that the first (larger) radii value is an integer multiple of the second (smaller) radii value. Edit: Thanks to 12Me21 for being a math wizard.