Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Max distance from point on ellipsoid to surface

Subject: Max distance from point on ellipsoid to surface

From: stefaneli

Date: 22 May, 2012 17:07:07

Message: 1 of 8

I want to find a point on an given ellipsoid that is the farthest from a given surface. (The distance between a point on ellipsoid and the surface should be max). So how can I do this? I was thinking about some kind of Lagrange multipliers. But what do you think? Thanks.

Subject: Max distance from point on ellipsoid to surface

From: Roger Stafford

Date: 22 May, 2012 18:59:06

Message: 2 of 8

"stefaneli" wrote in message <jpgh3q$c1$1@newscl01ah.mathworks.com>...
> I want to find a point on an given ellipsoid that is the farthest from a given surface. (The distance between a point on ellipsoid and the surface should be max). So how can I do this? I was thinking about some kind of Lagrange multipliers. But what do you think? Thanks.
- - - - - - - - - - -
  How is your surface determined? Is it given by a set of discrete points or is it determined by a mathematical equation?

  With a mathematical equation, what you want to find is a point on the surface such that if the normal to the surface at that point is extended, it will intersect the ellipsoid orthogonally. That is what Lagrange multipliers would lead to. That will give you two equations to be satisfied. Together with the requirement of the point being on the surface, that is three equalities altogether. Of course you would have to exclude the multiple solutions that give the closest distance rather than the furtherest. Also if your surface has a bounding edge, a non-orthogonal solution might occur on this edge.

  How hard such a problem would be depends entirely on the particular surface equation.

Roger Stafford

Subject: Max distance from point on ellipsoid to surface

From: stefaneli

Date: 22 May, 2012 19:37:07

Message: 3 of 8

My surface is determined by a mathematical equation 3x+4y^2+6z+6=0. So basically I need to find tangent plane and normal line(to that tangent plane) at each point of surface and see if that normal line (extended) orthogonally intersects tangent plane of ellipsoid at any point. And Lagrange multipliers would lead this? I'm not sure if I got it right. Thanks.

 
"Roger Stafford" wrote in message <jpgnlq$1fp$1@newscl01ah.mathworks.com>...
> "stefaneli" wrote in message <jpgh3q$c1$1@newscl01ah.mathworks.com>...
> > I want to find a point on an given ellipsoid that is the farthest from a given surface. (The distance between a point on ellipsoid and the surface should be max). So how can I do this? I was thinking about some kind of Lagrange multipliers. But what do you think? Thanks.
> - - - - - - - - - - -
> How is your surface determined? Is it given by a set of discrete points or is it determined by a mathematical equation?
>
> With a mathematical equation, what you want to find is a point on the surface such that if the normal to the surface at that point is extended, it will intersect the ellipsoid orthogonally. That is what Lagrange multipliers would lead to. That will give you two equations to be satisfied. Together with the requirement of the point being on the surface, that is three equalities altogether. Of course you would have to exclude the multiple solutions that give the closest distance rather than the furtherest. Also if your surface has a bounding edge, a non-orthogonal solution might occur on this edge.
>
> How hard such a problem would be depends entirely on the particular surface equation.
>
> Roger Stafford

Subject: Max distance from point on ellipsoid to surface

From: James Tursa

Date: 22 May, 2012 20:13:07

Message: 4 of 8

"stefaneli" wrote in message <jpgh3q$c1$1@newscl01ah.mathworks.com>...
> I want to find a point on an given ellipsoid that is the farthest from a given surface. (The distance between a point on ellipsoid and the surface should be max). So how can I do this? I was thinking about some kind of Lagrange multipliers. But what do you think? Thanks.

Another way is to brute force it. Write functions to parametrically descibe each surface, define a function to calculate the distance between surface points on each surface (or the negative of this if you are looking for max distance), and then pass a function handle to this function and a starting guess to fminsearch.

James Tursa

Subject: Max distance from point on ellipsoid to surface

From: Roger Stafford

Date: 22 May, 2012 20:21:06

Message: 5 of 8

"stefaneli" wrote in message <jpgpt3$c6s$1@newscl01ah.mathworks.com>...
> My surface is determined by a mathematical equation 3x+4y^2+6z+6=0. So basically I need to find tangent plane and normal line(to that tangent plane) at each point of surface and see if that normal line (extended) orthogonally intersects tangent plane of ellipsoid at any point. And Lagrange multipliers would lead this? I'm not sure if I got it right. Thanks.
- - - - - - - -
  Well, I am saying that if you were to use the method of Lagrange multipliers, they would eventually lead to the conditions you have stated, but since you are able to state them already, there is no need to go through all the work of applying Lagrange multipliers. You're already past that in your formulation of the problem.

  Now what you have to do is translate your orthogonality conditions into two more equations and then solve the three equations for all possible solutions.

  I see a problem however in your particular surface. You will probably get solutions to the above equations. However the surface extends infinitely far out since it is a cylindrical projection of a parabola. The only maximum distance you could attain would have to occur on some finite boundary of that paraboloid, where the above orthogonality conditions would no longer hold.

  In other words, there is an aspect of your problem that I don't understand for that surface. Perhaps you could enlighten me.

Roger Stafford

Subject: Max distance from point on ellipsoid to surface

From: stefaneli

Date: 22 May, 2012 22:05:06

Message: 6 of 8

Finding a tangent plane and normal line isn't in my formulation of the problem. I wanted to be sure, that I've understood you well.
I was thinking about that problem also, but in my opinion after some point of the surface, orthogonallity conditions would no longer hold, so it doesn't matter if surface goes to infinity.

"Roger Stafford" wrote in message <jpgsfi$okp$1@newscl01ah.mathworks.com>...
> "stefaneli" wrote in message <jpgpt3$c6s$1@newscl01ah.mathworks.com>...
> > My surface is determined by a mathematical equation 3x+4y^2+6z+6=0. So basically I need to find tangent plane and normal line(to that tangent plane) at each point of surface and see if that normal line (extended) orthogonally intersects tangent plane of ellipsoid at any point. And Lagrange multipliers would lead this? I'm not sure if I got it right. Thanks.
> - - - - - - - -
> Well, I am saying that if you were to use the method of Lagrange multipliers, they would eventually lead to the conditions you have stated, but since you are able to state them already, there is no need to go through all the work of applying Lagrange multipliers. You're already past that in your formulation of the problem.
>
> Now what you have to do is translate your orthogonality conditions into two more equations and then solve the three equations for all possible solutions.
>
> I see a problem however in your particular surface. You will probably get solutions to the above equations. However the surface extends infinitely far out since it is a cylindrical projection of a parabola. The only maximum distance you could attain would have to occur on some finite boundary of that paraboloid, where the above orthogonality conditions would no longer hold.
>
> In other words, there is an aspect of your problem that I don't understand for that surface. Perhaps you could enlighten me.
>
> Roger Stafford

Subject: Max distance from point on ellipsoid to surface

From: Bruno Luong

Date: 23 May, 2012 06:52:09

Message: 7 of 8

"stefaneli" wrote in message <jph2ii$l94$1@newscl01ah.mathworks.com>...
> Finding a tangent plane and normal line isn't in my formulation of the problem. I wanted to be sure, that I've understood you well.
> I was thinking about that problem also, but in my opinion after some point of the surface, orthogonallity conditions would no longer hold, so it doesn't matter if surface goes to infinity.

What matter is the maximum distance (to the ellipsoid) does not even exist. So all the Lagrangian condition, normal condition do not hold any more.

But the answer in this case is simple. dmax = Inf.

Bruno

Subject: Max distance from point on ellipsoid to surface

From: Bruno Luong

Date: 23 May, 2012 06:59:07

Message: 8 of 8

BTW here is a code of projection a point to an ellipsoid (conic) using Lagrange multiplier.

http://www.mathworks.com/matlabcentral/fileexchange/27711-euclidian-projection-on-ellipsoid-and-conic

I believe the same technique can be adapted to two conics.

Bruno

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us