1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#ifndef _TRIGTABLE_H_
#define _TRIGTABLE_H_
#include <math.h>
#include "defs.h"
double tsqr( const double r );
double tsqrt( const double q );
long int tcube( const long int c );
double fsqr( double r );
double fcube( double r );
double dist( int x1, int y1, int x2, int y2 );
double zdist( int x, int y, int x1, int y1 );
long int area( int x1, int y1, int x2, int y2, int x3, int y3 );
bool prect( int px1, int py1, int x1, int y1, int x2, int y2 );
bool ptriangle( int tx1, int ty1, int tx2, int ty2, int tx3, int ty3, int x1, int y1 );
// int sarctan( const double tr );
// int barctan( const double tr );
int lineIntersect( int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy, int *ix, int *iy );
int gang( int x1, int y1, int x2, int y2 );
int getAngle( int x1, int y1, int x2, int y2 );
int arcsine( double x );
// void set_trig();
inline double Tcos( double x ){
return cos( x * Util::PI / 180.0 );
}
inline double Tsine( double x ){
return -sin( x * Util::PI / 180.0 );
}
inline double Rsine( double x ){
return sin( x * Util::PI / 180.0 );
}
inline double Tcos( int x ){
return Tcos( (double)x );
}
inline double Tsine( int x ){
return Tsine( (double)x );
}
inline double Rsine( int x ){
return Rsine( (double)x );
}
/*
extern double tcos[360];
extern double tsine[360];
extern double rsine[360];
extern double ttan[360];
*/
#endif
|