polarRegress(a)

Determines the circle that best fits a set of points.


Syntax

polarFit(a)
a: array 1D coord - arbitrary points in cartesian coords
return: scalar record with three fields
   center: best fit center as coord
   radius: best fit radius as real
   error: estimated error

Usage

This is designed designed to use in determining the best-fit center of a series of measured points.

Location

menu: veeos ==> Data ==> Circles ==> polarRegress

library: dataLib

Example

see veeos examples inside of VEE

Notes

3 points on a plane uniquely define a circle (unless they are colinear of course), but if one has more than three points that don't exactly lie on a unique circle then determining a best-fit circle has no closed-form solution. Suppose, for instance, that one want to determine a circle with multiple measurements. The coordinates of a series of points near the presumed circumference are made, and then this function can be used to determine the best-fit circle. The algorithm used here is very basic so should be quite robust. Rather than using any sort of optimization, determines analytically the circles uniquely defined (see polarFit) by sets of three points from within the measurements, and then averages the resulting circle centers and radii. Note that best results are thereby obtained  if the measured points are widely spaced.

If there are only three points given then this reduces to polarFit since there is then a unique answer.

Note that there are other algorithms for finding a best-fit circle which may do better with noisy data, but a long as noise level si low this works quickly and well.

Reference

Dependencies

Supported On

VEE 7.0+, all platforms

See Also

polarFit


© 2015. All Rights Reserved.  Stan Bischof (stan@worldbadminton.com). Last updated 25 October 2015 11:22. © 2015.