forked from jdf/processing-py-site
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPVector_set.xml
More file actions
98 lines (79 loc) · 1.92 KB
/
PVector_set.xml
File metadata and controls
98 lines (79 loc) · 1.92 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root>
<name>set()</name>
<category>PVector</category>
<subcategory>Method</subcategory>
<type></type>
<example>
<noimage />
<code><![CDATA[
size(100, 100)
v = PVector(0.0, 0.0, 0.0)
v.set(20.0, 30.0, 40.0)
print(v.x) # Prints "20.0"
print(v.y) # Prints "30.0"
print(v.z) # Prints "40.0"
]]></code>
</example>
<example>
<noimage />
<code><![CDATA[
size(100, 100)
v1 = PVector(20.0, 30.0, 40.0)
v2 = PVector(0.0, 0.0, 0.0)
v2.set(v1)
print(v2.x) # Prints "20.0"
print(v2.y) # Prints "30.0"
print(v2.z) # Prints "40.0"
]]></code>
</example>
<example>
<noimage />
<code><![CDATA[
vvv = [20.0, 30.0, 40.0]
size(100, 100)
v = PVector(0.0, 0.0, 0.0)
v.set(vvv)
print(v.x) # Prints "20.0"
print(v.y) # Prints "30.0"
print(v.z) # Prints "40.0"
]]></code>
</example>
<description><![CDATA[
Sets the x, y, and z component of the vector using three separate variables, the data from a PVector, or the values from a float array.
]]></description>
<syntax>
.set(<c>x</c>, <c>y</c>, <c>z</c>)
.set(<c>x</c>, <c>y</c>)
.set(<c>v</c>)
.set(<c>source</c>)
</syntax>
<parameter>
<label>x</label>
<description><![CDATA[float: the x component of the vector]]></description>
</parameter>
<parameter>
<label>y</label>
<description><![CDATA[float: the y component of the vector]]></description>
</parameter>
<parameter>
<label>z</label>
<description><![CDATA[float: the z component of the vector]]></description>
</parameter>
<parameter>
<label>x</label>
<description><![CDATA[float: the x component of the vector]]></description>
</parameter>
<parameter>
<label>y</label>
<description><![CDATA[float: the y component of the vector]]></description>
</parameter>
<parameter>
<label>v</label>
<description><![CDATA[float: the y component of the vector]]></description>
</parameter>
<parameter>
<label>source</label>
<description><![CDATA[float: list to copy from]]></description>
</parameter>
</root>