comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: One ellipse to rule them all
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: One ellipse to rule them all [message #58622] Mon, 11 February 2008 15:06 Go to next message
ianpaul.freeley is currently offline  ianpaul.freeley
Messages: 18
Registered: March 2007
Junior Member
On Feb 11, 4:51 pm, David Fanning <n...@dfanning.com> wrote:
> ianpaul.free...@gmail.com writes:
>> I'm hoping someone has done this before and can help me out.
>
>> I have a bunch of x,y points, and I'd like to find the ellipse (with
>> minimum area) that encompasses all of them. Any thoughts?
>
> I can show you how to find an ellipse:
>
> http://www.dfanning.com/ip_tips/fit_ellipse.html
>
> To enclose all the points I would, uh, expand it
> slowly. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

My gut tells me I should be able to do it analytically. I *think* the
two points that have the largest separation should define the major
axis and position angle. Then I just need to fit for the minor axis
from the rest of the points, and the largest one is the winner.
Re: One ellipse to rule them all [message #58623 is a reply to message #58622] Mon, 11 February 2008 14:51 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ianpaul.freeley@gmail.com writes:

> I'm hoping someone has done this before and can help me out.
>
> I have a bunch of x,y points, and I'd like to find the ellipse (with
> minimum area) that encompasses all of them. Any thoughts?

I can show you how to find an ellipse:

http://www.dfanning.com/ip_tips/fit_ellipse.html

To enclose all the points I would, uh, expand it
slowly. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: One ellipse to rule them all [message #58706 is a reply to message #58622] Tue, 12 February 2008 08:08 Go to previous message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
> My gut tells me I should be able to do it analytically. I *think* the
> two points that have the largest separation should define the major
> axis and position angle. Then I just need to fit for the minor axis
> from the rest of the points, and the largest one is the winner.

I agree with the thoughts of this posting. A little work with a pen
can go a long way.

Personally I would
- start with the ellipse you define, and maybe enlarge it some to be
sure.
- define a cost function for ameoba that adjusts the tilt angle, semi-
minor and semi-major axis where the cost is the area of the ellipse
and you can be sure it has all the points but the cost for not being
huge.
- run it and see what you get

Of course standing on the shoulders of giants is better, so if any of
the mentioned references are good (I didnt read them) then go that
route.



Cheers,

Brian





------------------------------------------------------------ -------------
Brian Larsen
Boston University
Center for Space Physics
Re: One ellipse to rule them all [message #58720 is a reply to message #58622] Mon, 11 February 2008 15:55 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Feb 11, 5:06 pm, ianpaul.free...@gmail.com wrote:
> On Feb 11, 4:51 pm, David Fanning <n...@dfanning.com> wrote:
>
>> ianpaul.free...@gmail.com writes:
>>> I'm hoping someone has done this before and can help me out.
>
>>> I have a bunch of x,y points, and I'd like to find the ellipse (with
>>> minimum area) that encompasses all of them. Any thoughts?
>
>> I can show you how to find an ellipse:
>
>> http://www.dfanning.com/ip_tips/fit_ellipse.html
>
>> To enclose all the points I would, uh, expand it
>> slowly. :-)
>
>> Cheers,
>
>> David
>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming (www.dfanning.com)
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> My gut tells me I should be able to do it analytically. I *think* the
> two points that have the largest separation should define the major
> axis and position angle. Then I just need to fit for the minor axis
> from the rest of the points, and the largest one is the winner.

Look here - and references therein:
http://www-eleves-isia.cma.fr/documentation/CgalDoc2.4/basic _lib/Optimisation_ref/Class_Min_ellipse_2.html
Re: One ellipse to rule them all [message #58721 is a reply to message #58622] Mon, 11 February 2008 15:55 Go to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
ianpaul.free...@gmail.com wrote:
> On Feb 11, 4:51 pm, David Fanning <n...@dfanning.com> wrote:
>> ianpaul.free...@gmail.com writes:
>>> I'm hoping someone has done this before and can help me out.
>>
>>> I have a bunch of x,y points, and I'd like to find the ellipse (with
>>> minimum area) that encompasses all of them. Any thoughts?
>>
>> I can show you how to find an ellipse:
>>
>> http://www.dfanning.com/ip_tips/fit_ellipse.html
>>
>> To enclose all the points I would, uh, expand it
>> slowly. :-)
>>
>> Cheers,
>>
>> David
>>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming (www.dfanning.com)
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> My gut tells me I should be able to do it analytically. I *think* the
> two points that have the largest separation should define the major
> axis and position angle.

I don't think that is true in general.

Take three points building an equilateral triangle. The minimum
area ellipse including them is the circle centered on the geometric
center of the triangle, not any ellipse whose major axis connects
two points on the triangle.


Cheers,
Paolo
Then I just need to fit for the minor axis
> from the rest of the points, and the largest one is the winner.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: IDL batchfile as a linux script?
Next Topic: mpfit: what's different

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:49:20 PDT 2025

Total time taken to generate the page: 0.26652 seconds