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