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

Method windingLine

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

* @function LevelRenderer.Tool.Areal.prototype.windingLine

(x0, y0, x1, y1, x, y)

Source from the content-addressed store, hash-verified

657 * @function LevelRenderer.Tool.Areal.prototype.windingLine
658 */
659 windingLine(x0, y0, x1, y1, x, y) {
660 if ((y > y0 && y > y1) || (y < y0 && y < y1)) {
661 return 0;
662 }
663 if (y1 == y0) {
664 return 0;
665 }
666 var dir = y1 < y0 ? 1 : -1;
667 var t = (y - y0) / (y1 - y0);
668 var x_ = t * (x1 - x0) + x0;
669
670 return x_ > x ? dir : 0;
671 }
672
673 /**
674 * @function LevelRenderer.Tool.Areal.prototype.swapExtrema

Callers 2

isInsidePolygonMethod · 0.95
isInsidePathMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected