Tile.ps

Below is the text of the postscript file tile.ps, which can be found in the directory /u/cl/lib/postscript The corresponding picture is a tiling of the hyperbolic plane by ideal triangles. See the previous page for directions on how to view a postscript file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DEFINITIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 
% set inch scale and line width
 
   /inch {72 mul} def % define one inch
   0.1 setlinewidth  
 
%  define parameters of figure:

  /R 2.5 inch def                   % the scale: radius of limit circle  
  /a 60 def                         % the central half-angle  
  /b 90 a sub 2 mul def             % the angle subtended by the arc  
  /c a 2 mul def                    % the angle of rotation  
  /r R a sin a cos div mul def      % initial radius  
  /n 3 def                          % the number of arcs
  /N 7 def                          % number of layers 
 
% define basic arc (rotate after drawing it to get ready for next one):
  
  /ARC {
     r R r 180 180 b add arc  
     stroke  
     c rotate
  } def 
 
% procedure to update parameters for successive layers of tiling:
 
  /update { 
    /a a 2 div def                  % update a: a <== a/2 
    /b 90 a sub 2 mul def           % update b: b <== (90 - a)/2 
    /c a 2 mul def                  % update c: c <== 2a  
    /r R a sin a cos div mul def    % update r: r <== R tan a  
    /n n 2 mul def                  % update n: n <== 2n 
  } def  
 
%%%%%%%%%%%%%%%%%%%%% NOW DRAW THE FIGURE %%%%%%%%%%%%%%%%%%%%% 
 
gsave % save graphics state

4.25 inch 6.0 inch translate % put origin near center of page 


% draw unit circle:  
  newpath  
  0 0 R 0 360 arc stroke  
 
% draw first layer of arcs: 
  1 1 n {ARC} for 
 
% finally, draw N-1 more layers: 
 
1 1 N 1 sub { 
  update 
  1 1 n {ARC} for 
  } for
 
grestore % restore graphics state

%%%%%%%%%%%%%%%%%%%%% FINALLY, ADD LEGEND %%%%%%%%%%%%%%%%%%%%%

  /Times-BoldItalic findfont 
  36 scalefont 
  setfont 
  1.5 inch 1.5 inch moveto
   
  (Tiling of Hyperbolic Plane) show 
 
showpage