math.h File Reference
hardware coprocessor math instructions.
More...
#include "nds/ndstypes.h"
Detailed Description
hardware coprocessor math instructions.
Function Documentation
static void crossf32 |
( |
int32 * |
a, |
|
|
int32 * |
b, |
|
|
int32 * |
result | |
|
) |
| | [inline, static] |
1.19.12 fixed point cross product function result = AxB
- Parameters:
-
| a | pointer to fixed 3x3 matrix |
| b | pointer to fixed 3x3 matrix |
| result | pointer to fixed 3x3 matrix Cross product x = Ay * Bz - By * Az y = Az * Bx - Bz * Ax z = Ax * By - Bx * Ay |
integer divide
- Parameters:
-
| num | numerator |
| den | denominator |
- Returns:
- returns 32 bit integer result
integer 64 bit divide
- Parameters:
-
| num | 64 bit numerator |
| den | 32 bit denominator |
- Returns:
- returns 32 bit integer result
Fixed point divide.
- Parameters:
-
| num | Takes 20.12 numerator. |
| den | Takes 20.12 denominator. |
- Returns:
- returns 20.12 result.
1.19.12 fixed point dot product function result = A dot B
- Parameters:
-
| a | pointer to fixed 3x3 matrix |
| b | pointer to fixed 3x3 matrix |
- Returns:
- 32 bit integer result Dot Product result = Ax * Bx + Ay * By + Az * Bz
integer modulous
- Parameters:
-
| num | numerator |
| den | denominator |
- Returns:
- returns 32 bit integer remainder
integer 64 bit modulous
- Parameters:
-
| num | 64 bit numerator |
| den | 32 bit denominator |
- Returns:
- returns 32 bit integer remainder
Fixed point multiply.
- Parameters:
-
| a | Takes 20.12 |
| b | Takes 20.12 |
- Returns:
- returns 20.12 result
static void normalizef32 |
( |
int32 * |
a |
) |
[inline, static] |
1.19.12 fixed point normalize function A = A / |A|
- Parameters:
-
| a | pointer to fixed 3x3 matrix Normalize Ax = Ax / mag Ay = Ay / mag Az = Az / mag |
static u32 sqrt32 |
( |
int |
a |
) |
[inline, static] |
integer sqrt
- Parameters:
-
| a | 32 bit integer argument |
- Returns:
- returns 32 bit integer result
static u32 sqrt64 |
( |
long long |
a |
) |
[inline, static] |
integer sqrt
- Parameters:
-
| a | 64 bit integer argument |
- Returns:
- returns 32 bit integer result
Fixed point sqrt.
- Parameters:
-
- Returns:
- returns 20.12 result