onSegment function
dynamic
onSegment(
- dynamic p,
- dynamic q,
- dynamic r
Implementation
onSegment(p, q, r) {
return q.x <= math.max<num>(p.x, r.x) &&
q.x >= math.min<num>(p.x, r.x) &&
q.y <= math.max<num>(p.y, r.y) &&
q.y >= math.min<num>(p.y, r.y);
}