POV-Ray : Newsgroups : povray.binaries.programming : torus equation Server Time: 16 Dec 2018 23:11:26 GMT
  torus equation (Message 1 to 3 of 3)  
From: majucatur
Subject: torus equation
Date: 1 Feb 2002 16:56:48
Message: <3c5ac8d0@news.povray.org>
Thank you to Peter Popov and Ron Parker for the information that you gave me
on CSG, that were of great utility.

I have another question, does somebody know how is expressed a torus
mathematically?, the other figures don't represent a real problem, but does
it seem that the torus is a compound figure, how can I calculate the normal,
the intersections, etc. for a torus?, does exist a torus mathematical
formula?...

Again, thank you for your time.


Post a reply to this message

From: Warp
Subject: Re: torus equation
Date: 2 Feb 2002 10:07:41
Message: <3c5bba6c@news.povray.org>
majucatur <maj### [at] yahoocom> wrote:
: does exist a torus mathematical formula?...

  The torus function is:

sqrt((sqrt(x^2+z^2)-Rmaj)^2 + y^2) - Rmin = 0

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: torus equation
Date: 12 Feb 2002 00:38:10
Message: <3C686358.B118ABA9@online.no>
majucatur wrote:
> 
> Thank you to Peter Popov and Ron Parker for the information that you gave me
> on CSG, that were of great utility.
> 
> I have another question, does somebody know how is expressed a torus
> mathematically?, the other figures don't represent a real problem, but does
> it seem that the torus is a compound figure, how can I calculate the normal,
> the intersections, etc. for a torus?, does exist a torus mathematical
> formula?...

For answers to some of your questions, you
may have a look into these posts of mine:

http://news.povray.org/povray.advanced-users/20922/138919
http://news.povray.org/3C292BC5.5A6AB4A6%40hotmail.com

http://news.povray.org/povray.advanced-users/20922/145305
http://news.povray.org/3C4B045F.DFBD5D79%40hotmail.com


And at this page you'll find a polynomial
equation for the torus:

http://www.nada.kth.se/hacks/doc/PoVRay/pov122.html


Here's a macro that will return a quartic torus:

#macro QuarticTorus(Rmaj, Rmin)

  #local rxz = -2*(Rmaj^2 + Rmin^2);
  #local ry =  2*(Rmaj^2 - Rmin^2);
  #local rr =  (Rmaj^2 - Rmin^2)^2;

  quartic {
    <
      1,   0,   0,   0,   2,   0,   0,   2,   0, rxz,
      0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
      1,   0,   0,   2,   0,  ry,   0,   0,   0,   0,
      1,   0, rxz,   0,  rr
    >
    sturm
  }

#end // macro QuarticTorus


Tor Olav


Post a reply to this message

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