Changeset 2065 in ntrip for trunk/BNC/bncutils.cpp


Ignore:
Timestamp:
Dec 1, 2009, 2:13:03 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncutils.cpp

    r2063 r2065  
    222222  return failure;
    223223}
     224
     225// Rectangular Coordinates -> North, East, Up Components
     226////////////////////////////////////////////////////////////////////////////
     227void xyz2neu(const double* Ell, const double* xyz, double* neu) {
     228
     229  double sinPhi = sin(Ell[0]);
     230  double cosPhi = cos(Ell[0]);
     231  double sinLam = sin(Ell[1]);
     232  double cosLam = cos(Ell[1]);
     233
     234  neu[0] = - sinPhi*cosLam * xyz[0]
     235           - sinPhi*sinLam * xyz[1]
     236           + cosPhi        * xyz[2];
     237
     238  neu[1] = - sinLam * xyz[0]
     239           + cosLam * xyz[1];
     240
     241  neu[2] = + cosPhi*cosLam * xyz[0]
     242           + cosPhi*sinLam * xyz[1]
     243           + sinPhi        * xyz[2];
     244}
Note: See TracChangeset for help on using the changeset viewer.