|
|
So, just to provide a diagram for the elliptical torus, we can see that the same
sort of situation exists, and the same calculations are used once we establish a
length from the origin to point P.
And I think that's where things get interesting (complicated).
https://courses.lumenlearning.com/ivytech-collegealgebra/chapter/deriving-the-equation-of-an-ellipse-centered-at-the-or
igin/
describes how the definition of a torus (constant distance from two foci) gets
algebraically converted down to pow(x,2)/pow(a,2) + pow(y,2)/pow(b,2) = 1.
But really what we want is a distance function for the points on an ellipse.
I found this excellent answer for how to do that
https://math.stackexchange.com/q/1760296
so since the distance is sqrt(pow(x,2)+pow(y,2)), I use the equations from that
post to substitute in for x and y in the distance function to get:
#declare DistE = function (x, y, z, a, b){
sqrt (
(pow(a,2)*pow(b,2)*pow(x,2))/((pow(b,2)*pow(x,2))+(pow(a,2)*pow(y,2))) +
(pow(a,2)*pow(b,2)*pow(y,2))/((pow(b,2)*pow(x,2))+(pow(a,2)*pow(y,2)))
)
}
and then plug that into the main isosurface equation for an elliptical torus
with a constant circular cross-section.
#declare IET =
function (x,y,z,a,b,r) {
pow(DistE(x,y,z,a,b) - sqrt(pow(x,2)+pow(y,2)) ,2) + pow(z,2) - pow(r,2)
}
But I still get no visible surface.
Post a reply to this message
|
|