如果我们知道半径和角度,如何找到圆的一部分的面积?

How to find the area of a segment of a circle if we know the radius and an angle?

我在求一段圆的面积时遇到了一些问题。

我尝试使用这个公式但得到了另一个结果,如这里http://planetcalc.com/1421/,我使用计算器圆段面积从终端检查我的结果。

我的代码:

#define PI 3.14159265

double r = 12;
double a = 22;
double result = ((r*r)/2)*(PI*(a/180)-sin(a));

您必须稍微更正您的 sin 计算,它应该如下所示:

sin(M_PI * angle / 180)