feat(ex03): it works

This commit is contained in:
Khaïs COLIN 2025-05-15 10:55:59 +02:00
parent 6f17e2e888
commit b4f48cdfb0
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
8 changed files with 322 additions and 0 deletions

17
ex03/main.cpp Normal file
View file

@ -0,0 +1,17 @@
#include "Point.hpp"
static void assert_bsp(Point a, Point b, Point c, Point p, bool expected) {
bool result = bsp(a, b, c, p);
std::cout << "a: " << a << "\tb: " << b << "\tc: " << c << "\tp: " << p;
std::cout << "\tresult: " << result << " expected: " << expected << std::endl;
if (result != expected)
throw 0;
}
int main(void) {
assert_bsp(Point(0, 0), Point(20, 0), Point(10, 30), Point(10, 15), true);
assert_bsp(Point(0, 0), Point(0, 0), Point(0, 0), Point(0, 0), false);
assert_bsp(Point(0, 0), Point(20, 0), Point(30, 0), Point(15, 0), false);
assert_bsp(Point(0, 0), Point(20, 0), Point(30, 10), Point(15, 10.1f), false);
return 0;
}