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

Function test_operations

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

Source from the content-addressed store, hash-verified

39}
40
41void test_operations()
42{
43 const geode::Vector3D unit{ { 0, 2, 0 } };
44 const geode::Vector3D p{ { 1, 2, 4 } };
45 geode::OpenGeodeGeometryException::test(
46 p.dot( unit ) == 4, "Wrong dot product" );
47
48 const auto cross_unit =
49 geode::Vector3D{ { 1, 0, 0 } }.cross( geode::Vector3D{ { 0, 1, 0 } } );
50 const geode::Vector3D answer_unit{ { 0, 0, 1 } };
51 geode::OpenGeodeGeometryException::test(
52 cross_unit == answer_unit, "Wrong unit cross product" );
53
54 const geode::Vector3D answer{ { -8, 0, 2 } };
55 geode::OpenGeodeGeometryException::test(
56 p.cross( unit ) == answer, "Wrong cross product" );
57}
58
59void test()
60{

Callers 1

testFunction · 0.70

Calls 3

dotMethod · 0.80
crossMethod · 0.80
testFunction · 0.70

Tested by

no test coverage detected