示例#1
0
        // Operator overloading is not supported by the compiler yet.
        //public static CSMatrix operator*(CSMatrix A, CSMatrix B)
        //{
        //    return A.Mul(B);
        //}

        public CSVector Mul(CSVector vect)
        {
            float[] res = new float[] { 0, 0, 0, 0 };
            for (int i = 0; i < 4; ++i)
            {
                for (int k = 0; k < 4; ++k)
                {
                    res[i] += this[i, k] * vect[k];
                }
            }
            return(new CSVector(res));
        }
示例#2
0
		// Operator overloading is not supported by the compiler yet.
        //public static CSMatrix operator*(CSMatrix A, CSMatrix B)
        //{
        //    return A.Mul(B);
        //}

        public CSVector Mul(CSVector vect)
        {
            float[] res = new float[] { 0, 0, 0, 0 };
            for(int i = 0; i < 4; ++i) {
                for(int k = 0; k < 4; ++k) {
                    res[i] += this[i, k] * vect[k];
                }
            }
            return new CSVector(res);
        }