avr/modules_avr/asserv/eirbot/vect2/vect2.h File Reference

gestion de vecteurs en 2 dimensions More...

#include <utils/utils.h>
#include <math.h>

Go to the source code of this file.

Data Structures

struct  vect2_cart
struct  vect2_pol
union  vect2
struct  rep2_ortho_angle

Defines

#define VECT2_ANGLE_K2PI_PRES   1
#define VECT2_CARTESIEN   0
#define VECT2_POLAIRE   2
#define REP2_ORTHO_ANGLE   1

Typedefs

typedef double vect2_distance
typedef double vect2_angle_absolu
typedef double vect2_angle_relatif
typedef double vect2_angle
typedef vect2_cart vect2_cart
typedef vect2_pol vect2_pol
typedef vect2 vect2
typedef rep2_ortho_angle rep2_ortho_angle
typedef rep2_ortho_angle rep2

Functions

void vect2_mod1_angle (vect2_angle *dest, vect2_angle_absolu angle_max)
void vect2_mod2_angle (vect2_angle *dest, vect2_angle_absolu angle_max)
void vect2_2pol (vect2 *dest, vect2_angle_absolu angle_max)
void vect2_2cart (vect2 *dest, vect2_angle_absolu angle_max)
void vect2_2type (u08 type, vect2 *dest, vect2_angle_absolu angle_max)
void vect2_add (vect2 *dest, vect2 *src, vect2_angle_absolu angle_max)
void vect2_sub (vect2 *dest, vect2 *src, vect2_angle_absolu angle_max)
void vect2_homotetie (vect2_distance rapport, vect2 *dest)
void vect2_angle_to_rep (vect2_angle_absolu *angle, rep2 *repere)
void vect2_angle_from_rep (vect2_angle_absolu *angle, rep2 *repere)
void vect2_vect_to_rep (vect2 *dest, rep2 *repere)
void vect2_vect_from_rep (vect2 *dest, rep2 *repere)
void vect2_point_to_rep (vect2 *dest, rep2 *repere)
void vect2_point_from_rep (vect2 *dest, rep2 *repere)


Detailed Description

gestion de vecteurs en 2 dimensions

Test:
en debug, avec le module positionnement
tout est referencé par rapport au repere unité orthonormé direct Les reperes sont pour le moment uniquement orthonormés directs pour chaque repere on definit une echelle, une origine et un angle un pointeur de repere NULL signifie repere unité

On peut faire des operations suivantes:

les vecteurs et les points sont declares tous deus comme "vect" leur differences resident uniquement dans l'utilisation on peut par ex faire une addition vectorielle d un point (qui peut etre finalement represente par un vecteur et une origine) avec un vecteur, ce qui donnera un nouveau point.

Definition in file vect2.h.


Define Documentation

#define REP2_ORTHO_ANGLE   1
 

Definition at line 115 of file vect2.h.

#define VECT2_ANGLE_K2PI_PRES   1
 

Definition at line 65 of file vect2.h.

#define VECT2_CARTESIEN   0
 

Definition at line 67 of file vect2.h.

Referenced by __trajectory_gotoxy(), pos_aller_a(), shot_angle(), shot_angle2(), and trajectory_gotoa_fromxy().

#define VECT2_POLAIRE   2
 

Definition at line 68 of file vect2.h.

Referenced by pos_position_manage(), vect2_2cart(), vect2_2pol(), vect2_2type(), and vect2_homotetie().


Typedef Documentation

typedef rep2_ortho_angle rep2
 

Definition at line 139 of file vect2.h.

typedef struct rep2_ortho_angle rep2_ortho_angle
 

Definition at line 137 of file vect2.h.

typedef union vect2 vect2
 

Definition at line 111 of file vect2.h.

typedef double vect2_angle
 

Definition at line 61 of file vect2.h.

typedef double vect2_angle_absolu
 

Definition at line 59 of file vect2.h.

typedef double vect2_angle_relatif
 

Definition at line 60 of file vect2.h.

typedef struct vect2_cart vect2_cart
 

Definition at line 77 of file vect2.h.

typedef double vect2_distance
 

Definition at line 58 of file vect2.h.

typedef struct vect2_pol vect2_pol
 

Definition at line 86 of file vect2.h.


Function Documentation

void vect2_2cart vect2 dest,
vect2_angle_absolu  angle_max
 

le meme en cartésien

Definition at line 101 of file vect2.c.

References VECT2_POLAIRE.

Referenced by pos_aller_a(), vect2_2type(), vect2_add(), and vect2_sub().

void vect2_2pol vect2 dest,
vect2_angle_absolu  angle_max
 

convertir un vecteur en coordonnées polaires

Definition at line 69 of file vect2.c.

References VECT2_POLAIRE.

Referenced by shot_angle(), shot_angle2(), trajectory_gotoa_fromxy(), vect2_2type(), vect2_rotation(), vect2_vect_from_rep(), and vect2_vect_to_rep().

void vect2_2type u08  type,
vect2 dest,
vect2_angle_absolu  angle_max
 

le meme en universel

Definition at line 124 of file vect2.c.

References vect2_2cart(), vect2_2pol(), and VECT2_POLAIRE.

void vect2_add vect2 dest,
vect2 src,
vect2_angle_absolu  angle_max
 

addition entre 2 vecteurs ayant le meme repere dest = dest + src sortie toujours en cartesien optimal si l'entree est cartesienne

Definition at line 144 of file vect2.c.

References vect2_2cart().

Referenced by vect2_point_from_rep().

void vect2_angle_from_rep vect2_angle_absolu angle,
rep2 repere
 

Definition at line 224 of file vect2.c.

References NULL.

Referenced by pos_position_manage(), and vect2_vect_from_rep().

void vect2_angle_to_rep vect2_angle_absolu angle,
rep2 repere
 

conversion d'un angle en un autre repere

Definition at line 217 of file vect2.c.

References NULL.

Referenced by pos_aller_a(), pos_avancer_angle(), pos_rotation_rayon(), pos_tourne(), and vect2_vect_to_rep().

void vect2_homotetie vect2_distance  rapport,
vect2 dest
 

multiplication d un vecteur par un nombre sortie au meme format que l'entree

Definition at line 193 of file vect2.c.

References VECT2_POLAIRE.

void vect2_mod1_angle vect2_angle dest,
vect2_angle_absolu  angle_max
 

modulo 0-2pi

Definition at line 44 of file vect2.c.

void vect2_mod2_angle vect2_angle dest,
vect2_angle_absolu  angle_max
 

modulo -pi-pi

Definition at line 53 of file vect2.c.

Referenced by aller_a_manage().

void vect2_point_from_rep vect2 dest,
rep2 repere
 

conversion d un repere quelconque vers le repere unité optimal si l'entrée est polaire sortie toujours en cartesiens

Definition at line 304 of file vect2.c.

References NULL, vect2_add(), and vect2_vect_from_rep().

Referenced by pos_aller_a(), and pos_position_manage().

void vect2_point_to_rep vect2 dest,
rep2 repere
 

conversion d'un point : meme chose qu'un vecteur, on y ajoute le deplacement d'origine ! du repere unité vers un repere quelconque vraiment pas optimise, car le vect2_add fonctionne en cartesien puis on convertit en polaire optimal si l'entrée est en cartesien sortie toujours en polaire

Definition at line 287 of file vect2.c.

References NULL, vect2_sub(), and vect2_vect_to_rep().

Referenced by aller_a_manage().

void vect2_sub vect2 dest,
vect2 src,
vect2_angle_absolu  angle_max
 

Definition at line 167 of file vect2.c.

References vect2_2cart().

Referenced by shot_angle(), shot_angle2(), trajectory_gotoa_fromxy(), and vect2_point_to_rep().

void vect2_vect_from_rep vect2 dest,
rep2 repere
 

Definition at line 257 of file vect2.c.

References NULL, vect2_2pol(), and vect2_angle_from_rep().

Referenced by vect2_point_from_rep().

void vect2_vect_to_rep vect2 dest,
rep2 repere
 

conversion d'echelle d'un vecteur (pas de deplacement d'origine!) sortie toujours en polaire

Definition at line 236 of file vect2.c.

References NULL, vect2_2pol(), and vect2_angle_to_rep().

Referenced by vect2_point_to_rep().


Generated on Fri Nov 11 06:44:26 2005 for AVR by  doxygen 1.4.5