public static final void rotate ( Atom atom , Matrix m ) { double x = atom . getX ( ) ; double y = atom . getY ( ) ; double z = atom . getZ ( ) ; double [ ] [ ] ad = new double [ ] [ ] { { x , y , z } } ; Matrix am = new Matrix ( ad ) ; Matrix na = am . times ( m ) ; atom . setX ( na . get ( 0 , 0 ) ) ; atom . setY ( na . get ( 0 , 1 ) ) ; atom . setZ ( na . get ( 0 , 2 ) ) ; }
Rotate an Atom around a Matrix object . The rotation Matrix must be a pre - multiplication Matrix .