5 ′Intersection
10 CLS:BEEP:BEEP1:ANGLE 0:SET F5:PRINT CHR$(9);:CLS
20 PRINT " ***Find Intersection point***"
30 CLS:PRINT "<<1:AZI#AZI>> <<2:AZI#DIST>>";:PRINT
40 PRINT"<<3:DIST#DIST>> <>";
50 T$=INKEY$
60 IF (T$="1") THEN 150
70 IF (T$="2") THEN 600
80 IF (T$="3") THEN 800
90 IF (T$="4") THEN 400
100 IF (T$="Q") THEN PRINT TAB(10);"<<>>"; :SET F9:END
110 GOTO 50
150 CLS:PRINT "N1=";N1;:INPUT N1
160 PRINT "E1=";E1;:INPUT E1
170 PRINT "AZIMUTH1=";AZI1;:INPUT AZI1
180 FANG=AZI1:GOSUB 3000:DAZI1=DANG
190 PRINT "N2=";N2;:INPUT N2
200 PRINT "E2=";E2;:INPUT E2
210 PRINT "AZIMUTH2=";AZI2;:INPUT AZI2
220 FANG=AZI2:GOSUB 3000:DAZI2=DANG
230 DELTY=N2-N1:DELTX=E2-E1
240 GOSUB 3500:AZI12=Y:DIST12=X
250 NI=(TAN(DAZI2)*N2-TAN(DAZI1)*N1+E1-E2)/(TAN(DAZI2)- TAN(DAZI1))
260 EI=(NI-N1)*TAN(DAZI1)+E1
290 PRINT "NI= ";NI;:PRINT
300 PRINT "EI= ";EI
310 GOTO 30
400 ′Four points
410 CLS:PRINT "N1= ";N1;:INPUT N1
420 PRINT "E1= ";E1;:INPUT E1
430 PRINT "N2= ";N2;:INPUT N2
440 PRINT "E2= ";E2;:INPUT E2
450 PRINT "N3= ";N3;:INPUT N3
460 PRINT "E3= ";E3;:INPUT E3
470 PRINT "N4= ";N4;:INPUT N4
480 PRINT "E4= ";E4;:INPUT E4
490 DELTY=N2-N1:DELTX=E2-E1:GOSUB 3500:AZI12=Y:DIST12=X
500 DELTY=N4-N3:DELTX=E4-E3:GOSUB 3500:AZI34=Y:DIST34=X
510 DELTY=N3-N1:DELTX=E3-E1:GOSUB 3500:AZI=Y
512 IF (AZI12=90 OR AZI12=270) THEN NI=N1 ELSE 515
513 EI=(NI-N3)*TAN(AZI34)+E3
515 IF (AZI34=90 OR AZI34=270) THEN NI=N3 ELSE 520
520 IF NOT((AZI12=90 OR AZI12=270) OR (AZI34=90 OR AZI34=270)) THEN NI=(TAN(AZI34)*N3-TAN(AZI12)*N1+E1- E3)/(TAN(AZI34)-TAN(AZI12)) ELSE 540
530 EI=(NI-N1)*TAN(AZI12)+E1
540 PRINT "NI= ";NI;:PRINT
550 PRINT "EI= ";EI
560 GOTO 30
600 ′AZI # DIST
610 CLS:PRINT "N1= ";N1;:INPUT N1
620 PRINT "E1= ";E1;:INPUT E1
630 PRINT "AZIMUTH= ";INAZI;:INPUT INAZI:FANG=INAZI:GOSUB 3000:DAZI1=DANG
635 CANG=0:PAZI=DAZI1:GOSUB 4500:DAZI2=NAZI
640 PRINT "N2= ";N2;:INPUT N2 645 PRINT "E2= ";E2;:INPUT E2
650 PRINT "DIST= ";DIST;:INPUT DIST
660 DELTY=N2-N1:DELTX=E2-E1:GOSUB 3500:DIST12=X:AZI12=Y
670 PHI1=AZI12-DAZI1:IF PHI1<0 THEN PHI1=PHI1+360
675 PHI2=AZI12-DAZI2:IF PHI2<0 THEN PHI2=PHI2+360
680 NI1=(SQR(DIST^2-(DIST12*SIN(PHI1))^2)
+DIST12*COS(PHI1))*COS(DAZI1)+N1
685 NI2=(SQR(DIST^2-(DIST12*SIN(PHI2))^2)
+DIST12*COS(PHI2))*COS(DAZI2)+N1
690 EI1=(SQR(DIST^2-(DIST12*SIN(PHI1))^2)
+DIST12*COS(PHI1))*SIN(DAZI1)+E1
695 EI2=(SQR(DIST^2-(DIST12*SIN(PHI2))^2)
+DIST12*COS(PHI2))*SIN(DAZI2)+E1
700 PRINT "NI(1)= ";NI1;:PRINT
710 PRINT "EI(1)= ";EI1
720 PRINT "NI(2)= ";NI2;:PRINT
730 PRINT "EI(2)= ";EI2
740 GOTO 30
800 ′DIST # DIST
810 CLS:PRINT "N1= ";N1;:INPUT N1
820 PRINT "E1= ";E1;:INPUT E1
830 PRINT "DIST1= ";DIST1;:INPUT DIST1
835 PRINT "N2= ";N2;:INPUT N2
840 PRINT "E2= ";E2;:INPUT E2
850 PRINT "DIST2= ";DIST2;:INPUT DIST2
860 DELTY=N2-N1:DELTX=E2-E1:GOSUB 3500:DIST12=X:AZI12=Y
870 ANG=ACS((DIST2^2+DIST12^2-DIST1^2)/(2*DIST2*DIST12))
880 ANG1=ANG:ANG2=-1*ANG+360
890 CANG=ANG1:PAZI=AZI12:GOSUB 4500:AZI2I1=NAZI ′AZI 2=> Int No.1
900 CANG=ANG2:PAZI=AZI12:GOSUB 4500:AZI2I2=NAZI
910 PNI=N2+DIST2*COS(AZI2I1)
920 PEI=E2+DIST2*SIN(AZI2I1)
930 MNI=N2+DIST2*COS(AZI2I2)
940 MEI=E2+DIST2*SIN(AZI2I2)
950 CLS:BEEP:PRINT "NI(1)= ";PNI;:PRINT
960 PRINT "EI(1)= ";PEI
970 CLS:PRINT "NI(2)= ";MNI;:PRINT
980 PRINT "EI(2)= ";MEI
990 GOTO 30
3000 ′Convert input angle to degree
3010 DD=FIX(FANG)
3020 TEMP=FRAC(FANG)*100
3030 MM=FIX(TEMP)
3040 SS=FRAC(TEMP)*100
3050 DANG=DEG(DD,MM,SS)
3060 RETURN
3500 ′Find Azimuth
3510 X=POL(DELTY,DELTX)
3520 IF Y<0 THEN Y=Y+360
3530 RETURN
4500 ′Find next azimuth
4510 TEMP=CANG+PAZI
4520 IF TEMP>180 THEN 4550 ELSE 4530
4530 TEMP=TEMP+180
4540 GOTO 4590
4550 IF TEMP>540 THEN 4580
4560 TEMP=TEMP-180
4570 GOTO 4590
4580 TEMP=TEMP-540
4590 NAZI=TEMP
4600 RETURN