首页 > 文档 > arc() 弧形
2017
07-28

arc() 弧形

Name

arc() 弧形

   

Examples

arc() 弧形 - 第1张  | Processing编程艺术

arc(50, 55, 50, 50, 0, HALF_PI);

noFill();

arc(50, 55, 60, 60, HALF_PI, PI);

arc(50, 55, 70, 70, PI, PI+QUARTER_PI);

arc(50, 55, 80, 80, PI+QUARTER_PI, TWO_PI);

arc() 弧形 - 第2张  | Processing编程艺术

arc(50, 50, 80, 80, 0, PI+QUARTER_PI, OPEN);

arc() 弧形 - 第3张  | Processing编程艺术

arc(50, 50, 80, 80, 0, PI+QUARTER_PI, CHORD);

arc() 弧形 - 第4张  | Processing编程艺术

arc(50, 50, 80, 80, 0, PI+QUARTER_PI, PIE);

Description

Draws an arc to the screen. Arcs are drawn along the outer edge of an ellipse defined by the abc, and d parameters. The origin of the arc’s ellipse may be changed with the ellipseMode() function. Use the start and stop parameters to specify the angles (in radians) at which to draw the arc.

There are three ways to draw an arc; the rendering technique used is defined by the optional seventh parameter. The three options, depicted in the above examples, are PIE, OPEN, and CHORD. The default mode is the OPEN stroke with a PIE fill.

In some cases, the arc() function isn’t accurate enough for smooth drawing. For example, the shape may jitter on screen when rotating slowly. If you’re having an issue with how arcs are rendered, you’ll need to draw the arc yourself with beginShape()/endShape() or a PShape.

向屏幕绘制弧线。弧线沿由 abc d 参数定义的椭圆的外边缘绘制。圆弧的椭圆的原点可以用 ellipseMode () 函数来改变。使用开始停止参数指定绘制弧线的角度 (以弧度为单位)

 

画圆弧有三种方法;使用的渲染技术由可选的第七参数定义。上面的示例中描述的三选项是饼图、打开和和弦。默认模式是带有饼图填充的开放式描边。

 

在某些情况下, () 函数不够精确, 无法进行平滑绘制。例如, 当旋转缓慢时, 形状可能会在屏幕上抖动。如果您对如何呈现弧线有问题, 则需要使用 beginShape ()/endShape () PShape 来绘制弧线。

Syntax

arc(a, b, c, d, start, stop)

arc(a, b, c, d, start, stop, mode)

Parameters

a

float: x-coordinate of the arc’s ellipse

浮点型: 圆弧椭圆的 x 坐标

b

float: y-coordinate of the arc’s ellipse

浮点型: 圆弧椭圆的 y 坐标

c

float: width of the arc’s ellipse by default

圆弧椭圆的短轴

d

float: height of the arc’s ellipse by default圆弧椭圆的长轴

start

float: angle to start the arc, specified in radians以弧度指定的角度开始弧线

stop

float: angle to stop the arc, specified in radians以弧度指定的角度停止弧线

Returns

void

Related

ellipse()
ellipseMode()
radians()
degrees()



最后编辑:
作者:卡萨布兰卡
卡萨布兰卡
这个作者貌似有点懒,什么都没有留下。

留下一个回复

你的email不会被公开。