Defining Matrices with a function

For a university assignment I was asked to define 3 matrices for use in rotation matrices using functions, I'm unsure what that means so I'll post the question. I have done the whole question just not defining the matrices as functions. If you guys have any idea what he means or can see why my attempt is wrong that would be much appreciated.

The question:
Develop four functions for Rtheta, Rbeta, Rgamma and R of the form:

void RTheta (const double& theta, double array [3][3]);

using the pre-defined matrices




My Attempt:
void RTheta(const double theta, double array1[3][3]) {
array1 = { { cos(theta),sin(theta),0 }, {-sin(theta),cos(theta),0 },{ 0,0,1 } };
}

void RBeta(const double theta, double array2[3][3]) {
double Rbeta[3][3] = { { cos(theta),sin(theta),0 },{ -sin(theta),cos(theta),0 },{ 0,0,1 } };
}

void RGamma(const double theta, double array3[3][3]) {
double Rgamma[3][3] = { { cos(theta),sin(theta),0 },{ -sin(theta),cos(theta),0 },{ 0,0,1 } };
}
Topic archived. No new replies allowed.