public static FixQuaternion FromToRotation(FixVector3 fromVector, FixVector3 toVector) { FixVector3 w = FixVector3.Cross(fromVector, toVector); FixQuaternion q = new FixQuaternion(w.x, w.y, w.z, FixVector3.Dot(fromVector, toVector)); q.w += Fix64.Sqrt(fromVector.SqrMagnitude * toVector.SqrMagnitude); q.Normalize(); return(q); }
/// <summary> /// Calculates the dot product of two vectors. /// </summary> /// <param name="value1">The first vector.</param> /// <param name="value2">The second vector.</param> /// <returns>Returns the dot product of both.</returns> #region public static Fix64 operator *(JVector value1, JVector value2) public static Fix64 operator *(FixVector3 value1, FixVector3 value2) { return(FixVector3.Dot(ref value1, ref value2)); }
/// <summary> /// Calculates the dot product of two vectors. /// </summary> /// <param name="vector1">The first vector.</param> /// <param name="vector2">The second vector.</param> /// <returns>Returns the dot product of both vectors.</returns> #region public static Fix64 Dot(JVector vector1, JVector vector2) public static Fix64 Dot(FixVector3 vector1, FixVector3 vector2) { return(FixVector3.Dot(ref vector1, ref vector2)); }