mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 10:00:42 +01:00
92 lines
2.1 KiB
XML
92 lines
2.1 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<root>
|
|
<name>curve()</name>
|
|
|
|
<category>Shape</category>
|
|
|
|
<subcategory>Curves</subcategory>
|
|
|
|
<usage>Web & Application</usage>
|
|
|
|
<example>
|
|
<image>curve_.gif</image>
|
|
<code>
|
|
stroke(255, 102, 0);
|
|
curve(5, 26, 5, 26, 73, 24, 73, 61);
|
|
stroke(0);
|
|
curve(5, 26, 73, 24, 73, 61, 15, 65);
|
|
stroke(255, 102, 0);
|
|
curve(73, 24, 73, 61, 15, 65, 15, 65);
|
|
</code>
|
|
</example>
|
|
|
|
<description>
|
|
Draws a curved line on the screen. The first and second parameters specify the first anchor point and the last two parameters specify the second anchor. The middle parameters specify the points for defining the shape of the curve. Longer curves can be created by putting a series of <b>curve()</b> functions together. An additional function called <b>curveTightness()</b> provides control for the visual quality of the curve. The <b>curve()</b> function is an implementation of Catmull-Rom splines.
|
|
</description>
|
|
|
|
<syntax>
|
|
curve(<c>x1</c>, <c>y1</c>, <c>x2</c>, <c>y2</c>, <c>x3</c>, <c>y3</c>, <c>x4</c>, <c>y4</c>);
|
|
</syntax>
|
|
|
|
<parameter>
|
|
<label>x1</label>
|
|
<description>int or float: x-coordinate of the first anchor</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>y1</label>
|
|
<description>int or float: y-coordinate of the first anchor</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>x2</label>
|
|
<description>int or float: x-coordinate of the first point</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>y2</label>
|
|
<description>int or float: y-coordinate of the first point</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>x3</label>
|
|
<description>int or float: x-coordinate of the second point</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>y3</label>
|
|
<description>int or float: y-coordinate of the second point</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>x4</label>
|
|
<description>int or float: x-coordinate of the second anchor</description>
|
|
</parameter>
|
|
|
|
<parameter>
|
|
<label>y4</label>
|
|
<description>int or float: y-coordinate of the second anchor</description>
|
|
</parameter>
|
|
|
|
<returns>None</returns>
|
|
|
|
<related>
|
|
curveVertex()
|
|
bezier()
|
|
</related>
|
|
|
|
<availability>1.0</availability>
|
|
|
|
<type>Function</type>
|
|
|
|
<partof>Core</partof>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</root>
|