![](/img/trans.png)
[英]Points on a circle, with limits. How To calculate without angle, but radius and centre point?
[英]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)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.