| 2 | #include <cassert> |
| 3 | |
| 4 | void |
| 5 | vec3_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 | } |
no test coverage detected