1,2 /*––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––-*/ /* This program determines the distance between two points */ /* that are specified with latitude and longitude values */ //Yunfei Pan #include <stdio.h> #include <math.h> #define PI 3.141593 int main(void) { /* Declare variables and function prototype. */ double lat1, long1, lat2, long2; double gc_distance(double lat1,double long1, double lat2,double long2); /* Get locations of two points. */ printf("Enter latitude north and longitude west "); printf("for location 1: \n"); scanf("%lf %lf",&lat1,&long1); printf("Enter latitude north and longitude west "); printf("for location 2: \n"); scanf("%lf %lf",&lat2,&long2); /* Print great circle distance. */ printf("Great Circle Distance: %.0f miles \n", gc_distance(lat1,long1,lat2,long2)); /* Exit program. */ return 0; } /*–––...
Comments
Post a Comment