I tried to write the formula in proper syntax.
#include<iostream> #include<cmath> using namespace std; int main() { double l1, l2, g1, g2, d; double pi = 3.1416; //std::cout << "Enter the value of l1, l2 , g1 and g2\n"; //std::cin >> l1 >> l2 >> g1 >> g2; l1 = 28.7041; l2 = 22.5726; g1 = 77.1025; g2 = 88.3639; l1 = l1 * (pi / 180); l2 = l2 * (pi / 180); g1 = g1 * (pi / 180); g2 = g2 * (pi / 180); d = 3963*(acos((sin(l1) * sin(l2)) + ((cos(l1) * cos(l2)) * cos(g2 - g1)))); std::cout << d; }
Yea that's what i wonder, where is the problem? I was thinking of the pi value but i used a long value of pi amd still got same result.
see previous pictures Sir.
Обсуждают сегодня