Update Line.java

added the case if there is no distance in the x