]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - tools/quake2/qdata_heretic2/qcommon/angles.h
8e8934461f3d809cd2607ace5215f4306f71954e
[xonotic/netradiant.git] / tools / quake2 / qdata_heretic2 / qcommon / angles.h
1 /*
2    Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3    For a list of contributors, see the accompanying CONTRIBUTORS file.
4
5    This file is part of GtkRadiant.
6
7    GtkRadiant is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11
12    GtkRadiant is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with GtkRadiant; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21
22 // Angles in radians
23
24 #define ANGLE_0         0.0F
25 #define ANGLE_1         0.017453292F
26 #define ANGLE_5         0.087266462F
27 #define ANGLE_10        0.174532925F
28 #define ANGLE_15        0.261799387F
29 #define ANGLE_20        0.392699081F
30 #define ANGLE_30        0.523598775F
31 #define ANGLE_45        0.785398163F
32 #define ANGLE_60        1.047197551F
33 #define ANGLE_72        1.256637061F
34 #define ANGLE_90        1.570796327F
35 #define ANGLE_120       2.094395102F
36 #define ANGLE_135       2.35619449F
37 #define ANGLE_144       2.513274123F
38 #define ANGLE_180       3.141592653F
39 #define ANGLE_225       3.926990817F
40 #define ANGLE_270       4.71238898F
41 #define ANGLE_315       5.497787144F
42 #define ANGLE_360       6.283185307F
43
44 // Angles in degrees
45
46 #define DEGREE_0        0.0F
47 #define DEGREE_180      180.0F
48 #define DEGREE_45       ( DEGREE_180 / 4.0F )
49 #define DEGREE_90       ( DEGREE_180 / 2.0F )
50 #define DEGREE_135      ( DEGREE_90 + DEGREE_45 )
51 #define DEGREE_270      ( DEGREE_180 + DEGREE_90 )
52 #define DEGREE_360      ( DEGREE_180 * 2.0F )
53
54 #define DEGREE_225      ( DEGREE_180 + DEGREE_45 )
55 #define DEGREE_315      ( DEGREE_270 + DEGREE_45 )
56
57 #define DEGREE_30       ( DEGREE_180 / 6.0F )
58 #define DEGREE_60       ( DEGREE_180 / 3.0F )
59 #define DEGREE_120      ( DEGREE_360 / 3.0F )
60
61 #define DEGREE_1        ( DEGREE_180 / 180.0F )
62 #define DEGREE_5        ( DEGREE_180 / 36.0F )
63 #define DEGREE_10       ( DEGREE_180 / 18.0F )
64 #define DEGREE_15       ( DEGREE_180 / 12.0F )
65 #define DEGREE_20       ( DEGREE_180 / 8.0F )
66
67 // Conversion routines
68
69 #define ANGLE_TO_RAD    ANGLE_1
70 #define RAD_TO_ANGLE    ( 180.0F / ANGLE_180 )
71
72 #define SHORT_TO_ANGLE  ( 360.0 / 65536 )
73
74
75 #pragma warning(disable : 4305)     // 'initializing' : truncation from 'const double ' to 'float '