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

Function test_perpendicular

tests/geometry/test-perpendicular.cpp:33–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#include <geode/tests/common.hpp>
32
33void test_perpendicular()
34{
35 geode::Vector2D v{ { 1.578, 1e-10 } };
36 const auto perp = geode::perpendicular( v ).normalize();
37
38 const auto dot_product =
39 v.value( 0 ) * perp.value( 0 ) + v.value( 1 ) * perp.value( 1 );
40
41 geode::OpenGeodeGeometryException::test(
42 perp.length() == 1 && dot_product == 0.,
43 "Wrong result for normalized_perpendicular" );
44}
45
46void test_dot_perpendicular()
47{

Callers 1

testFunction · 0.70

Calls 5

perpendicularFunction · 0.85
normalizeMethod · 0.80
testFunction · 0.70
valueMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected