Révision 205
Ajouté par Lea DUVIVIER il y a environ 3 ans
branch/duvivier_lea/sp4a12/main.c | ||
---|---|---|
#include <stdio.h>
|
||
#include <stdlib.h>
|
||
#include <strings.h>
|
||
#include "trame.h"
|
||
#include "trame.h"
|
||
#include <math.h>
|
||
|
||
/*Trames de tests ? modifier si n?cessaire.*/
|
||
char * trames[]= {"$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C",
|
||
... | ... | |
|
||
}Position;
|
||
Position p1,p2,p3,p4;
|
||
typedef struct{
|
||
Position rpos;
|
||
float vitmax;
|
||
|
||
|
||
}Zone;
|
||
int decode_nombre(char *ch, int n);
|
||
Zone zones[]=
|
||
{
|
||
{{44.7887762, -3.012}, 50},
|
||
{{44.7891220, -3.013},70},
|
||
|
||
};
|
||
|
||
|
||
float latitude_nbf(char* c)
|
||
|
||
{
|
||
... | ... | |
vitesse=(calcule_distance(p1,p2)*3600);
|
||
return vitesse;
|
||
}
|
||
|
||
int distance_a_la_plus_proche_zone(Position p, Zone r[], int nb_zones, float *d)
|
||
{
|
||
int min_distance;
|
||
min_distance=2000000;
|
||
int i;
|
||
|
||
}
|
||
/*Fonction ? modifier !!!!!*/
|
||
void traitement(char * trame)
|
||
{
|
||
... | ... | |
printf("Erreur du test decode nombre");
|
||
exit(-1);
|
||
}
|
||
if(latitude_nbf("3723.2475")==37.387458) /* changer test*/
|
||
if((latitude_nbf("3723.2475")-37.38)>0.01)
|
||
{
|
||
printf("Erreur du test pour la latitude");
|
||
exit(-1);
|
||
|
||
}
|
||
if(longitude_nbf("00306.6036")==3.11006)
|
||
if((longitude_nbf("00306.6036")-3.11)>0.01)
|
||
{
|
||
printf("Erreur du test pour la latitude");
|
||
exit(-1);
|
||
|
||
}
|
||
if (lat_lon("00306.6036")==3.11006)
|
||
if ((lat_lon("00306.6036")-3.11)>0.01)
|
||
{
|
||
printf("Erreur de test pour la combinaison des deux fonctions");
|
||
exit(-1);
|
Formats disponibles : Unified diff
debut de int_zone la plus proche