gwnavruntime/kernel/SF_Math.h Source File

SF_Math.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 /**************************************************************************
8 
9 PublicHeader: Kernel
10 Filename : KY_Math.h
11 Content : Math inline functions and macro definitions
12 Created : July 7, 2005
13 Authors : Michael Antonov, Maxim Shemanarev
14 
15 **************************************************************************/
16 
17 #ifndef INC_KY_Kernel_Math_H
18 #define INC_KY_Kernel_Math_H
19 
21 
22 #include <math.h>
23 #include <stdlib.h>
24 
25 
26 // *** Useful math constants
27 
28 #define KY_MATH_EPSILON 1.0e-12 // epsilon
29 #define KY_MATH_E 2.7182818284590452354 // e
30 #define KY_MATH_LOG2E 1.4426950408889634074 // log_2 e
31 #define KY_MATH_LOG10E 0.43429448190325182765 // log_10 e
32 #define KY_MATH_LN2 0.69314718055994530942 // log_e 2
33 #define KY_MATH_LN10 2.30258509299404568402 // log_e 10
34 #define KY_MATH_PI 3.14159265358979323846 // pi
35 #define KY_MATH_PI_2 1.57079632679489661923 // pi/2
36 #define KY_MATH_PI_3 1.04719755119659774615 // pi/3
37 #define KY_MATH_PI_4 0.78539816339744830962 // pi/4
38 #define KY_MATH_1_PI 0.31830988618379067154 // 1/pi
39 #define KY_MATH_2_PI 0.63661977236758134308 // 2/pi
40 #define KY_MATH_2_SQRTPI 1.12837916709551257390 // 2/sqrt(pi)
41 #define KY_MATH_SQRT2 1.41421356237309504880 // sqrt(2)
42 #define KY_MATH_SQRT1_2 0.70710678118654752440 // 1/sqrt(2)
43 #define KY_MATH_DEGTORAD 0.01745329251994329577 // pi/180
44 #define KY_MATH_TAN_PI_8 0.41421356237309504880 // tan(pi/8)
45 #define KY_MATH_SIN_PI_4 0.70710678118654752440 // sin(pi/4)
46 
47 // Degrees to Radians
48 #define KY_DEGTORAD(d) ((d) * KY_MATH_PI / 180.0)
49 #define KY_RADTODEG(r) ((r) * 180.0 / KY_MATH_PI)
50 
51 #endif // INC_KY_Kernel_Math_H