POV-Ray : Newsgroups : povray.general : Grads to pov trig funcs - 57.3 where? : Grads to pov trig funcs - 57.3 where? Server Time
1 Aug 2024 20:11:22 EDT (-0400)
  Grads to pov trig funcs - 57.3 where?  
From: Stefan Viljoen
Date: 19 May 2005 18:30:08
Message: <428d136f@news.povray.org>
Hi guys

Is the correct povray representation of the top two formulas at

http://mathworld.wolfram.com/Spirograph.html

#while (my_degrees < 360)

        #declare x_loc = (radius_fixed + radius_rotating) * cos(my_degrees / 57.3)
- 
        (radius_rotating + spiro_offset) * cos(((((radius_fixed + radius_rotating)
/       
        radius_rotating)) * my_degrees) / 57.3);                
        
        //#debug concat("X:" , str(x_loc,3,3) "\n")
        
        #declare y_loc = (radius_fixed + radius_rotating) * sin(my_degrees / 57.3)
- 
        (radius_rotating + spiro_offset) * sin(((((radius_fixed + radius_rotating)
/       
        radius_rotating)) * my_degrees) / 57.3);                
        
        //#debug concat("Y:" , str(y_loc,3,3) "\n")
        
        sphere
        {
                <x_loc,y_loc,0>,0.25
                material
                {
                        texture
                        {
                                pigment
                                {
                                        color Red
                                }
                        }
                }
        }
        
        #declare my_degrees = my_degrees + 0.5;
#end

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!

-- 
Stefan Viljoen
Software Support Technician / Programmer
Polar Design Solutions


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.