Guest User

Untitled

a guest
Jun 21st, 2018
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. %!
  2. % M. C. Escher style impossible triangle
  3. % written by Guy Shaw
  4.  
  5. % Things that are easy to play with:
  6. % Position on paper, overall size, and linewidth
  7. /inch { 72 mul } bind def
  8.  
  9. 2 inch dup translate
  10. 3 inch dup scale
  11. 1 3 inch div setlinewidth
  12.  
  13. % Thickness parameter:
  14. % /Thick is the thickness of the structural members of the triange,
  15. % as a fraction of the height of the triangle.
  16. % Reasonable looking impossible triangles can be obtained with Thick <= 1/6.
  17. % right at /Thick == 1/6, there is no space left inside the triangle.
  18. % /Thick > 1/6 yields bizarre, but not very interesting results.
  19. % /Thick < 1/20 is less interesting, because the "impossibility"
  20. % is not so striking when the structural members are that thin.
  21. % A good "standard" value is 1/8.
  22.  
  23. /Thick 1 8 div def
  24.  
  25. % You would not normally want to change anything that follows.
  26.  
  27. /Tall 1 def
  28. /HalfThick Thick .5 mul def
  29.  
  30. newpath
  31. HalfThick Thick moveto
  32. Thick 0 lineto
  33. 1 Thick sub 0 lineto
  34. 1 HalfThick sub Thick lineto
  35. .5 HalfThick add Tall Thick sub lineto
  36.  
  37. 1 Thick sub 0 moveto
  38. .5 HalfThick add Tall 3 Thick mul sub lineto
  39. Thick 3 mul Thick 2 mul lineto
  40.  
  41. 1 Thick 2.5 mul sub Thick moveto
  42. .5 Tall Thick 4 mul sub lineto
  43. stroke
  44.  
  45. newpath
  46. HalfThick Thick moveto
  47. 1 Thick 2.5 mul sub Thick lineto
  48. HalfThick neg Thick rlineto
  49. Thick Thick add Thick Thick add lineto
  50. .5 HalfThick add Tall Thick sub lineto
  51. Thick neg 0 rlineto
  52. closepath
  53. fill
  54.  
  55. showpage
  56. % --
  57. % Guy Shaw
  58. % Paralogics
  59. % paralogics!shaw@uunet.uu.net or uunet!paralogics!shaw
Add Comment
Please, Sign In to add comment