VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
geocentricToMgFlatEarth.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *******************************************************************************/
9 #pragma once
10 
11 #include "geodeticCoord.h"
12 
13 #ifdef DtUSE_UTILITIES_NAMESPACE
14 namespace DtUSE_UTILITIES_NAMESPACE
15 {
16 #endif
17 
24 inline void DtGeocentricToMgFlatEarth(const DtVector& in, DtVector& out, const DtFloat64 &refLat, DtFloat64 &refLon ) const
25 {
26  const double theMultigenFlatEarthRadius = 6366707.02;
27  DtGeodeticCoord geodeticPosition;
28 
29  geodeticPosition.setGeocentric(in);
30  double lat = DtRad2Deg(geodeticPosition.lat());
31  double lon = DtRad2Deg(geodeticPosition.lon());
32 
33  out.setY(((lat - DtRad2Deg(refLat)) *
34  (theMultigenFlatEarthRadius * M_PI)) / 180.0);
35 
36  out.setX(((lon - DtRad2Deg(refLon)) *
37  (theMultigenFlatEarthRadius * M_PI * cos(refLat))) / 180.0);
38 
39  out.setZ(geodeticPosition.alt());
40 }
41 
42 #ifdef DtUSE_UTILITIES_NAMESPACE
43 }
44 #endif
virtual DtFloat64 alt() const
Definition: geodeticCoord.h:100
double DtRad2Deg(double rad)
Converts Radians to Degrees.
Definition: vlMath.h:81
virtual DtGeodeticCoord & setGeocentric(const DtVector &geocentric)
Set from geocentric coordinate (convert geocentric to geodetic).
void setX(const T &x)
gets/sets the x component of a Vector
This file provides a definition of GeodeticCoords and several helper functions.
Instances of DtGeodeticCoord are used to explicitly represent Geodetic coordinates.
Definition: geodeticCoord.h:29
Definition: vlVector.h:224
void setZ(const T &z)
gets/sets the z component of a Vector
void setY(const T &y)
gets/sets the y component of a Vector
#define M_PI
Definition: vlMath.h:58
void DtGeocentricToMgFlatEarth(const DtVector &in, DtVector &out, const DtFloat64 &refLat, DtFloat64 &refLon) const
Preforms Multigen Flat Earth transforms from Geocentric Coordinates.
Definition: geocentricToMgFlatEarth.h:24
virtual DtFloat64 lat() const
Definition: geodeticCoord.h:90
virtual DtFloat64 lon() const
Definition: geodeticCoord.h:95

Document ID: Generated on Tue Feb 2 21:02:17 EST 2021 from SVN revision 223668
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)