+ 1
Calculate the angle between two geographical coordinates. (This is a program with the operator of this problem,can you help me?)
Take the colon with a comma and return the angle between themhttps://code.sololearn.com/cQ1s8a2rDBtf/?ref=app
7 Antworten
+ 2
Faezeh Alinejad then there's something wrong with the formula you using up there .
as far as name of variables is concerned, that's not an issue .
You can write anything.
and the values that I am passing to the function are in the same sequence as required i.e. x1,y1,x2,y2
+ 1
double x[4];
for(int i=0;i<4;++i)
{
cin>>x[i];//Get the Longitude of the i cooordinate
cin.ignore();//read comma in betwwen and ignore it
// cin>>yi;//Get the latitude of the i coordinate
} cout<<return_angle(x[0],x[1],x[2],x[3]);
Replace everything inside main with this
+ 1
Hima Thank you for your response .I think there is a problem.In function return_angle values y1, y2 should be abbreviated by the user as a coordinates second component . Also the values of y1, y2 must be used in the atan2 function,But you have not considered these assumptions
In addition, the output of the above program is not the expected output, for example for inputs 35.708025,51.391929
35.708861,51.394976 must be display 71.3 from outputs
(Of course, to increase the accuracy of the calculation, I will add a grammar But it must work without it too)
+ 1
Martin Taylor it's ok .Thank you for your respond👍🏻
0
Hima There is still some problem.
I think that the function return_angle is not called
0
https://code.sololearn.com/cUkcPOubEFE3/?ref=app
Faezeh Alinejad here's a working code .