Révision 316
Ajouté par Guillaume DAVID il y a presque 3 ans
main.c | ||
---|---|---|
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
|
||
//Fonction ? modifier !!!!!
|
||
|
||
//Fonction ? modifier !!!!!
|
||
int trame_cmp(char *trame, char *type){
|
||
int test=1;
|
||
int i;
|
||
... | ... | |
return pos;
|
||
}
|
||
|
||
float calcul_distance(position p1,position p2){
|
||
float x,y,d;
|
||
|
||
x=sin(abs(p1.Long-p2.Long))*6370;
|
||
y=sin(abs(p1.Lat-p2.Lat))*6370;
|
||
|
||
d=sqrt(x*x+y*y);
|
||
|
||
return d;
|
||
}
|
||
|
||
void traitement(char * trame){
|
||
static int cpt=0;
|
||
cpt++;
|
||
... | ... | |
|
||
test_decode_position();
|
||
|
||
test_decode_trame();
|
||
test_decode_trame();
|
||
|
||
test_calcul_distance();
|
||
}
|
||
|
||
void test_decode_int(void){
|
||
... | ... | |
exit(-1);
|
||
}
|
||
}
|
||
|
||
void test_calcul_distance(void){
|
||
position pa, pb;
|
||
|
||
pa.Lat=48.85341;
|
||
pa.Long=2.3488;
|
||
pb.Lat=43.296482;
|
||
pb.Long=5.36978;
|
||
|
||
printf("%f\n\n\n",calcul_distance(pa,pb));
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
||
int main(int argc,char ** argv)
|
Formats disponibles : Unified diff
calcul distance test