Obtain a linear approximation to a Mapping, if appropriate AST_LINEARAPPROX
’
s forward transformation within the specified range
of output coordinates. If the transformation is not sufficiently linear, no coefficients are
returned. ’
s Nin attribute. This box should specify the region over which linearity is required. "
( Nin
1 )
Nout"
,
elements. The first Nout elements hold the constant offsets for the transformation outputs. The
remaining elements hold the gradients. So if the Mapping has 2 inputs and 3 outputs the linear
approximation to the forward transformation is:
X_out = fit(1) fit(4)X_in fit(5)Y_in
Y_out = fit(2) fit(6)X_in fit(7)Y_in
Z_out = fit(3) fit(8)X_in fit(9)Y_in
This function fits the Mapping’
s forward transformation. To fit the inverse transformation, the
Mapping should be inverted using AST_INVERT before invoking this function.
If a Mapping output is found to have a bad value (AST__BAD) at one or more of the test points used in the linearity test, then all the values in the returned fit that correspond to that output are set to AST__BAD. However, this does not affect the linearity tests on the other Mapping outputs - if they are all found to be linear then usable coefficients will be returned for them in the fit, and the function will return a .TRUE. value. Consequently, it may be necessary to check that the values in the returned fit are not AST__BAD before using them. If all Mapping outputs generate bad values, then .FALSE. is returned as the function value.
A value of .FALSE. will be returned if this function is invoked with the global error status set, or if it should fail for any reason.