mpicbg.models

## Class PolynomialTransform2D

• ### Field Summary

Fields
Modifier and Type Field and Description
`protected double[]` `a`
holds two coefficients for each polynomial coefficient, including 1 initialized at 0 order, i.e.
`protected int` `order`
order of the polynomial transform
`protected double[]` `polTerms`
register to hold all polynomial terms during applyInPlace following the order specified at http://bishopw.loni.ucla.edu/AIR5/2Dnonlinear.html#polylist excluding 1 because we want to avoid repeated multiplication with 1
• ### Constructor Summary

Constructors
Constructor and Description
`PolynomialTransform2D()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`double[]` `apply(double[] location)`
Apply the `CoordinateTransform` to a location.
`void` `applyInPlace(double[] location)`
Apply the `CoordinateTransform` to a location.
`static void` `main(String... args)`
`static int` `numPolTerms(int order)`
Calculate the number of polynomial terms for a 2d polynomial transform of given order.
`static int` `orderOf(int numPolTerms)`
Calculate the maximum order of a polynom whose number of polyynomial terms is smaller or equal a given number.
`protected void` ```populateTerms(double x, double y)```
`protected void` `printTerms()`
`void` `set(double... a)`
Set the coefficients.
• ### Methods inherited from class java.lang.Object

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

• #### order

`protected int order`
order of the polynomial transform
• #### a

`protected double[] a`
holds two coefficients for each polynomial coefficient, including 1 initialized at 0 order, i.e. translation, the order follows that specified at http://bishopw.loni.ucla.edu/AIR5/2Dnonlinear.html#polylist two times
• #### polTerms

`protected double[] polTerms`
register to hold all polynomial terms during applyInPlace following the order specified at http://bishopw.loni.ucla.edu/AIR5/2Dnonlinear.html#polylist excluding 1 because we want to avoid repeated multiplication with 1
• ### Constructor Detail

• #### PolynomialTransform2D

`public PolynomialTransform2D()`
• ### Method Detail

• #### orderOf

`public static final int orderOf(int numPolTerms)`
Calculate the maximum order of a polynom whose number of polyynomial terms is smaller or equal a given number.
Parameters:
`numPolTerms` -
Returns:
• #### numPolTerms

`public static final int numPolTerms(int order)`
Calculate the number of polynomial terms for a 2d polynomial transform of given order.
Parameters:
`order` -
Returns:
• #### set

`public void set(double... a)`
Set the coefficients. The number of coefficients implicitly specifies the order of the `PolynomialTransform2D` which is set to the highest order that is fully specified by the provided coefficients. The coefficients are interpreted in the order specified at http://bishopw.loni.ucla.edu/AIR5/2Dnonlinear.html#polylist , first for x', then for y'. It is thus not possible to omit higher order coefficients assuming that they would become 0. The passed vararg array is used directly without copy which enables direct access to the coefficients from calling code. Use this option wisely.
Parameters:
`a` - coefficients
• #### populateTerms

```protected void populateTerms(double x,
double y)```
• #### printTerms

`protected void printTerms()`
• #### apply

`public double[] apply(double[] location)`
Description copied from interface: `CoordinateTransform`
Apply the `CoordinateTransform` to a location.
Specified by:
`apply` in interface `CoordinateTransform`
Returns:
transformed location
• #### applyInPlace

`public void applyInPlace(double[] location)`
Description copied from interface: `CoordinateTransform`
Apply the `CoordinateTransform` to a location.
Specified by:
`applyInPlace` in interface `CoordinateTransform`
• #### main

`public static final void main(String... args)`