MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/Imath / vec3_example

Function vec3_example

website/examples/Vec3.cpp:4–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include <cassert>
3
4void
5vec3_example ()
6{
7 Imath::V3f a (1.0f, 2.0f, 3.0f);
8 Imath::V3f b; // b is uninitialized
9
10 b.x = a[0];
11 b.y = a[1];
12 b.z = a[2];
13
14 assert (a == b);
15
16 assert (a.length () == sqrt (a ^ a));
17
18 a.normalize ();
19 assert (Imath::equalWithAbsError (a.length (), 1.0f, 1e-6f));
20}

Callers 1

mainFunction · 0.85

Calls 2

sqrtFunction · 0.85
equalWithAbsErrorFunction · 0.50

Tested by

no test coverage detected