Exemplo n.º 1
0
def test_intersection2d():
    A1 = Point("A1", -150, -120)
    A2 = Point("A2", 130, 75)
    sA1o = PolarObservation('A1', 'station', Angle("76-13-23", "DMS"))
    sA2o = PolarObservation('A2', 'station', Angle("324-10-58", "DMS"))
    sA1 = Station(A1, sA1o)
    sA2 = Station(A2, sA2o)
    oA1 = PolarObservation("p3", None, Angle("308-46-36", "DMS"))
    oA2 = PolarObservation("p3", None, Angle("345-49-02", "DMS"))
    P3 = Calculation.intersection(sA1, oA1, sA2, oA2)
    assert compare(P3[0], Point('p3', -5.8979, 189.0319))
Exemplo n.º 2
0
def test_coincident_intersection():
    A3 = Point("A3", 0, 0)
    A4 = Point("A4", 100, 100)
    sA3o = PolarObservation('A3', 'station', Angle("0", "DMS"))
    sA4o = PolarObservation('A4', 'station', Angle("0", "DMS"))
    sA3 = Station(A3, sA3o)
    sA4 = Station(A4, sA4o)
    oA3 = PolarObservation("p5", None, Angle("45", "DMS"))
    oA4 = PolarObservation("p5", None, Angle("45", "DMS"))
    P5 = Calculation.intersection(sA3, oA3, sA4, oA4)[0]
    assert compare(P5, None)
Exemplo n.º 3
0
def test_intersection3d():
    p1 = Point('1', 100, 200, 20)
    p2 = Point('2', 150, 250, 30)
    s1o = PolarObservation('1', 'station', Angle(0))
    s2o = PolarObservation('2', 'station', Angle(0))
    s1 = Station(p1, s1o)
    s2 = Station(p2, s2o)
    o1 = PolarObservation("p", None, Angle(25, "DEG"))
    o2 = PolarObservation("p", None, Angle(310, "DEG"))
    p3 = Calculation.intersection(s1, o1, s2, o2)
    assert compare(p3[0], Point('p', 130.8201, 266.0939))
Exemplo n.º 4
0
def test_parallel_intersection():
    A1 = Point("A1", -150, -120)
    A2 = Point("A2", 130, 75)
    sA1o = PolarObservation('A1', 'station', Angle("0", "DMS"))
    sA2o = PolarObservation('A2', 'station', Angle("0", "DMS"))
    sA1 = Station(A1, sA1o)
    sA2 = Station(A2, sA2o)
    oA1 = PolarObservation("p4", None, Angle("225", "DMS"))
    oA2 = PolarObservation("p4", None, Angle("45", "DMS"))
    P4 = Calculation.intersection(sA1, oA1, sA2, oA2)[0]
    assert P4.e < -1.0E+17
    assert P4.n < -1.0E+17
Exemplo n.º 5
0
def test_reciprocal_intersection():
    A3 = Point("A3", 0, 0)
    A4 = Point("A4", 100, 100)
    sA3o = PolarObservation('A3', 'station', Angle("0", "DMS"))
    sA4o = PolarObservation('A4', 'station', Angle("0", "DMS"))
    sA3 = Station(A3, sA3o)
    sA4 = Station(A4, sA4o)
    oA3 = PolarObservation("p5", None, Angle("45", "DMS"))
    oA4 = PolarObservation("p5", None, Angle("225", "DMS"))
    P5 = Calculation.intersection(sA3, oA3, sA4, oA4)[0]

    assert P5.e > 100.0
    assert P5.n > 100.0