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

Function test_length

bindings/python/tests/geometry/test-py-vector.py:34–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32
33
34def test_length():
35 p = geom.Vector3D([1, 2, 4])
36 if p.length() != math.sqrt(1 + 4 + 16):
37 raise ValueError("[Test] Wrong vector length")
38
39 p_normalized = p.normalize()
40 if p_normalized.length() != 1:
41 raise ValueError("[Test] Wrong vector length")
42
43
44def test_operations():

Callers 1

test-py-vector.pyFile · 0.70

Calls 2

normalizeMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected