Mar 20, 2012 at 7:18pm UTC
Dear
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double straal;
double omtrek;
double cosinus;
cosinus = (cos (51));
straal = (40075 * cosinus);
omtrek = (2 * 3.1415926535 * straal);
cout << cosinus << endl;
cout << straal << endl;
cout << omtrek << endl;
system ("pause" );
return 0;
}
I wrote the following code:
It should calculate the circumference at latitude but it does something wrong,
it outputs the wrong cosisnus, straal (radius) and omtrek (circumference).
What do i do wrong?
Please help me.
Best Regards
Joriek
Last edited on Mar 20, 2012 at 7:19pm UTC
Mar 20, 2012 at 7:20pm UTC
The cos function operates in radians.