forked from processing-js/processing-js.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPVector_dist_.html
More file actions
72 lines (65 loc) · 1.73 KB
/
Copy pathPVector_dist_.html
File metadata and controls
72 lines (65 loc) · 1.73 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
---
layout: default
---
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr>
<th scope="row">Class</th>
<td>PVector</td>
</tr>
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>dist()</h3></td>
</tr>
<tr class="">
<th scope="row">Examples</th>
<td><div class="example"><pre class="">PVector v1 = new PVector(10, 20, 0);
PVector v2 = new PVector(60, 80, 0);
float d = v1.dist(v2);
println(d); // Prints "78.10249"</pre>
<hr />
<pre>PVector v1 = new PVector(10, 20, 0);
PVector v2 = new PVector(60, 80, 0);
float d = PVector.dist(v1, v2);
println(d); // Prints "78.10249"</pre></div></td>
</tr>
<tr class="">
<th scope="row">Description</th>
<td><p> Calculates the Euclidean distance between two points (considering a point as a vector object).</p></td>
</tr>
<tr class="">
<th scope="row">Syntax</th>
<td><pre><kbd>vec</kbd>.dist(<kbd>v</kbd>)</pre><br />
<pre><kbd>PVector</kbd>.dist(<kbd>v1</kbd>,<kbd>v2</kbd>)</pre><br /></td>
</tr>
<tr class="">
<th scope="row">Parameters</th>
<td>
<table cellpadding="0" cellspacing="0" border="0">
<tr class="">
<th scope="row">vec</th>
<td>any variable of type PVector</td>
</tr>
<tr class="">
<th scope="row">v</th>
<td>PVector: the x, y, and z coordinates of a PVector object</td>
</tr>
<tr class="">
<th scope="row">v1</th>
<td>PVector: the x, y, and z components from a PVector object</td>
</tr>
<tr class="">
<th scope="row">v2</th>
<td>PVector: the x, y, and z components from a PVector object</td>
</tr>
</table>
</td>
</tr>
<tr class="">
<th scope="row">Returns</th>
<td>float</td>
</tr>
<tr class="">
<th scope="row">Usage</th>
<td>Web & Application</td>
</tr>
</table>