border

PURPOSE ^

computes the vertices of the area

SYNOPSIS ^

function vertices = border(r,km,lm,sites)

DESCRIPTION ^

 computes the vertices of the area

  INPUT
   

  OUTPUT
   vertices          vertices of the area


 $Id: border.m,v 1.1 2004/05/12 16:22:59 dalai Exp $

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % computes the vertices of the area
0002 %
0003 %  INPUT
0004 %
0005 %
0006 %  OUTPUT
0007 %   vertices          vertices of the area
0008 %
0009 %
0010 % $Id: border.m,v 1.1 2004/05/12 16:22:59 dalai Exp $
0011 
0012 function vertices =  border(r,km,lm,sites)
0013 
0014 hex = r/sqrt(3)*exp(i*pi*(1:2:13)/6)';
0015 
0016 cellpoints =  repmat(hex,1,size(sites,2))+repmat(sites,7,1);
0017 cellpoints = reshape(cellpoints,1,size(cellpoints,1)*size(cellpoints,2));
0018 
0019 inner_hex = (km+.1)*r*exp(2*i*pi*(1:8)/6)';
0020 
0021 in = inpolygon(real(cellpoints),imag(cellpoints),real(inner_hex),imag(inner_hex));
0022 
0023 vertices = sortangle(cellpoints(~in));
0024 vertices = [vertices vertices(1)];

Generated on Sun 15-Aug-2004 22:13:10 by m2html © 2003