如何确定路径弧中的大弧标记 [英] How to Determine the large-arc-flag in Path Arc

查看:92
本文介绍了如何确定路径弧中的大弧标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个坐标start(x1,y1)end(x2,y2)和circle(c1,c2)

I have the two coordinate start(x1,y1) end(x2,y2) and circle(c1,c2)

x1, y1, x2, y2, c1, c2, radius, clockwise

我想画一条弧线,从(x1,y1)到(x2,y2),我认为SVG路径是

I want to draw an arc, from (x1,y1) to (x2,y2), I think the SVG Path is

M x1 y1 A radius radius 0 ? clockwise x2 y2

但是,如何确定大弧标记是1还是0,谢谢.

But How Can I Determine the large-arc-flag is 1 or 0, thanks.

推荐答案

规范本节中的图几乎解释了正在发生的事情.

The diagram in this section of the spec pretty much explains what is going on.

http://www.w3.org/TR/SVG/paths. html#PathDataEllipticalArcCommands

如果您有起点,终点和半径,则这些点之间的弧线将是小弧线(<180deg)或大弧线(> 180deg-绕圆的长距离).当然,这是假设圆心不在两点之间.

If you have a start point, end point, and a radius, then the arc between those points is either going to be a small arc (<180deg) or a large arc (>180deg - the long way around the circle). That's assuming the centre of the circle isn't directly between the two points, of course.

在大多数情况下,您可能需要快捷方式.也就是说,大弧标志= 0.

In most cases you probably want the short-cut. That is, large-arc-flag = 0.

通常它是另一个标志,sweep,这是一个比较棘手的标志.

Normally it is the other flag, sweep, which is the trickier one.

这篇关于如何确定路径弧中的大弧标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆