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

#include <glm/glm.hpp>

int main() {

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 normal = glm::cross(v1, v2);

glm::vec3 normalizedNormal = glm::normalize(normal);

std::cout << "(" << normalizedNormal.x << "," << normalizedNormal.y << "," << normalizedNormal.z << ")" << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/common.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/vec3.hpp>

#include <glm/geometric.hpp>

#include <glm/trigonometric.hpp>

#include <glm/gtx/string_cast.hpp>

#include <iostream>

int main()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 n = glm::normalize(glm::cross(v1, v2));

std::cout << "The normal vector is " << glm::to_string(n) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include "CMakeProject1.h"

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

using namespace std;


int main()
{
	constexpr double RADIANS_TO_DEGREES = 180.0 / glm::pi<float>();

	const glm::vec3 p1(3, 0, 0);
	const glm::vec3 p2(1.5, 0.86, 0);
	const glm::vec3 p3(3, 0, -1);

	const auto a = p2 - p1;
	const auto b = p3 - p1;

	const auto n = glm::normalize(glm::cross(a, b));

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

	return 0;
}

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

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5f, 0.86f, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 norm = glm::cross(glm::normalize(v1), glm::normalize(v2));

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

return 0;

}

# 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>

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::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 normal = glm::normalize(glm::cross(v1, v2));

std::cout << "Normal: " << glm::to_string(normal) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include "glm/glm.hpp"

#include "glm/gtc/constants.hpp"

#include "glm/gtx/string_cast.hpp"

int main()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p3 - p2;

glm::vec3 v2 = p1 - p2; // p2 -> p3 -> p1

glm::vec3 normal = glm::normalize(glm::cross(v1, v2));

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

return 0;

}

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

#define GLM_ENABLE_EXPERIMENTAL

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

int main(void) {
    glm::vec3 p1(3, 0, 0);
    glm::vec3 p2(1.5, 0.86, 0);
    glm::vec3 p3(3, 0, -1);

    glm::vec3 n = glm::normalize(glm::cross((p2 - p1), (p3 - p1)));

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

    return 0;
}

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

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

#define GLM_

int main()
{
	glm::vec3 p1(3, 0, 0);
	glm::vec3 p2(1.5f, 0.86f, 0);
	glm::vec3 p3(3, 0, -1);


	glm::vec3 normal = glm::normalize(glm::cross((p1 - p3), (p2 - p3)));

	std::cout << "Normal vector: " << glm::to_string(normal) << std::endl;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

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

int main() {

	glm::vec3 p1(3, 0, 0);
	glm::vec3 p2(1.5f, 0.86f, 0);
	glm::vec3 p3(3, 0, -1);

	glm::vec3 v1 = p2 - p1;
	glm::vec3 v2 = p3 - p1;
	glm::vec3 normal = glm::normalize(glm::cross(v1, v2));
	std::cout << "Normal: " << glm::to_string(normal) << std::endl;
	return 0;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/gtx/string_cast.hpp>

int main(void)

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

std::cout << "Result: " << glm::to_string(glm::normalize(glm::cross(v1, v2))) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

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

glm::vec3 calculateNormal(glm::vec3 p1, glm::vec3 p2, glm::vec3 p3)
{
	glm::vec3 v1 = p2 - p1;
	glm::vec3 v2 = p3 - p1;

	glm::vec3 normal = glm::cross(v1, v2);
	return glm::normalize(normal);
}

int main()
{
	glm::vec3 p1(3, 0, 0);
	glm::vec3 p2(1.5, 0.86, 0);
	glm::vec3 p3(3, 0, -1);

	glm::vec3 res = calculateNormal(p1, p2, p3);

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

	return 0;
}

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

glm::vec3 normalize(glm::vec3 p1, glm::vec3 p2, glm::vec3 p3) {
	glm::vec3 v1 = p2 - p1;
	glm::vec3 v2 = p3 - p1;
	return glm::normalize(glm::cross(v1, v2));
}

int main() {
	glm::vec3 p1(3, 0, 0);
	glm::vec3 p2(1.5, 0.86, 0);
	glm::vec3 p3(3, 0, -1);

	std::cout << "The normal is: " << glm::to_string(normalize(p1, p2, p3)) << std::endl;
	return 0;
}

# data[].attributes.body
glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 n = glm::cross(v1, v2);

n = glm::normalize(n);

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

# data[].attributes.body
int main() {
    glm::vec3 p1(3, 0, 0);
    glm::vec3 p2(1.5, 0.86, 0);
    glm::vec3 p3(3, 0, -1);

    glm::vec3 v1 = (p2-p1);
    glm::vec3 v2 = (p3-p1);

    std::cout << "normal  " << glm::to_string(glm::normalize(glm::cross(v1,v2))) << std::endl;

    return 0;
}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/gtc/constants.hpp>

#include <glm/gtx/string_cast.hpp>

#include <iostream>

static void triangleNormal()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 normal = glm::normalize(glm::cross(v1, v2));

std::cout << "normal = " << glm::to_string(normal);

}

int main()

{

triangleNormal();

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/gtx/string_cast.hpp>

int main() {

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 normal = glm::normalize(glm::cross(p2 - p1, p3 - p1));

std::cout << "Normal: " << glm::to_string(normal) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtc/constants.hpp>

#include <glm/gtx/string_cast.hpp>

void main()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

//p2 -> p3 -> p1

glm::vec3 v1F = p3 - p2;

glm::vec3 v2F = p1 - p2;

glm::vec3 normalF = glm::cross(v1F, v2F);

glm::vec3 n = glm::normalize(normalF);

std::cout << "Result for p2->p3->p1: " << glm::to_string(n) << std::endl;

//p3 -> p1 -> p2

glm::vec3 v1S = p1 - p3;

glm::vec3 v2S = p2 - p3;

glm::vec3 normalS = glm::cross(v1S, v2S);

glm::vec3 d = glm::normalize(normalS);

std::cout << "Result for p3->p1->p2: " << glm::to_string(d) << std::endl;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/glm.hpp>

#include <iostream>

#include <glm/gtx/string_cast.hpp>

int main(void)

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 normal = glm::normalize(glm::cross(v1, v2));

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

}

# data[].attributes.body
glm::vec3 PointSub(glm::vec3 b, glm::vec3 a) {

return (b - a);

}

glm::vec3 GetNormal(glm::vec3 p1, glm::vec3 p2, glm::vec3 p3) {

glm::vec3 v1 = PointSub(p1, p2);

glm::vec3 v2 = PointSub(p3, p2);

glm::vec3 normal = glm::normalize(glm::cross(v1, v2));

return normal;

}

int main() {

std::cout << glm::to_string(GetNormal(glm::vec3(1.5, 0.86, 0), glm::vec3(3, 0, 1), glm::vec3(3, 0, 0)));

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>

static void normVec() {

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 N = glm::normalize(glm::cross(v1, v2));

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

}

int main() {

normVec();

return 0;

}

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

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 n = glm::cross(v1, v2);

n = glm::normalize(n);

std::cout << "n: " << n.x << " " << n.y << " " << n.z << std::endl;

}

int main(void) {

ex3();

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>

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

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

int main()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 normal = glm::normalize(glm::cross(v1, v2));

std::cout << "Normal: " << glm::to_string(normal) << 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>

const constexpr float TEST = glm::pi<float>();

int main()

{

glm::vec3 p1{ 3, 0, 0 };

glm::vec3 p2{ 1.5, 0.86, 0 };

glm::vec3 p3{ 3, 0, -1 };

glm::vec3 v1{ p2 - p1 };

glm::vec3 v2{ p3 - p1 };

glm::vec3 cross_product{ glm::cross(v1, v2) };

glm::vec3 normalised{ glm::normalize(cross_product) };

std::cout << "normal vector: " << glm::to_string(normalised) << '\n';

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()

{

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

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

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1(1.5 - 3, 0.86 - 0, 0 - 0);

glm::vec3 v2(3 - 3, 0 - 0, -1 - 0);

glm::vec3 c = glm::cross(glm::normalize(v1), glm::normalize(v2));

std::cout << glm::to_string(c);

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <iostream>

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

int main()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v32 = p3 - p2;

glm::vec3 v12 = p1 - p2;

glm::vec3 normal = glm::normalize(glm::cross(v32, v12));

std::cout << glm::to_string(normal) << 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>

int main() {

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 norm = glm::normalize(glm::cross(p2 - p1, p3 - p1));

std::cout << "normal: " << glm::to_string(norm) << std::endl;

return 0;

}

# data[].attributes.body
#define GLM_ENABLE_EXPERIMENTAL

#include <glm/glm.hpp>

#include <glm/gtx/string_cast.hpp>

#include <glm/gtc/constants.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::vec3 p1(3.f, 0, 0);

glm::vec3 p2(1.5f, 0.86f, 0);

glm::vec3 p3(3.f, 0, -1.f);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p2;

display(glm::normalize(glm::cross(v1, v2)), "normal: ");

return 0;

}

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

int main() {
	glm::vec3 p1(3, 0, 0);
	glm::vec3 p2(1.5, 0.86, 0);
	glm::vec3 p3(3, 0, -1);

	glm::vec3 v1 = p1 - p2;
	glm::vec3 v2 = p1 - p3;

	glm::vec3 normal = glm::normalize(glm::cross(v1, v2));
	std::cout << glm::to_string(normal) << std::endl;
}

# data[].attributes.body
#include <glm/gtc/constants.hpp>
#include <glm/vec3.hpp>
#include <glm/glm.hpp>
#include "CMakeProject2.h"
#include <iostream>

void main() {
	glm::vec3 p1{ 3, 0, 0 };
	glm::vec3 p2{ 1.5f, 0.86f, 0 };
	glm::vec3 p3{ 3, 0, -1 };

	glm::vec3 v1 = p2 - p1;
	glm::vec3 v2 = p3 - p1;

	std::cout << glm::to_string(glm::normalize(glm::cross(v1, v2))) << std::endl;
}

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

int main() {
    glm::vec3 p1(3, 0, 0);
    glm::vec3 p2(1.5, 0.86, 0);
    glm::vec3 p3(3, 0, -1);

    glm::vec3 v1 = p2 - p1;
    glm::vec3 v2 = p3 - p1;

    glm::vec3 normal = glm::cross(v1, v2);

    glm::vec3 normalizedNormal = glm::normalize(normal);

    std::cout << "(" << normalizedNormal.x << ", " << normalizedNormal.y << ", " << normalizedNormal.z << ")" << std::endl;

    return 0;
}

# data[].attributes.body
#include "GameGraphicsCourses.h"

#include <glm/gtc/constants.hpp>

int main()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 normal = glm::cross(v1, v2);

normal = glm::normalize(normal);

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

return 0;

}

# data[].attributes.body
static void exo5()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 normalv(0, 0, 0);

glm::vec3 result(0, 0, 0);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

normalv = glm::cross(v1, v2);

normalv = glm::normalize(normalv);

std::cout << "Exo5" << std::endl;

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

}

# data[].attributes.body
glm::vec3 calc_triangle_normal(glm::vec3 p1, glm::vec3 p2, glm::vec3 p3) {
    glm::vec3 v1 = p2 - p1;
    glm::vec3 v2 = p3 - p1;

    return glm::normalize(glm::cross(v1, v2));
}


int main() {
    glm::vec3 p1(3, 0, 0);
    glm::vec3 p2(1.5f, 0.86f, 0);
    glm::vec3 p3(3, 0, -1);
    std::cout << glm::to_string(calc_triangle_normal(p1, p2, p3)) << std::endl;
}

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

#include <glm/glm.hpp>

# define GLM_ENABLE_EXPERIMENTAL

#include <glm/gtx/string_cast.hpp>

using namespace std;

int main()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 c = glm::cross(v1, v2);

glm::vec3 res = glm::normalize(c);

cout << glm::to_string(res) << endl;

return 0;

}

# data[].attributes.body
void calculateTriangleNormal()

{

glm::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5f, 0.86f, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 normal = glm::normalize(glm::cross(v1, v2));

std::cout << "Normal: " << glm::to_string(normal) << std::endl;

}

int main()

{

calculateTriangleNormal();

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::vec3 p1(3, 0, 0);
  glm::vec3 p2(1.5, 0.86, 0);
  glm::vec3 p3(3, 0, -1);

  glm::vec3 side1 = p2 - p1;
  glm::vec3 side2 = p3 - p1;

  glm::vec3 normal = glm::normalize(glm::cross(side1, side2));
  std::cout << "normal is " << glm::to_string(normal) << std::endl;
}

# 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::vec3 p1(3, 0, 0);

glm::vec3 p2(1.5, 0.86, 0);

glm::vec3 p3(3, 0, -1);

glm::vec3 v1 = p2 - p1;

glm::vec3 v2 = p3 - p1;

glm::vec3 normal = glm::normalize(glm::cross(v1, v2));

std::cout << "Normal: " << glm::to_string(normal) << std::endl;

}

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

glm::vec3 CalculateNormal(const glm::vec3& p0, const glm::vec3& p1, const glm::vec3& p2) {
	return glm::normalize(glm::cross(p1 - p0, p2 - p0));
}

int main() {
	glm::vec3 p0(3, 0, 0);
	glm::vec3 p1(1.5f, 0.86f, 0);
	glm::vec3 p2(3, 0, -1);

	glm::vec3 normal = CalculateNormal(p0, p1, p2);
	std::cout << "Normal: " << glm::to_string(normal) << std::endl;

	return 0;
}

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

glm::vec3 CalculateNormal(const glm::vec3 &p1, const glm::vec3 &p2, const glm::vec3 &p3)
{
    glm::vec3 v1 = p2 - p1;
    glm::vec3 v2 = p3 - p1;

    return glm::normalize(glm::cross(v1, v2));
}

int main()
{
    glm::vec3 p1(3.0f, 0.0f ,  0.f);
    glm::vec3 p2(1.5f, 0.86f,  0.f);
    glm::vec3 p3(3.0f, 0.0f , -1.f);

    glm::vec3 normal = CalculateNormal(p1, p2, p3);

    std::cout << "Normal of the triangle : " << glm::to_string(normal) << std::endl;
    return 0;
}