VR-Link API Documentation for HLA 1.3
mgFlatEartTranslation.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 "geodCoord.h"
12 
13 #ifdef DtUSE_UTILITIES_NAMESPACE
14 namespace DtUSE_UTILITIES_NAMESPACE
15 {
16 #endif
17 
24 inline void DtGocentricToMgFlatEarth(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

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)