Skip to content

Instantly share code, notes, and snippets.

@pratikdevdas
Created July 26, 2022 08:32
Show Gist options
  • Save pratikdevdas/abeba376502de556f80e5d418d9fe547 to your computer and use it in GitHub Desktop.
Save pratikdevdas/abeba376502de556f80e5d418d9fe547 to your computer and use it in GitHub Desktop.
Mathematics with js
let x1, y1, x2, y2, result;
x1 = prompt('x1');
y1 = prompt('y1');
x2 = prompt('x2');
y2 = prompt('y2');
result = Math.sqrt(Math.pow((x2 - x1),2)+Math.pow((y2 - y1),2));
console.log(result.toFixed(4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment