%%HP: T(3)A(D)F(.);
\<<
@ Program to compute a Hause quadrilateral
DEG
@ Enter observations at Stn C

"Station C"
{":\Gd1:
:\Gd2:
:b :"
{ 1 0 } }
INPUT OBJ\->

"Station D"
{":\Gg1:
:\Gg2:"
{ 1 0 } }
INPUT OBJ\->

@ Store as local variables
\-> d1 d2 b g1 g2
\<<

@ Compute side 1
b g1 HMS\-> SIN *
180 d2 HMS- g1 HMS- HMS\-> SIN /

DUP

@ compute co-ords of P2
d2 HMS\-> COS *
SWAP
d2 HMS\-> SIN *

@ Compute side 2
b d1 HMS\-> SIN *
180 d1 HMS- g2 HMS- HMS\-> SIN /

DUP

@ Compute co-ords of P1
g2 HMS\-> COS * b SWAP -
SWAP
g2 HMS\-> SIN *

@ store as local variables
\-> xp2 yp2 xp1 yp1
\<<

@ compute beta
yp2 NEG xp1 xp2 - *
xp2 NEG yp1 yp2 - * -
yp2 NEG yp1 yp2 - *
xp2 NEG xp1 xp2 - * +
/
ATAN

"Solution

\Gb = " SWAP \->HMS DMS +
CLLCD 1 DISP 3 FREEZE 0 WAIT

\>>
\>>
\>>
