mappix/geo-dist.h

66 lines
1.6 KiB
C

/*
*
* geo-dist
*
* Copyright (C) 2006 Nils Faerber <nils.faerber@kernelconcepts.de>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#ifndef _GEO_DIST_H
#define _GEO_DIST_H
#ifdef __cplusplus
extern "C"
{
#endif
/*
* Calculate distances on Earth surface given geographic locations
*/
typedef enum {
WGS84,
NAD27,
International,
Krasovsky,
Bessel,
WGS72,
WGS66,
FAIsphere
} EllipsoidType;
/* nautical in kilometer */
#define NAUTICAL_MILE 1.852
/*
* glat1, glat2: geodetic latitude in radians, N positive
* glon1, glon2: geodetic longitude in radians E positive
* Coordinates in radians means
* 50°50.32N ^= 50 degree, 50 minutes and 32 seconds
* ^= 50 + (50 / 60) + (32 / 3600)
* ^= 50.84222
*
* returns: distance in nm (nautical miles), factor of 1.852 gives km
*/
double dist_ell(double, double, double, double, EllipsoidType);
#ifdef __cplusplus
}
#endif
#endif /* _GEO_DIST_H */