public class Matrix2D extends Object implements XYZindices, UVWindices, Cloneable, org.freehep.xml.io.XMLIO
X, Y, Z
U, V, W
Constructor and Description |
---|
Matrix2D()
Creates an identity matrix.
|
Matrix2D(double m00,
double m10,
double m01,
double m11,
double m02,
double m12)
Creates a matrix with given parameters.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
void |
concatenate(Matrix2D m)
Concatenates this matrix with m, such that M' = M * m.
|
Matrix2D |
createInverse() |
boolean |
equals(Object obj) |
double |
getDeterminant() |
double |
getScaleX() |
double |
getScaleY() |
double |
getShearX() |
double |
getShearY() |
double |
getTranslateX() |
double |
getTranslateY() |
int |
hashCode() |
void |
modelTranslate(double tx,
double ty)
Model-Translates by tx and ty.
|
void |
preConcatenate(Matrix2D m)
Pre-concatenates this matrix with m, such that M' = m * M.
|
void |
restore(org.freehep.xml.io.XMLIOManager xmlioManager,
org.jdom.Element nodeEl) |
void |
rotate(double theta)
Rotates theta radians.
|
void |
save(org.freehep.xml.io.XMLIOManager xmlioManager,
org.jdom.Element nodeEl) |
void |
scale(double sx,
double sy)
Scales by sx and sy.
|
void |
shear(double shx,
double shy)
Shears by shx and shy.
|
String |
toString() |
double[][] |
transform(double[][] xyz,
int n,
boolean delta)
Transforms xyz by this matrix for n points, using translation if delta is
false.
|
double[] |
transform(double[] xyz,
boolean delta)
Transforms xyz by this matrix, using translation if delta is false.
|
void |
translate(double tx,
double ty)
Translates by tx and ty.
|
public Matrix2D()
public Matrix2D(double m00, double m10, double m01, double m11, double m02, double m12)
m00
- matrix param 00m10
- matrix param 10m01
- matrix param 01m11
- matrix param 11m02
- matrix param 02m12
- matrix param 12public double getScaleX()
public double getScaleY()
public double getShearX()
public double getShearY()
public double getTranslateX()
public double getTranslateY()
public double getDeterminant()
public Matrix2D createInverse() throws NoninvertibleTransformException
NoninvertibleTransformException
- if matrix cannot be invertedpublic void concatenate(Matrix2D m)
m
- post matrixpublic void preConcatenate(Matrix2D m)
m
- pre matrixpublic void rotate(double theta)
[ cos(theta) -sin(theta) 0 ] [ sin(theta) cos(theta) 0 ] [ 0 0 1 ]
theta
- anglepublic void scale(double sx, double sy)
[ sx 0 0 ] [ 0 sy 0 ] [ 0 0 1 ]
sx
- scale factor in xsy
- scale factor in ypublic void shear(double shx, double shy)
[ 1 shx 0 ] [ shy 1 0 ] [ 0 0 1 ]
shx
- shear factor in xshy
- shear factor in ypublic void translate(double tx, double ty)
[ 1 0 tx ] [ 0 1 ty ] [ 0 0 1 ]
tx
- translation in xty
- translation in ypublic void modelTranslate(double tx, double ty)
[ 1 0 tx ] [ 0 1 ty ] [ 0 0 1 ]
tx
- translation in xty
- translation in ypublic double[] transform(double[] xyz, boolean delta)
xyz
- input xyzdelta
- use translationpublic double[][] transform(double[][] xyz, int n, boolean delta)
xyz
- input xyzn
- number of pointsdelta
- use translationpublic void save(org.freehep.xml.io.XMLIOManager xmlioManager, org.jdom.Element nodeEl)
save
in interface org.freehep.xml.io.XMLIO
public void restore(org.freehep.xml.io.XMLIOManager xmlioManager, org.jdom.Element nodeEl)
restore
in interface org.freehep.xml.io.XMLIO
Copyright © 1996-2014 FreeHEP. All Rights Reserved.