aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-03 03:49:37 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-05-03 03:49:37 +0200
commitbdcbb4816251b726f37c995880d1517196fb822b (patch)
treeaf79f5e689003e32a41de297a07f4954ec9a9c8c
parent9f7a92bc44141aa0884782d38d240c3a126234a4 (diff)
downloadAsciiMap-bdcbb4816251b726f37c995880d1517196fb822b.tar.gz
Rectified my infinite stupidity
-rw-r--r--m.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/m.c b/m.c
index 86fb968..c8d3a23 100644
--- a/m.c
+++ b/m.c
@@ -16,6 +16,7 @@ uint8_t avg(int argc, uint8_t *argv)
float distance(uint8_t _1[3], uint8_t _2[3])
{
- return fabs(sqrt( pow((double)_1[0], 2) + pow((double)_1[1],2) + pow((double)_1[2],2) )
- - sqrt( pow((double)_2[0], 2) + pow((double)_2[1],2) + pow((double)_2[2],2) ) );
+ return fabs( sqrt( pow((double)_2[0] - (double)_1[0], 2) +
+ pow((double)_2[1] - (double)_1[1], 2) +
+ pow((double)_2[2] - (double)_1[2], 2) ) );
}