summaryrefslogtreecommitdiff
path: root/src/linalg.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/linalg.h')
-rw-r--r--src/linalg.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/linalg.h b/src/linalg.h
index 593aa9d..fe6b1b2 100644
--- a/src/linalg.h
+++ b/src/linalg.h
@@ -113,4 +113,9 @@ __device__ __host__ float norm(const float3 &a)
return sqrtf(dot(a,a));
}
+__device__ __host__ float3 normalize(const float3 &a)
+{
+ return a/norm(a);
+}
+
#endif