TUpolyExp2D TCL UTILITIES USER MANUAL TUpolyExp2D
SYNOPSIS
Return the 2D polynomial expansion of an (X,Y) pair of values.
PACKAGE
TCLUTILS
NAME
TUpolyExp2D
USAGE
set rV  [TUpolyExp2D  X Y nC A Order {Offset} {uLim} {lLim}]
INPUT DEFINITIONS
X - Input X Variable
Y - Input Y Variable
nC - The number of polynomial coefficients
A - Array of polynomial coefficients
Order - Order of polynomial being solved
Offset - Optional offset into the polynomial coefficient array. Default is 0.
uLim - Optional upper limit clamp. Produced values above this limit are clamped to it. If uLim and lLim are identical this check is bypassed. Default is 0.
lLim - Optional lower limit clamp. Produced values below this limit are clamped to it. If uLim and lLim are identical this check is bypassed. Default is 0.
RETURN DEFINITION
rV - The result of the polynomial expansion.
DESCRIPTION
TUpolyExp2D solves polynomials of the form:
rV = A(0) + A(1)X + +A(2)Y + A(3)X2 + A(4)XY + A(5)Y2 + ...
        
The result is returned through the procedure. The routine provides for an optional offset into the coefficent array as well as the ability to clamp the returned value to either an upper or to a lower limit. Setting the upper and lower limits to the same value (the default condition) turns off the limit checking feature.
ERRORS
None Generated
C BACKING
Yes
EXAMPLE(S)
# SOLVE for radius of circle containing X and Y

set A(0) 0.0
set A(1) 0.0
set A(2) 0.0
set A(3) 1.0
set A(4) 0.0
set A(5) 1.0

set rV [TUpolyExp2D 5.0 0.0 6 A 2 ]
puts stderr "(5.00 0.00) gives $rV"
set rV [TUpolyExp2D 3.53 3.53 6 A 2 ]
puts stderr "(3.53 3.53) gives $rV"

> (5.00 0.00) gives 25.0
> (3.53 3.53) gives 24.9218

      
Apr 21, 2003