예제 #1
0
        /// <summary>
        /// 同除以一个实数
        /// </summary>
        /// <param name="q"></param>
        /// <param name="f"></param>
        /// <returns></returns>
        public static Quaternions operator/(Quaternions q, double f)
        {
            Quaternions t = new Quaternions();

            t.T = q.T / f;
            t.V = q.V / f;
            return(t);
        }
예제 #2
0
        /// <summary>
        /// 四元数的积
        /// </summary>
        /// <param name="q1"></param>
        /// <param name="q2"></param>
        /// <returns></returns>
        public static Quaternions operator*(Quaternions q1, Quaternions q2)
        {
            Quaternions q = new Quaternions();

            q.T = q1.T * q2.T - q1.V * q2.V;
            q.V = q1.T * q2.V + q2.T * q1.V + q1.V.XMultpy(q2.V);
            return(q);
        }