creates an hexagonal cell INPUT h0 center of the hexagon in the "hexagon base" : [1; exp(2*i*pi/3); exp(4*i*pi/3)] radius radius of the hexagon style plot style (as in regular plot function) OUTPUT fig plot of the hexagonal cell $Id: mk_hex.m,v 1.1 2004/05/12 16:22:59 dalai Exp $
0001 % creates an hexagonal cell 0002 % 0003 % INPUT 0004 % h0 center of the hexagon in the "hexagon base" : [1; exp(2*i*pi/3); exp(4*i*pi/3)] 0005 % radius radius of the hexagon 0006 % style plot style (as in regular plot function) 0007 % 0008 % OUTPUT 0009 % fig plot of the hexagonal cell 0010 % 0011 % 0012 % $Id: mk_hex.m,v 1.1 2004/05/12 16:22:59 dalai Exp $ 0013 0014 function fig = mk_hex(h0,radius) 0015 0016 fig = plot( h0 + exp(i*pi*(1:2:13)/6).'*radius , 'k');