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
SUMMARY

This discussion focuses on finding arcs of best fit for large sets of X and Y data points related to highway edges. Users seek calculators or tools that can handle extensive datasets, ideally producing the center coordinates and radius of the arc. A suggested method involves averaging the X and Y coordinates to find the center and calculating the average distance from this center to determine the radius. Additionally, the conversation highlights the need for more sophisticated approaches, such as using least squares for better accuracy, particularly when the data does not represent a complete circle.

PREREQUISITES
  • Understanding of basic geometry and circular arcs
  • Familiarity with data analysis tools like Excel
  • Knowledge of least squares fitting techniques
  • Basic programming skills in MATLAB or Mathematica for advanced calculations
NEXT STEPS
  • Research "Excel formulas for distance calculations" to automate the averaging process
  • Learn about "least squares fitting for circular arcs" to improve accuracy
  • Explore "MATLAB functions for curve fitting" to implement more complex models
  • Read the paper on "conic regression techniques" for advanced fitting methods
USEFUL FOR

This discussion is beneficial for civil engineers, data analysts, and anyone involved in geometric modeling or data fitting, particularly in the context of highway design and analysis.

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 X_0 and Y_0

For each (X,Y) data pair, calculate
\sqrt{ (X-X_0)^2 + (Y-Y_0)^2 }
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 X_0 and Y_0

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
1K