rotateByAxisAngle method

Vector3D rotateByAxisAngle(
  1. Vector3D axis,
  2. double angle
)

Implementation

Vector3D rotateByAxisAngle(Vector3D axis, double angle) {
  final w = axis.normalize().scale(math.sin(angle / 2.0));
  final wv = w.crossProduct(this);
  final wwv = w.crossProduct(wv).scale(2);
  return add(wv.scale(2 * math.cos(angle / 2.0))).add(wwv);
}