1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
#include <iostream> // contains cout/cin functions
#include <cmath> // contains trig functions
using namespace std;
//______________________________________________________________________________
// Prototypes:
//void convert_to_radians(char, int, int, int, double&, double&);
void convert_to_radians(point convert);
//______________________________________________________________________________
// Main function:
int main() {
const double RADIUS = 3958.89;
struct coordinate {
char direction;
double degrees;
double minutes;
double seconds;
} ;
struct point {
coordinate latitude;
coordinate longitude;
double alpha;
double beta;
} first, second;
double theta;
cout << "This program will calculate the distance between two coordinates on Earth." << endl
<< "Please enter your coordinates in the following format:" << endl
<< " (N, S, E, or W) (Degrees) (Minutes) (Seconds)" << endl
<< " i.e. N 95 18 35" << endl
<< "Enter the latitude of the first coordinate:" << endl;
cin >> first.latitude.direction >> first.latitude.degrees >> first.latitude.minutes >> first.latitude.seconds;
cout << "Enter the longitude of the first coordinate:" << endl;
cin >> first.longitude.direction >> first.longitude.degrees >> first.longitude.minutes >> first.longitude.seconds;
cout << "Enter the latitude of the second coordinate:" << endl;
cin >> second.latitude.direction >> second.latitude.degrees >> second.latitude.minutes >> second.latitude.seconds;
cout << "Enter the longitude of the second coordinate:" << endl;
cin >> second.longitude.direction >> second.longitude.degrees >> second.longitude.minutes >> second.longitude.seconds;
convert_to_radians(point convert);
system("PAUSE");
return 0;
}
//______________________________________________________________________________
// Function definitions:
//void calc_maximum(int Val1, int Val2, int Val3, int Val4, int& Max1, int& Max2) {
void convert_to_radians(point convert) {
double degrees=0;
cout << degrees << endl;
degrees += first.latitude.degrees;
cout degrees << endl;
}
//______________________________________________________________________________
|