summaryrefslogtreecommitdiffstats
path: root/units.h
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2015-06-13 11:54:33 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-13 21:08:11 -0700
commit7a594e3ec5e66f30a1604d492f3bb1af1259afd7 (patch)
treeb0fb86b70ad06b5386db0518d1d70df07c54bfe3 /units.h
parent9ec155fad05d53aaac42c7a8b9460b7eb6a0c803 (diff)
downloadsubsurface-7a594e3ec5e66f30a1604d492f3bb1af1259afd7.tar.gz
Simplify distance calculations
This simplifies the distance calculations and removes a dependency. This version uses propper math instead of my to simple previous version. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'units.h')
-rw-r--r--units.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/units.h b/units.h
index 90d7949b0..0baf2ffa5 100644
--- a/units.h
+++ b/units.h
@@ -119,6 +119,11 @@ typedef struct
int udeg;
} degrees_t;
+static inline double udeg_to_radians(int udeg)
+{
+ return (udeg * M_PI) / (1000000.0 * 180.0);
+}
+
static inline double grams_to_lbs(int grams)
{
return grams / 453.6;