def test_distance_segment_to_segment4():
    f1 = (0, 0)
    f2 = (278.05674689789083, 848.3102386968303)
    t1 = (221.055090540802, 675.7367042826397)
    t2 = (237.6344733521503, 723.4080418578025)
    d, pf, pt, u_f, u_t = de.distance_segment_to_segment(f1, f2, t1, t2)
    if directory:
        plot_distance_segment_to_segment_euc(
            f1, f2, t1, t2, pf, pt, "test_distance_segment_to_segment4")
    assert d == pytest.approx(0)
    assert pf == pytest.approx((228.63358669727376, 697.5274459946864))
    assert pt == pytest.approx((228.63358669727376, 697.5274459946864))
    assert u_f == pytest.approx(0.8222551304652699)
    assert u_t == pytest.approx(0.4571036354431931)
def test_distance_segment_to_segment2():
    f1 = (0, 0)
    f2 = (-0.43072496752146333, 381.4928613075559)
    t1 = (-206.26362055248765, -175.32538004745732)
    t2 = (-246.4746107556939, 480.8174213050763)
    d, pf, pt, u_f, u_t = de.distance_segment_to_segment(f1, f2, t1, t2)
    if directory:
        plot_distance_segment_to_segment_euc(
            f1, f2, t1, t2, pf, pt, "test_distance_segment_to_segment2")
    assert d == pytest.approx(216.60187728486514)
    assert pf == pytest.approx((0.0, 0.0))
    assert pt == pytest.approx((-216.1962718133358, -13.249350827191222))
    assert u_f == pytest.approx(0)
    assert u_t == pytest.approx(0.2470133466162735)