]>
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 | |
85a60ebd | 27 | @brief Group of utility classes and functions |
28 | @ingroup FMD_flow | |
29 | */ | |
39eefe19 | 30 | //__________________________________________________________________ |
31 | /** Normalize the angle @a ang to the interval @f$ [0,2\pi)@f$ | |
32 | @ingroup u_utils | |
33 | @param ang Angle to normalize | |
34 | @return the normalised angle */ | |
35 | inline Double_t | |
36 | NormalizeAngle(Double_t ang) | |
37 | { | |
38 | while (ang < 0) ang += 2 * M_PI; | |
39 | while (ang >= 2*M_PI) ang -= 2 * M_PI; | |
40 | return ang; | |
41 | } | |
42 | ||
43 | #endif | |
44 | //____________________________________________________________________ | |
45 | // | |
46 | // EOF | |
47 | // | |
48 |