How to determine if a point ( x 3 ; y 3 ) lies on a line passing through points ( x 1 ; y 1 ) and ( x 2 ; y 2 )?
1 answer
The equation of a line passing through the points (x1; y1) and (x2; y2) is usually written as
x - x1 y - y1 ------- = ------- x2 - x1 y2 - y1 To get rid of the division, you can convert the equation:
(x - x1) * (y2 - y1) - (x2 - x1) * (y - y1) = 0 It remains to substitute a point here (x3, y3).
- "usually written as" - the first time I see this form. The canonical equation looks different:
(x - x1) / (x2 - x1) = (y - y1) / (y2 - y1). Although, of course, they are equivalent, but the points in the canonical notation do not disappear - Andrey NOP - @AndreyNOP this option is not generalized to three or more points ... However, it also exists and is objectively better. Thank you for reminding. - Pavel Mayorov
|