Ejemplo n.º 1
0
 /// <summary>
 /// Calculates the length of the quaternion
 /// </summary>
 /// <returns>The length of the vector</returns>
 public static float Magnitude(Quaternion value) => Mathematics.Sqrt(Mathematics.Pow(value.X, 2)) + Mathematics.Sqrt(Mathematics.Pow(value.Y, 2)) + Mathematics.Sqrt(Mathematics.Pow(value.Z, 2)) + Mathematics.Sqrt(Mathematics.Pow(value.W, 2));
Ejemplo n.º 2
0
 /// <summary>
 /// Calculates the length of the vector
 /// </summary>
 /// <returns>May be preferred when only the relative length is needed and speed is of the essence</returns>
 public static float Magnitude(Vector4 value) => Mathematics.Sqrt(Mathematics.Pow(value.X, 2) + Mathematics.Pow(value.Y, 2) + Mathematics.Pow(value.Z, 2) + Mathematics.Pow(value.W, 2));