mirror of
https://github.com/jhasse/poly2tri.git
synced 2025-08-03 05:45:39 +02:00
Add new function Triangle::CircumcicleContains
This commit is contained in:
15
unittest/TriangleTest.cpp
Normal file
15
unittest/TriangleTest.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <poly2tri/common/shapes.h>
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TriangleTest)
|
||||
{
|
||||
p2t::Point a(0, 0);
|
||||
p2t::Point b(1, 0);
|
||||
p2t::Point c(0.5, .5);
|
||||
p2t::Triangle triangle(a, b, c);
|
||||
BOOST_CHECK(triangle.Contains(&a));
|
||||
BOOST_CHECK(triangle.Contains(&b));
|
||||
BOOST_CHECK(triangle.Contains(&c));
|
||||
BOOST_CHECK(triangle.CircumcicleContains(p2t::Point(0.5, 0.1)));
|
||||
BOOST_CHECK(!triangle.CircumcicleContains(p2t::Point(1, 0.4)));
|
||||
}
|
Reference in New Issue
Block a user