dist()

Math / Calculation

Description

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

NameTypeDescription
x1/y1floatx,y of the first point
x2/y2floatx,y of the second point
z1/z2floatz-coordinates (optional, 3D)

Returns

float

Related

Under the Hood

Implementation in Processing.h / Processing.cpp:

Loading...