想請問各位先進如何計算弧線長度?
以下是在cadence看到的範例,但最近發現它似乎不能判斷弧線是否大於180度,因此超過180度時會計算錯誤。
這個公式我看不懂,是實測時發現的。想請問如何修改或用其他方法來計算弧線的長度?
節錄自http://www.cadence.com/tw/Resources/list1esc_length-1.pdf
;if radius is not nil, then it's an arc and need to calculate
;the length for the arc.
if(rad!=nil then
rad_sq=rad*rad
len_sq=len*len
cos_theta=(2*rad_sq-len_sq)/(2*rad_sq)
theta=acos(cos_theta)
len=theta*rad
);endif(rad!=nil 作者: ginooolu 时间: 2013-5-17 12:33
自己update一下
目前構思是取得start-end座標,中心座標,順時針或逆時針繞線後做判斷,應可判斷為>180或<180度。
然後再用圓周減去原弧線長
但具體判斷公式還在構思,似乎會有多種狀況,望先進提供意見作者: deargds 时间: 2013-5-17 17:35
;if radius is not nil, then it's an arc and need to calculate
;the length for the arc.
if(rad!=nil then
rad_sq=rad*rad
len_sq=len*len
cos_theta=(2*rad_sq-len_sq)/(2*rad_sq)
theta=acos(cos_theta)
len=theta*rad
);endif(rad!=nil
作者: ginooolu 时间: 2013-5-22 17:38 本帖最后由 ginooolu 于 2013-5-22 17:41 编辑