00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _REFERENTIEL_
00023 #define _REFERENTIEL_
00024
00025 #include <utils/utils.h>
00026
00027 #include <math.h>
00028
00056
00057
00058 typedef double vect2_distance;
00059 typedef double vect2_angle_absolu;
00060 typedef double vect2_angle_relatif;
00061 typedef double vect2_angle;
00062
00063
00064
00065 #define VECT2_ANGLE_K2PI_PRES 1 // option a ajouter
00066
00067 #define VECT2_CARTESIEN 0
00068 #define VECT2_POLAIRE 2
00069
00070 struct vect2_cart
00071 {
00072 u08 type;
00073
00074 vect2_distance x;
00075 vect2_distance y;
00076 };
00077 typedef struct vect2_cart vect2_cart;
00078
00079 struct vect2_pol
00080 {
00081 u08 type;
00082
00083 vect2_distance u;
00084 vect2_angle_absolu teta;
00085 };
00086 typedef struct vect2_pol vect2_pol;
00087
00088
00106 union vect2
00107 {
00108 vect2_cart cart;
00109 vect2_pol pol;
00110 };
00111 typedef union vect2 vect2;
00112
00113
00114
00115 #define REP2_ORTHO_ANGLE 1
00116
00128 struct rep2_ortho_angle
00129 {
00130 u08 type;
00131
00132 vect2 origine;
00133 vect2 x;
00134 vect2_angle_absolu angle_max_fils;
00135 vect2_angle_absolu angle_max_pere;
00136 };
00137 typedef struct rep2_ortho_angle rep2_ortho_angle;
00138
00139 typedef rep2_ortho_angle rep2;
00140
00141
00142
00143
00144
00147 void vect2_mod1_angle(vect2_angle * dest, vect2_angle_absolu angle_max );
00149 void vect2_mod2_angle(vect2_angle * dest, vect2_angle_absolu angle_max );
00150
00152 void vect2_2pol(vect2 * dest, vect2_angle_absolu angle_max);
00153 void vect2_2cart(vect2 * dest, vect2_angle_absolu angle_max);
00154 void vect2_2type(u08 type, vect2 * dest, vect2_angle_absolu angle_max);
00155
00163 void vect2_add(vect2 * dest, vect2 * src, vect2_angle_absolu angle_max);
00164 void vect2_sub(vect2 * dest, vect2 * src, vect2_angle_absolu angle_max);
00165
00167 void vect2_homotetie(vect2_distance rapport, vect2 * dest);
00168
00169
00170
00172 void vect2_angle_to_rep(vect2_angle_absolu * angle, rep2 * repere);
00173 void vect2_angle_from_rep(vect2_angle_absolu * angle, rep2 * repere);
00174
00175
00179 void vect2_vect_to_rep(vect2 * dest, rep2 * repere);
00180 void vect2_vect_from_rep(vect2 * dest, rep2 * repere);
00181
00182
00190 void vect2_point_to_rep(vect2 * dest, rep2 * repere);
00191
00196 void vect2_point_from_rep(vect2 * dest, rep2 * repere);
00197
00198
00199 #endif