Changeset 7244 in ntrip for trunk/BNC/src/bncutils.cpp


Ignore:
Timestamp:
Aug 20, 2015, 1:37:05 PM (9 years ago)
Author:
stuerze
Message:

method for transformation of rectangular coordinates into geocentric coordinates is added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncutils.cpp

    r7228 r7244  
    409409}
    410410
     411// Rectangular Coordinates -> Geocentric Coordinates
     412////////////////////////////////////////////////////////////////////////////
     413void xyz2geoc(const double* XYZ, double* Geoc) {
     414
     415  const double bell = t_CST::aell*(1.0-1.0/t_CST::fInv) ;
     416  const double e2   = (t_CST::aell*t_CST::aell-bell*bell)/(t_CST::aell*t_CST::aell) ;
     417
     418  double Ell[3];
     419  xyz2ell(XYZ, Ell);
     420
     421  double rho = sqrt(XYZ[0]*XYZ[0]+XYZ[1]*XYZ[1]+XYZ[2]*XYZ[2]);
     422  double Rn = t_CST::aell/sqrt(1-(e2)*pow(sin(Ell[0]),2));
     423
     424  Geoc[0] = atan((1-e2 * Rn/(Rn + Ell[2])) * tan(Ell[0]));
     425  Geoc[1] = Ell[1];
     426  Geoc[2] = rho-t_CST::rgeoc;
     427}
     428
    411429//
    412430////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.