public final class RotationAxis
extends java.lang.Object
A superposition of two structures is generally represented as a rotation matrix plus a translation vector. However, it can also be represented as an axis of rotation plus some translation.
This class calculates the rotation axis and stores it as four properties:
getRotationAxis()
)
getAngle()
)
getRotationPos()
)
getScrewTranslation()
)
The axis of rotation is poorly defined and numerically unstable for small
angles. Therefor it's direction is left as null for angles less than
MIN_ANGLE
.
Constructor and Description |
---|
RotationAxis(AFPChain afpChain)
Calculate the rotation axis for the first block of an AFPChain
|
RotationAxis(Matrix rotation,
Atom translation)
Determine the location of the rotation axis based on a rotation matrix and a translation vector
|
Modifier and Type | Method and Description |
---|---|
double |
getAngle()
The rotation angle
|
static double |
getAngle(AFPChain afpChain)
Calculate the rotation angle for a structure
|
static double |
getAngle(Matrix rotation)
Calculate the rotation angle for a given matrix
|
java.lang.String |
getJmolScript(Atom[] atoms)
Returns a Jmol script which will display the axis of rotation.
|
Atom |
getOtherTranslation()
Deprecated.
|
Atom |
getRotationAxis()
Get a unit vector along the rotation axis
|
Atom |
getRotationPos()
Get a position on the rotation axis.
|
Atom |
getScrewTranslation()
Get the component of translation parallel to the axis of rotation
|
public RotationAxis(AFPChain afpChain) throws StructureException
afpChain
- StructureException
java.lang.NullPointerException
- if afpChain does not contain a valid rotation matrix and shift vectorpublic double getAngle()
public Atom getRotationAxis()
public Atom getRotationPos()
public Atom getScrewTranslation()
@Deprecated public Atom getOtherTranslation()
public java.lang.String getJmolScript(Atom[] atoms)
As the rotation angle gets smaller, the axis of rotation becomes poorly defined and would need to get farther and farther away from the protein. This is not particularly useful, so we arbitrarily draw it parallel to the translation and omit the arc.
atoms
- Some atoms from the protein, used for determining the bounds
of the axis.jmol.evalString()
public static double getAngle(AFPChain afpChain) throws StructureException
afpChain
- StructureException
- If the alignment doesn't contain any blocksjava.lang.NullPointerException
- If the alignment doesn't have a rotation matrix setpublic static double getAngle(Matrix rotation)
rotation
- Rotation matrix