From 3e3148b6f81f41fb4bea0ecd5f3e1b4aacf2ce6a Mon Sep 17 00:00:00 2001 From: Francois Henrotte <francois.henrotte@ulg.ac.be> Date: Mon, 4 Mar 2013 14:24:11 +0000 Subject: [PATCH] added SVector3.unit() --- Geo/SVector3.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Geo/SVector3.h b/Geo/SVector3.h index f58a069cf0..8e36d65777 100644 --- a/Geo/SVector3.h +++ b/Geo/SVector3.h @@ -35,6 +35,7 @@ class SVector3 { double n = norm(); if(n){ P[0] /= n; P[1] /= n; P[2] /= n; } return n; } + SVector3 unit() const{ SVector3 y(*this); y.normalize(); return y; } void negate() { P[0] = -P[0]; P[1] = -P[1]; P[2] = -P[2]; } // why both [] and (), why not double &operator[](int i){ return P[i]; } -- GitLab