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.905542 - 0.11916⋅i + 0.380625⋅j + 0.144635⋅k
julia> rand(DCM)DCM{Float64}: 0.424574 0.399741 0.812369 -0.776948 0.621536 0.100223 -0.464853 -0.673721 0.574466
julia> rand(EulerAngles)EulerAngles{Float64}: R(Z) : 3.64319 rad ( 208.739°) R(Y) : 2.10039 rad ( 120.344°) R(X) : 5.11474 rad ( 293.053°)
julia> rand(EulerAngleAxis)EulerAngleAxis{Float64}: Euler angle : 2.24746 rad (128.77°) Euler axis : [0.0634468, -0.974105, 0.217013]