public static void translate2DCenterTo ( IAtomContainer container , Point2d p ) { Point2d com = get2DCenter ( container ) ; Vector2d translation = new Vector2d ( p . x - com . x , p . y - com . y ) ; for ( IAtom atom : container . atoms ( ) ) { if ( atom . getPoint2d ( ) != null ) { atom . getPoint2d ( ) . add ( translation ) ; } } }
Translates the geometric 2DCenter of the given AtomContainer container to the specified Point2d p .