Fitcircle

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search

Purpose

fits circles (and spheres) to x,y (and z) data.

Synopsis

[xc,a] = fitcircle(x)

Description

For x, y data FITCIRCLE finds the circle center (xc) and radius (a) that fits the equation:

(x(:,1) - xc(1))^2 + (x(:,2) - xc(2))^2 = a^2

Parameters for a sphere can also be found.

Input

  • x = Mx2 matrix of x, y-coordinates (class double) for fitting a circle, or
Mx3 matrix of x, y, z-coordinates (class double) for fitting a sphere.

Outputs

  • xc = 1x2 circle center (class double) [1x3 sphere center]
  • a = 1x1 circle (sphere) radius.

See Also