From 4e2720ff56afff978acaf589218cee0122d2ae29 Mon Sep 17 00:00:00 2001 From: Anthony LaTorre Date: Fri, 6 May 2011 12:06:58 -0400 Subject: added rotations --- linalg.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linalg.h') diff --git a/linalg.h b/linalg.h index 698b6f5..8362ab1 100644 --- a/linalg.h +++ b/linalg.h @@ -98,4 +98,9 @@ __device__ __host__ float dot(const float3 &a, const float3 &b) return a.x*b.x + a.y*b.y + a.z*b.z; } +__device__ __host__ float3 cross(const float3 &a, const float3 &b) +{ + return make_float3(a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x); +} + #endif -- cgit