main.cpp
1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* main.cpp :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* By: gychoi <gychoi@student.42seoul.kr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* Created: 2023/08/02 17:45:27 by gychoi #+# #+# */ 9 /* Updated: 2023/08/04 04:00:07 by gychoi ### ########.fr */ 10 /* */ 11 /* ************************************************************************** */ 12 13 #include "Point.hpp" 14 15 static void _printPoint(std::string const name, Point const& point) 16 { 17 std::cout << name<< "(" << point.getX() << ", " << point.getY() << ")" << std::endl; 18 } 19 20 int main(void) 21 { 22 Point a(0, 42.42); 23 Point b(42.42, 0); 24 Point c(0, 0); 25 _printPoint("a", a); 26 _printPoint("b", b); 27 _printPoint("c", c); 28 std::cout << "----------" << std::endl; 29 Point p1(4.2, 4.2); 30 _printPoint("p1", p1); 31 std::cout << bsp(a, b, c, p1) << std::endl; 32 Point p2(10, 10); 33 _printPoint("p2", p2); 34 std::cout << bsp(a, b, c, p2) << std::endl; 35 Point p3(1000, 1000); 36 _printPoint("p3", p3); 37 std::cout << bsp(a, b, c, p3) << std::endl; 38 Point p4(0, 21.42); 39 _printPoint("p4", p4); 40 std::cout << bsp(a, b, c, p4) << std::endl; 41 Point p5(-0.01, -0.01); 42 _printPoint("p5", p5); 43 std::cout << bsp(a, b, c, p5) << std::endl; 44 Point p6(0.01, 42.42); 45 _printPoint("p6", p6); 46 std::cout << bsp(a, b, c, p6) << std::endl; 47 Point p7(42.42, 0.01); 48 _printPoint("p7", p7); 49 std::cout << bsp(a, b, c, p7) << std::endl; 50 Point p8(0, 42.42); 51 _printPoint("p8", p8); 52 std::cout << bsp(a, b, c, p8) << std::endl; 53 Point p9(42.42, 0); 54 _printPoint("p9", p9); 55 std::cout << bsp(a, b, c, p9) << std::endl; 56 Point p10(0, 0); 57 _printPoint("p10", p10); 58 std::cout << bsp(a, b, c, p10) << std::endl; 59 Point p11(-1, -1); 60 _printPoint("p11", p11); 61 std::cout << bsp(a, b, c, p11) << std::endl; 62 Point p12(40, 2); 63 _printPoint("p12", p12); 64 std::cout << bsp(a, b, c, p12) << std::endl; 65 Point p13(2, 40); 66 _printPoint("p13", p13); 67 std::cout << bsp(a, b, c, p13) << std::endl; 68 Point p14(14.14, 14.14); 69 _printPoint("p14", p14); 70 std::cout << bsp(a, b, c, p14) << std::endl; 71 return 0; 72 }