public static final void plus ( Structure s , Matrix matrix ) { AtomIterator iter = new AtomIterator ( s ) ; Atom oldAtom = null ; Atom rotOldAtom = null ; while ( iter . hasNext ( ) ) { Atom atom = null ; atom = iter . next ( ) ; try { if ( oldAtom != null ) { logger . debug ( "before {}" , getDistance ( oldAtom , atom ) ) ; } } catch ( Exception e ) { logger . error ( "Exception: " , e ) ; } oldAtom = ( Atom ) atom . clone ( ) ; 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 . plus ( matrix ) ; double [ ] coords = new double [ 3 ] ; coords [ 0 ] = na . get ( 0 , 0 ) ; coords [ 1 ] = na . get ( 0 , 1 ) ; coords [ 2 ] = na . get ( 0 , 2 ) ; atom . setCoords ( coords ) ; try { if ( rotOldAtom != null ) { logger . debug ( "after {}" , getDistance ( rotOldAtom , atom ) ) ; } } catch ( Exception e ) { logger . error ( "Exception: " , e ) ; } rotOldAtom = ( Atom ) atom . clone ( ) ; } }
calculate structure + Matrix coodinates ...