示例#1
0
 /// <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));
 }
示例#2
0
 /// <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));
 }
示例#3
0
 /// <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));
 }
示例#4
0
 /// <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));
 }
示例#5
0
 /// <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));
 }
示例#6
0
 /// <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));
 }
示例#7
0
 /// <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);
 }
示例#8
0
 /// <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));
 }
示例#9
0
 /// <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));
 }