MCPcopy Index your code
hub / github.com/microsoft/SandDance / getDistance

Function getDistance

docs/app/js/sanddance-app.js:93024–93028  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 3

computeInputDataFunction · 0.70
getScaleFunction · 0.70
sanddance-app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected