🧮 Calculates the distance between two points.
This function also accepts two objects with x and y properties.
x
y
x-coordinate of the first point
y-coordinate of the first point
x-coordinate of the second point
y-coordinate of the second point
distance between the points
q5.draw = function () { background(0.8); line(0, 0, mouseX, mouseY); let d = dist(0, 0, mouseX, mouseY); text(round(d), -80, -80);}; Copy
q5.draw = function () { background(0.8); line(0, 0, mouseX, mouseY); let d = dist(0, 0, mouseX, mouseY); text(round(d), -80, -80);};
🧮 Calculates the distance between two points.
This function also accepts two objects with
xandyproperties.