EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GaMath.h
Go to the documentation of this file.
1 /*
2  This file is part of the Gangsta Wrapper physics SDK abstraction library suite.
3  Copyright (C) 2005 Ed Jones (Green Eyed Monster)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 
19  See also the files README.txt and LICENSE.txt in the root directory of this module.
20 */
21 #ifndef GAMATH_H
22 #define GAMATH_H
23 
24 #include "GaPreReqs.h"
25 
26 namespace Ga
27 {
28  class Math
29  {
30  public:
31  static const GaExport GaFloat GaPi;
34  static const GaExport GaFloat GaEpsilon;
35  static const GaExport GaFloat GaMinFloat;
36  static const GaExport GaFloat GaMaxFloat;
37 
38 #ifdef GANGSTA_DOUBLE
39  static inline GaFloat squareRoot(GaFloat f){return sqrt(f);}
40  static inline GaFloat arcCosine(const GaFloat &r){return acos(r);}
41  static inline GaFloat arcTangent(const GaFloat &r){return atan(r);}
42  static inline GaFloat arcTangent(const GaFloat &x, const GaFloat &y){return atan2(x,y);}
43  static inline GaFloat cosine(const GaFloat &r){return cos(r);}
44  static inline GaFloat sine(const GaFloat &r){return sin(r);}
45  static inline GaFloat absolute(GaFloat f){return fabs(f);}
46 #else
47  static inline GaFloat squareRoot(GaFloat f){return sqrtf(f);}
48  static inline GaFloat arcCosine(const GaFloat &r){return acosf(r);}
49  static inline GaFloat cosine(const GaFloat &r){return cosf(r);}
50  static inline GaFloat sine(const GaFloat &r){return sinf(r);}
51  static inline GaFloat absolute(GaFloat f){return fabs(f);}
52 #endif
53  };
54 }
55 
56 #endif
static GaFloat arcTangent(const GaFloat &x, const GaFloat &y)
Definition: GaMath.h:42
static GaFloat arcCosine(const GaFloat &r)
Definition: GaMath.h:40
static const GaExport GaFloat GaPi
Definition: GaMath.h:31
itemID[count] Create count or of the specified() x() y(z)-Jump to the specified position in space.Stopped." ) COMMAND( translocate
static const GaExport GaFloat GaMinFloat
Definition: GaMath.h:35
static const GaExport GaFloat GaEpsilon
Definition: GaMath.h:34
Definition: GaMath.h:26
static GaFloat arcTangent(const GaFloat &r)
Definition: GaMath.h:41
static GaFloat squareRoot(GaFloat f)
Definition: GaMath.h:39
static const GaExport GaFloat GaDegreesInRadian
Definition: GaMath.h:32
static GaFloat sine(const GaFloat &r)
Definition: GaMath.h:44
static const GaExport GaFloat GaMaxFloat
Definition: GaMath.h:36
static GaFloat absolute(GaFloat f)
Definition: GaMath.h:45
double GaFloat
Definition: GaPreReqs.h:69
static const GaExport GaFloat GaRadianInDegree
Definition: GaMath.h:33
#define GaExport
Definition: GaPreReqs.h:57
static GaFloat cosine(const GaFloat &r)
Definition: GaMath.h:43