CLICK HERE FOR FREE BLOGGER TEMPLATES, LINK BUTTONS AND MORE! »

Total Tayangan Halaman

Trail Of Waving Hearts

Rabu, 27 Februari 2019

REM PROGRAM PERHITUNGAN AZIMUT AB MATLAB



REM PROGRAM PERHITUNGAN AZIMUT AB
REM PROGRAM BY KHARISMA SRINARTA
CLS
PRINT "PROGRAM PERHITUNGAN AZIMUT AB"
INPUT "Koordinat XA =";XA
INPUT "Koordinat YA =";YA
INPUT "Koordinat XB =";XB
INPUT "Koordinay YB =";YB

       DX=XB-XA
       DY=YB-YA
       PI=4*ATN(1)
IF DX=0 OR DY=0 THEN GOSUB 1000 ELSE GOSUB 2000

PRINT
PRINT "KOORDINAT A";TAB(20);"KOORDINAT B";TAB(40);"AZIMUT AB"
PRINT "======================================================"
PRINT "(";XA;",";YA;")";TAB(20);"(";XB;",";YB;")";TAB(40);AD
END

1000 IF DX=0 AND DY>0 THEN AD=0 ELSE IF DX=0 AND DY<0 THEN AD=180 ELSE IF DX>0 AND DY=0 THEN AD=90 ELSE AD=270
RETURN

2000 AR=ATN(DX/DY)
AR2=ABS(AR)
ADG=AR2*180/PI
IF DX>0 AND DY>0 THEN AD=ADG ELSE IF DX>0 AND DY<0 THEN AD=180-ADG ELSE IF DX<0 AND DY<0 THEN AD=180+ADG ELSE AD=360-ADG
RETURN
PRINT "Terima Kasih Telah Melakukan Perhitungan"

(Hasil)
PROGRAM PERHITUNGAN AZIMUT AB
Koordinat XA =-20
Koordinat YA =35
Koordinat XB =45
Koordinay YB =-22

KOORDINAT A        KOORDINAT B            AZIMUT AB
======================================================
(-20,35)                            (45,-22)                       131.248271


Tidak ada komentar:

Posting Komentar