ArcObjects Library Reference (DataSourcesRaster)  

IRasterGeometryProc.LeastSquareFit Method

Computes a least squares fit for the input control points.

[Visual Basic .NET]
Public Function LeastSquareFit ( _
    ByVal sourceControlPoints As IPointCollection, _
    ByVal targetControlPoints As IPointCollection, _
    ByVal transformType As esriGeoTransTypeEnum, _
    ByVal forwardTransformation As Boolean, _
    ByVal returnTransformationCoef As Boolean _
) As Object
[C#]
public object LeastSquareFit (
    IPointCollection sourceControlPoints,
    IPointCollection targetControlPoints,
    esriGeoTransTypeEnum transformType,
    bool forwardTransformation,
    bool returnTransformationCoef
);
[C++]
HRESULT LeastSquareFit(
  IPointCollection* sourceControlPoints,
  IPointCollection* targetControlPoints,
  esriGeoTransTypeEnum transformType,
  VARIANT_BOOL forwardTransformation,
  VARIANT_BOOL returnTransformationCoef,
  VARIANT* pVar
);
[C++]

Parameters

sourceControlPoints [in]

  sourceControlPoints is a parameter of type IPointCollection

targetControlPoints [in]

  targetControlPoints is a parameter of type IPointCollection

transformType [in]

  transformType is a parameter of type esriGeoTransTypeEnum

forwardTransformation [in]   forwardTransformation is a parameter of type VARIANT_BOOL returnTransformationCoef [in]   returnTransformationCoef is a parameter of type VARIANT_BOOL pVar [out, retval]   pVar is a parameter of type VARIANT

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

The numbers of points in the SourceControlPoints and targetControlPoints must be equal. To create a first order polynomial transformation, there should be at least 3 un-correlated points for both source and target control points. For the second order and third order polynomial transformations, the minimum number of un-correlated points are 6 and 10 respectively.

Setting the argument forwardTransformation to be true indicates the transformation will be computed from SourceControls to targetControlPoints, while setting it to be false indicates the transformation will be computed from targetControlPoints to SourceControlPoints.

Setting the argument ReturnTransformationCoef to be true indicates the returned variant will be the coefficients of the transformation polynomial, while setting it to be false indicates that the returned variant will be residual.

The returned coefficients are represented as a Nx2 array with N varies with the transformation order. The returned residual is represented as a one-dimensional array. The number of the element in the array equals the number of the control points.

See Also

IRasterGeometryProc Interface