|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectStatic
MathTransforms
public final class MathTransforms
Utility methods related to MathTransforms. This class centralizes in one place some of
the most commonly used functions from the org.geotoolkit.referencing.operation.transform
package, thus reducing the need to explore that low-level package. The MathTransforms
class provides the following services:
MathTransform
The factory static methods are provided as convenient alternatives to the GeoAPI
MathTransformFactory interface. However
users seeking for more implementation neutrality are encouraged to limit themselves
to the GeoAPI factory interfaces instead.
MathTransformFactory
| referencing/geotk-referencing (download) | View source code for this class |
| Method Summary | |
|---|---|
static MathTransform1D |
concatenate(MathTransform1D tr1,
MathTransform1D tr2)
Concatenates the given one-dimensional transforms. |
static MathTransform1D |
concatenate(MathTransform1D tr1,
MathTransform1D tr2,
MathTransform1D tr3)
Concatenates the three given one-dimensional transforms. |
static MathTransform2D |
concatenate(MathTransform2D tr1,
MathTransform2D tr2)
Concatenates the given two-dimensional transforms. |
static MathTransform2D |
concatenate(MathTransform2D tr1,
MathTransform2D tr2,
MathTransform2D tr3)
Concatenates the three given two-dimensional transforms. |
static MathTransform |
concatenate(MathTransform tr1,
MathTransform tr2)
Concatenates the two given transforms. |
static MathTransform |
concatenate(MathTransform tr1,
MathTransform tr2,
MathTransform tr3)
Concatenates the three given transforms. |
static Matrix |
derivativeAndTransform(MathTransform transform,
double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
A buckle method for calculating derivative and coordinate transformation in a single step. |
static LinearTransform |
dimensionFilter(int sourceDim,
int[] toKeep)
Creates an affine transform that keep only a subset of the source ordinate values. |
static LinearTransform |
identity(int dimension)
Returns an identity transform of the specified dimension. |
static LinearTransform |
linear(AffineTransform matrix)
Creates an affine transform from the specified Java2D object. |
static LinearTransform |
linear(int dimension,
double scale,
double offset)
Creates an affine transform that apply the same linear conversion for all dimensions. |
static LinearTransform |
linear(Matrix matrix)
Creates an arbitrary linear transform from the specified matrix. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static LinearTransform identity(int dimension)
LinearTransform1D or
AffineTransform2D respectively.
dimension - The dimension of the transform to be returned.
public static LinearTransform linear(int dimension,
double scale,
double offset)
y = x ×scale+offset
dimension - The input and output dimensions.scale - The scale term in the linear equation.offset - The offset term in the linear equation.
public static LinearTransform linear(Matrix matrix)
M, and output dimension is N, then the
given matrix shall have size [N+1][M+1]. The +1 in the matrix dimensions allows the
matrix to do a shift, as well as a rotation. The [M][j] element of the matrix will
be the j'th ordinate of the moved origin.
The matrix is usually square and affine, but this is not mandatory. Non-affine transforms are allowed.
matrix - The matrix used to define the linear transform.
MathTransformFactory.createAffineTransform(Matrix)public static LinearTransform linear(AffineTransform matrix)
linear(Matrix).
matrix - The matrix used to define the affine transform.
public static LinearTransform dimensionFilter(int sourceDim,
int[] toKeep)
throws IndexOutOfBoundsException
sourceDim and
the dimension of target coordinates is toKeep.length.
sourceDim - the dimension of source coordinates.toKeep - the indices of source ordinate values to keep.
IndexOutOfBoundsException - if a value of toKeep
is lower than 0 or not smaller than sourceDim.Matrices.createDimensionFilter(int, int[])
public static MathTransform concatenate(MathTransform tr1,
MathTransform tr2)
MathTransform1D or MathTransform2D if the dimensions of the
concatenated transform are equal to 1 or 2 respectively.
tr1 - The first math transform.tr2 - The second math transform.
MathTransformFactory.createConcatenatedTransform(MathTransform, MathTransform)
public static MathTransform2D concatenate(MathTransform2D tr1,
MathTransform2D tr2)
concatenate(MathTransform, MathTransform) and casting the
result to a MathTransform2D instance.
tr1 - The first math transform.tr2 - The second math transform.
public static MathTransform1D concatenate(MathTransform1D tr1,
MathTransform1D tr2)
concatenate(MathTransform, MathTransform) and casting the
result to a MathTransform1D instance.
tr1 - The first math transform.tr2 - The second math transform.
public static MathTransform concatenate(MathTransform tr1,
MathTransform tr2,
MathTransform tr3)
tr1 - The first math transform.tr2 - The second math transform.tr3 - The third math transform.
public static MathTransform2D concatenate(MathTransform2D tr1,
MathTransform2D tr2,
MathTransform2D tr3)
concatenate(MathTransform, MathTransform, MathTransform) and
casting the result to a MathTransform2D instance.
tr1 - The first math transform.tr2 - The second math transform.tr3 - The third math transform.
public static MathTransform1D concatenate(MathTransform1D tr1,
MathTransform1D tr2,
MathTransform1D tr3)
concatenate(MathTransform, MathTransform, MathTransform) and
casting the result to a MathTransform1D instance.
tr1 - The first math transform.tr2 - The second math transform.tr3 - The third math transform.
public static Matrix derivativeAndTransform(MathTransform transform,
double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
throws TransformException
MathTransform implementations:
DirectPosition ptSrc = ...; DirectPosition ptDst = ...; Matrix matrixDst = derivative(ptSrc); ptDst = transform(ptSrc, ptDst);
transform - The transform to use.srcPts - The array containing the source coordinate.srcOff - The offset to the point to be transformed in the source array.dstPts - the array into which the transformed coordinate is returned.dstOff - The offset to the location of the transformed point that is
stored in the destination array.
TransformException - If the point can't be transformed or if a problem occurred while
calculating the derivative.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||