I've this below case where there is a line between start to finish. I've 2 points where point A can be perpendicular to the line while point B cannot.
Is there a way to check the same mathematically?
This is the python method I've done so far to get the perpendicular distance from point to line.
Point A
p_s, p_r = np.array([-380.,3510.]), np.array([-380.,2910.])
center = np.array([190.0,2390.0])
np.abs(np.cross(p_r-p_s, p_s-center)) / np.linalg.norm(p_r-p_s)
Result: 680.0
Point B
p_s, p_r = np.array([-380.,3510.]), np.array([-380.,2910.])
center = np.array([300.0,3240.0])
np.abs(np.cross(p_r-p_s, p_s-center)) / np.linalg.norm(p_r-p_s)
Result: 570.0
Based on my understanding, in case of point B, the above python code extends the line beyond Finish point and find the distance of the perpendicular line.
Is there a way to say Point A will be perpendicular to line start-finish while point B won't meet the line at 90?
Thanks.

Let $S$ and $F$ be your start and finish points, and $P$ the point in question. Find the measure of angles $PSF$ and $PFS$. If either angle is obtuse, then the perpendicular through $P$ will not intersect the line segment $SF$.