Class BivariateRegularGrid
- java.lang.Object
-
- dev.nm.analysis.curvefit.interpolation.bivariate.BivariateRegularGrid
-
- All Implemented Interfaces:
BivariateGrid
public class BivariateRegularGrid extends Object implements BivariateGrid
A regular grid is a tessellation of n-dimensional Euclidean space by congruent parallelotopes (e.g. bricks), meaning that grid points are equally-spaced. This is a special case of rectilinear grid. This implementation is backed by a two-dimensional array.- See Also:
- Wikipedia: Regular grid
-
-
Constructor Summary
Constructors Constructor Description BivariateRegularGrid(double[][] z, double x0, double y0, double deltaX, double deltaY)
Constructs a new grid where the dependent variable values are taken from the given two-dimensional array and the values of the dependent variables are specified by their first values and the difference between successive values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
deltaX()
Return the distance between two adjacent points along the x-axis.double
deltaY()
Return the distance between two adjacent points along the y-axis.int
sizeX()
Define the size of the grid along the x-axis.int
sizeY()
Define the size of the grid along the y-axis.double[]
x()
Get the values of the independent variable xi.double
x(int i)
Get the value of xi, the i-th value of the independent variable x.double
x0()
Get the value of x0, the first value of the independent variable x.double[]
y()
Get the values of the independent variable yj.double
y(int j)
Get the value of yj, the j-th value of the independent variable y.double
y0()
Get the value of y0, the first value of the independent variable y.double
z(int i, int j)
Get the value of the dependent variable z at the given indices in the grid.
-
-
-
Constructor Detail
-
BivariateRegularGrid
public BivariateRegularGrid(double[][] z, double x0, double y0, double deltaX, double deltaY)
Constructs a new grid where the dependent variable values are taken from the given two-dimensional array and the values of the dependent variables are specified by their first values and the difference between successive values. The first index for the input array will be corresponding to x and the second index to y and the size will be inferred from the size of the array.- Parameters:
z
- the two-dimensional array containing the values of the dependent variablex0
- the first value of the independent variable xy0
- the first value of the independent variable ydeltaX
- the distance between adjacent points along the x-axisdeltaY
- the distance between adjacent points along the y-axis
-
-
Method Detail
-
z
public double z(int i, int j)
Description copied from interface:BivariateGrid
Get the value of the dependent variable z at the given indices in the grid.- Specified by:
z
in interfaceBivariateGrid
- Parameters:
i
- the index along the x-axisj
- the index along the y-axis- Returns:
- z(xi, yj)
-
x
public double[] x()
Description copied from interface:BivariateGrid
Get the values of the independent variable xi.- Specified by:
x
in interfaceBivariateGrid
- Returns:
- xi's
-
y
public double[] y()
Description copied from interface:BivariateGrid
Get the values of the independent variable yj.- Specified by:
y
in interfaceBivariateGrid
- Returns:
- yj's
-
x
public double x(int i)
Description copied from interface:BivariateGrid
Get the value of xi, the i-th value of the independent variable x.- Specified by:
x
in interfaceBivariateGrid
- Parameters:
i
- the index- Returns:
- xi
-
y
public double y(int j)
Description copied from interface:BivariateGrid
Get the value of yj, the j-th value of the independent variable y.- Specified by:
y
in interfaceBivariateGrid
- Parameters:
j
- the index- Returns:
- yj
-
sizeX
public int sizeX()
Description copied from interface:BivariateGrid
Define the size of the grid along the x-axis. That is, the number of points along the x-axis.- Specified by:
sizeX
in interfaceBivariateGrid
- Returns:
- the size along the x-axis
-
sizeY
public int sizeY()
Description copied from interface:BivariateGrid
Define the size of the grid along the y-axis. That is, the number of points along the y-axis.- Specified by:
sizeY
in interfaceBivariateGrid
- Returns:
- the size along the y-axis
-
x0
public double x0()
Get the value of x0, the first value of the independent variable x.- Returns:
- x0
-
y0
public double y0()
Get the value of y0, the first value of the independent variable y.- Returns:
- y0
-
deltaX
public double deltaX()
Return the distance between two adjacent points along the x-axis.- Returns:
- \(\delta_x\)
-
deltaY
public double deltaY()
Return the distance between two adjacent points along the y-axis.- Returns:
- \(\delta_y\)
-
-