Thank you, It works.
This is program for Pothenot snellius - Problem used in Geodesy to calculate the coordinates of point T.
On the beginning you are asked to input coordinates of points A,M,B, and measured angle Alpha, Beta. Point A is determined going from unknown point T in clockwise direction A,M,B
This is the result
You can Use this data to test the program:
Note: this is 47 deg- 43 min-13.8sec
Calculator set in Degrees mode
The code:
Code:
EXPORT Nazad2()
BEGIN
LOCAL Aa,Ab,ya,xa,yb,xb,Xt,Yt;
LOCAL xm,ym,da,db,Mi1,Kk2,Pp2;
LOCAL Tx,Ty;
INPUT({Aa,Ab,ya,xa,ym,xm,yb,xb},"U smjeru kazaljke na satu od nepoznate tacke", {"Alfa","Beta","ya","xa","ym","xm","yb","xb"});
// Duzine a=da i b=db
da:=SQRT((ya-ym)^2+(xa-xm)^2);
db:=SQRT((ym-yb)^2+(xm-xb)^2);
///Mikro tj Mi
Mi1:=atan((da*sin(Ab))/(db*sin(Aa)));
// Direkcioni sa A na M
LOCAL y1,x1,n1;
y1:=ym-ya;
x1:=xm-xa;
CASE
IF y1>0 AND x1>0 THEN n1:=ATAN(y1/x1) END;
IF y1>0 AND x1<0 THEN n1:=ATAN(y1/x1)+180 END;
IF y1<0 AND x1<0 THEN n1:=ATAN(y1/x1)+180 END;
IF y1<0 AND x1>0 THEN n1:=ATAN(y1/x1)+360 END;
END;
// Direkcioni sa B na M
LOCAL y2,x2,n2;
y2:=ym-yb;
x2:=xm-xb;
CASE
IF y2>0 AND x2>0 THEN n2:=ATAN(y2/x2) END;
IF y2>0 AND x2<0 THEN n2:=ATAN(y2/x2)+180 END;
IF y2<0 AND x2<0 THEN n2:=ATAN(y2/x2)+180 END;
IF y2<0 AND x2>0 THEN n2:=ATAN(y2/x2)+360 END;
END;
// Ugao delta
LOCAL n3,n4,n5,n6,Dd1;
CASE
IF n1>180 THEN n3:=n1-180 END;
IF n1<180 THEN n3:=n1+180 END;
END;
CASE
IF n2>180 THEN n4:=n2-180 END;
IF n2<180 THEN n4:=n2+180 END;
END;
// Ugao delta Dd1
Dd1:=n3-n4;
// fi+ ksi=Ff1 fi - ksi=kk1
LOCAL Ff1,Kk1;
Ff1:= 180- ((Aa+Ab+Dd1)/2);
Kk1:=atan(tan(Ff1)*1/tan(Mi1+45));
// FI I KSI
LOCAL Fi1,Ks1;
CASE
IF Mi1>45 THEN Fi1:=Ff1-Kk1 END;
IF Mi1<45 THEN Fi1:=Ff1+Kk1 END;
END;
CASE
IF Mi1>45 THEN Ks1:=Ff1+Kk1 END;
IF Mi1<45 THEN Ks1:=Ff1-Kk1 END;
END;
PRINT("------UPUTSTVO--------");
PRINT("--------DIGITRON U STEPENE------");
PRINT("u smjeru kazaljke na satu od nepoznate Oznacit A(FI) M u sredini, desno B- ksi");
@matalog I really appreciate the time you took to write the tips and commands. They were a lot of help!
Also thank to other users like road that helped me in the past with the variable inputs.