def find_min_new (a,b,c,d): ab = Vector(a, b) cd = Vector(c, d) res_intersection = ab.is_intersection(cd) if res_intersection == 0: print("One end of segment belongs another segment") return ab.length() elif res_intersection < 0: print("Not intersection") return ab.length() else: bd = Vector(b, d) ad = Vector(a, d) cb = Vector(c, b) ac = Vector(a, c) print("Intersection") return min(ac.length()+cb.length(), ad.length()+bd.length())