Skip to main content Link Menu Expand (external link) Document Search Copy Copied

double dist2D()

Gets the 2D Euclidian distance between the current vector and the origin (0, 0).

Returns

A double representing the Euclidian distance between the current vector and the origin

Explanation

See dist2D(PVector) for a detailed explanation.

Example

PVector v = PVector(3, 4);
v.dist2D(); // Returns 5

See Also