LOCDIREC:
GLOBAL A$(3),B$(3),C$(3),D$(3),E$(3),F$(3),AC,AS,OC,OS,B,C,DZ,D,E,BZ,AZ,ZA,AZI,J,A,QRA$(6),N,M,Q
REM F5AYE 20/6/94
PRINT"CALCUL LOCAT AZIMUT SUR:360.AZI 525.DIVI(0EST) 6400.ARTI DIVISIONS APPUYER / EXE"
GET :CLS
PRINT"ENTRER LOCAT PIVOT"
PRINT"POUR INTER. ENTRER YET STOPPER Z"
GOTO SUBA::
SUBE::
QRA$=A$+B$+C$+D$+E$+F$
AS=AC*PI/180 :OS=OC*PI/180
PRINT"ENTRER LOCAT STATION"
GOTO SUBA::
SUBF::
OC=OC*PI/180 :AC=AC*PI/180
B=(COS(OC-OS)*COS(AC)*COS(AS))+(SIN(AC)*SIN(AS))
C=SQR(1-(B*B))/B
IF C<0 :DZ=PI+ATAN(C) :GOTO SUBB::
ENDIF
DZ=ATAN(C)
SUBB::
D=ABS(111.111*DZ*180/PI)
E=INT(D)
IF D-E>0.5 :E=E+1
ENDIF
BZ=(SIN(AC)-SIN(AS)*COS(DZ))/(SIN(DZ)*COS(AS))
IF BZ>1 :AZ=0 :GOTO SUBC::
ENDIF
IF BZ<-1 :AZ=180 :GOTO SUBC::
ENDIF
AZI=ATAN(SQR(1-(BZ*BZ))/BZ)*180/PI
AZ=INT(AZI)
IF AZI-AZ<0.5 :AZ=AZ+1
ENDIF
IF AZ<0 :AZ=180+AZ
ENDIF
IF SIN(OS-OC)<0 :GOTO SUBC::
ENDIF
AZ=360-AZ
SUBC::
Q=INT((6400*AZ)/360)
PRINT"DIST.";E;" KM ARTI";Q
ZA=AZ-90 :IF AZ>=0 AND AZ<90 :ZA=ZA+360 :ENDIF
M=INT((525*ZA)/360)
PRINT"AZIMUT:";AZ;" DIVI:";M
PRINT"ENTRER LOCAT STATION"
SUBA::
REM ROUTINE
A$=GET$ :IF A$="" :GOTO SUBA::
ENDIF
IF A$="Y"
OFF :GOTO SUBA:: :ENDIF
IF A$="Z"
STOP :ENDIF
B$=GET$ :IF B$="" :GOTO SUBA::
ENDIF
KSTAT 3
C$=GET$ :IF C$="" :GOTO SUBA::
ENDIF
D$=GET$ :IF D$="" :GOTO SUBA::
ENDIF
KSTAT 1
E$=GET$ :IF E$="" :GOTO SUBA::
ENDIF
F$=GET$ :IF F$="" :GOTO SUBA::
ENDIF
PRINT A$;B$;C$;D$;E$;F$
IF A$<"A" OR A$>"R" :GOTO SUBD::
ENDIF
IF B$<"A" OR B$>"R" :GOTO SUBD::
ENDIF
IF C$<"0" OR C$>"9" :GOTO SUBD::
ENDIF
IF D$<"0" OR D$>"9" :GOTO SUBD::
ENDIF
IF E$<"A" OR E$>"X" :GOTO SUBD::
ENDIF
IF F$<"A" OR F$>"X" :GOTO SUBD::
ENDIF
OC=(ASC(A$)-ASC("J"))*20+(ASC(C$)-ASC("0"))*2+(FLT(ASC(E$)-ASC("A")))*1/12+0.04
AC=(ASC(B$)-ASC("J"))*10+ASC(D$)-ASC("0")+(FLT(ASC(F$)-ASC("A")))*1/24+0.02
N=N+1
IF N>1 :GOTO SUBF::
ENDIF
GOTO SUBE::
SUBD::
PRINT"ERREUR LOCATOR .."
GOTO SUBA::