fromRotationMatrix

taken from https://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/