diff options
Diffstat (limited to 'vec.h')
-rw-r--r-- | vec.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -71,6 +71,11 @@ struct vec3 { } } + // Squared module + T mod2() const { + return x * x + y * y + z * z; + } + vec3 unit_vec() const { return *this * (1.0 / norm()); } |