forked from theZiz/sparrow3d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sparrowMath.h
59 lines (45 loc) · 1.81 KB
/
sparrowMath.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
Alternatively, the contents of this file may be used under the terms
of the GNU Lesser General Public license (the "LGPL License"), in which case the
provisions of LGPL License are applicable instead of those
above.
For feedback and questions about my Files and Projects please mail me,
Alexander Matthes (Ziz) , zizsdl_at_googlemail.com
*/
#ifndef _SPARROW_MATH_H
#define _SPARROW_MATH_H
#include "sparrowDefines.h"
#ifdef SDL_INCLUDE_SUBDIR
#include <SDL/SDL.h>
#else
#include <SDL.h>
#endif
/* spInitMath initializes the fixed point look up tables for sin, cos, etc. */
PREFIX void spInitMath( void );
/* spSin calculates the sin of value*/
PREFIX Sint32 spSin( Sint32 value );
/* spCos calculates the cos of value*/
PREFIX Sint32 spCos( Sint32 value );
/* spTan calculates the cos of value*/
PREFIX Sint32 spTan( Sint32 value );
/* spAcos calculates the acos of value. For values smaller than -1 and bigger
* than 1, it returns 0. */
PREFIX Sint32 spAcos(Sint32 value);
/* spAcos calculates the asin of value. For values smaller than -1 and bigger
* than 1, it returns 0. */
PREFIX Sint32 spAsin(Sint32 value);
/* spSqrt fast square root*/
PREFIX Sint32 spSqrt ( Sint32 n );
/* spMin return the smallest of 2 numbers */
PREFIX Sint32 spMin( Sint32 a, Sint32 b );
/* spMax return the biggest of 2 numbers */
PREFIX Sint32 spMax( Sint32 a, Sint32 b );
#endif