Reference dist()

dist()

Calculates the Euclidean distance between two points (considering a point as a vector object).

Examples

Syntax

dist()
dist(v1, v2)

Parameters

v1
p5.Vector: The first p5.Vector
v2
p5.Vector: The second p5.Vector

Returns

Number: The distance
Notice any errors or typos? Please let us know. Please feel free to edit src/math/p5.Vector.js and open a pull request!

Related References