Class JxnVectorTransformation
- java.lang.Object
-
- JxnVectorTransformation
-
-
Constructor Summary
Constructors Modifier Constructor Description JxnVectorTransformation()Creates a three-dimensional identity transformation.protectedJxnVectorTransformation(double[][] tm)Creates a transformation object from a given matrixtm.JxnVectorTransformation(int dim)Creates an identity transformation of dimensiondim.JxnVectorTransformation(JxnVectorAlgebra ex, JxnVectorAlgebra ey, JxnVectorAlgebra ez)Creates a transformation object from given coordinate (basis) vectors.JxnVectorTransformation(JxnVectorTransformation t)Creates a copy oft.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description JxnVectorTransformationconcat(JxnVectorTransformation t2)Returns the resulting transformation for this transformation (not changed) followed by a 2nd transformationt2.static JxnVectorTransformationdiv(JxnVectorTransformation tNum, JxnVectorTransformation tDen)ReturnstNum * tDen-1.static doublegetRMSDiff(JxnVectorTransformation tA, JxnVectorTransformation tB)Checks the difference of two transformations.double[][]getT()Returns the transformation matrix.static JxnVectorTransformationinv(JxnVectorTransformation t)Returns the inverse oft.JxnVectorTransformationinverse()Returns the inverse of this (without changing it).double[]map(double[] v)Called internally.doublemap(int i, double x, double y, double z)Called internally.JxnRealArrayAlgebramap(int i, JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz)Returns thei-th coordinate of the mapping of the curve given byrx,ryandrz.JxnRealArrayAlgebra[]map(JxnRealArrayAlgebra[] rxyz)Returns the mapping of the curve given by an arrayrxyz = { rx, ry, rz }.JxnVectorAlgebramap(JxnVectorAlgebra v)Returns the mapping ofv.JxnVectorTransformationmove(double dx, double dy, double dz)Returns the resulting transformation for this transformation (not changed) followed by a translation defined bydx,dyanddz.JxnVectorTransformationmove(double f, JxnVectorAlgebra v)Returns the resulting transformation for this transformation (not changed) followed by a translation defined byvscaled byf.JxnVectorTransformationmove(JxnVectorAlgebra v)Returns the resulting transformation for this transformation (not changed) followed by a translation defined byv.JxnVectorTransformationmoveIt(double dx, double dy, double dz)Modifies this transformation by appending a translation defined bydx,dyanddz.JxnVectorTransformationmoveIt(double f, JxnVectorAlgebra v)Modifies this transformation by appending a translation defined byvscaled byf.JxnVectorTransformationmoveIt(JxnVectorAlgebra v)Modifies this transformation by appending a translation defined byv.JxnRealArrayAlgebra[]mul(JxnRealArrayAlgebra[] rxyz)Returns the mapping ofrxyz = { rx, ry, rz }.JxnVectorAlgebramul(JxnVectorAlgebra v)Returns the mapping ofv.static JxnVectorTransformationmul(JxnVectorTransformation tLeft, JxnVectorTransformation tRght)Returns the combination oftLeftandtRght.JxnVectorTransformationrotate(double phiX, double phiY, double phiZ)Returns the resulting transformation for this transformation (not changed) followed by rotations defined byphiX,phiYandphiZ(in this sequence).JxnVectorTransformationrotate(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)Returns the resulting transformation for this transformation (not changed) followed by a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oowith anglealphaJxnVectorTransformationrotateD(double phiX, double phiY, double phiZ)Returns the resulting transformation for this transformation (not changed) followed by rotations defined byphiX,phiYandphiZ(parameters in degrees).JxnVectorTransformationrotateD(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)Returns the resulting transformation for this transformation (not changed) followed by a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oowith anglealphain degrees.JxnVectorTransformationrotateIt(double phiX, double phiY, double phiZ)Modifies this transformation by appending rotations defined byphiX,phiYandphiZ(in this sequence).JxnVectorTransformationrotateIt(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)Modifies this transformation by appending a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oowith anglealphaJxnVectorTransformationrotateItD(double phiX, double phiY, double phiZ)Modifies this transformation by appending rotations defined byphiX,phiYandphiZ(parameters in degrees).JxnVectorTransformationrotateItD(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)Modifies this transformation by appending a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oowith anglealphain degrees.JxnVectorTransformationrotD(double phiX, double phiY, double phiZ)Deprecated.JxnVectorTransformationscale(double f)Returns the resulting transformation for this transformation (not changed) followed by a scaling of all components byf.JxnVectorTransformationscale(double fx, double fy, double fz)Returns the resulting transformation for this transformation (not changed) followed by a scaling defined byfx,fyandfz.JxnVectorTransformationscale(JxnVectorAlgebra v0, double f)Returns the resulting transformation for this transformation (not changed) followed by a scaling defined by the fixed pointv0and the scale factorf.JxnVectorTransformationscaleIt(double f)Modifies this transformation by appending a scaling of all components byf.JxnVectorTransformationscaleIt(double fx, double fy, double fz)Modifies this transformation by appending a scaling defined byfx,fyandfz.JxnVectorTransformationscaleIt(JxnVectorAlgebra v0, double f)Modifies this transformation by appending a scaling defined by the fixed pointv0and the scale factorf.StringtoString()
-
-
-
Constructor Detail
-
JxnVectorTransformation
public JxnVectorTransformation()
Creates a three-dimensional identity transformation.
-
JxnVectorTransformation
public JxnVectorTransformation(int dim)
Creates an identity transformation of dimensiondim.
-
JxnVectorTransformation
protected JxnVectorTransformation(double[][] tm)
Creates a transformation object from a given matrixtm.
The transformationy = A x + bis represented by the augmentednxn+1matrixtm = ( A | b ).- See Also:
- Wikipedia
-
JxnVectorTransformation
public JxnVectorTransformation(JxnVectorTransformation t)
Creates a copy oft.
-
JxnVectorTransformation
public JxnVectorTransformation(JxnVectorAlgebra ex, JxnVectorAlgebra ey, JxnVectorAlgebra ez)
Creates a transformation object from given coordinate (basis) vectors.
The vectorsex,eyandezmust be linear independent but need not necessarily be orthogonal or normalized.
Ifex,eyandezare ...
... target coordinate vectors given in source coordinates the transformation object maps target coordinates into source coordinates.
... source coordinate vectors given in target coordinates the transformation object maps source coordinates into target coordinates.
Use theinverse()method to get the reverse mapping.
-
-
Method Detail
-
move
public JxnVectorTransformation move(JxnVectorAlgebra v)
Returns the resulting transformation for this transformation (not changed) followed by a translation defined byv.
-
moveIt
public JxnVectorTransformation moveIt(JxnVectorAlgebra v)
Modifies this transformation by appending a translation defined byv.- Returns:
this
-
move
public JxnVectorTransformation move(double f, JxnVectorAlgebra v)
Returns the resulting transformation for this transformation (not changed) followed by a translation defined byvscaled byf.
-
moveIt
public JxnVectorTransformation moveIt(double f, JxnVectorAlgebra v)
Modifies this transformation by appending a translation defined byvscaled byf.- Returns:
this
-
move
public JxnVectorTransformation move(double dx, double dy, double dz)
Returns the resulting transformation for this transformation (not changed) followed by a translation defined bydx,dyanddz.
-
moveIt
public JxnVectorTransformation moveIt(double dx, double dy, double dz)
Modifies this transformation by appending a translation defined bydx,dyanddz.- Returns:
this
-
scale
public JxnVectorTransformation scale(double fx, double fy, double fz)
Returns the resulting transformation for this transformation (not changed) followed by a scaling defined byfx,fyandfz.
-
scaleIt
public JxnVectorTransformation scaleIt(double fx, double fy, double fz)
Modifies this transformation by appending a scaling defined byfx,fyandfz.- Returns:
this
-
scale
public JxnVectorTransformation scale(double f)
Returns the resulting transformation for this transformation (not changed) followed by a scaling of all components byf.
-
scaleIt
public JxnVectorTransformation scaleIt(double f)
Modifies this transformation by appending a scaling of all components byf.- Returns:
this
-
scale
public JxnVectorTransformation scale(JxnVectorAlgebra v0, double f)
Returns the resulting transformation for this transformation (not changed) followed by a scaling defined by the fixed pointv0and the scale factorf. Note: a point reflection is achieved byscale( v0, -1 ).
-
scaleIt
public JxnVectorTransformation scaleIt(JxnVectorAlgebra v0, double f)
Modifies this transformation by appending a scaling defined by the fixed pointv0and the scale factorf.- Returns:
this
-
rotate
public JxnVectorTransformation rotate(double phiX, double phiY, double phiZ)
Returns the resulting transformation for this transformation (not changed) followed by rotations defined byphiX,phiYandphiZ(in this sequence).
-
rotateD
public JxnVectorTransformation rotateD(double phiX, double phiY, double phiZ)
Returns the resulting transformation for this transformation (not changed) followed by rotations defined byphiX,phiYandphiZ(parameters in degrees).
-
rotD
public JxnVectorTransformation rotD(double phiX, double phiY, double phiZ)
Deprecated.
-
rotateIt
public JxnVectorTransformation rotateIt(double phiX, double phiY, double phiZ)
Modifies this transformation by appending rotations defined byphiX,phiYandphiZ(in this sequence).- Returns:
this
-
rotateItD
public JxnVectorTransformation rotateItD(double phiX, double phiY, double phiZ)
Modifies this transformation by appending rotations defined byphiX,phiYandphiZ(parameters in degrees).- Returns:
this
-
rotate
public JxnVectorTransformation rotate(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)
Returns the resulting transformation for this transformation (not changed) followed by a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oowith anglealpha
-
rotateD
public JxnVectorTransformation rotateD(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)
Returns the resulting transformation for this transformation (not changed) followed by a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oowith anglealphain degrees.
-
rotateIt
public JxnVectorTransformation rotateIt(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)
Modifies this transformation by appending a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oowith anglealpha
-
rotateItD
public JxnVectorTransformation rotateItD(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)
Modifies this transformation by appending a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oowith anglealphain degrees.
-
inv
public static JxnVectorTransformation inv(JxnVectorTransformation t)
Returns the inverse oft.
-
inverse
public JxnVectorTransformation inverse()
Returns the inverse of this (without changing it).
-
mul
public static JxnVectorTransformation mul(JxnVectorTransformation tLeft, JxnVectorTransformation tRght)
Returns the combination oftLeftandtRght.
mapping sequence = transformation sequence:
-v' = T3 * T2 * T1 * vright to left: multiply the transformation matricesTi
-v' = T1.t2(...).t3(...).map(v)left to right: method chaining of the transformation methodsti
-v' = T3.map( T2.map( T1.map( v ) ) ) = T3 * ( T2 * ( T1 * v ) )
-v' = T3 * ( T2 * ( T1 * v ) ) = ( ( T3 * T2 ) * T1 ) * v = T3 * T2 * T1 * v
-
concat
public JxnVectorTransformation concat(JxnVectorTransformation t2)
Returns the resulting transformation for this transformation (not changed) followed by a 2nd transformationt2.- Returns:
mul( t2, this )
-
div
public static JxnVectorTransformation div(JxnVectorTransformation tNum, JxnVectorTransformation tDen)
ReturnstNum * tDen-1.
-
mul
public JxnVectorAlgebra mul(JxnVectorAlgebra v)
Returns the mapping ofv.- Returns:
map(v)
-
mul
public JxnRealArrayAlgebra[] mul(JxnRealArrayAlgebra[] rxyz)
Returns the mapping ofrxyz = { rx, ry, rz }.- Returns:
map(rxyz)
-
map
public JxnVectorAlgebra map(JxnVectorAlgebra v)
-
map
public double[] map(double[] v)
Called internally.
-
map
public JxnRealArrayAlgebra[] map(JxnRealArrayAlgebra[] rxyz)
Returns the mapping of the curve given by an arrayrxyz = { rx, ry, rz }.
Callsmap(int, JxnRealArrayAlgebra, JxnRealArrayAlgebra, JxnRealArrayAlgebra).
-
map
public JxnRealArrayAlgebra map(int i, JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz)
Returns thei-th coordinate of the mapping of the curve given byrx,ryandrz.
Call for each coordinate to get the mapping of the curve:
map_rx = map( 0, rx, ry, rz ) map_ry = map( 1, rx, ry, rz ) map_rz = map( 2, rx, ry, rz )
-
map
public double map(int i, double x, double y, double z)Called internally.
-
getT
public double[][] getT()
Returns the transformation matrix.
-
getRMSDiff
public static double getRMSDiff(JxnVectorTransformation tA, JxnVectorTransformation tB)
Checks the difference of two transformations.
-
-