Random rotations
Sometimes it is necessary to generate random rotations. For example, if you are testing a stochastic system numerically, you need to perform a Monte Carlo simulation sampling the initial conditions. ReferenceFrameRotations.jl defines rand
function for all rotation representations, which samples a random rotation uniformly in SO(3).
julia> rand(Quaternion)
Quaternion{Float64}: + 0.106873 - 0.186806⋅i + 0.967335⋅j - 0.133955⋅k
julia> rand(DCM)
DCM{Float64}: 0.443569 0.890368 0.10243 0.819486 -0.4492 0.355896 0.36289 -0.0739241 -0.928895
julia> rand(EulerAngles)
EulerAngles{Float64}: R(Y) : 0.640155 rad ( 36.6782°) R(X) : 5.20521 rad ( 298.236°) R(Z) : 4.0819 rad ( 233.876°)
julia> rand(EulerAngleAxis)
EulerAngleAxis{Float64}: Euler angle : 2.30403 rad (132.011°) Euler axis : [0.311194, 0.719553, -0.620808]