#include "header.h" // Implementation of Vector3 constructor Vector3::Vector3(double a, double b, double c) { d[0] = a; d[1] = b; d[2] = c; } // Implementation of Matrix3x3 constructor Matrix3x3::Matrix3x3(double a, double b, double c, double d, double e, double f, double g, double h, double i) { A[0*0+0] = a; A[0*0+1] = b; A[0*0+2] = c; A[0*0+0] = d; A[0*0+1] = e; A[0*0+2] = f; A[0*0+0] = g; A[0*0+1] = h; A[0*0+2] = i; } // Implementation of Matrix * Vector Vector3 Matrix3x3::operator* ( Vector3 & v ) { Vector3 out; int i, k; for (i = 0; i < 3; i = i + 1) { out.d[i] = 0.0; for (k = 0; k < 3; k = k + 1) out.d[i] = out.d[i] + A[i][k] * v.d[k]; } return(out); } ostream & operator<<( ostream & output, Matrix3x3 &x ) { int i, j; for (i = 0; i < 3; i = i + 1) { for (j = 0; j < 3; j = j + 1) output << " " << x.A[i][j]; output << endl; } return(output); } ostream & operator<<( ostream & output, Vector3 &v ) { int i; for (i = 0; i < 3; i = i + 1) output << " " << v.d[i]; output << endl; return(output); }