Class JxnVectorTransformation
- java.lang.Object
-
- JxnVectorTransformation
-
-
Constructor Summary
Constructors Modifier Constructor Description JxnVectorTransformation()
Creates a three-dimensional identity transformation.protected
JxnVectorTransformation(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 JxnVectorTransformation
concat(JxnVectorTransformation t2)
Returns the resulting transformation for this transformation (not changed) followed by a 2nd transformationt2
.static JxnVectorTransformation
div(JxnVectorTransformation tNum, JxnVectorTransformation tDen)
ReturnstNum * tDen
-1.static double
getRMSDiff(JxnVectorTransformation tA, JxnVectorTransformation tB)
Checks the difference of two transformations.double[][]
getT()
Returns the transformation matrix.static JxnVectorTransformation
inv(JxnVectorTransformation t)
Returns the inverse oft
.JxnVectorTransformation
inverse()
Returns the inverse of this (without changing it).double[]
map(double[] v)
Called internally.double
map(int i, double x, double y, double z)
Called internally.JxnRealArrayAlgebra
map(int i, JxnRealArrayAlgebra rx, JxnRealArrayAlgebra ry, JxnRealArrayAlgebra rz)
Returns thei
-th coordinate of the mapping of the curve given byrx
,ry
andrz
.JxnRealArrayAlgebra[]
map(JxnRealArrayAlgebra[] rxyz)
Returns the mapping of the curve given by an arrayrxyz = { rx, ry, rz }
.JxnVectorAlgebra
map(JxnVectorAlgebra v)
Returns the mapping ofv
.JxnVectorTransformation
move(double dx, double dy, double dz)
Returns the resulting transformation for this transformation (not changed) followed by a translation defined bydx
,dy
anddz
.JxnVectorTransformation
move(double f, JxnVectorAlgebra v)
Returns the resulting transformation for this transformation (not changed) followed by a translation defined byv
scaled byf
.JxnVectorTransformation
move(JxnVectorAlgebra v)
Returns the resulting transformation for this transformation (not changed) followed by a translation defined byv
.JxnVectorTransformation
moveIt(double dx, double dy, double dz)
Modifies this transformation by appending a translation defined bydx
,dy
anddz
.JxnVectorTransformation
moveIt(double f, JxnVectorAlgebra v)
Modifies this transformation by appending a translation defined byv
scaled byf
.JxnVectorTransformation
moveIt(JxnVectorAlgebra v)
Modifies this transformation by appending a translation defined byv
.JxnRealArrayAlgebra[]
mul(JxnRealArrayAlgebra[] rxyz)
Returns the mapping ofrxyz = { rx, ry, rz }
.JxnVectorAlgebra
mul(JxnVectorAlgebra v)
Returns the mapping ofv
.static JxnVectorTransformation
mul(JxnVectorTransformation tLeft, JxnVectorTransformation tRght)
Returns the combination oftLeft
andtRght
.JxnVectorTransformation
rotate(double phiX, double phiY, double phiZ)
Returns the resulting transformation for this transformation (not changed) followed by rotations defined byphiX
,phiY
andphiZ
(in this sequence).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, +oo
with anglealpha
JxnVectorTransformation
rotateD(double phiX, double phiY, double phiZ)
Returns the resulting transformation for this transformation (not changed) followed by rotations defined byphiX
,phiY
andphiZ
(parameters in degrees).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, +oo
with anglealpha
in degrees.JxnVectorTransformation
rotateIt(double phiX, double phiY, double phiZ)
Modifies this transformation by appending rotations defined byphiX
,phiY
andphiZ
(in this sequence).JxnVectorTransformation
rotateIt(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)
Modifies this transformation by appending a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oo
with anglealpha
JxnVectorTransformation
rotateItD(double phiX, double phiY, double phiZ)
Modifies this transformation by appending rotations defined byphiX
,phiY
andphiZ
(parameters in degrees).JxnVectorTransformation
rotateItD(JxnVectorAlgebra v0, JxnVectorAlgebra v1, double alpha)
Modifies this transformation by appending a rotation around the axisv(t) = v0 + v1 * t; t = -oo, +oo
with anglealpha
in degrees.JxnVectorTransformation
rotD(double phiX, double phiY, double phiZ)
Deprecated.JxnVectorTransformation
scale(double f)
Returns the resulting transformation for this transformation (not changed) followed by a scaling of all components byf
.JxnVectorTransformation
scale(double fx, double fy, double fz)
Returns the resulting transformation for this transformation (not changed) followed by a scaling defined byfx
,fy
andfz
.JxnVectorTransformation
scale(JxnVectorAlgebra v0, double f)
Returns the resulting transformation for this transformation (not changed) followed by a scaling defined by the fixed pointv0
and the scale factorf
.JxnVectorTransformation
scaleIt(double f)
Modifies this transformation by appending a scaling of all components byf
.JxnVectorTransformation
scaleIt(double fx, double fy, double fz)
Modifies this transformation by appending a scaling defined byfx
,fy
andfz
.JxnVectorTransformation
scaleIt(JxnVectorAlgebra v0, double f)
Modifies this transformation by appending a scaling defined by the fixed pointv0
and the scale factorf
.String
toString()
-
-
-
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 + b
is represented by the augmentedn
xn+1
matrixtm = ( 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
,ey
andez
must be linear independent but need not necessarily be orthogonal or normalized.
Ifex
,ey
andez
are ...
... 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 byv
scaled byf
.
-
moveIt
public JxnVectorTransformation moveIt(double f, JxnVectorAlgebra v)
Modifies this transformation by appending a translation defined byv
scaled 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
,dy
anddz
.
-
moveIt
public JxnVectorTransformation moveIt(double dx, double dy, double dz)
Modifies this transformation by appending a translation defined bydx
,dy
anddz
.- 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
,fy
andfz
.
-
scaleIt
public JxnVectorTransformation scaleIt(double fx, double fy, double fz)
Modifies this transformation by appending a scaling defined byfx
,fy
andfz
.- 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 pointv0
and 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 pointv0
and 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
,phiY
andphiZ
(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
,phiY
andphiZ
(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
,phiY
andphiZ
(in this sequence).- Returns:
this
-
rotateItD
public JxnVectorTransformation rotateItD(double phiX, double phiY, double phiZ)
Modifies this transformation by appending rotations defined byphiX
,phiY
andphiZ
(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, +oo
with 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, +oo
with anglealpha
in 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, +oo
with 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, +oo
with anglealpha
in 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 oftLeft
andtRght
.
mapping sequence = transformation sequence:
-v' = T3 * T2 * T1 * v
right 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
,ry
andrz
.
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.
-
-