|
#define | angleToDegrees(angle) ((angle) * 360 / DEGREES_IN_CIRCLE) |
| Converts an angle in the format used by libnds in the 360 degree format.
|
|
#define | DEGREES_IN_CIRCLE (1 << 15) |
| Number of degrees in a circle.
|
|
#define | degreesToAngle(degrees) ((degrees) * DEGREES_IN_CIRCLE / 360) |
| Convert an angle in 360 degree format to the format used by libnds.
|
|
#define | fixedToFloat(n, bits) (((float)(n)) / (float)(1 << (bits))) |
| Converts a fixed point number to a floating point number.
|
|
#define | fixedToInt(n, bits) ((int)((n) >> (bits))) |
| Convert a fixed point number to an integer.
|
|
#define | floatToFixed(n, bits) ((int)((n) * (float)(1 << (bits)))) |
| Converts a floating point number to a fixed point number.
|
|
#define | floorFixed(n, bits) ((int)((n) & ~(((1 << (bits)) - 1)))) |
| Removes the decimal part of a fixed point number.
|
|
#define | intToFixed(n, bits) ((int)((n) << (bits))) |
| Converts an integer to a fixed point number.
|
|
Fixed point trig functions. Angle can be in the range of -32768 to.
- There are 32768 degrees in the unit circle used by nds. To convert between standard degrees (360 per circle):
#define degreesToAngle(degrees)
Convert an angle in 360 degree format to the format used by libnds.
Definition trig_lut.h:98
or
angle = angleInDegrees * 32768 / 360;
This unit of measure is sometimes refered to as a binary radian (brad) or binary degree. It allows for more precise representation of angle and faster calculation as the DS has no floating point processor.