POV-Ray : Newsgroups : povray.general : Math: helix wrap around a circle : Re: Math: helix wrap around a circle Server Time
11 Aug 2024 03:22:53 EDT (-0400)
  Re: Math: helix wrap around a circle  
From: Alberto
Date: 13 Sep 1999 13:46:51
Message: <37DD38FD.7C4FF8E3@ma.usb.ve>
Another solution:

I hope this can help you. The whole helix is created at once. At the end
you can reorient it as you wish.

cut here
-------------------------------------------------
#default{pigment{ rgb 1}}
camera{location 2*<0,5,-5> look_at 0}
light_source{<2,5,-5> rgb 1}

#declare R1 = 3; // the size of the circle
#declare R2 = 1; // the "size" of the helix
#declare R3 = .1;// point size
#declare Omega = 4*pi; //the speed of the helix
// around the circle

#declare n = 320 // number of points

#declare k = 0;

union{
  #while(k < n)
    #declare s = 2*pi*k/n;
    sphere{
    <
       (R2*cos(Omega*s) + R1)*cos(s),
      R2*sin(Omega*s),
      (R2*cos(Omega*s) + R1)*sin(s)
    >,
    R3
  }
  #declare k = k + 1;
  #end
} // here you can reorient your helix
-------------------------------------------------

Alberto


Post a reply to this message

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