Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

Fxp_trig.c File Reference

Fixed-point trigenometry tables and routines. More...

#include <stdio.h>
#include <math.h>
#include "Fxp.h"

Include dependency graph for Fxp_trig.c:

Include dependency graph

Go to the source code of this file.

Defines

#define TABLE_SIZE   2048
 # of elements in trig tables

#define TABLEPOS_TO_ANGLE(n)   ((Afxp)((AFXP_MAX*n)/TABLE_SIZE))
 Converts a table-index to an angle.

#define ANGLE_TO_TABLEPOS(a)   (((TABLE_SIZE*(int)a)/AFXP_MAX)%TABLE_SIZE)
 Converts an angle to a table pos.

#define AVERAGE(x, y)   ((x+y)/2)
 Returns average of two values.


Functions

int FindInTable (Sfxp val, int min, int max, const Sfxp table[TABLE_SIZE])
 Binary search for specified area, sorted in increasing order.

int FXP_DumpTrig (const char *fname)
 Prints contents of trig tables to a C file.


Variables

const Sfxp __SIN_TABLE []
 Table of sin values vs angle.

const Sfxp __COS_TABLE []
 Table of cos values vs angle.

const Sfxp __TAN_TABLE []
 Table of tan values vs angle.


Detailed Description

Definition in file Fxp_trig.c.


Generated on Sat Oct 11 13:19:27 2003 for Spritelib by doxygen 1.3.4