public Vector2d rotate ( double x , double y ) { final double length = length ( ) ; if ( Math . abs ( length ) < GenericMath . DBL_EPSILON ) { throw new ArithmeticException ( "Cannot rotate by the zero complex" ) ; } final double nx = this . x / length ; final double ny = this . y / length ; return new Vector2d ( x * nx - y * ny , y * nx + x * ny ) ; }
Rotates the double components of a vector by this complex .