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.892535 - 0.0221365⋅i - 0.312915⋅j - 0.323999⋅k
julia> rand(DCM)DCM{Float64}: 0.0546606 0.698451 -0.713567 -0.755929 0.49585 0.42744 0.652368 0.516042 0.555082
julia> rand(EulerAngles)EulerAngles{Float64}: R(Y) : 1.4104 rad ( 80.8098°) R(Z) : 1.32875 rad ( 76.1319°) R(Y) : 2.014 rad ( 115.394°)
julia> rand(EulerAngleAxis)EulerAngleAxis{Float64}: Euler angle : 2.00792 rad (115.046°) Euler axis : [0.589844, 0.437571, 0.678686]