Description:
This routine does a least
squares fit of data to a plane. The plane is described by an equation of form:-
| (44) |
Invocation
CALL SCULIB_FIT_PLANE (N, X, Y, Z, QUALITY, MX, MY, C, STATUS)
Arguments
N
= INTEGER (Given)
the number of data points
X (N) = REAL (Given)
the x coords of the measured
points
Y (N) = REAL (Given)
the y coords of the measured points
Z (N) = REAL (Given)
the
measured values
QUALITY (N) = INTEGER (Given)
the quality on the data
MX = REAL
(Returned)
the slope of the fitted plane in the x-axis
MY = REAL (Returned)
the slope of the fitted
plane in the y-axis
C = REAL (Returned)
the constant of the fitted plane
STATUS = INTEGER
(Given and returned)
global status
Method
If status is good on entry the routine will loop
through the input data calculating the sums required and the number of valid data points (i.e. those
with good quality flags).
If there are less than 3 valid data then an error message will be output and bad status returned else the
plane coefficients will be calculated from the following formulae:-
| (45) |
| (46) |
where
is the number of valid data points. If the denominator of the expression for MX is 0 then an error
message will be output and bad status returned.
end if
Copyright
Copyright ©1995,1996,1997,1998,1999 Particle Physics and Astronomy Research
Council. All Rights Reserved.