include iostream include math using namespace std class PointSphere pr

 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
#include <iostream>
#include <math.h>
using namespace std;
class PointSphere{
private:
double lat, lon, rad, x, y, z;
public:
double ConvertToPolar(double x, double y, double z){
lat = atan(pow((pow(x,2) + pow(y,2)),0.5)/z);
lon = atan(x/y);
rad = sqrt(pow(x,2) + pow(y,2) + pow(z,2));
return (lat, lon, rad);
}
double ConvertToDescartes(double lat, double lon, double rad){
x = rad*cos(lat)*cos(lon);
y = rad*cos(lat)*sin(lon);
z = rad*sin(lat);
return (x, y, z);
}
double CountOfLenght(double lat1, double lon1, double rad1, double lat2, double lon2, double rad2){
double AngleLenth = acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon2-lon1));
double Lenth = (rad*AngleLenth);
}
};
int main() {
return 0;
}