GDAL
ogr_geo_utils.h
1/******************************************************************************
2 * $Id$
3 *
4 * Project: X-Plane aeronautical data reader
5 * Purpose: Definition of geo-computation functions
6 * Author: Even Rouault, even dot rouault at spatialys.com
7 *
8 ******************************************************************************
9 * Copyright (c) 2008, Even Rouault <even dot rouault at spatialys.com>
10 *
11 * SPDX-License-Identifier: MIT
12 ****************************************************************************/
13
14#ifndef OGR_GEO_UTILS_H_INCLUDED
15#define OGR_GEO_UTILS_H_INCLUDED
16
17#include "cpl_port.h"
18
28// Such that OGR_GREATCIRCLE_DEFAULT_RADIUS * M_PI * 2 == 360 * 60.0 * 1852.0
29// that is that one degree == 60 nautical miles
30constexpr double OGR_GREATCIRCLE_DEFAULT_RADIUS = 6366707.01949370746;
31
32double OGR_GreatCircle_Distance(double dfLatA_deg, double dfLonA_deg,
33 double dfLatB_deg, double dfLonB_deg,
34 double dfRadius);
35
36double OGR_GreatCircle_InitialHeading(double dfLatA_deg, double dfLonA_deg,
37 double dfLatB_deg, double dfLonB_deg);
38
39/* such as ExtendPosition(A, Distance(A,B), InitialHeading(A,B)) ~= B */
40int CPL_DLL OGR_GreatCircle_ExtendPosition(double dfLatA_deg, double dfLonA_deg,
41 double dfDistance,
42 double dfHeadingInA, double dfRadius,
43 double *pdfLatB_deg,
44 double *pdfLonB_deg);
45
46#endif /* ndef OGR_GEO_UTILS_H_INCLUDED */
Core portability definitions for CPL.