| 31 | #include <geode/tests/common.hpp> |
| 32 | |
| 33 | void 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 | |
| 46 | void test_dot_perpendicular() |
| 47 | { |