turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-07-2018 09:46 AM - last edited on 03-07-2018 10:02 AM by Rick_SAS

I have found some article how to fit some data with circle that is best (Fit a circle to data by Rick Wicklin, https://blogs.sas.com/content/iml/2015/06/08/fit-circle.html).

Now, I want to fit the same data with ellipse and I don't know how to rewrite the code.

I have some data as a result of measuring of tusks of wild boars. I think that the best fitting curve is logarithmic spiral, but for more complex view I need to compare data with more curves.

Thanks for any answer.

Accepted Solutions

Highlighted
## Re: How can I fit the data with ellipse?

Options

Solution

03-08-2018
05:26 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to spichal

03-07-2018 01:48 PM

Ah! I see from your program that you have already discovered my article about fitting a spiral to data. Good. You ought to be able to use a similar approach with the parameterization

x = a*cos(theta); y = b*sin(theta);

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to spichal

03-07-2018 10:22 AM

1. Can you post some sample data?

2. Do you expect the eccentricity to be small?

3. Are your data aligned in coordinate directions so that you can use the elliptic equation

(x-x0)^2 /a^2 + (y-y0)^2 /b^2 = 1

or do you need to rotate the data first?

4. Do you have data only along a portion of the arc (as in the blog post you link to) or do you have data all the way around the ellipse?

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

03-07-2018 11:16 AM

Ad 1) There is a file (in attachment) with some data.

Ad 2) Yes, I think the eccentricity might be small.

Ad 3) Data come from the picture of wild boar’s tusk, which was located in Geogebra and the coordinates of the boundary were determined. I am not sure if it is necessary before looking for the best fitting curve to rotate the coordinates.

Ad 4) I have only a portion of the arc. The arc of wild boar’s tusk is usually in a range up to 180°.

Thanks for your interest.

Highlighted
## Re: How can I fit the data with ellipse?

Options

Solution

03-08-2018
05:26 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to spichal

03-07-2018 01:48 PM

Ah! I see from your program that you have already discovered my article about fitting a spiral to data. Good. You ought to be able to use a similar approach with the parameterization

x = a*cos(theta); y = b*sin(theta);