load coords.txt
load fault.txt
load new_faults.txt

llh = zeros(size(fault'));  llh(1,:) = fault(:,2)'; llh(2,:) = fault(:,1)';
    
or = coords(61,:)';		%% origin of fault model is AF26
origin = [or(1), or(2)];
%origin  = [24+13/60+18.1/360 120+39/60+5/360];
XY = llh2localxy(llh, origin);
   
   
%shift the E and N to local Taiwan coordinate system
XY(:,1)=XY(:,1)+.897;
XY(:,2)=XY(:,2)-0.1945;

fault1=XY(1:363,:); l=plot(fault1(:,1),fault1(:,2),'r');set(l,'linewidth',2); hold on;
%fault2=XY(364:374,:);l=plot(fault2(:,1),fault2(:,2),'g');set(l,'linewidth',2);
%fault3=XY(375:389,:);l=plot(fault3(:,1),fault3(:,2),'g');set(l,'linewidth',2);
%fault4=XY(390:395,:);l=plot(fault4(:,1),fault4(:,2),'g');set(l,'linewidth',2);
%fault5=XY(396:402,:);l=plot(fault5(:,1),fault5(:,2),'g');set(l,'linewidth',2);
%fault6=XY(403:404,:);l=plot(fault6(:,1),fault6(:,2),'g');set(l,'linewidth',2);
%fault7=XY(408:414,:);l=plot(fault7(:,1),fault7(:,2),'g');set(l,'linewidth',2);
%fault8=XY(415:418,:);l=plot(fault8(:,1),fault8(:,2),'g');set(l,'linewidth',2);
%fault9=XY(419:424,:);l=plot(fault9(:,1),fault9(:,2),'g');set(l,'linewidth',2);
%fault10=XY(425:428,:);l=plot(fault10(:,1),fault10(:,2),'g');set(l,'linewidth',2);

fault2=new_faults(1:8,:);l=plot(fault2(:,1),fault2(:,2),'r');set(l,'linewidth',2);
fault2=new_faults(9:16,:);l=plot(fault2(:,1),fault2(:,2),'r');set(l,'linewidth',2);
fault2=new_faults(17:25,:);l=plot(fault2(:,1),fault2(:,2),'r');set(l,'linewidth',2);
fault2=new_faults(26:38,:);l=plot(fault2(:,1),fault2(:,2),'r');set(l,'linewidth',2);
fault2=new_faults(39:47,:);l=plot(fault2(:,1),fault2(:,2),'r');set(l,'linewidth',2);
fault2=new_faults(48:52,:);l=plot(fault2(:,1),fault2(:,2),'r');set(l,'linewidth',2);
fault2=new_faults(53:60,:);l=plot(fault2(:,1),fault2(:,2),'r');set(l,'linewidth',2);
fault2=new_faults(61:67,:);l=plot(fault2(:,1),fault2(:,2),'r');set(l,'linewidth',2);
fault2=new_faults(68:77,:);l=plot(fault2(:,1),fault2(:,2),'r');set(l,'linewidth',2);



