Distance between two points

This commit is contained in:
Angelos Chalaris
2017-12-08 16:09:05 +02:00
parent 86b6c8b75d
commit e38dc0c7bc
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,8 @@
### Distance between two points
Use `Math.pow()` and `Math.sqrt()` to calculate the Euclidean distance between two points.
```js
var distance = x0, y0, x1, y1 =>
Math.sqrt(Math.pow(x1-x0, 2) + Math.pow(y1 - y0, 2))
```