private void stretch ( IntStack stack , IAtom beg , IAtom end , double amount ) { Point2d begPoint = beg . getPoint2d ( ) ; Point2d endPoint = end . getPoint2d ( ) ; if ( begPoint . distance ( endPoint ) + amount > MAX_BOND_LENGTH ) return ; Vector2d vector = new Vector2d ( endPoint . x - begPoint . x , endPoint . y - begPoint . y ) ; vector . normalize ( ) ; vector . scale ( amount ) ; for ( int i = 0 ; i < stack . len ; i ++ ) atoms [ stack . xs [ i ] ] . getPoint2d ( ) . ( vector ) ; }
Stretch the distance between beg and end moving all atoms provided in the stack .