diff options
Diffstat (limited to 'linalg.h')
-rw-r--r-- | linalg.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |