Using grating projections to calculate fields at an arbitrary location