angleTo method

double angleTo(
  1. dynamic v
)

Implementation

double angleTo(v) {
  var denominator = Math.sqrt(lengthSq() * v.lengthSq());

  if (denominator == 0) return Math.PI / 2;

  var theta = dot(v) / denominator;

  // clamp, to handle numerical problems

  return Math.acos(MathUtils.clamp(theta, -1, 1));
}