]> git.mxchange.org Git - simgear.git/blobdiff - simgear/math/SGMisc.hxx
Ignore generated binaries.
[simgear.git] / simgear / math / SGMisc.hxx
index b6671f8434fbfedb20a9b253a1c63a3af7b6cfcb..b8ba7e8d9c764b45d6d0daa4d9206105d24b6be6 100644 (file)
@@ -1,3 +1,21 @@
+// Copyright (C) 2006  Mathias Froehlich - Mathias.Froehlich@web.de
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Library General Public
+// License as published by the Free Software Foundation; either
+// version 2 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
+// Library General Public License for more details.
+//
+// You should have received a copy of the GNU Library 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.
+//
+
 #ifndef SGMisc_H
 #define SGMisc_H
 
@@ -29,6 +47,11 @@ public:
       return 0;
   }
 
+  static T rad2deg(const T& val)
+  { return val*180/pi(); }
+  static T deg2rad(const T& val)
+  { return val*pi()/180; }
+
 #ifndef NDEBUG
   /// Returns true if v is a NaN value
   /// Use with care: allways code that you do not need to use that!