angleTo method

double angleTo(
  1. dynamic v
)

Implementation

double angleTo(v) {
  final denominator = math.sqrt(length2 * v.length2);

  if (denominator == 0) return math.pi / 2;

  final theta = dot(v) / denominator;

  // clamp, to handle doubleerical problems

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