Create a class in a h file with four float members (four elements of a 2x2 matrix). You need to implement all of the ope
Posted: Wed Apr 27, 2022 3:12 pm
Create a class in a h file with four float members (four
elements of a 2x2 matrix). You need to implement all of the
operators, methods and constructors in the cpp file. You will need
it to compile and produce the output: (3,14)
cpp file:
#include <iostream>
#include "Mat.h"
using namespace std;
int main(int argc, const char * argv[])
{
Mat a ( Mat::Identity );
Mat b ( 1.0f, 2.0f, 1.0f, 4.0f );
Vec v = Vec(1,2)*(((a + b) - (4*a)) + a*b);
cout << v<<endl;
return 0;
}
elements of a 2x2 matrix). You need to implement all of the
operators, methods and constructors in the cpp file. You will need
it to compile and produce the output: (3,14)
cpp file:
#include <iostream>
#include "Mat.h"
using namespace std;
int main(int argc, const char * argv[])
{
Mat a ( Mat::Identity );
Mat b ( 1.0f, 2.0f, 1.0f, 4.0f );
Vec v = Vec(1,2)*(((a + b) - (4*a)) + a*b);
cout << v<<endl;
return 0;
}