MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / isInsideRing

Method isInsideRing

src/common/overlay/levelRenderer/Area.js:603–606  ·  view source on GitHub ↗

* @function LevelRenderer.Tool.Areal.prototype.isInsideRing * @description 图形 Ring 是否包含鼠标位置, true表示坐标处在图形内。 * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。

(cx, cy, r0, r, x, y)

Source from the content-addressed store, hash-verified

601 * @returns {boolean} 图形是否包含鼠标位置, true表示坐标处在图形内。
602 */
603 isInsideRing(cx, cy, r0, r, x, y) {
604 var d = (x - cx) * (x - cx) + (y - cy) * (y - cy);
605 return (d < r * r) && (d > r0 * r0);
606 }
607
608 /**
609 * @function LevelRenderer.Tool.Areal.prototype.isInsideRect

Callers 1

_mathMethodMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected