public final class CSTShapeFunction extends java.lang.Object implements java.lang.Cloneable, javolution.xml.XMLSerializable, javolution.lang.ValueType
Modified by: Joseph A. Huwaldt
Modifier and Type | Method and Description |
---|---|
CSTShapeFunction |
copy()
Returns a copy of this CSTShapeFunction instance
allocated by the calling thread
(possibly on the stack). |
boolean |
equals(java.lang.Object obj)
Compares this CSTShapeFunction against the specified object for strict equality
(same values).
|
Point |
get2DPoint(double s)
Return a 2D point that represents the value of this shape function at the specified
parametric position: (s,getValue(s)).
|
BasicNurbsCurve |
getBasisFunction()
Return the basis function for this shape function.
|
double[] |
getCoefficients()
Return the array of Bernstein Polynomial coefficients for this shape function.
|
double[] |
getDerivatives(double s,
int grade)
Calculate all the derivatives from
0 to grade with
respect to parametric distance on the shape function for the given parametric
distance along the shape function, d^{grade}p(s)/d^{grade}s . |
int |
getOrder()
Return the order of this shape function.
|
double |
getValue(double s)
Return the value of this shape function at the specified parametric location.
|
int |
hashCode()
Returns the hash code for this object.
|
boolean |
isValid()
Return
true if this shape function contains valid and finite numerical
components. |
static CSTShapeFunction |
newInstance(int order,
double... Acoefs)
Construct a new shape function of the specified order from the specified list of
Bernstein Polynomial coefficients.
|
static CSTShapeFunction |
valueOf(NurbsCurve bfCrv)
Construct a new shape function from the specified 1D basis function Bezier curve.
|
public static CSTShapeFunction newInstance(int order, double... Acoefs)
order
- The order of the shape function to return.Acoefs
- The coefficients of the Bernstein Polynomial used to construct the
shape function. If more than "order" coefficients are provided then
the additional coefficients are ignored. May not be null.public static CSTShapeFunction valueOf(NurbsCurve bfCrv)
bfCrv
- The 1D basis function Bezier curve used to define this shape function.
May not be null.public int getOrder()
getCoefficients()
public BasicNurbsCurve getBasisFunction()
getCoefficients()
public double getValue(double s)
s
- The parametric distance along the curve to calculate the value of this
shape function at.public Point get2DPoint(double s)
s
- The parametric distance along the curve to calculate the value of this
shape function at.public double[] getDerivatives(double s, int grade)
0
to grade
with
respect to parametric distance on the shape function for the given parametric
distance along the shape function, d^{grade}p(s)/d^{grade}s
.
Example:
1st derivative (grade = 1), this returns [p(s), dp(s)/ds]
;
2nd derivative (grade = 2), this returns [p(s), dp(s)/ds, d^2p(s)/d^2s]
; etc.
s
- Parametric distance to calculate derivatives for (0.0 to 1.0
inclusive).grade
- The maximum grade to calculate the derivatives for (1=1st derivative,
2=2nd derivative, etc)java.lang.IllegalArgumentException
- if the grade is < 0.public double[] getCoefficients()
getOrder()
,
getBasisFunction()
public boolean isValid()
true
if this shape function contains valid and finite numerical
components. A value of false
will be returned if any of the values are
NaN or Inf.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare with.true
if this object is identical to that object;
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public CSTShapeFunction copy()
allocated
by the calling thread
(possibly on the stack).copy
in interface javolution.lang.ValueType