dist()
Math / CalculationDescription
Calculates the distance between two points. Supports 2D and 3D.
Syntax
float dist(float x1, float y1, float x2, float y2)
float dist(float x1, float y1, float z1, float x2, float y2, float z2)
Parameters
| Name | Type | Description |
|---|---|---|
| x1/y1 | float | x,y of the first point |
| x2/y2 | float | x,y of the second point |
| z1/z2 | float | z-coordinates (optional, 3D) |
Returns
floatRelated
Under the Hood
Implementation in Processing.h / Processing.cpp:
Loading...