function [x,y]=crystal(R,C)
% crystal Create hexagonal crystal lattice.
% Usage:: [x,y]=crystal(R,C)
%
% Create hexagonal crystal lattice with R rows and C columns

% revision history:
% 09/12/03 Mark D. Shattuck <mds>   crystal.m

[x y]=ndgrid((0:R-1)-(R-1)/2,((0:C-1)-(C-1)/2)*(sqrt(3)/2));
x(:,1:2:C)=x(:,1:2:C)-1/4;
x(:,2:2:C)=x(:,2:2:C)+1/4;
