public static void rotate ( IAtomContainer atomCon , Point2d center , double angle ) { Point2d point ; double costheta = Math . cos ( angle ) ; double sintheta = Math . sin ( angle ) ; IAtom atom ; for ( int i = 0 ; i < atomCon . getAtomCount ( ) ; i ++ ) { atom = atomCon . getAtom ( i ) ; point = atom . getPoint2d ( ) ; double relativex = point . x - center . x ; double relativey = point . y - center . y ; point . x = relativex * costheta - relativey * sintheta + center . x ; point . y = relativex * sintheta + relativey * costheta + center . y ; } }
Rotates a molecule around a given center by a given angle .