|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.functionfit.BSpline
public class BSpline
Represents a B-spline with control points at (Xi, Yi). Let Pi = (Xi, Yi), for i = 0,…, n - 1, be a control point and let tj, for j = 0,…, m - 1 be a knot. A B-spline of degree p = m - n - 1 is a parametric curve defined as
Ni, p(t) | = | ((t - ti)/(ti+p - ti))Ni, p-1(t) + ((ti+p+1 - t)/(ti+p+1 - ti+1))Ni+1, p-1(t) | |
Ni, 0(t) | = | { |
This class provides methods to evaluate
P(t) = (X(t), Y(t)) at any value of t,
for a B-spline of any degree p >= 1.
Note that the
evaluate
method
of this class can be slow, since it
uses a root finder to determine
the value of t* for which X(t*) = x
before it computes Y(t*).
Constructor Summary | |
---|---|
BSpline(double[] x,
double[] y,
double[] knots)
Constructs a new uniform B-spline with control points at (x[i], y[i]), and knot vector given by the array knots. |
|
BSpline(double[] x,
double[] y,
int degree)
Constructs a new uniform B-spline of degree degree with control points at (x[i], y[i]). |
Method Summary | |
---|---|
static BSpline |
createApproxBSpline(double[] x,
double[] y,
int degree,
int h)
Returns a B-spline curve of degree degree smoothing (xi, yi), for i = 0,…, n points. |
static BSpline |
createInterpBSpline(double[] x,
double[] y,
int degree)
Returns a B-spline curve of degree degree interpolating the (xi, yi) points. |
double |
derivative(double u)
Computes (or estimates) the first derivative of the function at point x. |
double |
derivative(double u,
int n)
Computes (or estimates) the nth derivative of the function at point x. |
BSpline |
derivativeBSpline()
Returns the derivative B-spline object of the current variable. |
BSpline |
derivativeBSpline(int i)
Returns the ith derivative B-spline object of the current variable; i must be less than the degree of the original B-spline. |
double |
evaluate(double u)
Returns the value of the function evaluated at x. |
double |
evalX(double u)
|
double |
evalY(double u)
|
double[] |
getKnots()
Returns an array containing the knot vector (t0, tm-1). |
double |
getMaxKnot()
Returns the knot maximal value. |
double |
getMinKnot()
Returns the knot minimal value. |
double[] |
getX()
Returns the Xi coordinates for this spline. |
double[] |
getY()
Returns the Yi coordinates for this spline. |
double |
integral(double a,
double b)
Computes (or estimates) the integral of the function over the interval [a, b]. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BSpline(double[] x, double[] y, int degree)
x
- the values of X.y
- the values of Y.degree
- the degree of the B-spline.public BSpline(double[] x, double[] y, double[] knots)
x
- the values of X.y
- the values of Y.knots
- the knots of the B-spline.Method Detail |
---|
public double[] getX()
public double[] getY()
public double getMaxKnot()
public double getMinKnot()
public double[] getKnots()
public static BSpline createInterpBSpline(double[] x, double[] y, int degree)
x
- the values of X.y
- the values of Y.degree
- the degree of the B-spline.
public static BSpline createApproxBSpline(double[] x, double[] y, int degree, int h)
x
- the values of X.y
- the values of Y.degree
- the degree of the B-spline.h
- the desired number of control points.
public BSpline derivativeBSpline()
public BSpline derivativeBSpline(int i)
i
- the degree of the derivative.
public double evaluate(double u)
MathFunction
evaluate
in interface MathFunction
u
- value at which the function is evaluated
public double integral(double a, double b)
MathFunctionWithIntegral
integral
in interface MathFunctionWithIntegral
a
- the starting point of the interval.b
- the ending point of the interval.
public double derivative(double u)
MathFunctionWithFirstDerivative
derivative
in interface MathFunctionWithFirstDerivative
u
- the point to evaluate the derivative to.
public double derivative(double u, int n)
MathFunctionWithDerivative
evaluate
.
derivative
in interface MathFunctionWithDerivative
u
- the point to evaluate the derivate to.n
- the order of the derivative.
public double evalX(double u)
public double evalY(double u)
|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |