Esempio n. 1
0
        static Vector3D NextOrthogonalVector3D(Vector3D v)
        {
            var a0 = v.X == 0 ? Rotation3DHelper.UnitX : new Vector3D(v.Y, -v.X, 0);

            a0.Normalize();
            var angle = RandomHelper.NextDouble(-π, π);
            var q     = Rotation3DHelper.CreateQuaternionInRadians(v, angle);

            return(a0.Multiply(q));
        }
Esempio n. 2
0
 static Quaternion NextQuaternion() => Rotation3DHelper.CreateQuaternionInRadians(
     new Vector3D(RandomHelper.NextDouble(-1, 1), RandomHelper.NextDouble(-1, 1), RandomHelper.NextDouble(-1, 1)),
     RandomHelper.NextDouble(-7, 7));