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)); }
static Quaternion NextQuaternion() => Rotation3DHelper.CreateQuaternionInRadians( new Vector3D(RandomHelper.NextDouble(-1, 1), RandomHelper.NextDouble(-1, 1), RandomHelper.NextDouble(-1, 1)), RandomHelper.NextDouble(-7, 7));