KallistiOS  2.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Macros | Functions
fmath.h File Reference

Inline functions for the DC's special math instructions. More...

#include <sys/cdefs.h>
#include <arch/types.h>

Go to the source code of this file.

Macros

#define F_PI   3.1415926f

Functions

float fipr (float x, float y, float z, float w, float a, float b, float c, float d)
float fipr_magnitude_sqr (float x, float y, float z, float w)
 Floating point inner product w/self (square of vector magnitude)
float fsin (float r)
 Floating point sine.
float fcos (float r)
 Floating point cosine.
float ftan (float r)
 Floating point tangent.
float fisin (int d)
 Integer sine.
float ficos (int d)
 Integer cosine.
float fitan (int d)
 Integer tangent.
float fsqrt (float f)
 Floating point square root.
float frsqrt (float f)

Detailed Description

Inline functions for the DC's special math instructions.

Author:
Andrew Kieschnick

Macro Definition Documentation

#define F_PI   3.1415926f

PI constant (if you don't want full math.h)


Function Documentation

float fcos ( float  r)
inline

Floating point cosine.

Parameters:
ra floating point number between 0 and 2*PI
Returns:
cos(r), where r is [0..2*PI]
float ficos ( int  d)
inline

Integer cosine.

Parameters:
dan integer between 0 and 65535
Returns:
cos(d), where d is [0..65535]
float fipr ( float  x,
float  y,
float  z,
float  w,
float  a,
float  b,
float  c,
float  d 
)
inline
Returns:
v1 dot v2 (inner product)
float fipr_magnitude_sqr ( float  x,
float  y,
float  z,
float  w 
)
inline

Floating point inner product w/self (square of vector magnitude)

Returns:
v1 dot v1 (square of magnitude)
float fisin ( int  d)
inline

Integer sine.

Parameters:
dan integer between 0 and 65535
Returns:
sin(d), where d is [0..65535]
float fitan ( int  d)
inline

Integer tangent.

Parameters:
dan integer between 0 and 65535
Returns:
tan(d), where d is [0..65535]
float frsqrt ( float  f)
inline
Returns:
1.0f / sqrt(f)
float fsin ( float  r)
inline

Floating point sine.

Parameters:
ra floating point number between 0 and 2*PI
Returns:
sin(r), where r is [0..2*PI]
float fsqrt ( float  f)
inline

Floating point square root.

Returns:
sqrt(f)
float ftan ( float  r)
inline

Floating point tangent.

Parameters:
ra floating point number between 0 and 2*PI
Returns:
tan(r), where r is [0..2*PI]