Question: Write prototypes and implementations for 3 non - member functions named R 1 , R 2 , and R 3 that each accept an angle
Write prototypes and implementations for nonmember functions named R R and R that
each accept an angle in units of radians and return objects of the Matrix class corresponding to the
following rotation matrices that rotate clockwise about the or xyz axes:
cos sin
sin cos
cossin
sin cos
cos sin
sin cos
Note that you may see different versions of these rotation matrices with the other sin element
being negative, this is due to rotation in a different direction
To perform arithmetic operations on matrices, you can use nonmember functions, member
functions, or overloaded operators which are a special type of member function where the function
name is the operator and the syntax for calling the function uses the operator. Three nonmember
functions have the following prototypes:Matrix Multiplyconst Matrix& A const Matrix& B;
Matrix Multiplyconst Matrix& A double k;
Matrix Addconst Matrix& A Matrix& B;
The second multiply function is an overload because multiply is different when you are
multiplying a Matrix by a scalar different in both linear algebra and in C we need to tell the
compiler how to do this
a Write prototypes for the corresponding member functions. These member functions
should not change the matrix object, but should ask the Matrix object to determine and
return the results of:
i multiplying itself by another matrix,
ii multiplying itself by a scalar a double
iii. adding itself to another matrix.
b Write prototypes of member functions that overload the and operators for the same
three cases listed above
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
