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

Function test_length

tests/geometry/test-vector.cpp:30–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#include <geode/tests/common.hpp>
29
30void test_length()
31{
32 const geode::Vector3D p{ { 1, 2, 4 } };
33 geode::OpenGeodeGeometryException::test(
34 p.length() == std::sqrt( 1 + 4 + 16 ), "Wrong vector length" );
35
36 const auto p_normalized = p.normalize();
37 geode::OpenGeodeGeometryException::test(
38 p_normalized.length() == 1, "Wrong vector length" );
39}
40
41void test_operations()
42{

Callers 1

testFunction · 0.70

Calls 3

normalizeMethod · 0.80
testFunction · 0.70
lengthMethod · 0.45

Tested by

no test coverage detected