HTML5获取arc结束的坐标

时间:2012-09-09 19:11:59

标签: javascript html5

如果我们绘制弧线,我们如何获得弧线末端(最后一点)相对于中心的坐标。

1 个答案:

答案 0 :(得分:11)

请参阅http://jsfiddle.net/5DdQt/

使用

function getPoint(c1,c2,radius,angle){
    return [c1+Math.cos(angle)*radius,c2+Math.sin(angle)*radius];
}
  • c1c2是圆弧中心的坐标
  • radius是弧的半径
  • angle是最后一个角度
相关问题