pub fn on_segment(p: [f64; 2], q: [f64; 2], r: [f64; 2]) -> bool
Whether point q lies on segment p-r (given that p, q, r are collinear).