Got Grazing Problem

Given an elliptical ranch with dimensions 2*R units horizontally and 1 unit vertically, a goat is tied to the fence inside the ranch using a leash of length r units. The angle formed between the point of tying and the horizontal axis is θ.

To determine the area of grass the goat can graze, the following inputs are provided as shown in the image below:

R half of the horizontal dimension of the ranch,
r the length of the leash, and
θ the angle formed by the point of tying and the horizontal axis.
Write a program that takes these three inputs as floating-point numbers on separate lines and prints the total area of grass the goat can graze, rounded to three decimal points.

Example:

Input:

0.75
0.25
310

Output:

0.091


include
include

double grazing_area(double R, double r, double theta) {
double theta_rad = M_PI * theta / 180.0;
double b = 1.0 / 2.0;
double sector_area = 0.5 * r * r * theta_rad;
double triangle_area = 0.5 * r * (R - r * cos(theta_rad));
double grazing_area = sector_area - triangle_area;
if (grazing_area > M_PI * R * b) {
grazing_area = M_PI * R * b;
}

return round(grazing_area * 1000.0) / 1000.0;

}

int main() {
double R, r, theta;
std::cin >> R >> r >> theta;
double area = grazing_area(R, r, theta);
std::cout << area << std::endl;

return 0;

}

i need 0.091 utput but my code give me 0.095
can anyone tell me where i’m wrong please make correction in this