rotationMatrix function
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));
}