public class PolynomialTransform2D extends Object implements CoordinateTransform
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 and Description |
---|
PolynomialTransform2D() |
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.
|
protected int order
protected double[] a
protected double[] polTerms
public static final int orderOf(int numPolTerms)
numPolTerms
- public static final int numPolTerms(int order)
order
- public void set(double... a)
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.a
- coefficientsprotected void populateTerms(double x, double y)
protected void printTerms()
public double[] apply(double[] location)
CoordinateTransform
CoordinateTransform
to a location.apply
in interface CoordinateTransform
public void applyInPlace(double[] location)
CoordinateTransform
CoordinateTransform
to a location.applyInPlace
in interface CoordinateTransform
public static final void main(String... args)
Copyright © 2015–2021 Fiji. All rights reserved.