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); }
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); }
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); }
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); }
public CoVector3(CoVector3 coVector) { vector = coVector.vector; }