LineUtil
概述
折线点处理工具
方法(Methods)
方法:
方法 | 参数 | 返回值 | 描述 |
---|---|---|---|
simplify() | <Point[]> points,<Number> tolerance | Point[] | 在一个多段线减少的点的数量,同时保持其形状,并返回简化的点的新的数组 |
pointToSegmentDistance() | <Point> p, <Point> p1,<Point> p2 | Number | 返回点p到线段p1p2的距离 |
closestPointOnSegment() | <Point> p, <Point> p1,<Point> p2 | Point | 返回线段上距离点p最近的点 |
clipSegment() | <Point> a,<Point> b,<Bounds> bounds | - | 用矩形边界分割线段ab,用作只显示屏幕或其附近的折线点,提升性能 |