Esempio n. 1
0
        /// <summary>
        /// DUAL.Mul : res = a * b
        /// The geometric product.
        /// </summary>
        public static DUAL operator *(DUAL a, DUAL b)
        {
            DUAL res = new DUAL();

            res[0] = b[0] * a[0];
            res[1] = b[1] * a[0] + b[0] * a[1];
            return(res);
        }
Esempio n. 2
0
        /// <summary>
        /// DUAL.Conjugate : res = a.Conjugate()
        /// Clifford Conjugation
        /// </summary>
        public DUAL Conjugate()
        {
            DUAL res = new DUAL();

            res[0] = this[0];
            res[1] = -this[1];
            return(res);
        }
Esempio n. 3
0
        /// <summary>
        /// DUAL.Involute : res = a.Involute()
        /// Main involution
        /// </summary>
        public DUAL Involute()
        {
            DUAL res = new DUAL();

            res[0] = this[0];
            res[1] = -this[1];
            return(res);
        }
Esempio n. 4
0
        /// <summary>
        /// DUAL.Dual : res = !a
        /// Poincare duality operator.
        /// </summary>
        public static DUAL operator !(DUAL a)
        {
            DUAL res = new DUAL();

            res[0] = a[1];
            res[1] = a[0];
            return(res);
        }
Esempio n. 5
0
        /// <summary>
        /// DUAL.adds : res = a + b
        /// multivector/scalar addition
        /// </summary>
        public static DUAL operator +(DUAL a, float b)
        {
            DUAL res = new DUAL();

            res[0] = a[0] + b;
            res[1] = a[1];
            return(res);
        }
Esempio n. 6
0
        /// <summary>
        /// DUAL.sadd : res = a + b
        /// scalar/multivector addition
        /// </summary>
        public static DUAL operator +(float a, DUAL b)
        {
            DUAL res = new DUAL();

            res[0] = a + b[0];
            res[1] = b[1];
            return(res);
        }
Esempio n. 7
0
        /// <summary>
        /// DUAL.Sub : res = a - b
        /// Multivector subtraction
        /// </summary>
        public static DUAL operator -(DUAL a, DUAL b)
        {
            DUAL res = new DUAL();

            res[0] = a[0] - b[0];
            res[1] = a[1] - b[1];
            return(res);
        }
Esempio n. 8
0
        /// <summary>
        /// DUAL.Vee : res = a & b
        /// The regressive product. (JOIN)
        /// </summary>
        public static DUAL operator &(DUAL a, DUAL b)
        {
            DUAL res = new DUAL();

            res[1] = 1 * (a[1] * b[1]);
            res[0] = 1 * (a[0] * b[1] + a[1] * b[0]);
            return(res);
        }