# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.analysis.curvefit.interpolation.bivariate

## Class PartialDerivativesByCenteredDifferencing

• java.lang.Object
• com.numericalmethod.suanshu.analysis.curvefit.interpolation.bivariate.PartialDerivativesByCenteredDifferencing
• All Implemented Interfaces:
BicubicInterpolation.PartialDerivatives

public class PartialDerivativesByCenteredDifferencing
extends Object
implements BicubicInterpolation.PartialDerivatives
This implementation computes the partial derivatives by centered differencing. That is, $\frac{\partial z}{\partial x} = \frac{z_{i+1, j} - z_{i-1, j}}{x_{i+1} - x_{i-1}} \\ \frac{\partial z}{\partial y} = \frac{z_{i, j+1} - z_{i, j-1}}{y_{j+1} - y_{j-1}} \\ \frac{\partial^2 z}{\partial x \partial y} = \frac{z_{i+1,j+1}-z_{i+1,j-1}-z_{i-1,j+1}+z_{i-1,j-1}}{(x_{i+1}-x_{i-1})(y_{j+1}-y_{j-1})}$ At the points on the boundaries, one-sided differences are used.
• ### Constructor Summary

Constructors
Constructor and Description
PartialDerivativesByCenteredDifferencing()
• ### Method Summary

All Methods
Modifier and Type Method and Description
double dx(BivariateGrid grid, int i, int j)
Get the partial derivative $$\frac{\partial z}{\partial x}$$, at the given position in the grid.
double dxdy(BivariateGrid grid, int i, int j)
Get the cross derivative $$\frac{\partial^2 z}{\partial x \partial y}$$, at the given position in the grid.
double dy(BivariateGrid grid, int i, int j)
Get the partial derivative $$\frac{\partial z}{\partial y}$$, at the given position in the grid.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### PartialDerivativesByCenteredDifferencing

public PartialDerivativesByCenteredDifferencing()
• ### Method Detail

• #### dx

public double dx(BivariateGrid grid,
int i,
int j)
Description copied from interface: BicubicInterpolation.PartialDerivatives
Get the partial derivative $$\frac{\partial z}{\partial x}$$, at the given position in the grid.
Specified by:
dx in interface BicubicInterpolation.PartialDerivatives
Parameters:
grid - the grid for which to get the partial derivative
i - the index along the x-axis
j - the index along the y-axis
Returns:
$$\frac{\partial z}{\partial x}$$ at the given point
• #### dy

public double dy(BivariateGrid grid,
int i,
int j)
Description copied from interface: BicubicInterpolation.PartialDerivatives
Get the partial derivative $$\frac{\partial z}{\partial y}$$, at the given position in the grid.
Specified by:
dy in interface BicubicInterpolation.PartialDerivatives
Parameters:
grid - the grid for which to get the partial derivative
i - the index along the x-axis
j - the index along the y-axis
Returns:
$$\frac{\partial z}{\partial y}$$ at the given point
• #### dxdy

public double dxdy(BivariateGrid grid,
int i,
int j)
Description copied from interface: BicubicInterpolation.PartialDerivatives
Get the cross derivative $$\frac{\partial^2 z}{\partial x \partial y}$$, at the given position in the grid.
Specified by:
dxdy in interface BicubicInterpolation.PartialDerivatives
Parameters:
grid - the grid for which to get the partial derivative
i - the index along the x-axis
j - the index along the y-axis
Returns:
$$\frac{\partial^2 z}{\partial x \partial y}$$ at the given point