POV-Ray : Newsgroups : povray.general : Help! Can anyone figure this math? : Re: Help! Can anyone figure this math? Server Time
13 Aug 2024 19:20:28 EDT (-0400)
  Re: Help! Can anyone figure this math?  
From: Alain CULOS
Date: 5 Sep 1998 16:45:42
Message: <35F05231.66C45D58@bigfoot.com>
Philippe Debar wrote:

> >but I have a question: can't you use spheres to join
> >cones?
> Yes... but the torus and the sphere solutions handle different cases.
> With a sphere, you can join cones on different axis, you can't with
> a torus. My cones would be on the same axis. They could be joined
> smoothly by either adding a torus or removing a torus from a
> cylinder. You can't do that with a sphere.

You are after a simple problem for the scaled cylinder, but more complex for
the torus.

If you take :
point A, tangeant Ta,
point B, tangeant Tb,
Now intersect both tangeants from their respective origins and call this C.
Also intersect the line described by A, Tb with the one described by B, Ta, you
get a point that you name D.
ACBD is a parallelepiped into which your ellipse is inscribed.
D is the centre of the ellipse, you can now edit the matrix tranform for the
circle to become an ellipse : match one axis into DA and the other into DB, you
are done with it.

When you draw this solution on paper, you get a scaled and rotated ellipse
(there is no way out of that fate). So the answer for your torus is a bit more
complex but not much. The only problem is you cannot do it with a simple
transform, instead you have to write the equation down and use the quartic
object.

The ellipse above can be described by X^2+Y^2=1, where the X axis lies along DA
and the Y axis along DB, DA being one X unit long and DB being one Y unit long.

The transform for that is :
X=(x*(xa-xd)+y*(ya-yd)) / ((xa-xd)^2+(ya-yd)^2)^(1/2)
Y=(x*(xb-xd)+y*(yb-yd)) / ((xb-xd)^2+(yb-yd)^2)^(1/2)
Expand this into your X^2+Y^2=1 you get a wonderful equation.
Now substitute every occurance of x with (x^2+z^2)^(1/2) into this equation and
you get your wonderful torus equation. Make it so that you have no square
roots, only integer powers ranging from 0 to 4 and you can write that into your
quartic object.

I hope this helps, and have fun with the equations,
Al.

--
ANTI SPAM / ANTI ARROSAGE COMMERCIAL :

To answer me, please take out the Z from my address.


Post a reply to this message

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