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>
This commit is contained in:
Anton Lundin 2015-06-13 11:54:33 +02:00 committed by Dirk Hohndel
parent 9ec155fad0
commit 7a594e3ec5
4 changed files with 26 additions and 14 deletions

View file

@ -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;