, embed the matrix in the next larger size with last column , and rotate the larger matrix so the last column becomes . As usual, we have special alternatives for the case. Each of these methods begins with three independent random scalars uniformly distributed on the unit interval. takes advantage of the odd dimension to change a Householder reflection to a rotation by negation, and uses that to aim the axis of a uniform planar rotation. Another method uses unit quaternions. Multiplication of rotation matrices is homomorphic to multiplication of quaternions, and multiplication by a unit quaternion rotates the unit sphere. Since the homomorphism is a local isometry, we immediately conclude that to produce a uniform distribution on SO(3) we may use a uniform distribution on . In practice: create a four-element vector where each element is a sampling of a normal distribution. Normalize its length and you have a uniformly sampled random unit quaternion which represents a uniformly sampled random rotation. Note that the aforementioned only applies to rotations in dimension 3. For a generalised idea of quaternions, one should look into Rotors. Euler angles can also be used, though not with each angle uniformly distributed (; ). For the axis–angle form, the axis is uniformly distributed over the unit sphere of directions, , while the angle has the nonuniform distribution over noted previously . See also Euler–Rodrigues formula Euler's rotation theorem Rodrigues' rotation formula Plane of rotation Axis–angle representation Rotation group SO(3) Rotation formalisms in three dimensions Rotation operator (vector space) Transformation matrix Yaw-pitch-roll system Kabsch algorithm Isometry Rigid transformation Rotations in 4-dimensional Euclidean space Trigonometric Identities Versor Remarks Notes References ; reprinted as article 52 in (GTM 222) (Also NASA-CR-53568.) (GTM 102) External links Rotation matrices at Mathworld Math Awareness Month 2000 interactive demo (requires Java) Rotation Matrices at MathPages A parametrization of SOn(R) by generalized Euler Angles Rotation about any point Transformation (function) Matrices Mathematical physics