Esempio n. 1
0
def test_polar_point3d_3():
    ppp = Point("1", 10, 20, 30)
    ooo = PolarObservation("1", "station", Angle("0", "DMS"), None, None, 1.0)
    sss = Station(ppp, ooo)
    oo2 = PolarObservation("2", None, Angle("90", "DMS"), Angle("90", "DMS"), Distance(20, "SD"), 3.5)
    pp2 = Calculation.polarpoint(sss, oo2)[0]
    assert compare(pp2, Point('2', 30.0000, 20.0000, 27.5))
Esempio n. 2
0
def test_polar_points():
    # polar points
    p101pol = Point("101", 13456.25, 12569.75)
    p201pol = Point("201", 13102.13, 11990.13)
    p202pol = Point("202", 13569.11, 12788.66)
    p203pol = Point("203", 13861.23, 12001.54)
    o101pol = PolarObservation('101', "station")
    s101pol = Station(p101pol, o101pol)
    o201pol = PolarObservation("201", None, Angle("112-15-15", "DMS"))
    o202pol = PolarObservation("202", None, Angle("288-06-30", "DMS"))
    o203pol = PolarObservation("203", None, Angle("45-21-12", "DMS"))
    o9pol = PolarObservation("9", None, Angle("145-10-16", "DMS"), None, Distance(206.17, "HD"))
    o10pol = PolarObservation("10", None, Angle("201-30-47", "DMS"), None, Distance(219.38, "HD"))
    z101pol = Calculation.orientation(s101pol, [[p201pol, o201pol], [p202pol, o202pol], [p203pol, o203pol]])[0]
    assert compare(z101pol.get_angle('DMS'), '99-10-05')

    s101pol.o.hz = z101pol
    p9pol = Calculation.polarpoint(s101pol, o9pol)[0]
    p10pol = Calculation.polarpoint(s101pol, o10pol)[0]
    assert compare(p9pol, Point("9", 13270.4141, 12480.4691))
    assert compare(p10pol, Point("10", 13267.5785, 12681.6903))

    pA1pol = Point("A1", 153.867, 456.430)
    pT1pol = Point("T1", -237.865, -297.772)
    pT2pol = Point("T2", -1549.927, 669.6126)
    pT3pol = Point("T3", 1203.064, -220.0314)
    oA1pol = PolarObservation('A1', "station")
    sA1pol = Station(pA1pol, oA1pol)
    oT1pol = PolarObservation("T1", None, Angle("73-02-35", "DMS"))
    oT2pol = PolarObservation("T2", None, Angle("142-43-39", "DMS"))
    oT3pol = PolarObservation("T3", None, Angle("348-24-26", "DMS"))
    oP1pol = PolarObservation("P1", None, Angle("112-43-47", "DMS"), None, Distance(673.699, "HD"))
    oP2pol = PolarObservation("P2", None, Angle("84-0-44", "DMS"), None, Distance(788.105, "HD"))
    zA1pol = Calculation.orientation(sA1pol, [[pT1pol, oT1pol], [pT2pol, oT2pol], [pT3pol, oT3pol]])[0]
    assert compare(zA1pol.get_angle('DMS'), '134-24-16')

    sA1pol.o.hz = zA1pol
    pP1pol = Calculation.polarpoint(sA1pol, oP1pol)[0]
    pP2pol = Calculation.polarpoint(sA1pol, oP2pol)[0]
    assert compare(pP1pol, Point("P1", -466.8905, 194.6468))

    assert compare(pP2pol, Point("P2", -335.8415, -161.0610))