I am a beginner with c++, I don't understand why I don't get the same result as when I use my calculator.
eg. radius=2, a(angle)=60, according to my calculator it should be 118.2679496, with the program I get 120.61.
The formula for the area of circular segment is r^2/2*(a-sin(a))
Thank you for the help!
#include <iostream>
#include <cmath>
using namespace std;
int main(){
double r, a, area;
cout<< "fill the radius: "<<"\n";
cin >> r;
cout <<"fill the angle: "<<"\n";
cin >> a;
area = r*r/2*(a-sin(a));
cout <<"The area is "<< area <<"."<<"\n";
return 0;
}