aboutsummaryrefslogtreecommitdiff
path: root/redist/linmath.c
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-04-01 07:29:19 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-04-01 15:37:48 -0600
commit558429f4d01462edb606fe51d592e9f9e3889425 (patch)
tree64178fe671438928a47f9dd96570d5ff9c4c8f9f /redist/linmath.c
parent2a5a0bde0fa45f86b1fcfbfd50bb779f25337573 (diff)
downloadlibsurvive-558429f4d01462edb606fe51d592e9f9e3889425.tar.gz
libsurvive-558429f4d01462edb606fe51d592e9f9e3889425.tar.bz2
Added distance function to linmath
Diffstat (limited to 'redist/linmath.c')
-rw-r--r--redist/linmath.c5
1 files changed, 5 insertions, 0 deletions
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];