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