Main Page
Hardware Class Hierarchy
Hardware API
Mapping Class Hierarchy
Mapping API
fixedpoint.h File Reference
16.16 fixed point math functions.
More...
Go to the source code of this file.
Detailed Description
16.16 fixed point math functions.
This file contains the global function prototypes, macros, and numerical constants for the libfixed fixed point math library.
To use the functions defined in this file, include <68332/fixedpoint.h> and link libfixed.a.
Define Documentation
| #define DOUBLE_TO_FIXED |
( |
x |
|
) |
((long)((x) * 65536.0 + 0.5))
|
|
| #define FIXED_10 0xA0000L
|
|
| #define FIXED_1000 0x3E80000L
|
|
| #define FIXED_180 0xB40000L
|
|
| #define FIXED_2PI 411775L
|
|
| #define FIXED_90 0x5A0000L
|
|
| #define FIXED_DEGREE_CONVERSION 0x394C4AL
|
|
| #define FIXED_FOUR 0x40000L
|
|
| #define FIXED_MINUS_1 -65536L
|
|
| #define FIXED_ONE INT_TO_FIXED(1)
|
|
| #define FIXED_PIDIV2 102944L
|
|
| #define FIXED_PIDIV4 51472L
|
|
| #define FIXED_POINT_005 DOUBLE_TO_FIXED(0.005)
|
|
| #define FIXED_POINT_03 DOUBLE_TO_FIXED(0.03)
|
|
| #define FIXED_POINT_1 DOUBLE_TO_FIXED(0.1)
|
|
| #define FIXED_POINT_15 DOUBLE_TO_FIXED(0.15)
|
|
| #define FIXED_POINT_1_1 DOUBLE_TO_FIXED(1.1)
|
|
| #define FIXED_POINT_35 DOUBLE_TO_FIXED(0.35)
|
|
| #define FIXED_RADIAN_CONVERSION 0x478L
|
|
| #define FIXED_SQRT2 92682L
|
|
| #define FIXED_TO_DOUBLE |
( |
x |
|
) |
(((double)x) / 65536.0)
|
|
| #define FIXED_TO_INT |
( |
x |
|
) |
((x) >> 16)
|
|
| #define FIXED_TWO 0x20000L
|
|
| #define INT_TO_FIXED |
( |
x |
|
) |
((x) << 16)
|
|
| #define ROUND_FIXED_TO_INT |
( |
x |
|
) |
(((x) + 0x8000) >> 16)
|
|
Typedef Documentation
| typedef int32 FIXED_POINT
|
|
Function Documentation
|
|
Calculates the arctangent of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: The return value will be in the range of -FIXED_PI/2 to FIXED_PI/2
- Parameters:
-
- Returns:
- The arctangent of x in radians.
|
|
|
Calculates the cosine of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: The input will be transformed to within the range of -FIXED_PI to +FIXED_PI.
- Parameters:
-
| x | The input value in radians. |
- Returns:
- The cosine of x.
|
|
|
Divides a 16.16 fixed point dividend by a 16.16 fixed point divisor, returning a 16.16 fixed point quotient. Note: No checking for underflow is performed.
- Parameters:
-
| x | The dividend. |
| y | The divisor. |
- Returns:
- The quotient.
|
|
|
Calculates the base e exponential of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: No checking for overflow is performed.
- Parameters:
-
- Returns:
- The exponential result.
|
|
|
Calculates the base e logarithm of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: No checking for underflow is performed.
- Parameters:
-
- Returns:
- The logarithm result.
|
|
|
Multiplies two 16.16 fixed point numbers together, returning a 16.16 fixed point product. Note: No checking for overflow is performed.
- Parameters:
-
| x | The first multiplicand. |
| y | The second multiplicand. |
- Returns:
- The product.
|
|
|
Calculates the sine of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: The input will be transformed to within the range of -FIXED_PI to +FIXED_PI.
- Parameters:
-
| x | The input value in radians. |
- Returns:
- The sine of x.
|
|
|
Calculates the square root of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: No checking for underflow is performed.
- Parameters:
-
- Returns:
- The square root.
|
|
|
Calculates the tangent of a 16.16 fixed point number, returning a 16.16 fixed point result. Note: The input will be transformed to within the range of -FIXED_PI to +FIXED_PI. Note: The return value will be in the range of -32768.0 to 32767.999984741
- Parameters:
-
| x | The input value in radians. |
- Returns:
- The tangent of x.
|
Generated on Mon Oct 8 19:32:21 2007 for OOMRM Mapping API by
1.3