X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_Lambert93.cxx;h=88390eb872a75824bad42173679c1521b955a1a4;hb=ad8562bab9992101430a6327aa7ca06c71f6d084;hp=504eab764b89d5bf1a41452834b9b648d01186ee;hpb=d6c292cb8fd69d63c5295d32870e54d8aac352fc;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_Lambert93.cxx b/src/HYDROData/HYDROData_Lambert93.cxx index 504eab76..88390eb8 100755 --- a/src/HYDROData/HYDROData_Lambert93.cxx +++ b/src/HYDROData/HYDROData_Lambert93.cxx @@ -332,3 +332,53 @@ void HYDROData_Lambert93::toGeo( double theX, double theY, } +void HYDROData_Lambert93::DMSToDeg( int theDeg, + int theMin, + double theSec, + double& theDegOut ) +{ + double aCoef = theDeg > 0 ? 1.0 : -1.0; + + theDegOut = (double)theDeg; + theDegOut += aCoef * ( (double)theMin ) / 60.0; + theDegOut += aCoef * theSec / 3600.0; +} + +void HYDROData_Lambert93::DMSToSec( int theDeg, + int theMin, + double theSec, + double& theSecOut ) +{ + double aCoef = theDeg > 0 ? 1.0 : -1.0; + + theSecOut = theDeg * 3600.0; + theSecOut += aCoef * theMin * 60.0; + theSecOut += aCoef * theSec; +} + +void HYDROData_Lambert93::degToDMS( double theDegIn, + int& theDeg, + int& theMin, + double& theSec ) +{ + theDeg = int( theDegIn ); + + double aRemainder = fabs( theDegIn - theDeg ) * 60.0; + theMin = int( aRemainder ); + + aRemainder = ( aRemainder - theMin ) * 60.0; + theSec = aRemainder; +} + +void HYDROData_Lambert93::secToDMS( double theSecIn, + int& theDeg, + int& theMin, + double& theSec ) +{ + theDeg = int( theSecIn / 3600.0 ); + + double aRemainder = fabs( theSecIn - theDeg * 3600.0 ); + theMin = int( aRemainder / 60.0 ); + + theSec = fabs( aRemainder - theMin * 60.0 ); +}