# Ellipsoid Collision Problem

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

## Recommended Posts

Given a triangle intersecting an ellipsoid with Normal 'n' and knowing the points A for the center of the ellipsoid, B for the closest point in the triangle to the point A, C as point B projected onto the ellipsoid surface and of course knowing the radii of the ellipsoid, how can I determine the lenght of the green line on the picture, given that the line is parallel to the triangle normal? The idea is that the ellipsoid, if moved along the normal direction the "lenght" of this line, would come to rest on the triangle's point B. Ideas? Thanks!

##### Share on other sites
I don't know if this will work as it seems simple but:

Use the equation x^2/a^2 + y^2/b^2 = 1. (a = semimajor axis, b = semiminor axis) and since you know the coordinates of B (in your diagram) set the x comonent of B to a point on the ellipse (equation above) and solve for y. You will then receive two values for y and (from the point of view in your picture, you would want the negitive value, but if not i'm sure you could figure a way to get the right one), then with the coordinates of your new point and B just use the equation

d = sqrt((x2 - x1)^2 + (y2 - y1)^2)

to get the length of the green line.

There should also be other methods to get this but I think they would all take a similiar approach (i.e. find a point P on the ellipse where P.x = B.x and solve to get P.y, then calculate the distance between P and B).

As always.
In the 'Equations/Graphing' section.

Good luck.

##### Share on other sites
Ok, haven't worked the math out on this, but here is my instinct:

If B is on the side of the triangle, then AC must be parallel to n. This is because the shortest distance between a line and a point is always along the perpendicular line that passes through the point. In this case, the green line is really BC, and since in the problem statement you say you know both B and C the solution is just the distance between the two.

If B is actually a vertex of the triangle, then it strikes me that the problem would not be well defined because there would be a choice of two line segments to solve it for.

##### Share on other sites
Quote:
 Original post by intrest86Ok, haven't worked the math out on this, but here is my instinct:If B is on the side of the triangle, then AC must be parallel to n. This is because the shortest distance between a line and a point is always along the perpendicular line that passes through the point. In this case, the green line is really BC, and since in the problem statement you say you know both B and C the solution is just the distance between the two.If B is actually a vertex of the triangle, then it strikes me that the problem would not be well defined because there would be a choice of two line segments to solve it for.

No, thats not right, the segment AC is not parallel to n because the closest point in the plane to A is not B, I tried that and the result is always off (IE B always intersects the ellipsoid if done that way, sometimes more sometimes less.

McCoy:

I think your idea may work, but I would have to find which coord I am missing all the time, in this case the normal is 0,0,1 but I may need to find out the same thing for any normal.

I think what I want is a sphere-ray intersection to find the point where the line intersects the surface then find the distance to the plane from that point.

Thanks guys.

##### Share on other sites
Yup, solved it, what I did was to use the sphere-ray intersection algorithm on a unit radius sphere dividing the input vectors by the radii (in such a way that all vectors reside in a coordinate system in which the ellipsoid is a unit sphere), aply rotation and then get it back to real world coords... its more complicated than it sounds, I am pretty happy with the results as you may imply from the following image filename [smile]:

1. 1
Rutin
37
2. 2
3. 3
4. 4
5. 5

• 11
• 10
• 13
• 103
• 11
• ### Forum Statistics

• Total Topics
632976
• Total Posts
3009672
• ### Who's Online (See full list)

There are no registered users currently online

×