From 558429f4d01462edb606fe51d592e9f9e3889425 Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Sun, 1 Apr 2018 07:29:19 -0600 Subject: Added distance function to linmath --- redist/linmath.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'redist/linmath.c') diff --git a/redist/linmath.c b/redist/linmath.c index c57410f..01ae2b0 100644 --- a/redist/linmath.c +++ b/redist/linmath.c @@ -63,6 +63,11 @@ void copy3d(FLT *out, const FLT *in) { } FLT magnitude3d(const FLT *a) { return FLT_SQRT(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); } +FLT dist3d(const FLT *a, const FLT *b) { + LinmathPoint3d tmp; + sub3d(tmp, a, b); + return magnitude3d(tmp); +} FLT anglebetween3d(FLT *a, FLT *b) { FLT an[3]; -- cgit v1.2.3