angleTo method

double angleTo(
  1. Vector3 other
)

Returns the angle between this vector and other in radians.

Implementation

double angleTo(Vector3 other) {
  final otherStorage = other._v3storage;
  if (_v3storage[0] == otherStorage[0] &&
      _v3storage[1] == otherStorage[1] &&
      _v3storage[2] == otherStorage[2]) {
    return 0.0;
  }

  final d = dot(other) / (length * other.length);

  return math.acos(d.clamp(-1.0, 1.0));
}