Abacus.DoublePrecision.QuaternionTests.GetNextRandomQuaternion C# (CSharp) Method

GetNextRandomQuaternion() static private method

Helper function for getting the next random Quaternion.
static private GetNextRandomQuaternion ( ) : Quaternion
return Quaternion
        internal static Quaternion GetNextRandomQuaternion ()
        {
            Double pi; Maths.Pi(out pi);
            Double yaw = pi * (Double) rand.Next(0, 360) / (Double) 180;
            Double pitch = pi * (Double) rand.Next(0, 360) / (Double) 180;
            Double roll = pi * (Double) rand.Next(0, 360) / (Double) 180;

            Quaternion q; Quaternion.CreateFromYawPitchRoll(ref yaw, ref pitch, ref roll, out q);
            q.Normalise();
            return q;
        }