/// <summary> /// Divides a quaternion by a scalar. /// </summary> /// <param name="q">A <see cref="QuaternionF"/> instance.</param> /// <param name="s">A scalar.</param> /// <returns>A <see cref="QuaternionF"/> instance to hold the result.</returns> public static QuaternionF operator/(QuaternionF q, float s) { return(QuaternionF.Divide(q, s)); }
/// <summary> /// Divides a scalar by a quaternion. /// </summary> /// <param name="q">A <see cref="QuaternionF"/> instance.</param> /// <param name="s">A scalar.</param> /// <returns>A <see cref="QuaternionF"/> instance to hold the result.</returns> public static QuaternionF operator/(float s, QuaternionF q) { return(QuaternionF.Multiply(q, 1 / s)); }
/// <summary> /// Multiplies quaternion <paramref name="a"/> by quaternion <paramref name="b"/>. /// </summary> /// <param name="a">A <see cref="QuaternionF"/> instance.</param> /// <param name="b">A <see cref="QuaternionF"/> instance.</param> /// <returns>A new <see cref="QuaternionF"/> containing the result.</returns> public static QuaternionF operator*(QuaternionF a, QuaternionF b) { return(QuaternionF.Multiply(a, b)); }
/// <summary> /// Multiplies a quaternion by a scalar. /// </summary> /// <param name="q">A <see cref="QuaternionF"/> instance.</param> /// <param name="s">A scalar.</param> /// <returns>A <see cref="QuaternionF"/> instance to hold the result.</returns> public static QuaternionF operator*(QuaternionF q, float s) { return(QuaternionF.Multiply(q, s)); }
/// <summary> /// Subtracts a quaternion from a quaternion. /// </summary> /// <param name="a">A <see cref="QuaternionF"/> instance.</param> /// <param name="b">A <see cref="QuaternionF"/> instance.</param> /// <returns>A new <see cref="QuaternionF"/> instance containing the difference.</returns> public static QuaternionF operator-(QuaternionF a, QuaternionF b) { return(QuaternionF.Subtract(a, b)); }
/// <summary> /// Adds two quaternions. /// </summary> /// <param name="a">A <see cref="QuaternionF"/> instance.</param> /// <param name="b">A <see cref="QuaternionF"/> instance.</param> /// <returns>A new <see cref="QuaternionF"/> instance containing the sum.</returns> public static QuaternionF operator+(QuaternionF a, QuaternionF b) { return(QuaternionF.Add(a, b)); }
/// <summary> /// Calculates the dot product of two quaternions. /// </summary> /// <param name="a">A <see cref="QuaternionF"/> instance.</param> /// <param name="b">A <see cref="QuaternionF"/> instance.</param> /// <returns>The dot product value.</returns> public static float DotProduct(QuaternionF a, QuaternionF b) { return(a.W * b.W + a.X * b.X + a.Y * b.Y + a.Z * b.Z); }
/// <summary> /// Subtracts a quaternion from a quaternion. /// </summary> /// <param name="a">A <see cref="QuaternionF"/> instance.</param> /// <param name="b">A <see cref="QuaternionF"/> instance.</param> /// <returns>A new <see cref="QuaternionF"/> instance containing the difference.</returns> public static QuaternionF Subtract(QuaternionF a, QuaternionF b) { return(new QuaternionF(a.W - b.W, a.X - b.X, a.Y - b.Y, a.Z - b.Z)); }
/// <summary> /// Adds two quaternions. /// </summary> /// <param name="a">A <see cref="QuaternionF"/> instance.</param> /// <param name="b">A <see cref="QuaternionF"/> instance.</param> /// <returns>A new <see cref="QuaternionF"/> instance containing the sum.</returns> public static QuaternionF Add(QuaternionF a, QuaternionF b) { return(new QuaternionF(a.W + b.W, a.X + b.X, a.Y + b.Y, a.Z + b.Z)); }