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