i have and origin and a destination of a line stored as co ords of a grid (x,y)

i need to calculate if another random point is on the path of that line

any 1 know how?