示例#1
0
文件: dual.cs 项目: zeta1999/ganja.js
        /// <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);
        }
示例#2
0
文件: dual.cs 项目: zeta1999/ganja.js
        /// <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);
        }
示例#3
0
文件: dual.cs 项目: zeta1999/ganja.js
        /// <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);
        }
示例#4
0
文件: dual.cs 项目: zeta1999/ganja.js
        /// <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);
        }
示例#5
0
文件: dual.cs 项目: zeta1999/ganja.js
        /// <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);
        }
示例#6
0
文件: dual.cs 项目: zeta1999/ganja.js
        /// <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);
        }
示例#7
0
文件: dual.cs 项目: zeta1999/ganja.js
        /// <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);
        }
示例#8
0
文件: dual.cs 项目: wrnrlr/ganja.js
        /// <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);
        }