%
%   Book: MATLAB-Based Electromagnetics (Pearson Prentice Hall)
%   Author: Branislav M. Notaros
%   Instructor Resources
%   (c) 2011
%
%   This MATLAB code or any part of it may be used only for 
%   educational purposes associated with the book
%
%
%


%   Preprocessing of geometrical data for the MoM matrix


function [p,q,S] = localCoordinates(n,m,a,b)
dp = a/n;
dq = b/m;
for i=1:n
    for j=1:m
        p(m*(i-1)+ j) = (i-1/2)*dp; 
        q(m*(i-1)+ j) = (j-1/2)*dq;
        S(m*(i-1)+ j) = dp*dq;
    end;
end;