org.geotools.referencing.operation.matrix
Class Matrix3

java.lang.Object
  extended byjavax.vecmath.Matrix3d
      extended byorg.geotools.referencing.operation.matrix.Matrix3
All Implemented Interfaces:
org.opengis.util.Cloneable, java.lang.Cloneable, org.opengis.referencing.operation.Matrix, java.io.Serializable, XMatrix

public class Matrix3
extends javax.vecmath.Matrix3d
implements XMatrix

A matrix of fixed {@value}×{@value} size. This specialized matrix provides better accuracy than GeneralMatrix for matrix inversion and multiplication.

Since:
2.2
Version:
$Id: Matrix3.java 17964 2006-02-10 11:27:41Z desruisseaux $
Author:
Martin Desruisseaux
See Also:
Serialized Form

Field Summary
static int SIZE
          The matrix size, which is 3.
 
Fields inherited from class javax.vecmath.Matrix3d
m00, m01, m02, m10, m11, m12, m20, m21, m22
 
Constructor Summary
Matrix3()
          Creates a new identity matrix.
Matrix3(java.awt.geom.AffineTransform transform)
          Constructs a 3×3 matrix from the specified affine transform.
Matrix3(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
          Creates a new matrix initialized to the specified values.
Matrix3(org.opengis.referencing.operation.Matrix matrix)
          Creates a new matrix initialized to the same value than the specified one.
 
Method Summary
 boolean equalsAffine(java.awt.geom.AffineTransform transform)
          Returns if this matrix is equals to the specified affine transform.
 int getNumCol()
          Returns the number of colmuns in this matrix, which is always {@value} in this implementation.
 int getNumRow()
          Returns the number of rows in this matrix, which is always {@value} in this implementation.
 boolean isAffine()
          Returns if this matrix is an affine transform. A transform is affine if the matrix is square and last row contains only zeros, except in the last column which contains 1.
 boolean isIdentity()
          Returns if this matrix is an identity matrix.
 boolean isNaN()
          Returns if at least one value is .
 void multiply(org.opengis.referencing.operation.Matrix matrix)
          Sets the value of this matrix to the result of multiplying itself with the specified matrix. In other words, performs = × . In the context of coordinate transformations, this is equivalent to AffineTransform.concatenate: first transforms by the supplied transform and then transform the result by the original transform.
 void setMatrix(java.awt.geom.AffineTransform transform)
          Sets this matrix to the specified affine transform.
 java.lang.String toString()
          Returns a string representation of this matrix.
 
Methods inherited from class javax.vecmath.Matrix3d
add, add, add, add, clone, determinant, epsilonEquals, equals, equals, getColumn, getColumn, getElement, getRow, getRow, getScale, hashCode, invert, invert, mul, mul, mul, mul, mulNormalize, mulNormalize, mulTransposeBoth, mulTransposeLeft, mulTransposeRight, negate, negate, normalize, normalize, normalizeCP, normalizeCP, rotX, rotY, rotZ, set, set, set, set, set, set, set, set, setColumn, setColumn, setColumn, setElement, setIdentity, setRow, setRow, setRow, setScale, setZero, sub, sub, transform, transform, transpose, transpose
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.geotools.referencing.operation.matrix.XMatrix
invert, negate, setIdentity, setZero, transpose
 
Methods inherited from interface org.opengis.referencing.operation.Matrix
clone, getElement, setElement
 

Field Detail

SIZE

public static final int SIZE
The matrix size, which is 3.

See Also:
Constant Field Values
Constructor Detail

Matrix3

public Matrix3()
Creates a new identity matrix.


Matrix3

public Matrix3(double m00,
               double m01,
               double m02,
               double m10,
               double m11,
               double m12,
               double m20,
               double m21,
               double m22)
Creates a new matrix initialized to the specified values.


Matrix3

public Matrix3(java.awt.geom.AffineTransform transform)
Constructs a 3×3 matrix from the specified affine transform.


Matrix3

public Matrix3(org.opengis.referencing.operation.Matrix matrix)
Creates a new matrix initialized to the same value than the specified one. The specified matrix size must be {@value}×{@value}.

Method Detail

getNumRow

public final int getNumRow()
Returns the number of rows in this matrix, which is always {@value} in this implementation.

Specified by:
getNumRow in interface org.opengis.referencing.operation.Matrix

getNumCol

public final int getNumCol()
Returns the number of colmuns in this matrix, which is always {@value} in this implementation.

Specified by:
getNumCol in interface org.opengis.referencing.operation.Matrix

isIdentity

public final boolean isIdentity()
Returns if this matrix is an identity matrix.

Specified by:
isIdentity in interface org.opengis.referencing.operation.Matrix

isAffine

public final boolean isAffine()
Returns if this matrix is an affine transform. A transform is affine if the matrix is square and last row contains only zeros, except in the last column which contains 1.

Specified by:
isAffine in interface XMatrix

isNaN

public final boolean isNaN()
Returns if at least one value is .

Since:
2.3

multiply

public final void multiply(org.opengis.referencing.operation.Matrix matrix)
Sets the value of this matrix to the result of multiplying itself with the specified matrix. In other words, performs = × . In the context of coordinate transformations, this is equivalent to AffineTransform.concatenate: first transforms by the supplied transform and then transform the result by the original transform.

Specified by:
multiply in interface XMatrix

setMatrix

public void setMatrix(java.awt.geom.AffineTransform transform)
Sets this matrix to the specified affine transform.

Since:
2.3

equalsAffine

public boolean equalsAffine(java.awt.geom.AffineTransform transform)
Returns if this matrix is equals to the specified affine transform.

Since:
2.3

toString

public java.lang.String toString()
Returns a string representation of this matrix. The returned string is implementation dependent. It is usually provided for debugging purposes only.



Copyright © GeoTools. All Rights Reserved.