angle static method

double angle(
  1. double x1,
  2. double y1,
  3. double x2,
  4. double y2,
)

Computes the angle between two points (x1,y1) and (x2,y2). Angle zero points in the +X direction, 90 degrees points in the +Y direction (down) and from there we grow clockwise towards 360 degrees. @param {number} x1 x of first point. @param {number} y1 y of first point. @param {number} x2 x of second point. @param {number} y2 y of second point. @return {number} Standardized angle in degrees of the vector from x1,y1 to x2,y2.

Implementation

static double angle(double x1, double  y1, double x2, double y2)
{
  return standardAngle(radiansToDegrees(Math.atan2(y2 - y1, x2 - x1)));
}