MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / distance

Function distance

libs/echarts/echarts.simple.js:1076–1081  ·  view source on GitHub ↗

* 计算向量间距离 * @param {Vector2} v1 * @param {Vector2} v2 * @return {number}

(v1, v2)

Source from the content-addressed store, hash-verified

1074 * @return {number}
1075 */
1076function distance(v1, v2) {
1077 return Math.sqrt(
1078 (v1[0] - v2[0]) * (v1[0] - v2[0])
1079 + (v1[1] - v2[1]) * (v1[1] - v2[1])
1080 );
1081}
1082var dist = distance;
1083
1084/**

Callers 3

smoothSplineFunction · 0.70
smoothBezierFunction · 0.70
findNearestPointNewMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected