Package org.openscience.cdk.stereo
Class StereoTool
- java.lang.Object
- 
- org.openscience.cdk.stereo.StereoTool
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classStereoTool.SquarePlanarShapeThe shape that four atoms take in a plane.static classStereoTool.StereoClassCurrently unused, but intended for the StereoTool to indicate what it 'means' by an assignment of some atoms to a class.static classStereoTool.TetrahedralSignThe handedness of a tetrahedron, in terms of the point-plane distance of three of the corners, compared to the fourth.
 - 
Field SummaryFields Modifier and Type Field Description static doubleMAX_AXIS_ANGLEThe maximum angle in radians for two lines to be 'diaxial'.static doubleMIN_COLINEAR_NORMALThe maximum tolerance for the normal calculated during colinearity.static doublePLANE_TOLERANCE
 - 
Constructor SummaryConstructors Constructor Description StereoTool()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanallCoplanar(javax.vecmath.Vector3d planeNormal, javax.vecmath.Point3d pointInPlane, javax.vecmath.Point3d... points)Check that all the points in the list are coplanar (in the same plane) as the plane defined by the planeNormal and the pointInPlane.static StereoTool.TetrahedralSigngetHandedness(IAtom baseAtomA, IAtom baseAtomB, IAtom baseAtomC, IAtom apexAtom)Gets the tetrahedral handedness of four atoms - three of which form the 'base' of the tetrahedron, and the other the apex.static javax.vecmath.Vector3dgetNormal(javax.vecmath.Point3d ptA, javax.vecmath.Point3d ptB, javax.vecmath.Point3d ptC)Given three points (A, B, C), makes the vectors A-B and A-C, and makes the cross product of these two vectors; this has the effect of making a third vector at right angles to AB and AC.static StereoTool.SquarePlanarShapegetSquarePlanarShape(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD)Given four atoms (assumed to be in the same plane), returns the arrangement of those atoms in that plane.static ITetrahedralChirality.StereogetStereo(IAtom atom1, IAtom atom2, IAtom atom3, IAtom atom4)Take four atoms, and return Stereo.CLOCKWISE or Stereo.ANTI_CLOCKWISE.static booleanisColinear(javax.vecmath.Point3d ptA, javax.vecmath.Point3d ptB, javax.vecmath.Point3d ptC)Checks the three supplied points to see if they fall on the same line.static booleanisOctahedral(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE, IAtom atomF, IAtom atomG)Checks these 7 atoms to see if they are at the points of an octahedron.static booleanisSquarePlanar(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD)Checks these four atoms for square planarity.static booleanisTrigonalBipyramidal(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE, IAtom atomF)Checks these 6 atoms to see if they form a trigonal-bipyramidal shape.static doublesignedDistanceToPlane(javax.vecmath.Vector3d planeNormal, javax.vecmath.Point3d pointInPlane, javax.vecmath.Point3d point)Given a normalized normal for a plane, any point in that plane, and a point, will return the distance between the plane and that point.
 
- 
- 
- 
Field Detail- 
MAX_AXIS_ANGLEpublic static final double MAX_AXIS_ANGLE The maximum angle in radians for two lines to be 'diaxial'. Where 0.95 is about 172 degrees.- See Also:
- Constant Field Values
 
 - 
MIN_COLINEAR_NORMALpublic static final double MIN_COLINEAR_NORMAL The maximum tolerance for the normal calculated during colinearity.- See Also:
- Constant Field Values
 
 - 
PLANE_TOLERANCEpublic static final double PLANE_TOLERANCE - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
isSquarePlanarpublic static boolean isSquarePlanar(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD) Checks these four atoms for square planarity.- Parameters:
- atomA- an atom in the plane
- atomB- an atom in the plane
- atomC- an atom in the plane
- atomD- an atom in the plane
- Returns:
- true if all the atoms are in the same plane
 
 - 
getSquarePlanarShapepublic static StereoTool.SquarePlanarShape getSquarePlanarShape(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD) Given four atoms (assumed to be in the same plane), returns the arrangement of those atoms in that plane. The 'shapes' returned represent arrangements that look a little like the characters 'U', '4', and 'Z'. - Parameters:
- atomA- an atom in the plane
- atomB- an atom in the plane
- atomC- an atom in the plane
- atomD- an atom in the plane
- Returns:
- the shape (U/4/Z)
 
 - 
allCoplanarpublic static boolean allCoplanar(javax.vecmath.Vector3d planeNormal, javax.vecmath.Point3d pointInPlane, javax.vecmath.Point3d... points)Check that all the points in the list are coplanar (in the same plane) as the plane defined by the planeNormal and the pointInPlane.- Parameters:
- planeNormal- the normal to the plane
- pointInPlane- any point know to be in the plane
- points- an array of points to test
- Returns:
- false if any of the points is not in the plane
 
 - 
isOctahedralpublic static boolean isOctahedral(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE, IAtom atomF, IAtom atomG) Checks these 7 atoms to see if they are at the points of an octahedron.- Parameters:
- atomA- one of the axial atoms
- atomB- the central atom
- atomC- one of the equatorial atoms
- atomD- one of the equatorial atoms
- atomE- one of the equatorial atoms
- atomF- one of the equatorial atoms
- atomG- the other axial atom
- Returns:
- true if the geometry is octahedral
 
 - 
isTrigonalBipyramidalpublic static boolean isTrigonalBipyramidal(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE, IAtom atomF) Checks these 6 atoms to see if they form a trigonal-bipyramidal shape.- Parameters:
- atomA- one of the axial atoms
- atomB- the central atom
- atomC- one of the equatorial atoms
- atomD- one of the equatorial atoms
- atomE- one of the equatorial atoms
- atomF- the other axial atom
- Returns:
- true if the geometry is trigonal-bipyramidal
 
 - 
getStereopublic static ITetrahedralChirality.Stereo getStereo(IAtom atom1, IAtom atom2, IAtom atom3, IAtom atom4) Take four atoms, and return Stereo.CLOCKWISE or Stereo.ANTI_CLOCKWISE. The first atom is the one pointing towards the observer.- Parameters:
- atom1- the atom pointing towards the observer
- atom2- the second atom (points away)
- atom3- the third atom (points away)
- atom4- the fourth atom (points away)
- Returns:
- clockwise or anticlockwise
 
 - 
getHandednesspublic static StereoTool.TetrahedralSign getHandedness(IAtom baseAtomA, IAtom baseAtomB, IAtom baseAtomC, IAtom apexAtom) Gets the tetrahedral handedness of four atoms - three of which form the 'base' of the tetrahedron, and the other the apex. Note that it assumes a right-handed coordinate system, and that the points {A,B,C} are in a counter-clockwise order in the plane they share.- Parameters:
- baseAtomA- the first atom in the base of the tetrahedron
- baseAtomB- the second atom in the base of the tetrahedron
- baseAtomC- the third atom in the base of the tetrahedron
- apexAtom- the atom in the point of the tetrahedron
- Returns:
- the sign of the tetrahedron
 
 - 
isColinearpublic static boolean isColinear(javax.vecmath.Point3d ptA, javax.vecmath.Point3d ptB, javax.vecmath.Point3d ptC)Checks the three supplied points to see if they fall on the same line. It does this by finding the normal to an arbitrary pair of lines between the points (in fact, A-B and A-C) and checking that its length is 0.- Parameters:
- ptA-
- ptB-
- ptC-
- Returns:
- true if the tree points are on a straight line
 
 - 
signedDistanceToPlanepublic static double signedDistanceToPlane(javax.vecmath.Vector3d planeNormal, javax.vecmath.Point3d pointInPlane, javax.vecmath.Point3d point)Given a normalized normal for a plane, any point in that plane, and a point, will return the distance between the plane and that point.- Parameters:
- planeNormal- the normalized plane normal
- pointInPlane- an arbitrary point in that plane
- point- the point to measure
- Returns:
- the signed distance to the plane
 
 - 
getNormalpublic static javax.vecmath.Vector3d getNormal(javax.vecmath.Point3d ptA, javax.vecmath.Point3d ptB, javax.vecmath.Point3d ptC)Given three points (A, B, C), makes the vectors A-B and A-C, and makes the cross product of these two vectors; this has the effect of making a third vector at right angles to AB and AC. NOTE : the returned normal is normalized; that is, it has been divided by its length. - Parameters:
- ptA- the 'middle' point
- ptB- one of the end points
- ptC- one of the end points
- Returns:
- the vector at right angles to AB and AC
 
 
- 
 
-