angle static method

double angle(
  1. Coordinate p
)

Returns the angle of the vector from (0,0) to p, relative to the positive X-axis. The angle is normalized to be in the range ( -Pi, Pi ].

@param p the terminal point of the vector @return the normalized angle (in radians) that p makes with the positive x-axis.

Implementation

static double angle(Coordinate p) {
  return math.atan2(p.y, p.x);
}