# Working with ellipsoids and plane projection..

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

## Recommended Posts

Just a quick question could someone confirm that if you calculate the normal of an ellipsoid from a point on the surface. can I safely assume that the following assumption should be correct? p.n = 1 // let p = point on surface, n = ellipsoid normal vector I have a small area of points definied on the surface of an ellipsoid, which I would like to project to the plane of calculated normal. I initially thought I was having issues with floating point precission but I am not so sure now. When I compute the dot product of the projected vectors on the plane, with the ellipsoid normal vector, they dont seem to equal 1 I can post code if required. Regards

##### Share on other sites
I don't know what you mean by "p.n". You can't compute a dot product between a point and a vector (well, you can but the result doesn't mean anything).

Yes, a bit of code might help.

##### Share on other sites
I meant the Dot Product of the following

1) the surface vector which is the point on the ellipsoid surface
2) the normal vector which is tangent to the point on the ellipsoid surface

I think should be equal to 1.

##### Share on other sites
p.n = 1 is only true (for all p) on a sphere.

On an ellipsoid..
p.n = 1 is only true at the "poles"

##### Share on other sites
I have tried earlier today testing points on the poles, and I have noticed p.n do equal exactly 1.

one example away from the poles i get p.n = 1.0000000000188922

I initially thought this was a precision issue, turns out that it might not be after all. however this still leaves me with an issue projecting points to the ellipsoid normal tangent plane.

lets say I take the ellipsoid normal of the first point on the surface as a reference. to project a point on the surface to the plane, the equation is

projected_point = point - [point.normal]*normal

in code form..
// the following takes the point on the surface, and its calculated normal vectordouble d1 = DotProduct(ref, normal);  // d1 = 1.0000000000188922double d2 = DotProduct(point, normal);  // point = another point on the surface// d2 = 8.9100786519611319e-008proj[0] = point[0] - d2*normal[0];proj[1] = point[1] - d2*normal[1];proj[2] = point[2] - d2*normal[2];double d3 = DotProduct(proj, normal);// d3 = 0.99999991091810569

I am trying to work out why d3 != d1 when in theory ref and proj should be on the same plane.

##### Share on other sites
Quote:
 Original post by ossoI meant the Dot Product of the following 1) the surface vector which is the point on the ellipsoid surface

That still didn't make sense. I'm going to guess you mean the vector from the center of the ellipsoid to a point on the surface.

Quote:
 2) the normal vector which is tangent to the point on the ellipsoid surface

"Tangent to the point"? That doesn't make sense either. You probably mean the unit normal vector to the ellipsoid at that point on the surface.

Quote:
 I think should be equal to 1.

I don't. It only works in case your ellipsoid is a sphere of radius 1.

##### Share on other sites
Firstly, you can't take a dot product of a point and a direction. What you're actually taking the dot product of is the normal and the direction from the centre of the ellipsoid to the point on the surface.

Second, as has been stated already, p.n won't have a constant value on an ellipse (other than a sphere). Even for a sphere, it is only 1 if the radius is 1.

I am not sure what you are trying to do, but your projection will project onto a plane through the origin, which I don't think is what you want.

##### Share on other sites
I have just realised the stupidity, you're right it is not what I want at all!!

I think I know where i've gone wrong now!

##### Share on other sites
The standard plane equation
ax + by + cz + d = 0
n.p = -d

So from your code d1 gives you the constant in the standard plane equation...
d = -d1

p' the projected point = p - d'n
where d' is the perpendicular distance from p to the plane

d' = p.n - d (d from the plane equation)
d' (d2) should be = point.normal + d1

Then the projection should work fine

[Edited by - daftasbrush on April 1, 2008 3:28:13 PM]

##### Share on other sites
I made an error in calculating my ellipsoid normal by assuming the following will give me the normal..

It looks like it is giving me the normal's direction from the point on the ellipsoid surface. I need to give it a constant velocity and add it to the original point to compute the real xyz coordinates of the normal vector.

then I can begin to understand why my projection got messed up.

1. 1
Rutin
33
2. 2
3. 3
4. 4
5. 5

• 9
• 14
• 9
• 9
• 9
• ### Forum Statistics

• Total Topics
633331
• Total Posts
3011393
• ### Who's Online (See full list)

There are no registered users currently online

×