POV-Ray : Newsgroups : povray.newusers : Torus Equation Server Time
6 Nov 2024 18:26:09 EST (-0500)
  Torus Equation (Message 1 to 5 of 5)  
From: Lars Luthman
Subject: Torus Equation
Date: 25 Mar 1998 06:52:56
Message: <ZZZnv96llu-2503981252350001@dialin8.ksk.sala.se>
Hi!

I'm just wondering if anyone has the equation for a torus? I've seen it in
the doc file, but I would like to have it in this form: "y = ..."

...and I'm not that good at maths.

I would be very happy if anyone could help me with this.

To answer by mail, remove 'ZZZ' from my address.


ll


Post a reply to this message

From: Thomas Jespersen
Subject: Re: Torus Equation
Date: 2 Jun 1998 15:29:59
Message: <357452B6.21A0@daimi.aau.dk>
Lars Luthman wrote:
> 
> Hi!
> 
> I'm just wondering if anyone has the equation for a torus? I've seen it in
> the doc file, but I would like to have it in this form: "y = ..."

Here it is:

(x^2 + y^2 + z^2 - (a^2 + b^2))^2 = 4a^2(b^2 - z^2)

This torus is revolved around the z-axis. a is the radius of the torus
and b is the radius of the circle revolving around the torus (sorry, I
am not english, hope you understood!)


Post a reply to this message

From: Justin Rogers
Subject: Re: Torus Equation
Date: 8 Jul 1998 05:35:35
Message: <35a32f57.0@news.povray.org>
y = sqrt( sqrt(4a^2(b^2-z^2)) + a^2 + b^2 - z^2 - x^2 )

simplify

y = sqrt(2a(b-z)) + a + b - z - x

Now that should be the right equation...  Don't quote me or anything.

--
_____________________________________
Justin Rogers, CEO DigiTec Web Consultants
Personal Programmer and Web Consultant
Email:  dig### [at] 3nnet
Thomas Jespersen wrote in message <357### [at] daimiaaudk>...
>Lars Luthman wrote:
>>
>> Hi!
>>
>> I'm just wondering if anyone has the equation for a torus? I've seen it
in
>> the doc file, but I would like to have it in this form: "y = ..."
>
>Here it is:
>
>(x^2 + y^2 + z^2 - (a^2 + b^2))^2 = 4a^2(b^2 - z^2)
>
>This torus is revolved around the z-axis. a is the radius of the torus
>and b is the radius of the circle revolving around the torus (sorry, I
>am not english, hope you understood!)


Post a reply to this message


Attachments:
Download 'Justin Rogers.vcf.txt' (1 KB)

From: Ron Parker
Subject: Re: Torus Equation
Date: 8 Jul 1998 12:42:11
Message: <35a39353.0@news.povray.org>
On Wed, 8 Jul 1998 04:35:34 -0400, Justin Rogers <dig### [at] 3nnet> wrote:
>y = sqrt( sqrt(4a^2(b^2-z^2)) + a^2 + b^2 - z^2 - x^2 )
>
>simplify
>
>y = sqrt(2a(b-z)) + a + b - z - x
>
>Now that should be the right equation...  Don't quote me or anything.

This is almost certainly not the right equation.  

sqrt(x^2+y^2) is only equal to x+y when either x or y is zero.


Post a reply to this message

From: James Foster
Subject: Re: Torus Equation
Date: 1 Nov 2001 13:50:37
Message: <3BE1997D.9D428719@durham.ac.uk>
Sorry to bring up old news, i've only just signed up to the newsgroups so i'm
going from the start.


You had it right the fist time but you can't simplify it (like that)!!

y = sqrt( 2a * sqrt(b^2 - z^2) + a^2 + b^2 - z^2 - x^2 )
...is about as simple as you can get it.

sqrt(a + b) != sqrt(a) + sqrt(b)

James

PS I'm not a newbie. I've used the original DOS version of POVray (i think a
revision of version 1) so i know where i stand. Infact, i didn't know POV was
being developed until a friend told me about POV 3. Wow. I loved POV then, and
i'm looking forward to getting to grips with it's evolution. See you around
guys.

Justin Rogers wrote:

> y = sqrt( sqrt(4a^2(b^2-z^2)) + a^2 + b^2 - z^2 - x^2 )
>
> simplify
>
> y = sqrt(2a(b-z)) + a + b - z - x
>
> Now that should be the right equation...  Don't quote me or anything.
>
> --
> _____________________________________
> Justin Rogers, CEO DigiTec Web Consultants
> Personal Programmer and Web Consultant
> Email:  dig### [at] 3nnet
> Thomas Jespersen wrote in message <357### [at] daimiaaudk>...
> >Lars Luthman wrote:
> >>
> >> Hi!
> >>
> >> I'm just wondering if anyone has the equation for a torus? I've seen it
> in
> >> the doc file, but I would like to have it in this form: "y = ..."
> >
> >Here it is:
> >
> >(x^2 + y^2 + z^2 - (a^2 + b^2))^2 = 4a^2(b^2 - z^2)
> >
> >This torus is revolved around the z-axis. a is the radius of the torus
> >and b is the radius of the circle revolving around the torus (sorry, I
> >am not english, hope you understood!)


Post a reply to this message

From: Daren Scot Wilson
Subject: Re: Torus Equation
Date: 26 May 1998 16:01:27
Message: <356B1F97.2CBC07C1@pipeline.com>
Hah! I eat torii for breakfast!  

Since a torus is just a circle seen in the x-z plane (I'm assuming you
pick on y because you're taking that as the main axis), the formula
ought to be 

     (r-A)^2 + y^2 = B^2

where A is the major radius (origin to the midline of the curved pipe),
B is the minor radius (radius of the cross section of the pipe), and 

     r^2 = x^2 + z^2



You want it for y(x,z)?   Easy.

    y(x,z) = +- sqrt( B^2 - (r-A)^2 )

where you plug in

    r = sqrt( x^2 + z^2 ).


This formula for y(x,z) involves a square root, for which you take both
signs, so there are two values in most places where the torus exists,
one value only where r = A-B or r=B+A, and no real values where r<A-B or
r>A+B.  (Exercise for the student: if you plotted the imaginary values
of y(x,z) along y the y axis, what shape would you get?)





It would be fun to solve for x or z:

    x(y,z)  = +- sqrt( r^2 - z^2 )

where you plug in 

    r = A +- sqrt( B^2 - y^2 )
      
This formula for x(y,z) involve two square roots, giving four values in
the domain where y,z are in the torus (as projected onto the y-z plane).


Hope this helps.   I'll send you my bill <g>.

-- 
Daren Scot Wilson
Member, ACM
dar### [at] pipelinecom
www.newcolor.com
----------------------------------------------
Help the Cystic Fibrosis Foundation by 
fighting in the Operating System Wars!
http://www.geocities.com/SiliconValley/Network/5601/


Post a reply to this message

From: Roland Mas
Subject: Re: Torus Equation
Date: 2 Apr 1998 05:47:48
Message: <6fvqck$siq$1@melchior.cuivre.fr.eu.org>
Lars Luthman (ZZZ### [at] ksksalase) wrote:
> Hi!

> I'm just wondering if anyone has the equation for a torus? I've seen it in
> the doc file, but I would like to have it in this form: "y = ..."

Well, it's not so simple. Suppose the y vector is pointing in the direction
of the torus axis. Then for each value of (x,z), you may have 0, 1 or 2
values for y. See?

  Anyway, I'll think about it and post the best answer I find tonight or
tomorrow. Should I forget, will you please remind me?

Roland.
--

bob### [at] casimirrezelenstfr -- Linux, POV-Ray, LaTeX


Post a reply to this message

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