MCPcopy Create free account
hub / github.com/Geode-solutions/OpenGeode / test_line

Function test_line

tests/geometry/test-basic-objects.cpp:83–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83void test_line()
84{
85 const auto direction = geode::Vector2D{ { 1.0, 5.0 } }.normalize();
86 const geode::Point2D origin{ { -1.0, -5.0 } };
87 const geode::InfiniteLine2D line{ direction, origin };
88
89 geode::InfiniteLine2D line2{ line };
90 geode::OpenGeodeGeometryException::test(
91 line2.direction() == direction && line2.origin() == origin,
92 "Wrong result for line2" );
93
94 geode::InfiniteLine2D line3{ std::move( line ) };
95 geode::OpenGeodeGeometryException::test(
96 line3.direction() == direction && line3.origin() == origin,
97 "Wrong result for line3" );
98
99 const auto direction2 = geode::Vector2D{ { -1.0, -5.0 } }.normalize();
100 const geode::Point2D origin2{ { 1.0, 5.0 } };
101 geode::InfiniteLine2D line4{ direction2, origin2 };
102 line4 = line2;
103 geode::OpenGeodeGeometryException::test(
104 line4.direction() == direction && line4.origin() == origin,
105 "Wrong result for line4" );
106
107 geode::InfiniteLine2D line5{ direction2, origin2 };
108 line5 = std::move( line2 );
109 geode::OpenGeodeGeometryException::test(
110 line5.direction() == direction && line5.origin() == origin,
111 "Wrong result for line5" );
112}
113
114void test_plane()
115{

Callers 1

testFunction · 0.85

Calls 3

normalizeMethod · 0.80
testFunction · 0.70
directionMethod · 0.45

Tested by

no test coverage detected