function transpoly

Compute the transformation matrix for two reference coordinate systems. It is described by a second order polynomial (at least 6 reference sources must be provided). The transformation function will be calculated using a least squares fit to given coordinates. Note that if either in REFSTARS or in IMSTARS a coordinate is exactly (-1, -1), this star will not be used to calculate the transformation matrix.

Syntax
result = transpoly(REFSTARS, IMSTARS, errors)

Arguments
REFSTARS:   A matrix 2xm (m >= 6) with positions of the reference stars in the reference frame.
IMSTARS:   A matrix 2xm (same size as REFSTARS) with the positions of the same stars in the image to be transformed.
errors:   A matrix 2xm (same size as REFSTARS) with the errors in x (errors[1,:]) and y (errors[2,:]).


Returns
A matrix of size 4x6. 1st column: parametres in x, 2nd column: parameters in y,
   x' = result[1,1] + result[1,2]*x + result[1,3]*y + result[1,4]*xy + result[1,5]*x^2 + result[1,6]*y^2
   y' = result[2,1] + result[2,2]*x + result[2,3]*y + result[2,4]*xy + result[2,5]*x^2 + result[2,6]*y^2


See also
function transmatrix