## How to circumscribe an elliptical shape to a set of points in 3D?

### Doctor61 (view profile)

on 4 Feb 2013

I have the cartesian coordinates (x,y,z) of set of points that are distributed in a region of space that could be circumscribed by an ellipse if your camera is angled from origin towards the centre of this region. I plot these points with scatter3.

I want to find the ellipse (in any form that defines its location and shape in space) that encompass these points so that it passes through the ones at the edge and has the minimum area. Thanks in advance for your help.

Doctor61

### Doctor61 (view profile)

on 4 Feb 2013

Sorry I did not make it clear enough. I have the cartesian coordinates (x,y,z) of set of points that are distributed in a region of space that could be circumscribed by an ellipse if your camera is angled from origin towards the centre of this region. I plot these points with scatter3.

I want to find the ellipse (in any form that defines its location and shape in space) that circumscribe these points so that it passes through the ones at the edge and has the minimum surface area.

My matrix has 116 number of points, otherwise I would have included here for more clarification of how my they look like. Thanks in advance for your help.

Walter Roberson

### Walter Roberson (view profile)

on 4 Feb 2013

Minimum surface area is, at least in theory, perimeter of a 2D case, extended by revolution.

One of the presentations I found about the 2D case (that was explicitly talking about circumscribing) indicated that minimizing area for the 2D case is easier than minimizing perimeter for the 2D case, because perimeter is an integral that does not have a closed-form solution. I would imagine the same difficulty would apply for ellipsoids.

When you say the points could be circumscribed by an ellipse, do you mean that the points lie in a titled plane, or do you mean that there is a perspective in which the projection onto a titled plane could be circumscribed by an ellipse? The "lie in a titled plane" option would imply that "surface area" would not be the real concern, and that instead perimeter in the titled plane would be, but "projection into a titled plane" does offer meaning to "surface area" but requires specification of the method of completing the containing volume once one has a trial ellipse (which is 2D). Are you definitely talking about ellipses and not ellipsoids ??

Doctor61

### Doctor61 (view profile)

on 4 Feb 2013

RE your question, yes I mean "there is a perspective in which the projection onto a tilted (you mean tilted not titled, right?) plane could be circumscribed by an ellipse". So maybe I have expressed my question unclearly again, this could be even considered as a 2D case where you have several points in a plane and want to circumscribe a shape (here an ellipse) to them. The only thing will be that in my case these points would be the projection of my points into that 2D plane, which I also don't know how to do. It is true that I am not talking about ellipsoids here, only ellipse. So probably surface area is misleading here, I should have used only area.

## Products

No products are associated with this question.

### Walter Roberson (view profile)

on 4 Feb 2013
Edited by Walter Roberson

### Walter Roberson (view profile)

on 4 Feb 2013

The two-dimensional case is talked about in this technical solution and perhaps it could be extended.

And there is a FEX contribution to fit ellipsoids

An algorithm paper is here

Image Analyst

### Image Analyst (view profile)

on 4 Feb 2013

Matt J's post here: http://www.mathworks.com/matlabcentral/newsreader/view_thread/320964#879842 but it's also on fitting, not doing a minimum enclosing ellipsoid shell like John's. And here's is torstens solution - again, fitting, not min enclosing.

Walter Roberson

### Walter Roberson (view profile)

on 4 Feb 2013

You can fit the plane through the points using techniques such as http://www.mathworks.com/support/solutions/en/data/1-1AVW5/index.html?solution=1-1AVW5

You could then rotate and use ellipse fitting. There is a discussion of circumscribing an ellipse here

on 4 Feb 2013