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.854712 + 0.405105⋅i - 0.255352⋅j - 0.200382⋅k
julia> rand(DCM)DCM{Float64}: 0.645408 0.488087 0.587555 -0.663082 -0.0238294 0.748167 0.379171 -0.87247 0.308262
julia> rand(EulerAngles)EulerAngles{Float64}: R(Y) : 5.35912 rad ( 307.055°) R(X) : 3.50237 rad ( 200.671°) R(Y) : 0.328937 rad ( 18.8467°)
julia> rand(EulerAngleAxis)EulerAngleAxis{Float64}: Euler angle : 2.15477 rad (123.459°) Euler axis : [-0.721742, 0.005374, -0.692142]