public static boolean isOctahedral ( IAtom atomA , IAtom atomB , IAtom atomC , IAtom atomD , IAtom atomE , IAtom atomF , IAtom atomG ) { Point3d pointA = atomA . getPoint3d ( ) ; Point3d pointB = atomB . getPoint3d ( ) ; Point3d pointC = atomC . getPoint3d ( ) ; Point3d pointD = atomD . getPoint3d ( ) ; Point3d pointE = atomE . getPoint3d ( ) ; Point3d pointF = atomF . getPoint3d ( ) ; Point3d pointG = atomG . getPoint3d ( ) ; // the points on the axis should be in a line boolean isColinearABG = isColinear ( pointA , pointB , pointG ) ; if ( ! isColinearABG ) return false ; // check that CDEF are in a plane Vector3d normal = new Vector3d ( ) ; isSquarePlanar ( pointC , pointD , pointE , pointF , normal ) ; // now check rotation in relation to the first atom Vector3d vectorAB = new Vector3d ( pointA ) ; vectorAB . sub ( pointB ) ; // that is, they point in opposite directions return normal . dot ( vectorAB ) < 0 ; }
Checks these 7 atoms to see if they are at the points of an octahedron .