Pyrogenesis trunk
Functions
Fixed.cpp File Reference
#include "precompiled.h"
#include "Fixed.h"
#include "ps/CStr.h"
#include <sstream>
Include dependency graph for Fixed.cpp:

Functions

CFixed_15_16 atan2_approx (CFixed_15_16 y, CFixed_15_16 x)
 Inaccurate approximation of atan2 over fixed-point numbers. More...
 
void sincos_approx (CFixed_15_16 a, CFixed_15_16 &sin_out, CFixed_15_16 &cos_out)
 Compute sin(a) and cos(a). More...
 

Function Documentation

◆ atan2_approx()

CFixed_15_16 atan2_approx ( CFixed_15_16  y,
CFixed_15_16  x 
)

Inaccurate approximation of atan2 over fixed-point numbers.

Maximum error is almost 0.08 radians (4.5 degrees).

◆ sincos_approx()

void sincos_approx ( CFixed_15_16  a,
CFixed_15_16 sin_out,
CFixed_15_16 cos_out 
)

Compute sin(a) and cos(a).

Maximum error for -2pi < a < 2pi is almost 0.0005.