Wasn't it Stefan Viljoen who wrote:
>Hi guys
>
>Is the correct povray representation of the top two formulas at
>
>http://mathworld.wolfram.com/Spirograph.html
>
>
>as regards the conversion of degrees to radians in order to use Povray's sin
>and cos functions (which work with radians?)
>
>I must be doing something wrong - the shapes look "sincos - like" but not
>like those on the spirograph page...
>
>Any help appreciated!
The conversion factor (180/pi) is close enough to 57.3 for this purpose.
The only things you need to be aware of are:-
1. The results shown on that page are generated from the second pair of
equations. To get similar results from the first pair, "radius_rotating"
needs to be set to a negative value, and I'm not sure how to convert "a"
into "spiro_offset"
2. When "radius_rotating" and "radius_fixed" have no common divisors
(which is how you'd usually run things) you'll need to go round the
circle more than once.
Try these values for an example that looks like the Mathworld result for
(2,5) with a=1.0.
#declare my_degrees=0;
#declare radius_fixed = 5;
#declare radius_rotating = -2;
#declare spiro_offset = 7;
#while (my_degrees < 360*abs(radius_rotating))
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|