| Name | dist() |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Examples | // Sets the background gray value based on
// the distance of the mouse from the center
void draw()
{
float d = dist(50, 50, mouseX, mouseY);
fill(d*4);
rect(0, 0, 99, 99);
} |
||||||||||||
| Description | Calculates the distance between two points. | ||||||||||||
| Syntax | dist(x1, y1, x2,y2) dist(x1, y1, z1, x2,y2, z2) |
||||||||||||
| Parameters |
|
||||||||||||
| Returns | Float | ||||||||||||
| Usage | Web & Application |