# Calculate normal vectors for 'elliptic' torus

This topic is 1384 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all!

I'm struggling with the calculation of normal vectors for a kind of elliptic torus with the parametric form:

x = (a + r * cos(v)) * cos(u)

y = (b + r * cos(v)) * sin(u)

z = r * sin(v)

If a = b the normal vector is calculated as follows:

nx = x - a * cos(u)
ny = y - b * sin(u)

nz = z

But this does not work for a != b.

Any help is very welcome!

Best Regards

Karol

##### Share on other sites
You can always compute the partial derivative of (x,y,z) with respect to u and with respect to v, and then take their cross product. You can then scale it by any amount you want. For instance, if you divide by r, I think you get:

nx = cos(u) * cos(v) * (b + r * cos(v))
ny = sin(u) * cos(v) * (a + r * cos(v))
nz = sin(v) * (cos(u)^2 * (b + r * cos(v)) + sin(u)^2 * (a + r * cos(v)))

But perhaps I made a mistake somewhere.

EDIT: I just saw a simplification for nz:
nz = sin(v) * (cos(u)^2 * b + sin(u)^2 * a + r * cos(v)) Edited by Álvaro

I will test it.

Best Regards

Karol

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633767
• Total Posts
3013734
×