rotationMatrix function

Array rotationMatrix(
  1. double angle,
  2. Vector3 axis
)

Implementation

Array rotationMatrix(double angle, Vector3 axis) {
  var aboutZ = rotationAboutZ(angle);
  var zToAxis = zToVector(axis);
  var axisToZ = zToAxis.getInverse();
  return [zToAxis, aboutZ, axisToZ].reduce((acc, elem) => acc.matMul(elem));
}