In cartesian coordinate system for segment $AB$ with known points $A(x_1, y_1)$ and $B(x_2, y_2)$ which lies on a line $a$ what is the easiest way to realise does the segment contains point of intersection $C (x_0, y_0)$ of the line $a$ and it's perpendicular $b$ to the centre $O (0, 0)$? The point of intersection of lines $a$ and $b$ isn't necessary.
Following algorithm looks like difficult:
- find equation of the $a$;
- find equation of the $b$;
- solve the system of equations and find the point $C$;
- check does $x_o$ and $y_0$ belong to $AB$.