Package ffx.crystal
Class SymOp
java.lang.Object
ffx.crystal.SymOp
The SymOp class defines the rotation and translation of a single symmetry operator.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionfinal int[]
Replicates position for the given symmetry operator (LxMxN).final double[][]
The rotation matrix in fractional coordinates.final double[]
The translation vector in fractional coordinates.static final double[]
ConstantTr_0_0_0={ZERO, ZERO, ZERO}
static final double[][]
ConstantZERO_ROTATION = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}}
-
Constructor Summary
ConstructorDescriptionSymOp
(double[][] m) The SymOp constructor using a 4x4 matrix.SymOp
(double[][] rot, double[] tr) The SymOp constructor using a rotation matrix and translation vector.SymOp
(double[][] rot, double[] tr, int[] replicatesVector) The SymOp constructor using a rotation matrix and translation vector. -
Method Summary
Modifier and TypeMethodDescriptionReturn the combined SymOp that is equivalent to first applyingthis
SymOp and then the argument.static void
applyCartesianSymOp
(double[] xyz, double[] mate, SymOp symOp) Apply a cartesian symmetry operator to an array of coordinates.static void
applyCartesianSymOp
(double[] xyz, double[] mate, SymOp symOp, boolean[] mask) Apply a cartesian symmetry operator to an array of coordinates.static void
applyCartesianSymRot
(double[] xyz, double[] mate, SymOp symOp) Apply a Cartesian symmetry rotation to an array of Cartesian coordinates.static void
applyCartesianSymRot
(double[] xyz, double[] mate, SymOp symOp, boolean[] mask) Apply a Cartesian symmetry rotation to an array of Cartesian coordinates.static void
applyCartSymOp
(int n, double[] x, double[] y, double[] z, double[] mateX, double[] mateY, double[] mateZ, SymOp symOp) Apply a Cartesian symmetry operator to an array of Cartesian coordinates.static void
applyFracSymOp
(double[] xyz, double[] mate, SymOp symOp) Apply a fractional symmetry operator to one set of coordinates.static void
applySymOp
(int h, int k, int l, int[] mate, SymOp symOp, int nx, int ny, int nz) Apply a symmetry operator to one set of coordinates.static void
applySymRot
(HKL hkl, HKL mate, SymOp symOp) Apply a symmetry operator to one HKL.static void
applyTransSymRot
(HKL hkl, HKL mate, SymOp symOp) Apply a transpose rotation symmetry operator to one HKL.double[][]
asMatrix()
Return the SymOp as a 4x4 matrix.static String
asMatrixString
(SymOp symOp) Print a Sym Op matrix as a continued line string.static SymOp
combineSymOps
(SymOp symOp1, SymOp symOp2) Return the combined SymOp that is equivalent to first applying symOp1 and then SymOp2.static SymOp
invertSymOp
(SymOp symOp) Invert a symmetry operator.static SymOp
Create a SymOp from an input String.Return the combined SymOp that is equivalent to first applying the argument and thenthis
SymOp.static SymOp
randomSymOpFactory
(double scalar) Generate a random Cartesian Symmetry Operator.static SymOp
randomSymOpFactory
(double[] tr) Generate a random Cartesian Symmetry Operator.double
symPhaseShift
(double[] hkl) symPhaseShiftdouble
symPhaseShift
(HKL hkl) symPhaseShifttoString()
Print the symmetry operator with double precision.toXYZString
-
Field Details
-
ZERO_ROTATION
public static final double[][] ZERO_ROTATIONConstantZERO_ROTATION = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}}
-
Tr_0_0_0
public static final double[] Tr_0_0_0ConstantTr_0_0_0={ZERO, ZERO, ZERO}
-
rot
public final double[][] rotThe rotation matrix in fractional coordinates. -
tr
public final double[] trThe translation vector in fractional coordinates. -
replicatesVector
public final int[] replicatesVectorReplicates position for the given symmetry operator (LxMxN).
-
-
Constructor Details
-
SymOp
public SymOp(double[][] rot, double[] tr) The SymOp constructor using a rotation matrix and translation vector.- Parameters:
rot
- The rotation matrix.tr
- The translation vector.
-
SymOp
public SymOp(double[][] rot, double[] tr, int[] replicatesVector) The SymOp constructor using a rotation matrix and translation vector.- Parameters:
rot
- The rotation matrix.tr
- The translation vector.replicatesVector
- Describes symmetry operators location within replicates crystal.
-
SymOp
public SymOp(double[][] m) The SymOp constructor using a 4x4 matrix.- Parameters:
m
- The rotation matrix and translation vector as a 4x4 matrix.
-
-
Method Details
-
symPhaseShift
public double symPhaseShift(double[] hkl) symPhaseShift- Parameters:
hkl
- an array of double.- Returns:
- a double.
-
symPhaseShift
symPhaseShift- Parameters:
hkl
- aHKL
object.- Returns:
- a double.
-
asMatrix
public double[][] asMatrix()Return the SymOp as a 4x4 matrix.- Returns:
- A 4x4 matrix representation of the SymOp.
-
append
Return the combined SymOp that is equivalent to first applyingthis
SymOp and then the argument. Note: Applied as rotation then translation.X' = S_arg(S_this(X))
X' = S_combined(X)
- Parameters:
symOp
- The SymOp to append tothis
SymOp.- Returns:
- The combined SymOp.
-
prepend
Return the combined SymOp that is equivalent to first applying the argument and thenthis
SymOp. Note: Applied as rotation then translation.X' = S_this(S_arg(X))
X' = S_combined(X)
- Parameters:
symOp
- The SymOp to prepend tothis
SymOp.- Returns:
- The combined SymOp.
-
combineSymOps
Return the combined SymOp that is equivalent to first applying symOp1 and then SymOp2. Note: Applied as rotation then translation.X' = S_2(S_1(X))
X' = S_combined(X)
- Parameters:
symOp1
- The fist SymOp.symOp2
- The second SymOp.- Returns:
- The combined SymOp.
-
applyCartSymOp
public static void applyCartSymOp(int n, double[] x, double[] y, double[] z, double[] mateX, double[] mateY, double[] mateZ, SymOp symOp) Apply a Cartesian symmetry operator to an array of Cartesian coordinates. If the arrays x, y or z are null or not of length n, the method returns immediately. If mateX, mateY or mateZ are null or not of length n, the method returns immediately.- Parameters:
n
- Number of atoms.x
- Input cartesian x-coordinates.y
- Input cartesian y-coordinates.z
- Input cartesian z-coordinates.mateX
- Output cartesian x-coordinates.mateY
- Output cartesian y-coordinates.mateZ
- Output cartesian z-coordinates.symOp
- The cartesian symmetry operator.
-
applyCartesianSymOp
Apply a cartesian symmetry operator to an array of coordinates.- Parameters:
xyz
- Input cartesian coordinates.mate
- Symmetry mate cartesian coordinates.symOp
- The cartesian symmetry operator.
-
applyCartesianSymOp
Apply a cartesian symmetry operator to an array of coordinates.- Parameters:
xyz
- Input cartesian coordinates.mate
- Symmetry mate cartesian coordinates.symOp
- The cartesian symmetry operator.mask
- Only apply the SymOp if the per atom mask is true.
-
applyFracSymOp
Apply a fractional symmetry operator to one set of coordinates.- Parameters:
xyz
- Input fractional coordinates.mate
- Symmetry mate fractional coordinates.symOp
- The fractional symmetry operator.
-
applySymOp
Apply a symmetry operator to one set of coordinates.- Parameters:
h
- Input coordinates.k
- Input coordinates.l
- Input coordinates.mate
- Symmetry mate coordinates.symOp
- The symmetry operator.nx
- number of unit cell translationsny
- number of unit cell translationsnz
- number of unit cell translations
-
applySymRot
Apply a symmetry operator to one HKL.- Parameters:
hkl
- Input HKL.mate
- Symmetry mate HKL.symOp
- The symmetry operator.
-
applyCartesianSymRot
Apply a Cartesian symmetry rotation to an array of Cartesian coordinates. The length of xyz must be divisible by 3 and mate must have the same length.- Parameters:
xyz
- Input cartesian x, y, z-coordinates.mate
- Output cartesian x, y, z-coordinates.symOp
- The fractional symmetry operator.
-
applyCartesianSymRot
Apply a Cartesian symmetry rotation to an array of Cartesian coordinates. The length of xyz must be divisible by 3 and mate must have the same length.- Parameters:
xyz
- Input cartesian x, y, z-coordinates.mate
- Output cartesian x, y, z-coordinates.symOp
- The fractional symmetry operator.mask
- Only apply the SymOp if the per atom mask is true.
-
applyTransSymRot
Apply a transpose rotation symmetry operator to one HKL.- Parameters:
hkl
- Input HKL.mate
- Symmetry mate HKL.symOp
- The symmetry operator.
-
asMatrixString
Print a Sym Op matrix as a continued line string.- Parameters:
symOp
- Symmetry operation to print.- Returns:
- Continued line string.
-
invertSymOp
Invert a symmetry operator.- Parameters:
symOp
- Original symmetry operator of which the inverse is desired.- Returns:
- SymOp The inverse symmetry operator of the one supplied.
-
parse
Create a SymOp from an input String.- Parameters:
s
- InputString
containing 12 white-space delimited double values.- Returns:
- The SymOp.
-
randomSymOpFactory
Generate a random Cartesian Symmetry Operator.- Parameters:
scalar
- The range of translations will be from -scalar/2 .. scalar/2.- Returns:
- A Cartesian SymOp with a random rotation and translation.
-
randomSymOpFactory
Generate a random Cartesian Symmetry Operator.The random rotation matrix is derived from: Arvo, James (1992), "Fast random rotation matrices", in David Kirk, Graphics Gems III, San Diego: Academic Press Professional, pp. 117–120, ISBN 978-0-12-409671-4
- Parameters:
tr
- The translations to apply.- Returns:
- A Cartesian SymOp with a random rotation and translation.
-
toString
-
toStringPrecise
Print the symmetry operator with double precision.- Returns:
- String of rotation/translation with double precision.
-
toXYZString
toXYZString- Returns:
- a
String
object.
-