0001 function [length_icefront,normal_icefront]=buildicefrontnormals(x,y,index_icefront);
0002
0003
0004
0005
0006
0007
0008
0009
0010 length_icefront=zeros(length(index_icefront),1);
0011 normal_icefront=zeros(length(index_icefront),2);
0012
0013 length_icefront=sqrt( (x(index_icefront(:,1))-x(index_icefront(:,2))).^2 ...
0014 + (y(index_icefront(:,1))-y(index_icefront(:,2))).^2 );
0015
0016 normal_icefront(:,1)=cos( ...
0017 atan2( (x(index_icefront(:,1))-x(index_icefront(:,2))) , ...
0018 (y(index_icefront(:,2))-y(index_icefront(:,1))) ) ...
0019 );
0020
0021 normal_icefront(:,2)=sin( ...
0022 atan2( (x(index_icefront(:,1))-x(index_icefront(:,2))) , ...
0023 (y(index_icefront(:,2))-y(index_icefront(:,1))) ) ...
0024 );