* calculate the absolute distance between two points * @param {Object} p1 {x, y} * @param {Object} p2 {x, y} * @param {Array} [props] containing x and y keys * @return {Number} distance
(p1, p2, props)
| 93022 | * @param {Array} [props] containing x and y keys |
| 93023 | * @return {Number} distance |
| 93024 | */ function getDistance(p1, p2, props) { |
| 93025 | if (!props) props = PROPS_XY; |
| 93026 | var x = p2[props[0]] - p1[props[0]], y = p2[props[1]] - p1[props[1]]; |
| 93027 | return Math.sqrt(x * x + y * y); |
| 93028 | } |
| 93029 | /** |
| 93030 | * calculate the angle between two coordinates |
| 93031 | * @param {Object} p1 |
no outgoing calls
no test coverage detected