MEPP2 Project
degree_rad_conversion.h
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as
6 // published by the Free Software Foundation; either version 3 of
7 // the License, or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 #pragma once
12 
13 #include <cmath> // M_PI
14 
15 
16 namespace FEVV {
17 namespace Math {
18 
19 template< typename T >
20 inline T deg2rad(T deg)
21 {
22  return static_cast< T >(deg * (M_PI / 180.f));
23 }
24 
25 template< typename T >
26 inline T rad2deg(T rad)
27 {
28  return static_cast< T >(rad * (180.f / M_PI));
29 }
30 
31 } // namespace Math
32 } // namespace FEVV
FEVV::Math::deg2rad
T deg2rad(T deg)
Definition: degree_rad_conversion.h:20
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::Math::rad2deg
T rad2deg(T rad)
Definition: degree_rad_conversion.h:26