Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function distance(x0, y0, x1, y1) {
- // returns the length of a line segment
- const x = x1 - x0;
- const y = y1 - y0;
- return Math.sqrt(x * x + y * y);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement