MCPcopy Create free account
hub / github.com/dcloudio/mui / getDistance

Function getDistance

js/mui.gestures.js:49–56  ·  view source on GitHub ↗
(p1, p2, props)

Source from the content-addressed store, hash-verified

47 * @returns {Number}
48 */
49 var getDistance = function(p1, p2, props) {
50 if (!props) {
51 props = ['x', 'y'];
52 }
53 var x = p2[props[0]] - p1[props[0]];
54 var y = p2[props[1]] - p1[props[1]];
55 return sqrt((x * x) + (y * y));
56 };
57 /**
58 * scale
59 * @param {Object} starts

Callers 2

getScaleFunction · 0.70
calTouchDataFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected