Arcs Of Best Fit For Large Nos. of X&Y

  • Context: Undergrad 
  • Thread starter Thread starter tomtomtom1
  • Start date Start date
  • Tags Tags
    arcs Fit
Click For Summary

Discussion Overview

The discussion centers on finding arcs of best fit for large sets of X and Y data points, particularly in the context of highway edges. Participants explore various methods and tools for calculating the center and radius of the best-fit arc, considering both simple and more complex approaches.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant seeks a calculator or tool that can handle large datasets of X and Y coordinates to produce the arc of best fit, without a specific preference for the calculation method.
  • Another participant suggests a simple method of averaging the X and Y coordinates to find the center of the circle and then calculating the average distance from this center to determine the radius, though they do not claim this is optimal.
  • A third participant references a paper that outlines a method for computing the radius and coordinates of an arc of circle fitting a dataset, suggesting that it can be implemented in mathematical software.
  • One participant expresses concern that averaging the coordinates may not yield a good estimate for the center of the arc, proposing an alternative approach that involves identifying gaps in the angles of the points and using least squares for refinement.
  • A later reply indicates a misunderstanding of the original question, clarifying that the focus is on a partial arc rather than a full circle.

Areas of Agreement / Disagreement

Participants present multiple competing views on how to approach the problem, with no consensus on a single method or solution. The discussion remains unresolved regarding the best approach to take.

Contextual Notes

Some methods proposed depend on assumptions about the distribution of the data points, such as uniformity and the extent of the arc represented by the points. There are also unresolved mathematical steps in the suggested approaches.

tomtomtom1
Messages
160
Reaction score
8
Hi everyone

I was hoping someone could help with a problem I’m having.

I am often given large amounts of X & Y data which relate to the edges of highways.
Sometimes they are just a hand full approx 20 and other times there are approx 400.

I use the data to find arcs that best fit the x & y data which is then used to calculate various other aspects of the highway (which I won't bore you with).

My question is this; does anyone know of any calculators (online/excel/etc) that is available where by I can copy and paste in large rows of X&Y data and then the calculator then produces the arc of best fit i.e. the calculator should return the XY coordinates of the center of the circle and its radius.

I am not that fussed as to how the arc of best fit is calculated i.e. may or may not use least squares, I just need something that is able to handle large rows of XY data.

Can anyone help?
 
Physics news on Phys.org
Well, if you just want a circle that makes sense you can do the following:

Average the X and Y coordinates independently to get the X and Y coordinates of the center of the circle, call these [itex]X_0[/itex] and [itex]Y_0[/itex]

For each (X,Y) data pair, calculate
[tex]\sqrt{ (X-X_0)^2 + (Y-Y_0)^2 }[/tex]
the distance from that point to the center of your circle. Average all of these distances, and that is the radius of your circle.

I make no claim that this is optimal in any way, but it's probably pretty close. You should be able to make a spreadsheet in excel to do the calculations upon copy/pasting of data (with maybe a single dragging when doing the distance/averaging calculation but there's probably an excel command to avoid that)
 
Last edited:
Office_Shredder said:
Well, if you just want a circle that makes sense you can do the following:

Average the X and Y coordinates independently to get the X and Y coordinates of the center of the circle, call these [itex]X_0[/itex] and [itex]Y_0[/itex]

As I understand the situation, the X and Y coordinates are for a segment of a circular arc. There is no guarantee that they are uniformly separated. If you average the X and Y coordinates, this will not be a good estimate for the center of the circle. Nor will it be a particularly good estimate of the center of the arc.

One approach might be to assume that the points do not define more than about 3/4 of a circle. Start as you have outlined to determine the centroid of the sampled points. Compute the angle that each of the points make with the computed centroid, sort them and find the largest gap (modulo 360 degrees).

Split the points at the gap and sort by angle. At this point you could assume that the center lies on the perpendicular bisector of the line connecting the two extreme points and use least squares (or similar) to determine a radius. Given a radius, you could then try to refine the estimate of the center line.

This is all off the top of my head and may be hideously clumsy.
 
I misunderstood the question, I thought it was for a full circle as opposed to just a partial arc. The question makes a lot more sense now.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
28
Views
4K
  • · Replies 20 ·
Replies
20
Views
3K
Replies
24
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K