(c: Curve, count = HIT_SAMPLES)
| 573 | |
| 574 | /** The curve as `count` points from source to target, for distance tests. */ |
| 575 | export function samplePolyline(c: Curve, count = HIT_SAMPLES): Point[] { |
| 576 | const out: Point[] = []; |
| 577 | for (let i = 0; i < count; i++) out.push(pointAt(c, i / (count - 1))); |
| 578 | return out; |
| 579 | } |
| 580 | |
| 581 | function distanceToSegment(p: Point, a: Point, b: Point): number { |
| 582 | const dx = b.x - a.x; |
no test coverage detected