Drag the dot and points of the line.
This is a formula for finding if a dot is touching a line, using slope formula and substitution to isolate the variables of the unknown coordinate, which is the point on the line that is closest to the dot (and for some reason it forms a perpendicular line with the dot.