forked from jdf/processing-py-site
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPVector_div.xml
More file actions
59 lines (45 loc) · 1.39 KB
/
PVector_div.xml
File metadata and controls
59 lines (45 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>div()</name>
<category>PVector</category>
<subcategory>Method</subcategory>
<type></type>
<example>
<image />
<code><![CDATA[
v = PVector(30, 60, 0)
ellipse(v.x, v.y, 12, 12)
v.div(6)
ellipse(v.x, v.y, 24, 24)
]]></code>
</example>
<example>
<image />
<code><![CDATA[
v1 = PVector(30, 60, 0)
ellipse(v1.x, v1.y, 12, 12)
v2 = PVector.div(v1, 6)
ellipse(v2.x, v2.y, 24, 24)
]]></code>
</example>
<description><![CDATA[
Divides a vector by a scalar. The version of the method that uses a float acts directly on the vector upon which it is called (as in the first example above), and therefore has no return value. The versions that receive both a PVector and a float as arugments are static methods, and each returns a new PVector that is the result of the division operation. Both examples above produce the same visual output.
]]></description>
<syntax>
.div(<c>n</c>)
.div(<c>v</c>, <c>n</c>)
.div(<c>v</c>, <c>n</c>, <c>target</c>)
</syntax>
<parameter>
<label>n</label>
<description><![CDATA[float: the number by which to divide the vector]]></description>
</parameter>
<parameter>
<label>v</label>
<description><![CDATA[PVector: the vector to divide by the scalar]]></description>
</parameter>
<parameter>
<label>target</label>
<description><![CDATA[PVector: PVector in which to store the result]]></description>
</parameter>
</root>