public class Interpolation
extends java.lang.Object
Title: Polynomial Interpolation
Description: Polynomial interpoaltion using Newton's and Lagrange's methods
Copyright: Copyright Byrge Birkeland(c) 2002
Company: Agder University College
Constructor and Description |
---|
Interpolation() |
Modifier and Type | Method and Description |
---|---|
static Function |
cubicSpline(double[] t,
double[] x,
double[] z)
finds the cubic spline functions that interpolates the nodes (ti,xi)
|
static double[] |
cubicSplineCoeff(double[] t,
double[] x,
double z0,
double zn)
finds the natural cubic spline function that interpolates the noeds (xi,yi)
|
static double[] |
divDif(double[] x,
double[] y)
finds the divided differences, i.e. the coefrficients i Newton's interpolation
polynomial intyerpolating the nodes (xi,yi)
|
static Function |
horner(double[] a,
double[] x)
implements Horners-s method to compute the polynomial
a0+(t-x0)(a1+(t-x1)(a2+(t-x2)(a3+(...
|
static Function |
newtonInterp(double[] x,
double[] y)
Interpolates with Horners-s method, computing the polynomial
a0+(t-x0)(a1+(t-x1)(a2+(t-x2)(a3+(...
|
static Function |
quadSpline(double[] t,
double[] x,
double[] z)
finds the piecewise second degree function that interpolates given nodes (xi,yi)
|
static double[] |
quadSplineCoeff(double[] t,
double[] x,
double z0)
gives the derivatives at the nodes of the quadratic spline functions that
interpolates the nodes (ti,xi)
|
static Function |
splineDegreeOne(double[] t,
double[] x)
finds the piecewice linear function whose graph interpolates the points (ti,xi)
|
static java.lang.String |
toString(double[] x)
converts a double[] array to a String object
|
static java.lang.String |
toString(double[][] x)
converts a double[][] array to a String object
|
public static final Function horner(double[] a, double[] x)
a
- the vector of coefficientsx
- the vector of x coordinates of nodes to be interpolatedpublic static double[] divDif(double[] x, double[] y)
x
- the x coordinates of the nodes to be interpolatedy
- the y coordinates of the nodes to be interpolatedpublic static final Function newtonInterp(double[] x, double[] y)
y
- the vector of y coordinates of nodes to be interpolatedx
- the vector of x coordinates of nodes to be interpolatedpublic static final Function splineDegreeOne(double[] t, double[] x)
t
- the argument values of the points to be interpolatedx
- the ordinate values if the points to bed interpolatedpublic static double[] quadSplineCoeff(double[] t, double[] x, double z0)
t
- the argument values of the points to be interpolatedx
- the ordinate values of the points to be interpolatedz0
- the value of the first derivative at the node with index 0public static final Function quadSpline(double[] t, double[] x, double[] z)
t
- the argument values of the nodesx
- the ordinate values of the nodesz
- the vector of derivatives at the nodespublic static double[] cubicSplineCoeff(double[] t, double[] x, double z0, double zn)
t
- the argument values of the points to be interpolatedx
- the ordinate values of the points to be interpolatedz0
- the value of the second derivative at the node with index 0zn
- the value of the second derivative at the final nodepublic static final Function cubicSpline(double[] t, double[] x, double[] z)
t
- the argument values of the nodesx
- the ordinate values of the nodesz
- the vector of second derivatives at the nodespublic static java.lang.String toString(double[] x)
x
- the array to be convertedpublic static java.lang.String toString(double[][] x)
x
- the array to bed converted