Vector3RotateByAxisAngle function
Rotate v around axis by angle (radians) — Rodrigues' formula.
Implementation
Vector3 Vector3RotateByAxisAngle(Vector3 v, Vector3 axis, double angle) {
final a = axis.normalized();
final c = math.cos(angle), s = math.sin(angle);
return v.scaled(c) + a.cross(v).scaled(s) + a.scaled(a.dot(v) * (1 - c));
}