jwo.landserf.structure
Class BiCubic

java.lang.Object
  |
  +--jwo.landserf.structure.BiCubic

public class BiCubic
extends Object

Class for fitting a bi-cubic surface through a set of four grid points. Bi-cubic interpolation has the advantage of second order continuity (slope varies continuously). Unlike splines, this is an exact interpolator at grid points so is appropriate for smooth sub-pixel interpolation. Based on the algorithms in Press et al, 1988 Numerical Recipes in C pp.104-108.

Version:
1.8.0, 13th May, 1999
Author:
Jo Wood from algorithm by Press et al, 1988.

Constructor Summary
BiCubic(float[] z, float[] d, float[] e, float[] c, float xRes, float yRes)
          Initialises the bi-cubic function based on the values at the 4 corners of a grid cell.
 
Method Summary
 float getZ(float xOffset, float yOffset)
          Returns the interpolated height within the grid square based on the given scaled offsets in the x and y directions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BiCubic

public BiCubic(float[] z,
               float[] d,
               float[] e,
               float[] c,
               float xRes,
               float yRes)
Initialises the bi-cubic function based on the values at the 4 corners of a grid cell. Corners stored in anticlockwise order starting in the bottom left.

Parameters:
z - The z value at each of the 4 corners (anticlockwise from bottom left).
d - dz/dx value (coeficient 'd' using Evans' quadratic notation) at each of the 4 corners (anticlockwise from bottom left).
e - dz/dy value (coeficient 'e' using Evans' quadratic notation) at each of the 4 corners (anticlockwise from bottom left).
c - d2z/dxdy value (coeficient 'c' using Evans' quadratic notation) at each of the 4 corners (anticlockwise from bottom left).
xRes - xResolution of grid square.
yRes - yResolution of grid square.
Method Detail

getZ

public float getZ(float xOffset,
                  float yOffset)
Returns the interpolated height within the grid square based on the given scaled offsets in the x and y directions.

Parameters:
xOffset - Scaled offset in the x direction. 0 is the left edge of the grid, 1 is the right edge.
yOffset - Scaled offset in the y direction. 0 is the bottom edge of the grid, 1 is the top edge.