17. 3D Plot Example

% cat plot3d.ss
#define N 50
#define a 0.4
#define xCell(r,c) R ## r ## C ## c
#define Cell(r,c) xCell(r,c)

M = ((N/2.0)-0.5);

Cell(1,1):Cell(N,N) = { (sin(a*(row()-M))/(row()-M)) *
                        (sin(a*(col()-M))/(col()-M)) };

eval; plot3d Cell(1,1):Cell(N,N);

% SS -p3 plot3d.ss > plot3d.gif