A line can be represented as
l-> << p - p_0, vec v >> = 0 which stated that the points along p-p_0 are orthogonal to vec v
For the line ax+by+c=0 we have
p_0 is any point obeying the line equation.
a x_0+b y_0+c=0
vec v = (a,b) and
p = (x, y)
so
l_1->x+2y-5=0
taking p_1 = (5,0) and vec v_1=(1,2) we have
l_1-> << p - p_1, vec v_1 >> = 0
l_2->2x+4y-7=0
taking p_2=(7/2,0) and vec v_2=(2,4)=2 vec v_1 we have
l_2-> << p-p_2,vec v_2 >> = << p-p_2,2 vec v_1 >> = 0
so l_1 and l_2 are parallel because vec v_2 = lambda vec v_1 with lambda ne 0
being parallels, their distance is easily obtained, computing the projection of p_2-p_1 into the unit vector hat(v_1). So
hat(v_1)=(vec v_1)/(norm (vec v_1)) = ((1,2))//sqrt(1+2^2) = (1,2)//sqrt(5)
p_2-p_1=(7/2-5,0-0) = (-3/2,0) and finally
d = abs(<< p_2-p_1, hat(v_1) >>) = 3/(2sqrt(5))