Perhitungan Azimuth Menggunakan Aplikasi Matlab


INPUT :

clear all;
clc;
disp ('-------------------------------------------------');
disp ('>>>>>>>>Perhitungan Azimuth di Dua Titik<<<<<<<<<');
disp ('-------------------------------------------------');
XA=input(' Absis di titik A (XA)    = ');
XB=input(' Absis di titik B  (XB)   = ');
YA=input(' Ordinat di titik A (YA)  = ');
YB=input(' Ordinat di titik B (YB)  = ');
disp ('-------------------------------------------------');
Q=(XB-XA);
R=(YB-YA);
P=atand(Q/R);

if Q>0 & R<0
    disp(['Degree Azimuth AB = ' num2str((P+180))]);
elseif Q<0 & R<0
    disp(['Degree Azimuth AB = ' num2str((P+180))]);
elseif Q<0 & R>0
    disp(['Degree Azimuth AB = ' num2str((P+360))]);
else
    disp(['Degree Azimuth AB = ' num2str(P)]);
end;


OUTPUT :

1 comments:

 
Ary Sukma Putra © 2013. All Rights Reserved. Powered by Blogger
Top