Function: ELLIPSE2 Purpose: Fits an ellipse to a set of X and Y positions. Category: MATH File: ellipse.c Author: K.G. Begeman Use: INTEGER ELLIPSE2( N , Input INTEGER X , Input REAL ARRAY Y , Input REAL ARRAY P , Input/Output REAL ARRAY E , Output REAL ARRAY M ) Input INTEGER ARRAY ELLIPSE2 Returns number of iterations on success, else -1: No free parameters -2: Exceede iteration limit (50) -3: Diagonal of matrix has zeroes -4: Matrix could not be inverted N Number of positions. X Array with X coordinates (in units). Y Array with Y coordinates (in units). P On input contains the initial estimates of the ellipse parameters. On output the fitted parameters. P contains: P(1) = radius (in units) P(2) = inclination (degrees) P(3) = X centre of ellipse (units) P(4) = Y centre of ellipse (units) P(5) = Position angle (degrees) E Contains the errors in the fitted parameters. M Mask for free (1) or fixed (0) parameters. Related Docs: ellipse1.dc2 Updates: Jan 25, 1991: KGB Document created.