]>
Commit | Line | Data |
---|---|---|
39eefe19 | 1 | // -*- mode: C++ -*- |
97e94238 | 2 | /* Copyright (C) 2007 Christian Holm Christensen <cholm@nbi.dk> |
3 | * | |
4 | * This library is free software; you can redistribute it and/or | |
5 | * modify it under the terms of the GNU Lesser General Public License | |
6 | * as published by the Free Software Foundation; either version 2.1 of | |
7 | * the License, or (at your option) any later version. | |
8 | * | |
9 | * This library is distributed in the hope that it will be useful, but | |
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | * Lesser General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU Lesser General Public | |
15 | * License along with this library; if not, write to the Free Software | |
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 | |
17 | * USA | |
18 | */ | |
19 | #ifndef ALIFMDFLOWUTIL_H | |
20 | #define ALIFMDFLOWUTIL_H | |
39eefe19 | 21 | #include <cmath> |
22 | #ifndef M_PI | |
23 | # define M_PI 3.14159265358979323846264338327 | |
24 | #endif | |
25 | ||
26 | /** @defgroup u_utils Utilities | |
27 | @brief Group of utility classes and functions */ | |
28 | //__________________________________________________________________ | |
29 | /** Normalize the angle @a ang to the interval @f$ [0,2\pi)@f$ | |
30 | @ingroup u_utils | |
31 | @param ang Angle to normalize | |
32 | @return the normalised angle */ | |
33 | inline Double_t | |
34 | NormalizeAngle(Double_t ang) | |
35 | { | |
36 | while (ang < 0) ang += 2 * M_PI; | |
37 | while (ang >= 2*M_PI) ang -= 2 * M_PI; | |
38 | return ang; | |
39 | } | |
40 | ||
41 | #endif | |
42 | //____________________________________________________________________ | |
43 | // | |
44 | // EOF | |
45 | // | |
46 |