Exemple #1
0
        public static CoVector3 operator *(CoVector3 left, double right)
        {
            CoVector3 result = new CoVector3(left.vector);

            for (int i = 0; i < 3; i++)
            {
                result.vector[i] *= right;
            }
            return(result);
        }
Exemple #2
0
        public static CoVector3 CrossProduct(CoVector3 left, CoVector3 right)
        {
            CoVector3 result = new CoVector3(0);

            for (int i = 0; i < 3; i++)
            {
                result.vector[i] = left.vector[(i + 1) % 3] * right.vector[(i + 2) % 3] - left.vector[(i + 2) % 3] * right.vector[(i + 1) % 3];
            }
            return(result);
        }
Exemple #3
0
        public static CoVector3 operator -(CoVector3 left, CoVector3 right)
        {
            CoVector3 result = new CoVector3(left.vector);

            for (int i = 0; i < 3; i++)
            {
                result.vector[i] -= right.vector[i];
            }
            return(result);
        }
Exemple #4
0
        public static CoVector3 operator *(Matrix3x3 left, CoVector3 right)
        {
            CoVector3 result = new CoVector3(0);

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    result.vector[i] += left.matrix[i, j] * right.vector[j];
                }
            }
            return(result);
        }
Exemple #5
0
 public CoVector3(CoVector3 coVector)
 {
     vector = coVector.vector;
 }