If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Course: Unlisted resources area > Unit 2

Lesson 1: ProcessingJS documentation

dist(x1, y1, x2, y2)

Calculates the distance between two points, (x1, y1) and (x2, y2).
Parameters:
NameDescription
x1the x-coordinate of the first point
y1the y-coordinate of the first point
x2the x-coordinate of the second point
y2the y-coordinate of the second point

Want to join the conversation?

No posts yet.