angleBetween static method

double angleBetween(
  1. Coordinate tip1,
  2. Coordinate tail,
  3. Coordinate tip2
)

Returns the unoriented smallest angle between two vectors. The computed angle will be in the range [0, Pi).

@param tip1 the tip of one vector @param tail the tail of each vector @param tip2 the tip of the other vector @return the angle between tail-tip1 and tail-tip2

Implementation

static double angleBetween(
    Coordinate tip1, Coordinate tail, Coordinate tip2) {
  double a1 = angle2C(tail, tip1);
  double a2 = angle2C(tail, tip2);

  return diff(a1, a2);
}