我在找到计算弧终点坐标的方法时遇到了麻烦 . 我知道 centre point coordinates , radius (宽度和高度相同), start angle 和 end angle (如php imagefileldarc()函数所需) . 由此,我如何计算弧的终点坐标?
我试过以下公式无济于事:
$end['x'] = cos($Angle) * $Radius + $CenterX;
$end['y'] = sin($Angle) * $Radius + $CenterY;
非常感谢
1 回答
你绘制弧线的事实并不重要 . 您的计算将永远是:
x = cos(角度)* ratio centerx
y = sin(角度)*比率居中