buildicefrontnormal

PURPOSE ^

BUILDICEFRONTNORMALS - compute normals of the ice front

SYNOPSIS ^

function [length_icefront,normal_icefront]=buildicefrontnormals(x,y,index_icefront);

DESCRIPTION ^

BUILDICEFRONTNORMALS - compute normals of the ice front

   this routine builds the normal of the segments located on the ice front and calculates
   the length of these segments.

   Usage:
      [length_icefront,normal_icefront]=buildicefrontnormals(index_icefront);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [length_icefront,normal_icefront]=buildicefrontnormals(x,y,index_icefront);
0002 %BUILDICEFRONTNORMALS - compute normals of the ice front
0003 %
0004 %   this routine builds the normal of the segments located on the ice front and calculates
0005 %   the length of these segments.
0006 %
0007 %   Usage:
0008 %      [length_icefront,normal_icefront]=buildicefrontnormals(index_icefront);
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 );

Generated on Sun 29-Mar-2009 20:22:55 by m2html © 2003