%! /A [ 0 1 ] def A 0 get = % puts A[0] on the stack: 0 A aload % spills out the contents of A on the stack: 0 1 % PLUS A itself pop % gets rid of A A aload pop A 0 3 put % A now [ 3 1 ] % two arguments: 2D array + angle % returns the array rotated by angle % functions return values by putting them on the stack /rotate-2d { 1 dict begin /B exch def aload pop /y exch def /x exch def /c B cos def /s B sin def % [ cx-ys sx+cy ] [ c x mul y s mul sub s x mul y c mul add ] end } def [ 0 1 ] 45 rotate-2d ==