Calculates the distance between two points represented by vectors.
A point's coordinates can be represented by the components of a vector that extends from the origin to the point.
The static version of dist(), as in p5.Vector.dist(v1, v2), is the same as calling v1.dist(v2).
Use dist() to calculate the distance between points using coordinates as in dist(x1, y1, x2, y2).
Ejemplos
Sintaxis
dist(v)
Parámetros
v
p5.Vector: x, y, and z coordinates of a p5.Vector.
Returns
Number: 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!
Referencias Relacionadas
textToContours
Returns an array of arrays of points outlining a string of text written using the font.
textToModel
Converts text into a 3D model that can be rendered in WebGL mode.
textToPaths
Returns a flat array of path commands that describe the outlines of a string of text.
textToPoints
Returns an array of points outlining a string of text written using the font.