TZinovieva

Distance Between Points

Jan 19th, 2023
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function distanceBetweenPoints(x1, y1, x2, y2) {
  2.     let y = x2 - x1;
  3.     let x = y2 - y1;
  4.  
  5.     console.log(Math.sqrt(x * x + y * y));
  6. }
Advertisement
Add Comment
Please, Sign In to add comment