![]() |
VR-Link API Documentation for DIS
|
00001 /******************************************************************************* 00002 ** Copyright (c) 1992-2010 VT MAK 00003 ** All rights reserved. 00004 *******************************************************************************/ 00009 #pragma once 00010 00011 #include "geodCoord.h" 00012 00013 #ifdef DtUSE_UTILITIES_NAMESPACE 00014 namespace DtUSE_UTILITIES_NAMESPACE 00015 { 00016 #endif 00017 00024 inline void DtGocentricToMgFlatEarth(const DtVector& in, DtVector& out, const DtFloat64 &refLat, DtFloat64 &refLon ) const 00025 { 00026 const double theMultigenFlatEarthRadius = 6366707.02; 00027 DtGeodeticCoord geodeticPosition; 00028 00029 geodeticPosition.setGeocentric(in); 00030 double lat = DtRad2Deg(geodeticPosition.lat()); 00031 double lon = DtRad2Deg(geodeticPosition.lon()); 00032 00033 out.setY(((lat - DtRad2Deg(refLat)) * 00034 (theMultigenFlatEarthRadius * M_PI)) / 180.0); 00035 00036 out.setX(((lon - DtRad2Deg(refLon)) * 00037 (theMultigenFlatEarthRadius * M_PI * cos(refLat))) / 180.0); 00038 00039 out.setZ(geodeticPosition.alt()); 00040 } 00041 00042 #ifdef DtUSE_UTILITIES_NAMESPACE 00043 } 00044 #endif