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


Ignore:
Timestamp:
Aug 29, 2010, 3:45:01 PM (14 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncutils.cpp

    r2556 r2582  
    249249}
    250250
     251// North, East, Up Components -> Rectangular Coordinates
     252////////////////////////////////////////////////////////////////////////////
     253void neu2xyz(const double* Ell, const double* neu, double* xyz) {
     254
     255  double sinPhi = sin(Ell[0]);
     256  double cosPhi = cos(Ell[0]);
     257  double sinLam = sin(Ell[1]);
     258  double cosLam = cos(Ell[1]);
     259
     260  xyz[0] = - sinPhi*cosLam * neu[0]
     261           - sinLam        * neu[1]
     262           + cosPhi*cosLam * neu[2];
     263
     264  xyz[1] = - sinPhi*sinLam * neu[0]
     265           + cosLam        * neu[1]
     266           + cosPhi*sinLam * neu[2];
     267
     268  xyz[2] = + cosPhi        * neu[0]
     269           + sinPhi        * neu[2];
     270}
     271
    251272// Fourth order Runge-Kutta numerical integrator for ODEs
    252273////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.