public abstract class Spline2D extends Object implements Serializable, Cloneable
The simplest method of obtaining multivariate interpolation and approximation functions is to take univariate methods and form a multivariate method via tensor products. In the case of two-dimensional spline interpolation, the derivation proceeds as follows: Let tx be a knot sequence for splines of order kx, and ty be a knot sequence for splines of order ky. Let Nx+kx be the length of tx, and Ny+kx be the length of ty. Then, the tensor-product spline has the following form: Ny−1∑m=0Nx−1∑n=0cnmBn,kx,tx(x)Bm,ky,ty(y) Given two sets of points {xi}Nxi=1 and {yj}Nyj=1 for which the corresponding univariate interpolation problem can be solved, the tensor-product interpolation problem finds the coefficients cnm so that Ny−1∑m=0Nx−1∑n=0cnmBn,kx,tx(xi)Bm,ky,ty(yj)=fij This problem can be solved efficiently by repeatedly solving univariate interpolation problems as described in de Boor (1978, p. 347).
Constructor and Description |
---|
Spline2D() |
Modifier and Type | Method and Description |
---|---|
double[][] |
derivative(double[] xVec,
double[] yVec,
int xPartial,
int yPartial)
Returns the values of the partial derivative of the tensor-product spline
of an array of points.
|
double |
derivative(double x,
double y,
int xPartial,
int yPartial)
Returns the value of the partial derivative of the tensor-product spline
at the point (x, y).
|
double[][] |
getCoefficients()
Returns the coefficients for the tensor-product spline.
|
double[] |
getXKnots()
Returns the knot sequences in the x-direction.
|
double[] |
getYKnots()
Returns the knot sequences in the y-direction.
|
double |
integral(double a,
double b,
double c,
double d)
Returns the value of an integral of a tensor-product spline on a
rectangular domain.
|
double[][] |
value(double[] xVec,
double[] yVec)
Returns the values of the tensor-product spline of an array of points.
|
double |
value(double x,
double y)
Returns the value of the tensor-product spline at the point (x, y).
|
public double[] getXKnots()
double
array containing the knot
sequences of the spline in the x-direction.public double[] getYKnots()
double
array containing the knot
sequences of the spline in the y-direction.public double[][] getCoefficients()
double
matrix containing the coefficients.public double value(double x, double y)
x
- a double
scalar specifying the x-coordinate of
the evaluation point for the tensor-product spline.y
- a double
scalar specifying the y-coordinate of
the evaluation point for the tensor-product spline.double
scalar containing the value of the
tensor-product spline.public double derivative(double x, double y, int xPartial, int yPartial)
x
- a double
scalar specifying the x-coordinate of
the evaluation point for the tensor-product spline.y
- a double
scalar specifying the y-coordinate of
the evaluation point for the tensor-product spline.xPartial
- an int
scalar specifying the x-partial derivative.yPartial
- an int
scalar specifying the y-partial derivative.double
scalar containing the value of the
partial derivative ∂i+js∂ix∂jy
where i = xPartial
and j =
yPartial
, at (x, y).public double[][] value(double[] xVec, double[] yVec)
xVec
- a double
array specifying the
x-coordinates at which the spline is to be evaluated.yVec
- a double
array specifying the
y-coordinates at which the spline is to be evaluated.double
matrix containing the
values evaluated.public double[][] derivative(double[] xVec, double[] yVec, int xPartial, int yPartial)
xVec
- a double
array specifying the
x-coordinates at which the spline is to be evaluated.yVec
- a double
array specifying the
y-coordinates at which the spline is to be evaluated.xPartial
- an int
scalar specifying the x-partial derivative.yPartial
- an int
scalar specifying the y-partial derivative.double
matrix containing the values of
the partial derivatives ∂i+js∂ix∂jy
where i = xPartial
and j =
yPartial
, at each (x, y).public double integral(double a, double b, double c, double d)
If s is the spline, then the integral
method returns
∫ba∫dcs(x,y)dydx
This method uses the (univariate integration) identity (22) in de Boor
(1978, p. 151)
∫xt0n−1∑i=0αiBi,k(τ)dτ=r−1∑i=0[i∑j=0αjtj+k−tjk]Bi,k+1(x)
where t0≤x≤tr.
It assumes (for all knot sequences) that the first and last k knots are stacked, that is, t0=…=tk−1 and tn=…=tn+k−1 , where k is the order of the spline in the x or y direction.
a
- a double
specifying the lower limit for the
first variable of the tensor-product spline.b
- a double
specifying the upper limit for the
first variable of the tensor-product spline.c
- a double
specifying the lower limit for the
second variable of the tensor-product spline.d
- a double
specifying the upper limit for the
second variable of the tensor-product spline.double
, the integral of the tensor-product
spline over the rectangle [a, b]
by
[c, d]
.Copyright © 2020 Rogue Wave Software. All rights reserved.