#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
float lat1, lat2, lon1, lon2, d;
printf("Enter latitude and longitude of place ");
scanf("%f %f", &lat1, &lon1);
printf("Enter latitude and longitude of place ");
scanf("%f %f, &lat2, &lon2");
lat1=lat1*3.14/180;
lat2=lat2*3.14/180;
lon1=lon1*3.14/180;
lon2=lon2*3.14/180;
d=3963*acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon2-lon1));
printf("Distance between place 1 and place 2: %f",d);
}
#include<stdlib.h>
#include<math.h>
int main()
{
float lat1, lat2, lon1, lon2, d;
printf("Enter latitude and longitude of place ");
scanf("%f %f", &lat1, &lon1);
printf("Enter latitude and longitude of place ");
scanf("%f %f, &lat2, &lon2");
lat1=lat1*3.14/180;
lat2=lat2*3.14/180;
lon1=lon1*3.14/180;
lon2=lon2*3.14/180;
d=3963*acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon2-lon1));
printf("Distance between place 1 and place 2: %f",d);
}
lat1=lat1*3.14/180;
ReplyDeletelat2=lat2*3.14/180;
lon1=lon1*3.14/180;
lon2=lon2*3.14/180;
what are these for??