Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TEST(Polygons, Triangles){
- Polygon p1 = {3, new Point[3]{{1,1},{2,2},{1,2}}};
- Polygon p2 = {3, new Point[3]{{0,0},{3,3},{0,3}}};
- ASSERT_EQ(true, p1.isInsideOf(p2));
- ASSERT_EQ(false, p2.isInsideOf(p1));
- p1 = {3, new Point[3]{{1,1},{2,2},{1,2}}};
- p2 = {3, new Point[3]{{10,10},{11,11},{10,11}}};
- ASSERT_EQ(false, p1.isInsideOf(p2));
- ASSERT_EQ(false, p2.isInsideOf(p1));
- ASSERT_EQ(true, p1.isInsideOf(p1));
- ASSERT_EQ(true, p2.isInsideOf(p2));
- }
- TEST(Polygons, Others){
- Polygon p1 = {1, new Point[1]{{1,1}}};
- Polygon p2 = {4, new Point[4]{{0,0},{2,0},{2,2},{0,2}}};
- ASSERT_EQ(true, p1.isInsideOf(p2));
- ASSERT_EQ(false, p2.isInsideOf(p1));
- p1 = {4, new Point[4]{{0,0},{1,0},{1,1},{0,1}}};
- p2 = {4, new Point[4]{{0,0},{2,0},{2,2},{0,2}}};
- ASSERT_EQ(true, p1.isInsideOf(p2));
- ASSERT_EQ(false, p2.isInsideOf(p1));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement