forked from processing/processing-web-archive
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathatan2.xml
More file actions
executable file
·59 lines (38 loc) · 1.33 KB
/
Copy pathatan2.xml
File metadata and controls
executable file
·59 lines (38 loc) · 1.33 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>atan2()</name>
<category>Math</category>
<subcategory>Trigonometry</subcategory>
<usage>Web & Application</usage>
<example>
<image></image>
<code><![CDATA[
void draw() {
background(204);
translate(width/2, height/2);
float a = atan2(mouseY-height/2, mouseX-width/2);
rotate(a);
rect(-12, -5, 24, 10);
}
]]></code>
</example>
<description><![CDATA[Calculates the angle (in radians) from a specified point to the coordinate origin as measured from the positive x-axis. Values are returned as a <b>float</b> in the range from <b>PI</b> to <b>-PI</b>. The <b>atan2()</b> function is most often used for orienting geometry to the position of the cursor. Note: The y-coordinate of the point is the first parameter and the x-coordinate is the second due the the structure of calculating the tangent.]]></description>
<syntax><![CDATA[
atan2(<kbd>y</kbd>, <kbd>x</kbd>);
]]></syntax>
<parameter>
<label>y</label>
<description><![CDATA[int or float: y-coordinate of the point]]></description>
</parameter>
<parameter>
<label>x</label>
<description><![CDATA[int or float: x-coordinate of the point]]></description>
</parameter>
<returns>float</returns>
<related>
tan()
</related>
<availability>1.0</availability>
<type>Function</type>
<partof>Core</partof>
</root>