function [di,dj] = phi_to_xy_increment(phi) % % Written by: % -- % John L. Weatherwax 2005-08-04 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % % Epage % %----- switch phi % assign signs based on "matrix index increments" case 0, di= 0; dj= 1; case 45, di= -1; dj= +1; case 90, di= 1; dj= 0; case 135 di= -1; dj= -1; otherwise assert( logical(0), 'unknown value of phi' ); end