Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::geography::lonlat Struct Reference

#include <quetzal/geography/coordinates.hpp>

Detailed Description

Geographic coordinates.

Geographic coordinates (longitude and latitude) in decimal degree.

Public Types

using decimal_degree = double
 

Public Member Functions

constexpr lonlat (decimal_degree longitude, decimal_degree latitude) noexcept
 Constructor.
 
template<class T >
constexpr mp_units::quantity< mp_units::si::metre > great_circle_distance_to (const T &other) const noexcept
 Compute great-circle distance between two points on the Earth.
 

Public Attributes

decimal_degree lon
 Longitude.
 
decimal_degree lat
 Latitude.
 

Member Function Documentation

◆ great_circle_distance_to()

template<class T >
constexpr mp_units::quantity< mp_units::si::metre > quetzal::geography::lonlat::great_circle_distance_to ( const T &  other) const
inlineconstexprnoexcept

Compute great-circle distance between two points on the Earth.

Compute the great circle distance (in kilometers) from this point to an other coordinate.

Remarks
Implementation follows a direct translation of Haversine formula.
Template Parameters
TEither quetzal::geography::latlon or quetzal::geography::lonlat
Parameters
otherthe other coordinate
Returns
the distance in kilometers
Invariant
The returned distance is not negative.

The documentation for this struct was generated from the following file: