angleBetween static method
Implementation
static double angleBetween(Vec2 a, Vec2 b) {
final dotProduct = a.dot(b);
final magnitudes = a.magnitude * b.magnitude;
if (magnitudes == 0) return 0;
return acos((dotProduct / magnitudes).clamp(-1.0, 1.0));
}