FUNCTION RECT2D,X,Y ;+ ; Z=RECT2D(X,Y) ; Computes the 2D rect function for the arrays X and Y, The ; result is unity wherever the corresponding values in the ; X and Y array are within a unit rectangle centered on the origin. ; ; X and Y must be arrays that are of the same size. ; ; USAGE ; Compute X and Y arrays using MESHDOM ; s=INDGEN(101)/10 -5 ; t=INDGEN(101)/10 -5 ; MESHDOM,s,t,X,Y ; Z=RECT2D(X/2,Y/3) ; SURFACE,Z,X/2,Y/3 ; ; HISTORY ; Written by Harvey Rhody, September 1997 ;- RETURN,0*X+(X GE -0.5 AND X LE 0.5) AND (Y GE -0.5 AND Y LE 0.5) END