# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/vec3.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

int main()

{

glm::mat3 A = { 1, 1, -1, 0, 2, 0, 2, 3, 1 };

glm::mat3 B = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

glm::mat3 AB = A * B;

glm::mat3 BA = B * A;

std::cout << "A x B: " << glm::to_string(AB) << std::endl;

std::cout << "B x A: " << glm::to_string(BA) << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

#include <glm/mat4x4.hpp>

#include <glm/glm.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/gtx/string_cast.hpp>

int main() {

glm::mat3 a = {{1, 1, -1}, {0, 2, 0}, {2, 3, 1}};

glm::mat3 b = {{1, 0, 0}, {0, -1, 1}, {0, 1, 2}};

std::cout << "a x b : " << glm::to_string(a * b) << std::endl;

std::cout << "b x a : " << glm::to_string(b * a) << std::endl;

return 0;

}

# data[].attributes.body
int main(void) {

//glm::mat3 A = { {1, 0, 2}, {1, 2, 3}, {-1, 0, 1} };

glm::mat3 a = {{1, 1, -1}, {0, 2, 0}, {2, 3, 1} };

//glm::mat3 B = { {1, 0, 0}, {0, -1, 1}, {0, 1, 2} };

glm::mat3 b = { {1, 0, 0}, {0, -1, 1}, {0, 1, 2} };

glm::mat3 ab = a * b;

std::cout << "a * b: " << glm::to_string(ab) << std::endl;

glm::mat3 ba = b * a;

std::cout << "b * a: " << glm::to_string(ba) << std::endl;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/gtc/constants.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/mat3x3.hpp>

#include <iostream>

int main()

{

glm::mat3 a = {{1, 1, -1 }, {0, 2, 0}, {2, 3 , 1}};

glm::mat3 b = {{1, 0 ,0}, {0, -1, 1}, {0, 1, 2}};

glm::mat3 AB = a * b;

glm::mat3 BA = b * a;

std::cout << "A * B = " << glm::to_string(AB) << std::endl;

std::cout << "B * A = " << glm::to_string(BA) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/mat3x3.hpp>

#include <iostream>

#include <glm/gtx/string_cast.hpp>

int main()

{

glm::mat3 a = { {1, 1, -1}, {0, 2, 0}, {2, 3, 1} };

glm::mat3 b = { {1, 0, 0}, {0, -1, 1}, {0, 1, 2} };

std::cout << "A B is: " << glm::to_string(a b) << std::endl;

std::cout << "B A is: " << glm::to_string(b a) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

#include <glm/gtx/string_cast.hpp>

int main(void)

{

glm::mat3 m1 = {1, 1, -1, 0, 2, 0, 2, 3, 1};

glm::mat3 m2 = {1, 0, 0, 0, -1, 1, 0, 1, 2};

glm::mat3 m3 = m1 * m2;

glm::mat3 m4 = m2 * m1;

std::cout << "Result: " << glm::to_string(m3) << std::endl;

std::cout << "Result: " << glm::to_string(m4) << std::endl;

return 0;

}

# data[].attributes.body
int main()

{

glm::mat3 a {

1, 1, -1,

0, 2, 0,

2, 3, 1

};

glm::mat3 b = {

1, 0, 0,

0, -1, 1,

0, 1, 2

};

std::cout << glm::to_string(a) << std::endl;

std::cout << glm::to_string(b) << std::endl;

glm::mat3 resAxB = a * b;

glm::mat3 resBxA = b * a;

std::cout << "resAxB : " << glm::to_string(resAxB) << std::endl;

std::cout << "resBxA : " << glm::to_string(resBxA) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_FORCE_SWIZZLE

#define GLM_ENABLE_EXPERIMENTAL

#include <glm/gtx/string_cast.hpp>

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/mat3x3.hpp>

#include "ComputerGraphicsLecture2.h"

int main()

{

glm::mat3 A = { {1, 1, -1}, {0, 2, 0}, {2, 3, 1} };

glm::mat3 B = { {1, 0, 0}, {0, -1, 1}, {0, 1, 2} };

std::cout << glm::to_string(A * B) << std::endl;

std::cout << glm::to_string(B * A) << std::endl;

return 0;

}

# data[].attributes.body
#include <glm/glm.hpp>
#include <glm/mat3x3.hpp>

#include <glm/gtx/string_cast.hpp>
#include <iostream>

int main()
{
	glm::mat3 m1 = {1, 1, -1, 0, 2, 0, 2, 3, 1};
	glm::mat3 m2 = {1, 0, 0, 0, -1, 1, 0, 1, 2};

	std::cout << "A x B = " << glm::to_string(m1 * m2) << std::endl;
	std::cout << "B x A = " << glm::to_string(m2 * m1) << std::endl;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

int main() {

glm::mat3 a = { 1, 1, -1, 0, 2, 0, 2, 3, 1};

glm::mat3 b = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

glm::mat3 ab = a * b;

glm::mat3 ba = b * a;

std::cout << "Matrix AB = " << to_string(ab) << std::endl;

std::cout << "Matrix BA = " << to_string(ba) << std::endl;

}

# data[].attributes.body
#define GLM_FORCE_SWIZZLE

#define GLM_ENABLE_EXPERIMENTAL

#include "CMakeProject1.h"

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

#include <glm/mat4x4.hpp>

using namespace std;

int main()

{

const float DEGREES_TO_RADIANS = glm::pi<float>() / 180.0;

const float RADIANS_TO_DEGREES = 180.0 / glm::pi<float>();

glm::mat3x3 A = { { 1, 1, -1 }, { 0, 2, 0 }, {2, 3, 1 } };

glm::mat3x3 B = { { 1, 0, 0 }, { 0, -1, 1 }, { 0, 1, 2 } };

glm::mat3x3 Res_A_B = A * B;

cout << "Res_A_B: " << glm::to_string(Res_A_B) << endl;

glm::mat3x3 Res_B_A = B * A;

cout << "Res_B_A: " << glm::to_string(Res_B_A) << endl;

return 0;

}

# data[].attributes.body
int main() {

    glm::mat3 ma = { 1, 1, -1, 0, 2, 0, 2, 3, 1};
    glm::mat3 mb = { 1, 0, 0, 0, -1, 1, 0, 1, 2};
    glm::mat3 m3 = ma * mb;
    glm::mat3 m4 = mb * ma;

    std::cout << to_string(m3) << "\n" << to_string(m4) << std::endl;
    return 0;
}

# data[].attributes.body
#include <glm/gtc/constants.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x3.hpp>

#include "CMakeProject2.h"

#include <iostream>

void main() {

	glm::mat3 m5{ {1,1,-1}, {0,2,0}, {2,3,1} };

	glm::mat3 m6{ {1,0,0}, {0,-1,1}, {0,1,2} };

	glm::mat2 m7 = m5 * m6;

	glm::mat2 m8 = m6 * m5;

	std::cout << glm::to_string(m7) << '\n' << glm::to_string(m8) << std::endl;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

int main()

{

glm::mat3 A = { { 1, 1, -1 }, { 0, 2, 0 }, { 2, 3, 1 } };

glm::mat3 B = { { 1, 0, 0 }, { 0, -1, 1 }, { 0, 1, 2 } };

std::cout << to_string(A * B) << std::endl;

std::cout << to_string(B * A) << std::endl;

return (0);

}

# data[].attributes.body
#include <iostream>

#define GLM_ENABLE_EXPERIMENTAL

#include <glm/gtx/string_cast.hpp>
#include <glm/mat3x3.hpp>

int main(void) {
    glm::mat3 a = {1.f, 1.f, -1.f, 0.f, 2.f, 0.f, 2.f, 3.f, 1.f};
    glm::mat3 b = {1.f, 0.f, 0.f, 0.f, -1.f, 1.f, 0.f, 1.f, 2.f};

    std::cout << glm::to_string(a * b) << std::endl;
    std::cout << glm::to_string(b * a) << std::endl;

    return 0;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/glm.hpp>

#include <iostream>

#include <glm/gtx/string_cast.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

int main(void)

{

glm::mat3 m1 = { { 1, 1, -1 }, { 0, 2, 0}, {2, 3, 1} };

glm::mat3 m2 = { {1, 0, 0}, {0, -1, 1}, {0, 1, 2} };

glm::mat3 m3 = m1 * m2;

glm::mat3 m4 = m2 * m1;

std::cout << "AxB = " << to_string(m3) << std::endl;

std::cout << "BxA = " << to_string(m4) << std::endl;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include "CMakeProject1.h"

#include "iostream"
#include "glm/gtc/constants.hpp"
#include "glm/vec3.hpp"
#include "glm/mat3x3.hpp"
#include "glm/glm.hpp"
#include "glm/gtx/string_cast.hpp"

using namespace std;


int main()
{

	glm::mat3 mA = { 1, 1, -1,  0,  2, 0,  2, 3, 1 };
	glm::mat3 mB = { 1, 0,  0,  0, -1, 0,  0, 1, 2 };
	glm::mat3 mAB = mA * mB;
	glm::mat3 mBA = mB * mA;

	std::cout << "A * B = " << glm::to_string(mAB) << std::endl;
	std::cout << "B * A = " << glm::to_string(mBA) << std::endl;

	return 0;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include "CMakeProject1.h"

#include <glm/vec3.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat3x2.hpp>

int main()

{

glm::mat3 m1{ {1,1,-1}, {0, 2, 0}, {2, 3, 1} };

glm::mat3 m2{ {1, 0, 0}, {0, -1, 1}, {0, 1, 2} };

std::cout << "AxB: " << glm::to_string(m1 * m2) << '\n';

std::cout << "BxA: " << glm::to_string(m2 * m1) << '\n';

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/vec3.hpp>
#include <glm/mat4x4.hpp>
#include <glm/mat2x2.hpp>
#include <glm/mat3x2.hpp>

#include <glm/gtx/string_cast.hpp>
#include <glm/gtc/constants.hpp>

int main() {
	glm::mat3 a = { { 1.0f, 1.0f, -1.0f }, { 0.0f, 2.0f, 0.0f }, { 2.0f, 3.0f, 1.0f } };
	glm::mat3 b = { { 1.0f, 0.0f, 0.0f }, { 0.0f, -1.0f, 1.0f }, { 0.0f, 1.0f, 2.0f } };
	std::cout << "A * B: " << glm::to_string(a * b) << std::endl;
	std::cout << "B * A: " << glm::to_string(b * a) << std::endl;
	return 0;
}

# data[].attributes.body
void testMatrix(void) {

glm::mat3 m1 = { {1, 1, -1}, {0, 2, 0}, {2, 3, 1} };

glm::mat3 m2 = { {1, 0, 0}, {0, -1, 1}, {0, 1, 2} };

glm::mat3 m3 = m1 * m2;

glm::mat3 m4 = m2 * m1;

std::cout << "m3 =" << glm::to_string(m3) << std::endl;

std::cout << "m4 =" << glm::to_string(m4) << std::endl;

}

# data[].attributes.body
#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x3.hpp>

int main()

{

glm::mat3 a = { 1, 1, -1, 0, 2, 0, 2, 3, 1 };

glm::mat3 b = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

glm::mat3 c = a * b;

glm::mat3 d = b * a;

std::cout << "A x B: " << glm::to_string(c) << std::endl;

std::cout << "B x A: " << glm::to_string(d) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp>
#include <glm/gtx/string_cast.hpp>
#include <iostream>
#include <stdexcept>

int main() {
  glm::mat3 A({{1, 1, -1}, {0, 2, 0}, {2, 3, 1}});
  glm::mat3 B({{1, 0, 0}, {0, -1, 1}, {0, 1, 2}});
  std::cout << "AB: " << glm::to_string(A * B) << std::endl;
  std::cout << "BA: " << glm::to_string(B * A) << std::endl;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/vec3.hpp>
#include <glm/gtx/string_cast.hpp>
#include <iostream>

#include <glm/mat4x4.hpp>
#include <glm/mat2x2.hpp>
#include <glm/mat3x2.hpp>

int main()
{
	glm::mat3 a = { 1, 1, -1, 0, 2, 0, 2, 3, 1 };
	glm::mat3 b = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

	glm::mat3 ab = a * b;
	glm::mat3 ba = b * a;

	std::cout << "a * b: " << glm::to_string(ab) << std::endl;
	std::cout << "b * a: " << glm::to_string(ba) << std::endl;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

int main() {

glm::mat3 m1 = { 1, 1, -1, 0, 2, 0, 2, 3, 1 };

glm::mat3 m2 = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

glm::mat3 axb = m1 * m2;

glm::mat3 bxa = m2 * m1;

std::cout << "AxB" << to_string(axb) << std::endl;

std::cout << "BxA" << to_string(bxa) << std::endl;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/gtc/constants.hpp>

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

int main() {

glm::mat3 m1 = {{1, 1, -1}, {0, 2, 0}, {2, 3, 1}};

glm::mat3 m2 = { {1, 0, 0}, {0, -1, 1}, {0, 1, 2} };

glm::mat3 m3 = m1 * m2;

glm::mat3 m4 = m2 * m1;

std::cout << "m1 m2: " << glm::to_string(m3) << "m2 m1: " << glm::to_string(m4) << std::endl;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/gtx/string_cast.hpp>

int main()

{

glm::mat3 a = { 1, 1, -1, 0, 2, 0, 2, 3, 1 };

glm::mat3 b = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

std::cout << "A B = " << to_string(a b) << std::endl;

std::cout << "B A = " << to_string(b a) << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>

#include <glm/glm.hpp>

# define GLM_ENABLE_EXPERIMENTAL

#include <glm/gtx/string_cast.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

#include <glm/mat4x4.hpp>

using namespace std;

int main()

{

glm::mat3 a = { {1, 1, -1}, {0, 2, 0}, {2, 3, 1} };

glm::mat3 b = { {1, 0, 0}, {0, -1, 0}, {0, 1, 2} };

glm::mat3 m1 = a * b;

glm::mat3 m2 = b * a;

cout << to_string(m1) << endl;

cout << to_string(m2) << endl;

return 0;

}

# data[].attributes.body
// CMakeProject2.cpp : définit le point d'entrée de l'application.

//

#define GLM_ENABLE_EXPERIMENTAL

#define GLM_FORCE_SWIZZLE

#include "glm/gtx/string_cast.hpp"

#include "CMakeProject2.h"

#include "glm/glm.hpp"

#include <glm/gtc/constants.hpp>

int main()

{

glm::mat3 m1 = {1,1,-1,0,2,0,2,3,1};

glm::mat3 m2 = {1,0,0,0,-1,1,0,1,2};

glm::mat3 m3 = m1 * m2;

glm::mat3 m4 = m2 * m1;

std::cout << to_string(m3) << std::endl;

std::cout << to_string(m4) << std::endl;

return 0;

}

# data[].attributes.body
static void exo8()
{
	glm::mat3x3 A = { { 1, 1, -1 }, { 0, 2, 0 }, { 2, 3, 1 } };
	glm::mat3x3 B = { { 1, 0, 0 }, { 0, -1, 1 }, { 0, 1, 2 } };

	glm::mat3x3 AB = A * B;
	glm::mat3x3 BA = B * A;

	std::cout << "Exo8" << std::endl;
	std::cout << "A * B" << std::endl;
	std::cout << to_string(AB) << std::endl;
	std::cout << "B * A" << std::endl;
	std::cout << to_string(BA) << std::endl;
}

# data[].attributes.body
int main() {
    glm::mat3 ma = {{1, 1, -1}, {0, 2, 0}, {-1, 0, 1}};
    glm::mat3 mb = {{1, 0, 0}, {0, -1, 1}, {0, 1, 2}};

    std::cout << "a * b = " << to_string(ma * mb) << std::endl;
    std::cout << "b * a = " << to_string(mb * ma) << std::endl;

    return 0;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/gtc/constants.hpp>

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

//const float DEGREES_TO_RADIANS = 180.0 / glm::pi<float>();

int main() {

glm::mat3 m1 = { 1, 1, -1, 0, 2, 0, 2, 3, 1 };

glm::mat3 m2 = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

glm::mat3 m3 = m1 * m2;

glm::mat3 m4 = m2 * m1;

std::cout << "fst: " << glm::to_string(m3) << std::endl << "snd: " << glm::to_string(m4) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/gtx/string_cast.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

void main()

{

glm::mat3 A = {{1, 1, -1}, {0, 2, 0}, {2, 3, 1}};

glm::mat3 B = {{1, 0, 0}, {0, -1, 1}, {0, 1, 2}};

glm::mat3 AB = A * B;

glm::mat3 BA = B * A;

std::cout << "Result AB: " << to_string(AB) << std::endl;

std::cout << "Result BA: " << to_string(BA) << std::endl;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat3x2.hpp>

#include <iostream>

template<typename T>

void display(T x, const std::string& prefix = "") {

std::cout << prefix << glm::to_string(x) << std::endl;

}

int main(void) {

glm::mat3 a = { 1, 1, -1, 0, 2, 0, 2, 3, 1 };

glm::mat3 b = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

glm::mat3 ab = a * b;

glm::mat3 ba = b * a;

display(ab, "a * b = ");

display(ba, "b * a = ");

return 0;

}

# data[].attributes.body
#define GLM_FORCE_SWIZZLE

#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/mat2x2.hpp>

#include <glm/mat4x4.hpp>

#include <glm/mat3x3.hpp>

#include <glm/mat3x2.hpp>

static void matrixEx() {

glm::mat3 A = { 1, 1, -1, 0, 2, 0, 2, 3, 1 };

glm::mat3 B = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

glm::mat3 C = A * B;

glm::mat3 D = B * A;

std::cout << "A X B = " << to_string(C) << std::endl;

std::cout << "B X A = " << to_string(D) << std::endl;

}

int main() {

matrixEx();

return 0;

}

# data[].attributes.body
int main()

{

glm::mat3 a = { {1, 0, 2}, {1, 2, 3}, {-1, 0, 1} };

glm::mat3 b = { {1, 0, 0}, {0, -1, 1}, {0, 1, 2} };

std::cout << glm::to_string(a) << std::endl;

std::cout << glm::to_string(b) << std::endl;

glm::mat3 resAxB = a * b;

glm::mat3 resBxA = b * a;

std::cout << "resAxB : " << glm::to_string(resAxB) << std::endl;

std::cout << "resBxA : " << glm::to_string(resBxA) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_FORCE_SWIZZLE

#define GLM_ENABLE_EXPERIMENTAL

#include <glm/gtx/string_cast.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/glm.hpp>

#include <iostream>

int main()

{

glm::mat3 mA = {{1, 1, -1}, {0, 2, 0}, {2, 3, 1}};

glm::mat3 mB = {{1, 0, 0}, {0, -1, 1}, {0, 1, 2}};

glm::mat3 mC = mA * mB;

std::cout << "mA * mB = " << glm::to_string(mC) << std::endl;

glm::mat3 mD = mB * mA;

std::cout << "mB * mA = " << glm::to_string(mD) << std::endl;

}

# data[].attributes.body
#define GLM_FORCE_SWIZZLE

#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/mat3x3.hpp>

const double DEG_TO_RAD = glm::pi<double>() / 180.0;

const double RAD_TO_DEG = 180.0 / glm::pi<double>();

int main()

{

glm::mat3 a = { 1, 1, -1, 0, 2, 0, 2, 3, 1 };

glm::mat3 b = { 1, 0, 0, 0, -1, 1, 0, 1, 2 };

glm::mat3 c = a * b;

glm::mat3 d = b * a;

std::cout << "a * b = " << glm::to_string(c) << std::endl;

std::cout << "b * a = " << glm::to_string(d) << std::endl;

return 0;

}

# data[].attributes.body
#include <iostream>
#include <glm/gtx/string_cast.hpp>
#include <glm/mat4x4.hpp>
#include <glm/mat2x2.hpp>
#include <glm/mat3x2.hpp>

int main() {
	glm::mat3 A(1, 1, -1, 0, 2, 0, 2, 3, 1);
	glm::mat3 B(1, 0, 0, 0, -1, 1, 0, 1, 2);

	// A * B
	glm::mat3 C = A * B;

	// B * A
	glm::mat3 D = B * A;

	std::cout << "A * B: " << to_string(C) << std::endl;
	std::cout << "B * A: " << to_string(D) << std::endl;

	return 0;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL
    #include <glm/gtx/string_cast.hpp>
    #include <glm/glm.hpp>
#include <iostream>

int main()
{
    glm::mat3 matrix1(
		 1.f, 1.f, -1.f,
		 0.f, 2.f,  0.f,
		-1.f, 0.f,  1.f
    );
    glm::mat3 matrix2(
        1.f,  0.f, 0.f,
        0.f, -1.f, 1.f,
        0.f,  1.f, 2.f
    );
    glm::mat3 result1 = matrix1 * matrix2;
    glm::mat3 result2 = matrix2 * matrix1;

    std::cout << "A x B : " << glm::to_string(result1) << std::endl;
    std::cout << "B x A : " << glm::to_string(result2) << std::endl;
    return 0;
}