-
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
#include <HYDROData_Lambert93.h>
}
+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 );
+}