2009-02-04 15:25:03 +00:00
|
|
|
/****************************************************/
|
|
|
|
/* TRIGO.H : Tables de fonctions trigonometriques */
|
|
|
|
/* utilisees dans les rotations d'axes */
|
|
|
|
/****************************************************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#ifndef TRIGO_H
|
|
|
|
#define TRIGO_H
|
|
|
|
|
|
|
|
|
2007-08-08 20:51:08 +00:00
|
|
|
/* Prototype des fonctions de trigo.cpp */
|
2009-02-04 15:25:03 +00:00
|
|
|
void RotatePoint( int *pX, int *pY, int angle );
|
|
|
|
void RotatePoint( int *pX, int *pY, int cx, int cy, int angle );
|
|
|
|
void RotatePoint( wxPoint* point, int angle );
|
|
|
|
void RotatePoint( wxPoint *point, const wxPoint & centre, int angle );
|
|
|
|
void RotatePoint( double *pX, double *pY, int angle );
|
|
|
|
void RotatePoint( double *pX, double *pY, double cx, double cy, int angle );
|
|
|
|
int ArcTangente( int dy, int dx );
|
|
|
|
/* Retourne l'arc tangente en 0.1 degres du vecteur de coord dx, dy
|
|
|
|
entre -1800 et 1800
|
|
|
|
Analogue a atan2 ( mais plus rapide pour les caculs si
|
|
|
|
l'angle est souvent 0, -1800, ou +- 900 */
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2007-08-08 20:51:08 +00:00
|
|
|
bool DistanceTest( int seuil, int dx, int dy, int spot_cX, int spot_cY );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
/*******************/
|
|
|
|
/* Macro NEW_COORD */
|
|
|
|
/*******************/
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
/* Macro de calcul de novelles coordonnees par rotation d'axe
|
2009-02-04 15:25:03 +00:00
|
|
|
coord : xrot = y*sin + x*cos
|
|
|
|
yrot = y*cos - x*sin
|
|
|
|
soit : xrot = (y*tg + x)*cos
|
|
|
|
yrot = (y - x*tg)*cos
|
2007-06-05 12:10:51 +00:00
|
|
|
|
2009-02-04 15:25:03 +00:00
|
|
|
les coeffs COS sont tabules en fct de tg sur 16 valeurs.
|
2007-06-05 12:10:51 +00:00
|
|
|
*/
|
2009-02-04 15:25:03 +00:00
|
|
|
#define NEW_COORD( x0, y0 ) \
|
|
|
|
do { \
|
|
|
|
int itmp; \
|
|
|
|
itmp = x0; \
|
|
|
|
x0 = x0 + (int)( y0 * tg ); \
|
|
|
|
y0 = y0 - (int)( itmp * tg ); \
|
|
|
|
x0 = ( x0 * cosinus ) >> 8; \
|
|
|
|
y0 = ( y0 * cosinus ) >> 8; \
|
|
|
|
} while( 0 );
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
|
2009-05-21 17:42:42 +00:00
|
|
|
extern double fsinus[];
|
|
|
|
extern double fcosinus[];
|
2007-06-05 12:10:51 +00:00
|
|
|
|
|
|
|
#endif
|