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
|
#include "coord.h"
#include <iostream>
#include <cmath>
using namespace std;
void get_point (Point3D &p) {
cout << "Enter the ID which must be an integer." <<endl;
cin >> p.id;
cout << "You enterd " <<p.id << " for the ID" <<endl;
cout << "What is the x coordinate?" <<endl;
cin >> p.x;
cout << "You enterd " <<p.x << " for the x coordinate " <<endl;
cout << "What is the y coordinate?" <<endl;
cin >> p.y;
cout << "You enterd " <<p.y << " for the y coordinate " <<endl;
cout << "What is the z coordinate?" <<endl;
cin >> p.z;
cout << "You enterd " <<p.z << " for the z coordinate " <<endl;
cout << "What is the accuracy of the point? Enter A fot high accuracy, B for medium accuracy, and C for low accuracy." <<endl;
cin >> p.order;
cout << "You enterd " <<p.order << " for the accuracy of the point " <<endl;
}
void print_point(const Point3D p) {
cout << "Coordinates of Point " << p.id << ": "
<< "x= " << p.x << ", y= " << p.y << ", z=" << p.z << endl;
cout << "Accuracy (order) of Point " << p.id << ": " << p.order << endl;
}
void spatial_dist( double &ds, Point3D p1, Point3D p2) { //compute the plani distance
ds = sqrt(pow(p2.x - p1.x, 2)+pow(p2.y - p1.y, 2) +pow(p2.z- p1.z, 2)); //point
}
void plani_dist( double &dp, Point3D p1, Point3D p2) { //compute the plani distance
dp = sqrt(pow(p1.x- p2.x, 2)+pow(p1.y - p2.y, 2));
}
void ht_diff( double &ht, Point3D p1, Point3D p2 ) { //compute the height difference
ht = p2.z - p1.z;
}
void azimuth(double &theta, Point3D p1, Point3D p2) { // compute the azimuth (heading)
theta = atan((p2.y - p1.y)/(p2.x- p1.x));
}
|