General dimensional Rotation

Our main goal is to efficiently represent rotations in lower dimensions, such as 2D and 3D, but some operations on rotations in general dimensions are also supported.

example

julia> r1 = one(RotMatrix{4})  # generate identity rotation matrix4×4 RotMatrix{4, Bool, 16} with indices SOneTo(4)×SOneTo(4):
 1  0  0  0
 0  1  0  0
 0  0  1  0
 0  0  0  1
julia> m = @SMatrix rand(4,4)4×4 StaticArraysCore.SMatrix{4, 4, Float64, 16} with indices SOneTo(4)×SOneTo(4): 0.49579 0.40281 0.0386866 0.0208903 0.739067 0.599312 0.00289439 0.587874 0.331874 0.601825 0.851533 0.516978 0.686723 0.0396792 0.83876 0.115409
julia> r2 = nearest_rotation(m) # nearest rotation matrix from given matrix4×4 RotMatrix{4, Float64, 16} with indices SOneTo(4)×SOneTo(4): 0.441975 0.659781 -0.0984268 -0.599716 0.569614 0.21248 -0.352542 0.711412 -0.246016 0.591097 0.679964 0.357393 0.647823 -0.412488 0.635355 -0.0806483
julia> r3 = rand(RotMatrix{4}) # random rotation in SO(4)4×4 RotMatrix{4, Float64, 16} with indices SOneTo(4)×SOneTo(4): -0.457885 0.0284017 -0.104657 -0.882373 -0.74795 -0.186907 0.552652 0.316564 0.41473 -0.705475 0.492436 -0.296329 0.242717 0.683055 0.664176 -0.182743
julia> r1*r2/r3 # multiplication and division4×4 RotMatrix{4, Float64, 16} with indices SOneTo(4)×SOneTo(4): 0.35584 -0.698137 -0.152915 0.602163 -0.845617 -0.435383 -0.298079 -0.0807646 -0.257082 0.562449 -0.290102 0.730343 -0.303676 -0.0818421 0.896441 0.312211
julia> s = log(r2) # logarithm of RotMatrix is a RotMatrixGenerator4×4 RotMatrixGenerator{4, Float64, 16} with indices SOneTo(4)×SOneTo(4): 0.0 0.138605 0.33023 -1.17768 -0.138605 0.0 -0.808326 1.21512 -0.33023 0.808326 0.0 -0.308815 1.17768 -1.21512 0.308815 0.0
julia> exp(s) # exponential of RotMatrixGenerator is a RotMatrix4×4 RotMatrix{4, Float64, 16} with indices SOneTo(4)×SOneTo(4): 0.441975 0.659781 -0.0984268 -0.599716 0.569614 0.21248 -0.352542 0.711412 -0.246016 0.591097 0.679964 0.357393 0.647823 -0.412488 0.635355 -0.0806483