public static Vector3d rotate ( Vector3d vector , Vector3d axis , double angle ) { Matrix3d rotate = new Matrix3d ( ) ; rotate . set ( new AxisAngle4d ( axis . x , axis . y , axis . z , angle ) ) ; Vector3d result = new Vector3d ( ) ; rotate . transform ( vector , result ) ; return result ; }
Rotates a vector around an axis .