5 #include "VectorMath.h"
15 LatLong(
double latitudeInRadians,
double longitudeInRadians)
16 : m_latitude(latitudeInRadians)
17 , m_longitude(longitudeInRadians)
22 inline double GetLatitude()
const {
return m_latitude; }
23 inline double GetLongitude()
const {
return m_longitude; }
25 inline void SetLatitude(
double latitude) { m_latitude = latitude; }
26 inline void SetLongitude(
double longitude) { m_longitude = longitude; }
28 inline double GetLatitudeInDegrees()
const {
return Eegeo::Math::Rad2Deg(m_latitude); }
29 inline double GetLongitudeInDegrees()
const {
return Eegeo::Math::Rad2Deg(m_longitude); }
32 double BearingToInRadians(
double latitude,
double longitude)
const;
33 double BearingToNorthPole()
const;
36 static LatLong FromDegrees(
double latitudeInDegrees,
double longitudeInDegrees);
37 static LatLong FromRadians(
double latitudeInRadians,
double longitudeInRadians);
47 LatLongAltitude(
double latitudeInRadians,
double longitudeInRadians,
double altitudeInMetres)
48 : m_latLong(latitudeInRadians, longitudeInRadians)
49 , m_altitude(altitudeInMetres)
54 inline LatLong GetLatLong()
const {
return m_latLong; }
56 inline double GetAltitude()
const {
return m_altitude; }
57 inline void SetAltitude(
double altitude) { m_altitude = altitude; }
59 inline double GetLatitude()
const {
return m_latLong.GetLatitude(); }
60 inline double GetLongitude()
const {
return m_latLong.GetLongitude(); }
62 inline void SetLatitude(
double latitude) { m_latLong.SetLatitude(latitude); }
63 inline void SetLongitude(
double longitude) { m_latLong.SetLongitude(longitude); }
65 inline double GetLatitudeInDegrees()
const {
return m_latLong.GetLatitudeInDegrees(); }
66 inline double GetLongitudeInDegrees()
const {
return m_latLong.GetLongitudeInDegrees(); }
69 double BearingToInRadians(
double latitude,
double longitude)
const;
70 double BearingToNorthPole()
const;
72 static LatLongAltitude FromDegrees(
double latitudeInDegrees,
double longitudeInDegrees,
double altitudeInMetres);
73 static LatLongAltitude FromRadians(
double latitudeInRadians,
double longitudeInRadians,
double altitudeInMetres);
83 inline double SignedArea(
const std::vector<Eegeo::Space::LatLongAltitude>& points)
87 for (
int i=0; i<points.size()-1; ++i)
89 a += points.at(i).GetLongitude() * points.at(i+1).GetLatitude();
90 b += points.at(i).GetLatitude() * points.at(i+1).GetLongitude();