What is the value of r if the distance between the point (4,2) and (1,r)…