1 ex-1
1.1 source code in ex-1.rkt
1.2 the result of ex-1
2 ex-2
2.1 source code in ex-2.rkt
2.2 the result of ex-2
3 ex-3
3.1 source code in ex-3.rkt
3.2 the result of ex-3
4 ex-4
4.1 source code in ex-4.rkt
4.2 the result of ex-4
5 ex-5
5.1 source code in ex-5.rkt
5.2 the result of ex-5
6 ex-6
6.1 source code in ex-6.rkt
6.2 the result of ex-6
7 ex-7
7.1 source code in ex-7.rkt
7.2 the result of ex-7
8 ex-8
8.1 source code in ex-8.rkt
8.2 the result of ex-8
9 ex-9
9.1 source code in ex-9.rkt
9.2 the result of ex-9
10 ex-10
10.1 source code in ex-10.rkt
10.2 the result of ex-10
11 ex-11
11.1 source code in ex-11.rkt
11.2 the result of ex-11
12 ex-12
12.1 source code in ex-12.rkt
12.2 the result of ex-12
13 ex-13
13.1 source code in ex-13.rkt
13.2 the result of ex-13
14 ex-14
14.1 source code in ex-14.rkt
14.2 the result of ex-14
15 ex-15
15.1 source code in ex-15.rkt
15.2 the result of ex-15
16 ex-16
16.1 source code in ex-16.rkt
16.2 the result of ex-16
17 ex-17
17.1 source code in ex-17.rkt
17.2 the result of ex-17
18 ex-18
18.1 source code in ex-18.rkt
18.2 the result of ex-18
19 ex-19
19.1 source code in ex-19.rkt
19.2 the result of ex-19
20 ex-20
20.1 source code in ex-20.rkt
20.2 the result of ex-20
21 ex-21
21.1 source code in ex-21.rkt
21.2 the result of ex-21
22 ex-22
22.1 source code in ex-22.rkt
22.2 the result of ex-22
23 ex-23
23.1 source code in ex-23.rkt
23.2 the result of ex-23
24 ex-24
24.1 source code in ex-24.rkt
24.2 the result of ex-24
25 ex-25
25.1 source code in ex-25.rkt
25.2 the result of ex-25
26 ex-26
26.1 source code in ex-26.rkt
26.2 the result of ex-26
27 ex-27
27.1 source code in ex-27.rkt
27.2 the result of ex-27
28 ex-28
28.1 source code in ex-28.rkt
28.2 the result of ex-28
29 ex-29
29.1 source code in ex-29.rkt
29.2 the result of ex-29
30 ex-30
30.1 source code in ex-30.rkt
30.2 the result of ex-30
31 ex-31
31.1 source code in ex-31.rkt
31.2 the result of ex-31
32 ex-32
32.1 source code in ex-32.rkt
32.2 the result of ex-32
33 ex-33
33.1 source code in ex-33.rkt
33.2 the result of ex-33
34 ex-34
34.1 source code in ex-34.rkt
34.2 the result of ex-34
35 ex-35
35.1 source code in ex-35.rkt
35.2 the result of ex-35
36 ex-36
36.1 source code in ex-36.rkt
36.2 the result of ex-36
37 ex-37
37.1 source code in ex-37.rkt
37.2 the result of ex-37
38 ex-38
38.1 source code in ex-38.rkt
38.2 the result of ex-38
39 ex-39
39.1 source code in ex-39.rkt
39.2 the result of ex-39
40 ex-40
40.1 source code in ex-40.rkt
40.2 the result of ex-40
41 ex-41
41.1 source code in ex-41.rkt
41.2 the result of ex-41
42 ex-42
42.1 source code in ex-42.rkt
42.2 the result of ex-42
43 ex-43
43.1 source code in ex-43.rkt
43.2 the result of ex-43
44 ex-44
44.1 source code in ex-44.rkt
44.2 the result of ex-44
45 ex-45
45.1 source code in ex-45.rkt
45.2 the result of ex-45
46 ex-46
46.1 source code in ex-46.rkt
46.2 the result of ex-46
47 ex-47
47.1 source code in ex-47.rkt
47.2 the result of ex-47
48 ex-48
48.1 source code in ex-48.rkt
48.2 the result of ex-48
49 ex-49
49.1 source code in ex-49.rkt
49.2 the result of ex-49
50 ex-50
50.1 source code in ex-50.rkt
50.2 the result of ex-50
51 ex-51
51.1 source code in ex-51.rkt
51.2 the result of ex-51
52 ex-52
52.1 source code in ex-52.rkt
52.2 the result of ex-52
53 ex-53
53.1 source code in ex-53.rkt
53.2 the result of ex-53
54 ex-54
54.1 source code in ex-54.rkt
54.2 the result of ex-54
55 ex-55
55.1 source code in ex-55.rkt
55.2 the result of ex-55
56 ex-56
56.1 source code in ex-56.rkt
56.2 the result of ex-56
57 ex-57
57.1 source code in ex-57.rkt
57.2 the result of ex-57
58 ex-58
58.1 source code in ex-58.rkt
58.2 the result of ex-58
59 ex-59
59.1 source code in ex-59.rkt
59.2 the result of ex-59
60 ex-60
60.1 source code in ex-60.rkt
60.2 the result of ex-60
61 ex-61
61.1 source code in ex-61.rkt
61.2 the result of ex-61
62 ex-62
62.1 source code in ex-62.rkt
62.2 the result of ex-62
63 ex-63
63.1 source code in ex-63.rkt
63.2 the result of ex-63
64 ex-64
64.1 source code in ex-64.rkt
64.2 the result of ex-64
65 ex-65
65.1 source code in ex-65.rkt
65.2 the result of ex-65
66 ex-66
66.1 source code in ex-66.rkt
66.2 the result of ex-66
67 ex-67
67.1 source code in ex-67.rkt
67.2 the result of ex-67
68 ex-68
68.1 source code in ex-68.rkt
68.2 the result of ex-68
69 ex-69
69.1 source code in ex-69.rkt
69.2 the result of ex-69
70 ex-70
70.1 source code in ex-70.rkt
70.2 the result of ex-70
71 ex-71
71.1 source code in ex-71.rkt
71.2 the result of ex-71
72 ex-72
72.1 source code in ex-72.rkt
72.2 the result of ex-72
73 ex-73
73.1 source code in ex-73.rkt
73.2 the result of ex-73
74 ex-74
74.1 source code in ex-74.rkt
74.2 the result of ex-74
75 ex-75
75.1 source code in ex-75.rkt
75.2 the result of ex-75
76 ex-76
76.1 source code in ex-76.rkt
76.2 the result of ex-76
77 ex-77
77.1 source code in ex-77.rkt
77.2 the result of ex-77
78 ex-78
78.1 source code in ex-78.rkt
78.2 the result of ex-78
79 ex-79
79.1 source code in ex-79.rkt
79.2 the result of ex-79
80 ex-80
80.1 source code in ex-80.rkt
80.2 the result of ex-80
81 ex-81
81.1 source code in ex-81.rkt
81.2 the result of ex-81
82 ex-82
82.1 source code in ex-82.rkt
82.2 the result of ex-82
83 ex-83
83.1 source code in ex-83.rkt
83.2 the result of ex-83
84 ex-84
84.1 source code in ex-84.rkt
84.2 the result of ex-84
85 ex-85
85.1 source code in ex-85.rkt
85.2 the result of ex-85
86 ex-86
86.1 source code in ex-86.rkt
86.2 the result of ex-86
87 ex-87
87.1 source code in ex-87.rkt
87.2 the result of ex-87
88 ex-88
88.1 source code in ex-88.rkt
88.2 the result of ex-88
89 ex-89
89.1 source code in ex-89.rkt
89.2 the result of ex-89
90 ex-90
90.1 source code in ex-90.rkt
90.2 the result of ex-90
91 ex-91
91.1 source code in ex-91.rkt
91.2 the result of ex-91
92 ex-92
92.1 source code in ex-92.rkt
92.2 the result of ex-92
93 ex-93
93.1 source code in ex-93.rkt
93.2 the result of ex-93
94 ex-94
94.1 source code in ex-94.rkt
94.2 the result of ex-94
95 ex-95
95.1 source code in ex-95.rkt
95.2 the result of ex-95
96 ex-96
96.1 source code in ex-96.rkt
96.2 the result of ex-96
97 ex-97
97.1 source code in ex-97.rkt
97.2 the result of ex-97
98 ex-98
98.1 source code in ex-98.rkt
98.2 the result of ex-98
99 ex-99
99.1 source code in ex-99.rkt
99.2 the result of ex-99
100 ex-100
100.1 source code in ex-100.rkt
100.2 the result of ex-100
101 ex-101
101.1 source code in ex-101.rkt
101.2 the result of ex-101
102 ex-102
102.1 source code in ex-102.rkt
102.2 the result of ex-102
103 ex-103
103.1 source code in ex-103.rkt
103.2 the result of ex-103
104 ex-104
104.1 source code in ex-104.rkt
104.2 the result of ex-104
105 ex-105
105.1 source code in ex-105.rkt
105.2 the result of ex-105
106 ex-106
106.1 source code in ex-106.rkt
106.2 the result of ex-106
107 ex-107
107.1 source code in ex-107.rkt
107.2 the result of ex-107
108 ex-108
108.1 source code in ex-108.rkt
108.2 the result of ex-108
109 ex-109
109.1 source code in ex-109.rkt
109.2 the result of ex-109
110 ex-110
110.1 source code in ex-110.rkt
110.2 the result of ex-110
111 ex-111
111.1 source code in ex-111.rkt
111.2 the result of ex-111
112 ex-112
112.1 source code in ex-112.rkt
112.2 the result of ex-112
113 ex-113
113.1 source code in ex-113.rkt
113.2 the result of ex-113
114 ex-114
114.1 source code in ex-114.rkt
114.2 the result of ex-114
115 ex-115
115.1 source code in ex-115.rkt
115.2 the result of ex-115
116 ex-116
116.1 source code in ex-116.rkt
116.2 the result of ex-116
117 ex-117
117.1 source code in ex-117.rkt
117.2 the result of ex-117
118 ex-118
118.1 source code in ex-118.rkt
118.2 the result of ex-118
119 ex-119
119.1 source code in ex-119.rkt
119.2 the result of ex-119
120 ex-120
120.1 source code in ex-120.rkt
120.2 the result of ex-120
121 ex-121
121.1 source code in ex-121.rkt
121.2 the result of ex-121
122 ex-122
122.1 source code in ex-122.rkt
122.2 the result of ex-122
123 ex-123
123.1 source code in ex-123.rkt
123.2 the result of ex-123
124 ex-124
124.1 source code in ex-124.rkt
124.2 the result of ex-124
125 ex-125
125.1 source code in ex-125.rkt
125.2 the result of ex-125
126 ex-126
126.1 source code in ex-126.rkt
126.2 the result of ex-126
127 ex-127
127.1 source code in ex-127.rkt
127.2 the result of ex-127
128 ex-128
128.1 source code in ex-128.rkt
128.2 the result of ex-128
129 ex-128-b
129.1 source code in ex-128-b.rkt
129.2 the result of ex-128-b
130 ex-129
130.1 source code in ex-129.rkt
130.2 the result of ex-129
131 ex-130
131.1 source code in ex-130.rkt
131.2 the result of ex-130
132 ex-131
132.1 source code in ex-131.rkt
132.2 the result of ex-131
133 ex-132
133.1 source code in ex-132.rkt
133.2 the result of ex-132
134 ex-133
134.1 source code in ex-133.rkt
134.2 the result of ex-133
135 ex-134
135.1 source code in ex-134.rkt
135.2 the result of ex-134
136 ex-135
136.1 source code in ex-135.rkt
136.2 the result of ex-135
137 ex-136
137.1 source code in ex-136.rkt
137.2 the result of ex-136
138 ex-137
138.1 source code in ex-137.rkt
138.2 the result of ex-137
139 ex-138
139.1 source code in ex-138.rkt
139.2 the result of ex-138
140 ex-139
140.1 source code in ex-139.rkt
140.2 the result of ex-139
141 ex-140
141.1 source code in ex-140.rkt
141.2 the result of ex-140
142 ex-141
142.1 source code in ex-141.rkt
142.2 the result of ex-141
143 ex-142
143.1 source code in ex-142.rkt
143.2 the result of ex-142
144 ex-143
144.1 source code in ex-143.rkt
144.2 the result of ex-143
145 ex-144
145.1 source code in ex-144.rkt
145.2 the result of ex-144
146 ex-145
146.1 source code in ex-145.rkt
146.2 the result of ex-145
147 ex-146
147.1 source code in ex-146.rkt
147.2 the result of ex-146
Version: 5.1.1

Welcome to mpost-wrapper.

Many examples are listed as below. In order to run these examples, we need first require the snip module to show figures.

Example:

> (require (planet wcy/mpost-wrapper/snip))

1 ex-1

1.1 source code in ex-1.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (draw
   (call-with-values A-B-C
     op--)))
 

1.2 the result of ex-1

Examples:

> (require "examples/ex-1.rkt")
> (make-figure "ex-1" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-1.mp" (The system cannot find the path specified.; errno=3)

2 ex-2

2.1 source code in ex-2.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (draw
   (call-with-values A-B-C
     (lambda (A B C)
       (op-- A B C 'cycle)))))
 

2.2 the result of ex-2

Examples:

> (require "examples/ex-2.rkt")
> (make-figure "ex-2" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-2.mp" (The system cannot find the path specified.; errno=3)

3 ex-3

3.1 source code in ex-3.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (op-- A B C D 'cycle))
      (draw (op-- A C))
      (draw (op-- B D)))))
 

3.2 the result of ex-3

Examples:

> (require "examples/ex-3.rkt")
> (make-figure "ex-3" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-3.mp" (The system cannot find the path specified.; errno=3)

4 ex-4

4.1 source code in ex-4.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (point 0 0)
        #:withpen (scale '4bp 'pencircle)))
 

4.2 the result of ex-4

Examples:

> (require "examples/ex-4.rkt")
> (make-figure "ex-4" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-4.mp" (The system cannot find the path specified.; errno=3)

5 ex-5

5.1 source code in ex-5.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A B C 'cycle))
      (for ((p (in-list (list A B C))))
           (draw p #:withpen (scale '4bp 'pencircle)))
      )))
 

5.2 the result of ex-5

Examples:

> (require "examples/ex-5.rkt")
> (make-figure "ex-5" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-5.mp" (The system cannot find the path specified.; errno=3)

6 ex-6

6.1 source code in ex-6.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (op-- A B C D 'cycle))
      (draw (op-- A C))
      (draw (op-- B D))
      (for ((p (in-list (list A B C D))))
           (draw p #:withpen (scale '4bp 'pencircle))))))
 

6.2 the result of ex-6

Examples:

> (require "examples/ex-6.rkt")
> (make-figure "ex-6" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-6.mp" (The system cannot find the path specified.; errno=3)

7 ex-7

7.1 source code in ex-7.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A B  C 'cycle))
      (draw (op-- (mediation '.5 B C) A))
      (draw (op-- (mediation '.5 A C) B))
      (draw (op-- (mediation '.5 B A) C))
      )))
 

7.2 the result of ex-7

Examples:

> (require "examples/ex-7.rkt")
> (make-figure "ex-7" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-7.mp" (The system cannot find the path specified.; errno=3)

8 ex-8

8.1 source code in ex-8.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A  B  C 'cycle))
      (draw (op-- (mediation 0.5 B C) A))
      (draw (op-- (mediation 0.5 A C) B))
      (draw (op-- (mediation 0.5 B A) C))
      (draw (op* 1/3  (op+ A B C))
            #:withpen (scale '4bp 'pencircle))
      )))
 

8.2 the result of ex-8

Examples:

> (require "examples/ex-8.rkt")
> (make-figure "ex-8" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-8.mp" (The system cannot find the path specified.; errno=3)

9 ex-9

9.1 source code in ex-9.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A B C 'cycle))
      (draw (op-- A B) #:withpen (scale '4bp 'pencircle))
      )))
 

9.2 the result of ex-9

Examples:

> (require "examples/ex-9.rkt")
> (make-figure "ex-9" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-9.mp" (The system cannot find the path specified.; errno=3)

10 ex-10

10.1 source code in ex-10.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A B C 'cycle))
      (draw (op-- A B)
            #:withcolor (op+ 'green 'red))
      )))
 

10.2 the result of ex-10

Examples:

> (require "examples/ex-10.rkt")
> (make-figure "ex-10" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-10.mp" (The system cannot find the path specified.;

errno=3)

11 ex-11

11.1 source code in ex-11.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A B))
      (draw (op-- B C) #:dashed 'evenly)
      (draw (op-- C A) #:dashed 'withdots)
      )))
 

11.2 the result of ex-11

Examples:

> (require "examples/ex-11.rkt")
> (make-figure "ex-11" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-11.mp" (The system cannot find the path specified.;

errno=3)

12 ex-12

12.1 source code in ex-12.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (for ((p (in-list (list (op-- A B)
                              (op-- B C)
                              (op-- C A)
                              )))
            (color (in-list (list 0.8 0.6 0.4))))
           (draw p
                 #:withpen (scale '2bp 'pencircle)
                 #:withcolor (op* color 'white)))
      )))
 

12.2 the result of ex-12

Examples:

> (require "examples/ex-12.rkt")
> (make-figure "ex-12" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-12.mp" (The system cannot find the path specified.;

errno=3)

13 ex-13

13.1 source code in ex-13.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (op-- A  B  C 'cycle))
      (draw (op-- (mediation '.5 B C) A) #:dashed 'evenly)
      (draw (op-- (mediation '.5 A C) B) #:dashed 'evenly)
      (draw (op-- (mediation '.5 B A) C) #:dashed 'evenly)
      (draw (op* 1/3
                 (op+ A B C)) #:withpen (scale '4bp 'pencircle)
                 #:withcolor 'red)
      )))
 

13.2 the result of ex-13

Examples:

> (require "examples/ex-13.rkt")
> (make-figure "ex-13" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-13.mp" (The system cannot find the path specified.;

errno=3)

14 ex-14

14.1 source code in ex-14.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (op-- (point 0 0)
              (point '3cm 0)) #:dashed (scale 2 'evenly)))
 

14.2 the result of ex-14

Examples:

> (require "examples/ex-14.rkt")
> (make-figure "ex-14" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-14.mp" (The system cannot find the path specified.;

errno=3)

15 ex-15

15.1 source code in ex-15.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (op-- (point 0 0)
              (point '3cm 0))
        #:dashed (dashpattern "on 2bp off 3bp")))
 

15.2 the result of ex-15

Examples:

> (require "examples/ex-15.rkt")
> (make-figure "ex-15" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-15.mp" (The system cannot find the path specified.;

errno=3)

16 ex-16

16.1 source code in ex-16.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (op-- (point 0 0)
              (point '3cm 0))
        #:dashed (dashpattern "on 1bp off 2bp on 10bp off 2bp")))
 

16.2 the result of ex-16

Examples:

> (require "examples/ex-16.rkt")
> (make-figure "ex-16" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-16.mp" (The system cannot find the path specified.;

errno=3)

17 ex-17

17.1 source code in ex-17.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (drawarrow (op-- C B A))
      (drawarrow (op-- A C) #:withpen (scale '2bp 'pencircle)))))
 

17.2 the result of ex-17

Examples:

> (require "examples/ex-17.rkt")
> (make-figure "ex-17" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-17.mp" (The system cannot find the path specified.;

errno=3)

18 ex-18

18.1 source code in ex-18.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (drawdblarrow (op-- C B A 'cycle))
      (drawdblarrow (op-- A C) #:withpen (scale '2bp 'pencircle)))))
 

18.2 the result of ex-18

Examples:

> (require "examples/ex-18.rkt")
> (make-figure "ex-18" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-18.mp" (The system cannot find the path specified.;

errno=3)

19 ex-19

19.1 source code in ex-19.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (op--
         (point '-1.5cm 0)
         (point '1.5cm 0))))
 

19.2 the result of ex-19

Examples:

> (require "examples/ex-19.rkt")
> (make-figure "ex-19" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-19.mp" (The system cannot find the path specified.;

errno=3)

20 ex-20

20.1 source code in ex-20.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (fill (op-- A B C 'cycle) #:withcolor (op* 0.8 'white)))))
 

20.2 the result of ex-20

Examples:

> (require "examples/ex-20.rkt")
> (make-figure "ex-20" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-20.mp" (The system cannot find the path specified.;

errno=3)

21 ex-21

21.1 source code in ex-21.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (fill (op-- A B C 'cycle) #:withcolor (op* 0.8 'white))
      (draw (op-- A B C 'cycle)))))
 

21.2 the result of ex-21

Examples:

> (require "examples/ex-21.rkt")
> (make-figure "ex-21" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-21.mp" (The system cannot find the path specified.;

errno=3)

22 ex-22

22.1 source code in ex-22.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (fill (op-- A B C 'cycle) #:withcolor (op* 0.8 'white))
      (draw (op-- A B C 'cycle) #:withpen (scale '2bp 'pencircle)))))
 

22.2 the result of ex-22

Examples:

> (require "examples/ex-22.rkt")
> (make-figure "ex-22" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-22.mp" (The system cannot find the path specified.;

errno=3)

23 ex-23

23.1 source code in ex-23.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A B C 'cycle) #:withpen (scale '2bp 'pencircle))
      (fill (op-- A B C 'cycle) #:withcolor (op* 0.8 'white)))))
 

23.2 the result of ex-23

Examples:

> (require "examples/ex-23.rkt")
> (make-figure "ex-23" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-23.mp" (The system cannot find the path specified.;

errno=3)

24 ex-24

24.1 source code in ex-24.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (fill (op--  A C B D 'cycle) #:withcolor (op* 0.8 'white)))))
 

24.2 the result of ex-24

Examples:

> (require "examples/ex-24.rkt")
> (make-figure "ex-24" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-24.mp" (The system cannot find the path specified.;

errno=3)

25 ex-25

25.1 source code in ex-25.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (let ((p (op--  A C B D 'cycle)))
        (fill p #:withcolor (op* 0.8 'white))
        (draw p)))))
 

25.2 the result of ex-25

Examples:

> (require "examples/ex-25.rkt")
> (make-figure "ex-25" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-25.mp" (The system cannot find the path specified.;

errno=3)

26 ex-26

26.1 source code in ex-26.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((A (point '-1.5cm '-1.5cm))
        (B (point '1.5cm '-1.5cm))
        (C (point '1.5cm '1.5cm))
        (D (point '-1.5cm '1.5cm)))
    (fill (op-- A C B D  'cycle) #:withcolor (op* 0.8 'white))
    (draw (op-- (point '-1.5cm 0) (point '1.5cm '0)))
    (draw (op-- (point 0 '-1.5cm) (point 0 '1.5cm)))
    (drawarrow (op-- (point 0 0) (point '1cm 0))
               #:withpen (scale '2bp 'pencircle))
    (drawarrow (op-- (point 0 0) (point 0 '1cm))
               #:withpen (scale '2bp 'pencircle))))
 

26.2 the result of ex-26

Examples:

> (require "examples/ex-26.rkt")
> (make-figure "ex-26" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-26.mp" (The system cannot find the path specified.;

errno=3)

27 ex-27

27.1 source code in ex-27.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(require (planet wcy/mpost-wrapper/label))
(provide main)
 
 
(define (main)
  (let ((A (point 0 0)))
    (draw A #:withpen (scale '4bp 'pencircle))
    (label-top (btex "Au dessus") A)
    (label-bot  (btex "En dessous") A)
    (label-rt (btex "^^c0 droite") A)
    (label-lft  (btex "^^c0 gauche") A)))
 

27.2 the result of ex-27

Examples:

> (require "examples/ex-27.rkt")
> (make-figure "ex-27" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-27.mp" (The system cannot find the path specified.;

errno=3)

28 ex-28

28.1 source code in ex-28.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(require (planet wcy/mpost-wrapper/label))
(provide main)
 
(define (main)
  (let ((A (point 0 0)))
    (draw A #:withpen (scale '4bp 'pencircle))
    (label-ulft (btex "En haut ^^e0 gauche") A)
    (label-urt  (btex "En haut ^^e0 droite") A)
    (label-llft (btex "En bas ^^e0 gauche") A)
    (label-lrt  (btex "En bas ^^e0 droite") A)))
 

28.2 the result of ex-28

Examples:

> (require "examples/ex-28.rkt")
> (make-figure "ex-28" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-28.mp" (The system cannot find the path specified.;

errno=3)

29 ex-29

29.1 source code in ex-29.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(require (planet wcy/mpost-wrapper/label))
(provide main)
 
(define (main)
  (dot-label-urt (btex "$A$") (point 0 0)))
 

29.2 the result of ex-29

Examples:

> (require "examples/ex-29.rkt")
> (make-figure "ex-29" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-29.mp" (The system cannot find the path specified.;

errno=3)

30 ex-30

30.1 source code in ex-30.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(require (planet wcy/mpost-wrapper/label))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A B C 'cycle))
      (dot-label-llft (btex "$A$") A)
      (dot-label-lrt (btex "$B$") B)
      (dot-label-top (btex "$C$") C))))
 

30.2 the result of ex-30

Examples:

> (require "examples/ex-30.rkt")
> (make-figure "ex-30" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-30.mp" (The system cannot find the path specified.;

errno=3)

31 ex-31

31.1 source code in ex-31.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(require (planet wcy/mpost-wrapper/label))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A B C 'cycle))
      (label-bot (btex "$1$") (mediation  0.5 A B))
      (label-lft (btex "$1$") (mediation  1/2 A C))
      (label-urt (btex "$\\sqrt 2$") (mediation 1/2 B C)))))
 

31.2 the result of ex-31

Examples:

> (require "examples/ex-31.rkt")
> (make-figure "ex-31" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-31.mp" (The system cannot find the path specified.;

errno=3)

32 ex-32

32.1 source code in ex-32.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(require (planet wcy/mpost-wrapper/label))
(provide main)
 
(define (ex-32-points y xs)
  (map(lambda (x) (point x y)) xs))
(define (main)
  (let* ((u '1cm)
         (xs (list  (op* -1 u) 0 u))
         (u-points (ex-32-points u xs))
         (l-points (ex-32-points 0 xs)))
    (for* ((a (in-list l-points))
           (b (in-list u-points)))
          (draw  (op--  a b)))
    (for ((ut (in-list (list "$a$" "$b$" "$c$")))
          (a  (in-list u-points))
          (lt (in-list (list "$a'$" "$b'$" "$c'$")))
          (b  (in-list l-points)))
         (dot-label-top (btex ut) a)
         (dot-label-bot (btex lt) b))))
 

32.2 the result of ex-32

Examples:

> (require "examples/ex-32.rkt")
> (make-figure "ex-32" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-32.mp" (The system cannot find the path specified.;

errno=3)

33 ex-33

33.1 source code in ex-33.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (fullcircle)))
 

33.2 the result of ex-33

Examples:

> (require "examples/ex-33.rkt")
> (make-figure "ex-33" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-33.mp" (The system cannot find the path specified.;

errno=3)

34 ex-34

34.1 source code in ex-34.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (point 0 0 ) #:withpen (scale '4bp 'pencircle)))
 

34.2 the result of ex-34

Examples:

> (require "examples/ex-34.rkt")
> (make-figure "ex-34" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-34.mp" (The system cannot find the path specified.;

errno=3)

35 ex-35

35.1 source code in ex-35.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (point 0 0 ) #:withpen (scale '4bp 'pencircle)))
 

35.2 the result of ex-35

Examples:

> (require "examples/ex-35.rkt")
> (make-figure "ex-35" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-35.mp" (The system cannot find the path specified.;

errno=3)

36 ex-36

36.1 source code in ex-36.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C)
  (values (point 0 0)
          (point '1cm 0)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C
    (lambda (A B C)
      (draw (op-- A B C 'cycle))
      (for ((a-point (in-list (list A B C))))
           (fill (fullcircle  '4bp a-point) #:withcolor 'white))
      (for ((a-point (in-list (list A B C))))
           (draw  (fullcircle  '4bp a-point))))))
 

36.2 the result of ex-36

Examples:

> (require "examples/ex-36.rkt")
> (make-figure "ex-36" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-36.mp" (The system cannot find the path specified.;

errno=3)

37 ex-37

37.1 source code in ex-37.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (op.. A D B C))
      (for ((A (in-list (list A B C D))))
           (draw A #:withpen (scale '4bp 'pencircle))))))
 

37.2 the result of ex-37

Examples:

> (require "examples/ex-37.rkt")
> (make-figure "ex-37" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-37.mp" (The system cannot find the path specified.;

errno=3)

38 ex-38

38.1 source code in ex-38.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (path A '-- D '..  B '.. C))
      )))
 

38.2 the result of ex-38

Examples:

> (require "examples/ex-38.rkt")
> (make-figure "ex-38" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-38.mp" (The system cannot find the path specified.;

errno=3)

39 ex-39

39.1 source code in ex-39.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (path A '--- D '..  B '.. C))
      )))
 

39.2 the result of ex-39

Examples:

> (require "examples/ex-39.rkt")
> (make-figure "ex-39" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-39.mp" (The system cannot find the path specified.;

errno=3)

40 ex-40

40.1 source code in ex-40.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (path A '..  D '.. B '.. C))
      )))
 

40.2 the result of ex-40

Examples:

> (require "examples/ex-40.rkt")
> (make-figure "ex-40" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-40.mp" (The system cannot find the path specified.;

errno=3)

41 ex-41

41.1 source code in ex-41.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (op.. A B C D 'cycle)
            ))))
 

41.2 the result of ex-41

Examples:

> (require "examples/ex-41.rkt")
> (make-figure "ex-41" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-41.mp" (The system cannot find the path specified.;

errno=3)

42 ex-42

42.1 source code in ex-42.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (op.. A  C  'cycle)
            ))))
 

42.2 the result of ex-42

Examples:

> (require "examples/ex-42.rkt")
> (make-figure "ex-42" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-42.mp" (The system cannot find the path specified.;

errno=3)

43 ex-43

43.1 source code in ex-43.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (path (point 0    0) (dir-spec (point 0 1))  ".."
              (point '2cm 0) (dir-spec (point 1 0)))))
 

43.2 the result of ex-43

Examples:

> (require "examples/ex-43.rkt")
> (make-figure "ex-43" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-43.mp" (The system cannot find the path specified.;

errno=3)

44 ex-44

44.1 source code in ex-44.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (path (point 0    0) (dir-spec (dir 90))  ".."
              (point '2cm 0) (dir-spec (dir 0)))))
 

44.2 the result of ex-44

Examples:

> (require "examples/ex-44.rkt")
> (make-figure "ex-44" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-44.mp" (The system cannot find the path specified.;

errno=3)

45 ex-45

45.1 source code in ex-45.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (path (point 0    0) (dir-spec 'up)  ".."
              (point '2cm 0) (dir-spec 'right))))
 

45.2 the result of ex-45

Examples:

> (require "examples/ex-45.rkt")
> (make-figure "ex-45" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-45.mp" (The system cannot find the path specified.;

errno=3)

46 ex-46

46.1 source code in ex-46.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (path (point 0    0) (dir-spec 'up)  ".."
              (point '2cm 0) (dir-spec 'up))))
 

46.2 the result of ex-46

Examples:

> (require "examples/ex-46.rkt")
> (make-figure "ex-46" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-46.mp" (The system cannot find the path specified.;

errno=3)

47 ex-47

47.1 source code in ex-47.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (path (point 0    0) (dir-spec 'up)  ".."
              (point '2cm 0) (dir-spec 'up)  ".."
              'cycle)))
 

47.2 the result of ex-47

Examples:

> (require "examples/ex-47.rkt")
> (make-figure "ex-47" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-47.mp" (The system cannot find the path specified.;

errno=3)

48 ex-48

48.1 source code in ex-48.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (arc O A B rou)
  (let ((alpha (op-angle (op- A O)))
        (beta  (op-angle (op- B O))))
    (path (op+ O (polar rou alpha)) (dir-spec (dir (op+ alpha 90))) ".."
          (op+ O (polar rou beta )) (dir-spec (dir (op+ beta  90))))))
(define (main)
  (let* ((O (point 0 0))
         (alpha 30)
         (A (polar '2cm 0))
         (B (polar '2cm alpha)))
    (draw (path O ".." A))
    (draw (path O ".." B))
    (draw (arc O A B '1cm))))
 

48.2 the result of ex-48

Examples:

> (require "examples/ex-48.rkt")
> (make-figure "ex-48" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-48.mp" (The system cannot find the path specified.;

errno=3)

49 ex-49

49.1 source code in ex-49.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (arc O A B rou)
  (let ((alpha (op-angle (op- A O)))
        (beta  (op-angle (op- B O))))
    (path (op+ O (polar rou alpha)) (dir-spec (dir (op+ alpha 90))) ".."
          (op+ O (polar rou beta )) (dir-spec (dir (op+ beta  90))))))
(define (main)
  (let* ((O (point 0 0))
         (alpha 30)
         (A (polar '2cm 0))
         (B (polar '2cm alpha)))
    (draw (path O ".." A))
    (draw (path O ".." B))
    (draw (arc O A B '1cm))
    (draw (arc O A B '1.1cm))))
 

49.2 the result of ex-49

Examples:

> (require "examples/ex-49.rkt")
> (make-figure "ex-49" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-49.mp" (The system cannot find the path specified.;

errno=3)

50 ex-50

50.1 source code in ex-50.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (arc O A B rou)
  (let ((alpha (op-angle (op- A O)))
        (beta  (op-angle (op- B O))))
    (path (op+ O (polar rou alpha)) (dir-spec (dir (op+ alpha 90))) ".."
          (op+ O (polar rou beta )) (dir-spec (dir (op+ beta  90))))))
(define (draw-angle A B C n)
  (let ((rou '4.5mm))
    (if (> n 0)
        (begin
          (draw (arc A B C (op+ rou (op* n '0.5mm))))
          (draw-angle  A B C (- n 1)))
        (void))))
(define (main)
  (let ((A (point 0 0))
        (B (point '3cm 0))
        (C (point '1cm '2cm)))
    (draw (op-- A B C 'cycle))
    (draw-angle A B C 1)
    (draw-angle B C A 2)
    (draw-angle C A B 3)))
 

50.2 the result of ex-50

Examples:

> (require "examples/ex-50.rkt")
> (make-figure "ex-50" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-50.mp" (The system cannot find the path specified.;

errno=3)

51 ex-51

51.1 source code in ex-51.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (p (path (point u 0) (dir-spec 'up)  ".."
                  (point (op* -1 u) 0) (dir-spec 'down) "--"
                  'cycle)))
    (fill p #:withcolor (op* 0.8 'white))
    (draw p #:withpen (scale '1bp 'pencircle))
    ))
 

51.2 the result of ex-51

Examples:

> (require "examples/ex-51.rkt")
> (make-figure "ex-51" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-51.mp" (The system cannot find the path specified.;

errno=3)

52 ex-52

52.1 source code in ex-52.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (p (path (point u 0)            (dir-spec 'up) ".."
                  (point (op* -1   u) 0) (dir-spec 'down) "--"
                  (point (op* -0.2 u) 0) (dir-spec 'up) ".."
                  (point (op*  0.2 u) 0) (dir-spec 'down) "--"
                  'cycle)))
    (fill p #:withcolor (op* 0.8 'white))
    (draw p #:withpen (scale '1bp 'pencircle))
    ))
 

52.2 the result of ex-52

Examples:

> (require "examples/ex-52.rkt")
> (make-figure "ex-52" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-52.mp" (The system cannot find the path specified.;

errno=3)

53 ex-53

53.1 source code in ex-53.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (A  (point (op*  0.2 u) (op*  0.05 u)))
         (AA (point (op*  0.2 u) (op* -0.05 u)))
         (B  (point (op*  1.0 u) (op*  0.05 u)))
         (BB (point (op*  1.0 u) (op* -0.05 u)))
         (C  (point (op* -0.2 u) (op*  0    0)))
         (D  (point (op* -1.0 u) (op*  0    0)))
         (p (path B  (dir-spec 'up) ".."
                  D  (dir-spec 'down) ".."
                  BB (dir-spec 'up) "--"
                  AA (dir-spec 'down) ".."
                  C  (dir-spec 'up) ".."
                  A  (dir-spec 'down) "--"
                  'cycle)))
    (fill p #:withcolor (op* 0.8 'white))
    (draw p #:withpen (scale '1bp 'pencircle))
    ))
 

53.2 the result of ex-53

Examples:

> (require "examples/ex-53.rkt")
> (make-figure "ex-53" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-53.mp" (The system cannot find the path specified.;

errno=3)

54 ex-54

54.1 source code in ex-54.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (A (point 0 0))
         (B (polar u  60))
         (C (polar u -60))
         (D (point (op* 2 u) 0)))
    (for ((x (in-list (list A B C D))))
         (draw x #:withpen (scale '4bp 'pencircle)))
    (draw (op-- A D B D C))
    (for ((x (in-list (list (path A (dir-spec 'up) ".." B)
                            (path A (dir-spec 'down) ".." C)
                            (path A (dir-spec (dir  30)) ".." B)
                            (path A (dir-spec (dir -30)) ".." C)))))
         (draw x)
         )))
 

54.2 the result of ex-54

Examples:

> (require "examples/ex-54.rkt")
> (make-figure "ex-54" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-54.mp" (The system cannot find the path specified.;

errno=3)

55 ex-55

55.1 source code in ex-55.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (op.. (point 0 0)  (point '1cm '1cm) (point '2cm 0))))
 

55.2 the result of ex-55

Examples:

> (require "examples/ex-55.rkt")
> (make-figure "ex-55" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-55.mp" (The system cannot find the path specified.;

errno=3)

56 ex-56

56.1 source code in ex-56.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (path (point 0 0) '..
              "tension 2" '..
              (point '1cm '1cm) '..
              (point '2cm 0))))
 

56.2 the result of ex-56

Examples:

> (require "examples/ex-56.rkt")
> (make-figure "ex-56" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-56.mp" (The system cannot find the path specified.;

errno=3)

57 ex-57

57.1 source code in ex-57.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((u '1cm))
    (draw (path (polar u  90) (dir-spec (dir 0))    '..
                (polar u  -150) (dir-spec (dir 120))  '..
                (polar u  -30 ) (dir-spec (dir -120))  '..
                'cycle))))
 

57.2 the result of ex-57

Examples:

> (require "examples/ex-57.rkt")
> (make-figure "ex-57" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-57.mp" (The system cannot find the path specified.;

errno=3)

58 ex-58

58.1 source code in ex-58.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((u '1cm)
        (tension " tension 2 "))
    (draw (path (polar u  90) (dir-spec (dir 0))    '.. tension '..
                (polar u  -150 ) (dir-spec (dir 120))  '.. tension '..
                (polar u  -30 ) (dir-spec (dir -120))  '.. tension '..
                'cycle))))
 

58.2 the result of ex-58

Examples:

> (require "examples/ex-58.rkt")
> (make-figure "ex-58" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-58.mp" (The system cannot find the path specified.;

errno=3)

59 ex-59

59.1 source code in ex-59.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((u '1cm)
        (tension " tension 4 "))
    (draw (path (polar u  90) (dir-spec (dir 0))    '.. tension '..
                (polar u  -150 ) (dir-spec (dir 120))  '.. tension '..
                (polar u  -30 ) (dir-spec (dir -120))  '.. tension '..
                'cycle))))
 

59.2 the result of ex-59

Examples:

> (require "examples/ex-59.rkt")
> (make-figure "ex-59" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-59.mp" (The system cannot find the path specified.;

errno=3)

60 ex-60

60.1 source code in ex-60.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '0.5cm)
         (A (point 0 0))
         (B (point (op* -1 u) (op* 2 u)))
         (C (point (op* 4  u) (op* 3 u)))
         (D (point (op* 3  u) 0)))
    (draw (path
           A ".." " controls " B " and " C ".." D)
          #:withpen (scale '2pt 'pencircle))
    (draw (op-- B C) #:dashed 'evenly)
    (drawarrow (op-- A B))
    (drawarrow (op-- D C))))
 

60.2 the result of ex-60

Examples:

> (require "examples/ex-60.rkt")
> (make-figure "ex-60" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-60.mp" (The system cannot find the path specified.;

errno=3)

61 ex-61

61.1 source code in ex-61.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
 
(define (main)
  (define (f z1 zn)
    (if (null? zn)
        z1
        (let ((x (f2 z1 zn)))
          (f (car x) (cdr x)))))
  (define (f2 z1 zn)
    (if (null? (cdr zn))
        (list (mediation 1/2 z1 (car zn)))
        (cons (mediation 1/2 z1 (car zn))
              (f2 (car zn) (cdr zn)))))
  (let* ((u '1cm)
         (A (point 0 0))
         (B (point (op* -1 u) (op* 2 u)))
         (C (point (op* 3  u) (op* 3 u)))
         (D (point (op* 2  u) 0)))
    (for ((A (in-list (list A B C D))))
         (draw A #:withpen (scale '4bp 'pencircle)))
    (draw (path A ".." " controls " B " and " C ".." D))
    (draw (f A (list B C D))
          #:withpen (scale '4bp 'pencircle))))
 
 

61.2 the result of ex-61

Examples:

> (require "examples/ex-61.rkt")
> (make-figure "ex-61" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-61.mp" (The system cannot find the path specified.;

errno=3)

62 ex-62

62.1 source code in ex-62.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define  (bezier n A B C D)
    (let* ((a1 A)
           (a2 B)
           (a3 C)
           (a4 D)
           (a12 (mediation 1/2 a1   a2))
           (a23 (mediation 1/2 a2   a3))
           (a34 (mediation 1/2 a3   a4))
           (a123 (mediation 1/2  a12  a23))
           (a234 (mediation 1/2  a23  a34))
           (a1234(mediation 1/2  a123 a234)))
      (if (> n 0)
          (begin
            (bezier (- n 1) a1 a12 a123 a1234)
            (bezier (- n 1) a1234 a234 a34 a4))
          (draw a1234 #:withpen (scale '2bp 'pencircle)))))
  (let* ((u '1cm)
         (A (point 0 0))
         (B (point (op* -1 u) (op* 2 u)))
         (C (point (op* 3  u) (op* 3 u)))
         (D (point (op* 2  u) 0)))
    (for ((A (in-list (list A B C D))))
         (draw A #:withpen (scale '4bp 'pencircle)))
    ;; (draw (path A ".." " controls " B " and " C ".." D))
    (bezier 5 A B C D)))
 

62.2 the result of ex-62

Examples:

> (require "examples/ex-62.rkt")
> (make-figure "ex-62" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-62.mp" (The system cannot find the path specified.;

errno=3)

63 ex-63

63.1 source code in ex-63.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (path (point 0 0) (dir-spec 'up) '..
              (point '1cm '1mm) ".."
              (point '2cm 0) (dir-spec 'down))))
 

63.2 the result of ex-63

Examples:

> (require "examples/ex-63.rkt")
> (make-figure "ex-63" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-63.mp" (The system cannot find the path specified.;

errno=3)

64 ex-64

64.1 source code in ex-64.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (path (point 0 0) (dir-spec 'up) '...
              (point '1cm '1mm) "..."
              (point '2cm 0) (dir-spec 'down))))
 

64.2 the result of ex-64

Examples:

> (require "examples/ex-64.rkt")
> (make-figure "ex-64" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-64.mp" (The system cannot find the path specified.;

errno=3)

65 ex-65

65.1 source code in ex-65.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (path A " {curl 0} " ".."
                  D ".."
                  B ".."
                  C )))))
 

65.2 the result of ex-65

Examples:

> (require "examples/ex-65.rkt")
> (make-figure "ex-65" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-65.mp" (The system cannot find the path specified.;

errno=3)

66 ex-66

66.1 source code in ex-66.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (path A " {curl 1} " ".."
                  D ".."
                  B ".."
                  C )))))
 

66.2 the result of ex-66

Examples:

> (require "examples/ex-66.rkt")
> (make-figure "ex-66" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-66.mp" (The system cannot find the path specified.;

errno=3)

67 ex-67

67.1 source code in ex-67.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (A-B-C-D)
  (values (point 0 0)
          (point '1cm 0)
          (point '1cm '1cm)
          (point 0 '1cm)))
(define (main)
  (call-with-values A-B-C-D
    (lambda (A B C D)
      (draw (path A " {curl 2} " ".."
                  D ".."
                  B ".."
                  C )))))
 

67.2 the result of ex-67

Examples:

> (require "examples/ex-67.rkt")
> (make-figure "ex-67" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-67.mp" (The system cannot find the path specified.;

errno=3)

68 ex-68

68.1 source code in ex-68.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((A (unknown-point))
        (B (unknown-point))
        (C (unknown-point))
        (D (unknown-point)))
    (eqn= (xpart A) (ypart A) (ypart B) (xpart C) 0)
    (eqn= (xpart B) (ypart C) (xpart D) (ypart D) '2cm)
    (draw (op-- A B C D 'cycle)
          #:withpen (scale '2bp 'pencircle))))
 

68.2 the result of ex-68

Examples:

> (require "examples/ex-68.rkt")
> (make-figure "ex-68" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-68.mp" (The system cannot find the path specified.;

errno=3)

69 ex-69

69.1 source code in ex-69.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point 0 0))
         (B (point '2cm '3cm))
         (C (point '1cm 0))
         (D (point '-1cm '2cm))
         (M (unknown-point))
         (lambda1 (unknown-numeric))
         (mu (unknown-numeric)))
    (eqn= M  (mediation lambda1  A B)
          (mediation mu C D))
    (draw (op-- A B))
    (draw (op-- C D))
    (draw M #:withpen (scale '4bp 'pencircle))))
 

69.2 the result of ex-69

Examples:

> (require "examples/ex-69.rkt")
> (make-figure "ex-69" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-69.mp" (The system cannot find the path specified.;

errno=3)

70 ex-70

70.1 source code in ex-70.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point 0 0))
         (B (point '2cm '3cm))
         (C (point '1cm 0))
         (D (point '-1cm '2cm))
         (M (unknown-point)))
    (eqn= M  (mediation (whatever)  A B)
          (mediation (whatever) C D))
    (draw (op-- A B))
    (draw (op-- C D))
    (draw M #:withpen (scale '4bp 'pencircle))))
 

70.2 the result of ex-70

Examples:

> (require "examples/ex-70.rkt")
> (make-figure "ex-70" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-70.mp" (The system cannot find the path specified.;

errno=3)

71 ex-71

71.1 source code in ex-71.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point 0 0))
         (B (point '3cm 0))
         (C (point '1cm '2cm))
         (AA (mediation 0.5 B C))
         (BB (mediation 0.5 A C))
         (CC (mediation 0.5 A B))
         (G (unknown-point)))
    (eqn= G
          (mediation (whatever) A AA)
          (mediation (whatever) B BB))
    (draw (op-- A B C 'cycle))
    (for ((a (list A B C))
          (b (list AA BB CC)))
         (draw  (op-- a b) #:dashed  'withdots))
    (draw G #:withpen (scale '4bp 'pencircle))))
 

71.2 the result of ex-71

Examples:

> (require "examples/ex-71.rkt")
> (make-figure "ex-71" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-71.mp" (The system cannot find the path specified.;

errno=3)

72 ex-72

72.1 source code in ex-72.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((p  (fullcircle '5mm))
        (x (point '1mm '2mm)))
    (for ((n (in-range 5)))
         (draw (shift  (op* n x) p )))))
 

72.2 the result of ex-72

Examples:

> (require "examples/ex-72.rkt")
> (make-figure "ex-72" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-72.mp" (The system cannot find the path specified.;

errno=3)

73 ex-73

73.1 source code in ex-73.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((p (path (point '5mm '-5mm) (dir-spec 'right) '..
                 (point '2cm 0))))
    (for ((n (in-range 10)))
         (draw (rotate (* 10 n) p)))))
 

73.2 the result of ex-73

Examples:

> (require "examples/ex-73.rkt")
> (make-figure "ex-73" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-73.mp" (The system cannot find the path specified.;

errno=3)

74 ex-74

74.1 source code in ex-74.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((p  (fullcircle '5mm))
        (x (point '1mm '2mm)))
    (for ((n (in-range 1 5)))
         (draw (xscale n p)))))
 

74.2 the result of ex-74

Examples:

> (require "examples/ex-74.rkt")
> (make-figure "ex-74" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-74.mp" (The system cannot find the path specified.;

errno=3)

75 ex-75

75.1 source code in ex-75.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point '1cm 0))
         (B (rotate 72 A))
         (C (rotate 72 B))
         (D (rotate 72 C))
         (E (rotate 72 D)))
    (draw (op-- A B C D E 'cycle))))
 

75.2 the result of ex-75

Examples:

> (require "examples/ex-75.rkt")
> (make-figure "ex-75" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-75.mp" (The system cannot find the path specified.;

errno=3)

76 ex-76

76.1 source code in ex-76.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point '1cm 0))
         (B (rotate 72 A))
         (C (rotate 72 B))
         (D (rotate 72 C))
         (E (rotate 72 D)))
    (draw (op-- A C  E B D 'cycle))))
 

76.2 the result of ex-76

Examples:

> (require "examples/ex-76.rkt")
> (make-figure "ex-76" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-76.mp" (The system cannot find the path specified.;

errno=3)

77 ex-77

77.1 source code in ex-77.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point '1cm 0))
         (B (rotate 72 A))
         (C (rotate 72 B))
         (D (rotate 72 C))
         (E (rotate 72 D))
         (AA (unknown-point))
         (BB (unknown-point))
         (CC (unknown-point))
         (DD (unknown-point))
         (EE (unknown-point)))
    (eqn= AA (mediation (whatever) A C))
    (eqn= AA (mediation (whatever) B D))
    (eqn= BB (mediation (whatever) B D))
    (eqn= BB (mediation (whatever) C E))
    (eqn= CC (mediation (whatever) C E))
    (eqn= CC (mediation (whatever) D A))
    (eqn= DD (mediation (whatever) D A))
    (eqn= DD (mediation (whatever) E B))
    (eqn= EE (mediation (whatever) E B))
    (eqn= EE (mediation (whatever) A C))
    (fill (op-- A C  E B D 'cycle) #:withcolor (op* 0.8 'white))
    (fill (op-- AA  BB  CC  DD  EE  'cycle) #:withcolor 'white)
    (draw (op-- A  C  E  B  D  'cycle))))
 

77.2 the result of ex-77

Examples:

> (require "examples/ex-77.rkt")
> (make-figure "ex-77" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-77.mp" (The system cannot find the path specified.;

errno=3)

78 ex-78

78.1 source code in ex-78.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((p (path (op--
                  (point 0 0)
                  (point '1cm 0)))))
    (drawarrow p #:withpen (scale '2bp 'pencircle))
    (drawarrow (zscale (point 1 2) p))))
 

78.2 the result of ex-78

Examples:

> (require "examples/ex-78.rkt")
> (make-figure "ex-78" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-78.mp" (The system cannot find the path specified.;

errno=3)

79 ex-79

79.1 source code in ex-79.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (p (path (op-- (point 0 0)
                        (point u 0))))
         (A (point u (op* -1 u)))
         (alpha 90))
    (drawarrow p #:withpen (scale '1bp 'pencircle))
    (drawarrow ((rotate-around A alpha) p))
    (drawarrow
     (shift A (rotate alpha (shift (op* -1 A) p)))
     #:withpen (scale '1bp 'pencircle) #:dashed 'withdots)))
 

79.2 the result of ex-79

Examples:

> (require "examples/ex-79.rkt")
> (make-figure "ex-79" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-79.mp" (The system cannot find the path specified.;

errno=3)

80 ex-80

80.1 source code in ex-80.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(require (planet wcy/mpost-wrapper/label))
(provide main)
 
(define (main)
  (let* ((p (path
             (point 0 0) '--
             (point '1cm 0)))
         (A (point '1cm '-1cm))
         (alpha 90))
    (drawarrow p #:withpen (scale '1bp 'pencircle))
    (draw A #:withpen (scale '4bp 'pencircle))
    (label-ulft (btex "$A$") A)
    (draw (point 0 0) #:withpen (scale '4bp 'pencircle))
    (label-bot (btex "$O$") (point 0 0))
    (let loop ((i 0))
      (if (< i 10)
          (begin
            (drawarrow (shift  (op* -1 (op/ (op* i A) 10)) p) #:withcolor 'red)
            (drawarrow (rotate (op/ (op* i alpha) 10) (shift (op* -1 A) p)) #:withcolor 'green)
            (drawarrow (shift  (op/ (op* i A) 10) (rotate alpha (shift (op* -1 A) p)))
                       #:withcolor 'blue)
            (loop (+ 1 i)))
          (void)))))
 

80.2 the result of ex-80

Examples:

> (require "examples/ex-80.rkt")
> (make-figure "ex-80" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-80.mp" (The system cannot find the path specified.;

errno=3)

81 ex-81

81.1 source code in ex-81.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define (f AA A B C)
    (eqn= (op- AA A)
          (rotate  90 (op* (unknown-numeric)
                           (op- B C))))
    (eqn= AA (mediation (whatever) B C)))
  (let* ((A (point 0 0))
         (B (point '3cm 0))
         (C (point '1cm '2cm))
         (AA (unknown-point))
         (BB (unknown-point))
         (CC (unknown-point))
         (H (unknown-point)))
    (f AA A B C)
    (f BB B A C)
    (f CC C B A)
    (eqn= H (mediation (whatever) A AA))
    (eqn= H (mediation (whatever) B BB)) ;
    (for ((x (in-list (list
                       (op-- A B C 'cycle)
                       (op-- A AA)
                       (op-- B BB)
                       (op-- C CC)))))
         (draw x))
    (draw H #:withpen (scale '4bp 'pencircle))
    ))
 

81.2 the result of ex-81

Examples:

> (require "examples/ex-81.rkt")
> (make-figure "ex-81" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-81.mp" (The system cannot find the path specified.;

errno=3)

82 ex-82

82.1 source code in ex-82.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((A (point 0 0))
        (B (point '3cm 0))
        (C (point '1cm '2cm))
        (H (unknown-point)))
    (eqn= (op- H A)
          (rotate 90 (op* (whatever)
                          (op- B C))))
    (eqn= (op- H B)
          (rotate 90 (op* (whatever)
                          (op- A C))))
    (draw (op-- A  B  C  'cycle))
    (draw H #:withpen (scale '4bp 'pencircle))
    ))
 

82.2 the result of ex-82

Examples:

> (require "examples/ex-82.rkt")
> (make-figure "ex-82" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-82.mp" (The system cannot find the path specified.;

errno=3)

83 ex-83

83.1 source code in ex-83.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((A (point 0 0))
        (B (point '3cm 0))
        (C (point '1cm '2cm))
        (O (unknown-point)))
    (define (f B C)
      (eqn= (op- O
                 (mediation 1/2 B C))
            (op* (whatever)
                 (rotate 90 (op- B C)))))
    (f B C)
    (f A B)
    (draw (op-- A  B  C  'cycle))
    (draw O #:withpen (scale '4bp 'pencircle))
    (draw (fullcircle (op* 2 (op-abs (op- O A))) O))))
 

83.2 the result of ex-83

Examples:

> (require "examples/ex-83.rkt")
> (make-figure "ex-83" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-83.mp" (The system cannot find the path specified.;

errno=3)

84 ex-84

84.1 source code in ex-84.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '2cm)
         (A (point 0 0))
         (B (point u 0))
         (C (point u u))
         (D (point 0 u))
         (T (unknown-transform))
         (p  (op-- A  B  C  D  'cycle))
         )
    (eqn= (transform T A)
          (mediation 1/5 A B))
    (eqn= (transform T B)
          (mediation 1/5 B C))
    (eqn= (transform T C)
          (mediation 1/5 C D))
    (draw p)
    (draw (transform T p))))
 

84.2 the result of ex-84

Examples:

> (require "examples/ex-84.rkt")
> (make-figure "ex-84" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-84.mp" (The system cannot find the path specified.;

errno=3)

85 ex-85

85.1 source code in ex-85.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '2cm)
         (A (point 0 0))
         (B (point u 0))
         (C (point u u))
         (D (point 0 u))
         (Tx (unknown-transform))
         (p  (op-- A  B  C  D  'cycle))
         )
    (eqn= (transform Tx A)
          (mediation 1/5 A B))
    (eqn= (transform Tx B)
          (mediation 1/5 B C))
    (eqn= (transform Tx C)
          (mediation 1/5 C D))
    (for/fold
        ((p p))
        ((i (in-range 0 100)))
      (draw p)
      (transform Tx p))
    ))
 

85.2 the result of ex-85

Examples:

> (require "examples/ex-85.rkt")
> (make-figure "ex-85" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-85.mp" (The system cannot find the path specified.;

errno=3)

86 ex-86

86.1 source code in ex-86.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point '1cm 0))
         (B (rotate 72 A))
         (C (rotate 72 B))
         (D (rotate 72 C))
         (E (rotate 72 D))
         (p (op-- A B C D E 'cycle))
         (T (unknown-transform)))
    (eqn= (transform T A)
          (mediation 1/5 A B))
    (eqn= (transform T B)
          (mediation 1/5 B C))
    (eqn= (transform T C)
          (mediation 1/5 C D))
    (for/fold
        ((p p))
        ((i (in-range 0 3)))
      (draw p)
      (transform T p))))
 

86.2 the result of ex-86

Examples:

> (require "examples/ex-86.rkt")
> (make-figure "ex-86" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-86.mp" (The system cannot find the path specified.;

errno=3)

87 ex-87

87.1 source code in ex-87.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '3mm)
         (p (fullcircle (op* 2 u)))
         (p2 (scale 0.5 p)))
    (for ((x (in-list (list p
                            (shift (op* u (dir 30)) p2)
                            (shift (op* u (dir 150)) p2)
                            ))))
         (fill x #:withcolor (op* 0.8 'white)))))
 

87.2 the result of ex-87

Examples:

> (require "examples/ex-87.rkt")
> (make-figure "ex-87" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-87.mp" (The system cannot find the path specified.;

errno=3)

88 ex-88

88.1 source code in ex-88.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '3mm)
         (p (fullcircle (op* 2 u)))
         (p2 (scale 0.5 p))
         (T (unknown-transform)))
    (eqn= (transform T (point 0 0)) (point 0 0))
    (eqn= (transform T (point 1 0)) (point 1 1))
    (eqn= (transform T (point 0 1)) (point 1 0))
    (for ((p (in-list (list p
                            (shift (op* u (dir 30)) p2)
                            (shift (op* u (dir 150)) p2)
                            ))))
         (fill (transform T p) #:withcolor (op* 0.8 'white)))))
 

88.2 the result of ex-88

Examples:

> (require "examples/ex-88.rkt")
> (make-figure "ex-88" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-88.mp" (The system cannot find the path specified.;

errno=3)

89 ex-89

89.1 source code in ex-89.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '3mm)
         (p (fullcircle (op* 2 u)))
         (p2 (scale 0.5 p))
         (T (unknown-transform)))
    (eqn= (xpart T) (ypart T)  0)
    (eqn= (xxpart T) 1)
    (eqn= (yxpart T) 2)
    (eqn= (xypart T) 3)
    (eqn= (yypart T) 4)
    (for ((p (in-list (list p
                            (shift (op* u (dir 30)) p2)
                            (shift (op* u (dir 150)) p2)
                            ))))
         (fill (transform T p) #:withcolor (op* 0.8 'white)))))
 

89.2 the result of ex-89

Examples:

> (require "examples/ex-89.rkt")
> (make-figure "ex-89" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-89.mp" (The system cannot find the path specified.;

errno=3)

90 ex-90

90.1 source code in ex-90.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((pic-1 (new-picture
                (lambda ()
                  (let ((p1 (fullcircle '1cm))
                        (p2 (fullcircle '5mm)))
                    (draw p1)
                    (draw (shift (polar '1cm 45) p2))
                    (draw (shift (polar '1cm 135) p2)))))))
    (for ((a (in-list (list (point 0 0)
                            (point '1mm '1mm)
                            (point '2mm '2mm)))))
         (draw (shift a pic-1)))))
 

90.2 the result of ex-90

Examples:

> (require "examples/ex-90.rkt")
> (make-figure "ex-90" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-90.mp" (The system cannot find the path specified.;

errno=3)

91 ex-91

91.1 source code in ex-91.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((pic (unknown-picture)))
    (addto pic 'contour (fullcircle '1cm)
           #:withcolor (op* 0.8 'white))
    (addto pic 'doublepath (fullcircle '1cm)
           #:withpen (scale '0.5bp 'pencircle))
    (addto pic 'also (shift (point '1mm '1mm) pic))
    (draw pic)))
 

91.2 the result of ex-91

Examples:

> (require "examples/ex-91.rkt")
> (make-figure "ex-91" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-91.mp" (The system cannot find the path specified.;

errno=3)

92 ex-92

92.1 source code in ex-92.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((u '3mm)
        (mickey (unknown-picture)))
    (addto mickey 'contour (fullcircle (op* 2 u))
           #:withcolor (op* 0.8 'white))
    (addto mickey 'contour (fullcircle u (polar u 150))
           #:withcolor (op* 0.8 'white))
    (addto mickey 'contour (fullcircle u (polar u 30))
           #:withcolor (op* 0.8 'white))
    (draw mickey)))
 

92.2 the result of ex-92

Examples:

> (require "examples/ex-92.rkt")
> (make-figure "ex-92" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-92.mp" (The system cannot find the path specified.;

errno=3)

93 ex-93

93.1 source code in ex-93.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((u '3mm)
        (mickey (unknown-picture))
        (T (unknown-transform)))
    (addto mickey 'contour (fullcircle (op* 2 u))
           #:withcolor (op* 0.8 'white))
    (addto mickey 'contour (fullcircle u (polar u 150))
           #:withcolor (op* 0.8 'white))
    (addto mickey 'contour  (fullcircle u (polar u 30))
           #:withcolor (op* 0.8 'white))
    (eqn= (transform T (point 0 0 )) (point 0 0))
    (eqn= (transform T (point 1 0 )) (point 1 1))
    (eqn= (transform T (point 0 1 )) (point 1 0))
    (draw (transform T mickey))))
 

93.2 the result of ex-93

Examples:

> (require "examples/ex-93.rkt")
> (make-figure "ex-93" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-93.mp" (The system cannot find the path specified.;

errno=3)

94 ex-94

94.1 source code in ex-94.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((mickey (new-picture
                 (lambda ()
                   (let ((u '3mm))
                     (for ((p (in-list
                               (list (fullcircle (op* 2 u))
                                     (fullcircle u (polar u 150))
                                     (fullcircle u (polar u 30))))))
                          (fill p #:withcolor (op* 0.8 'white)))))))
        (T (unknown-transform)))
    (for ((v1 (in-list (list (point 0 0)
                             (point 1 0)
                             (point 0 1))))
          (v2 (in-list (list (point 0 0)
                             (point 1 1)
                             (point 1 0)))))
         (eqn= (transform T v1) v2))
    (draw (transform T mickey))))
 

94.2 the result of ex-94

Examples:

> (require "examples/ex-94.rkt")
> (make-figure "ex-94" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-94.mp" (The system cannot find the path specified.;

errno=3)

95 ex-95

95.1 source code in ex-95.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point 0 '1cm))
         (B (rotate 120 A))
         (p (path A (dir-spec (dir 0)) '..
                  'tension 2 '..
                  B (dir-spec (dir 120)))))
    (for ((p (in-list (list p (rotate 120 p) (rotate -120 p)))))
         (draw p))
    ))
 

95.2 the result of ex-95

Examples:

> (require "examples/ex-95.rkt")
> (make-figure "ex-95" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-95.mp" (The system cannot find the path specified.;

errno=3)

96 ex-96

96.1 source code in ex-96.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((n 5)
         (alpha (/ (* 2 360) n))
         (A (point 0 '1cm))
         (B (rotate alpha A))
         (p (path A (dir-spec (dir 180)) '..
                  'tension 4 '..
                  B (dir-spec (dir (+ 180 alpha))))))
    (draw p #:withcolor 'red)
    (for ((i (in-range 1 5)))
         (draw (rotate (* i (/ 360 n)) p)))
    ))
 

96.2 the result of ex-96

Examples:

> (require "examples/ex-96.rkt")
> (make-figure "ex-96" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-96.mp" (The system cannot find the path specified.;

errno=3)

97 ex-97

97.1 source code in ex-97.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((c0 (fullcircle '1cm (point 0 '1cm) 1 0.5))
         (c1 (rotate 120 c0))
         (c2 (rotate 120 c1))
         (A (point '-0.5cm '1cm))
         (l0 (path A (dir-spec 'down) '..
                   (rotate 120 (xscale -1 A)) (dir-spec (rotate 120 (op* -1 'down)))))
         (l1 (rotate 120 l0))
         (l2 (rotate 120 l1)))
    (for ((x (in-list (list c0 c1 c2  l0 l1 l2
                            ))))
         (draw x)
         )))
 

97.2 the result of ex-97

Examples:

> (require "examples/ex-97.rkt")
> (make-figure "ex-97" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-97.mp" (The system cannot find the path specified.;

errno=3)

98 ex-98

98.1 source code in ex-98.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((c0 (fullcircle '1cm (point 0 '1cm) 1 0.5))
         (c1 (rotate 90 c0))
         (c2 (rotate 90 c1))
         (c3 (rotate 90 c2))
         (A (point '-0.5cm '1cm))
         (l0 (path A (dir-spec 'down) '..
                   (rotate 90 (xscale -1 A)) (dir-spec (rotate 90 (op* -1 'down)))))
         (l1 (rotate 90 l0))
         (l2 (rotate 90 l1))
         (l3 (rotate 90 l2)))
    (for ((x (in-list (list c0 c1 c2 c3 l0 l1 l2 l3
                            ))))
         (draw x)
         )))
 

98.2 the result of ex-98

Examples:

> (require "examples/ex-98.rkt")
> (make-figure "ex-98" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-98.mp" (The system cannot find the path specified.;

errno=3)

99 ex-99

99.1 source code in ex-99.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point 0  0))
         (B (point '2cm '1cm))
         (p (fullcircle (op-abs (op- B A))
                        (mediation 0.5 A B))))
    (for ((x (in-list (list A B))))
         (draw x #:withpen (scale '4bp 'pencircle)))
    (draw p)))
 

99.2 the result of ex-99

Examples:

> (require "examples/ex-99.rkt")
> (make-figure "ex-99" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-99.mp" (The system cannot find the path specified.;

errno=3)

100 ex-100

100.1 source code in ex-100.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((origin (point 0 0))
         (A (point '2cm '2cm)))
    (for ((i (in-range 4)))
         (drawarrow (rotate (op* (* i -1/3) (op-angle A))
                            (op-- origin A))))))
 

100.2 the result of ex-100

Examples:

> (require "examples/ex-100.rkt")
> (make-figure "ex-100" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-100.mp" (The system cannot find the path specified.;

errno=3)

101 ex-101

101.1 source code in ex-101.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((origin (point 0 0))
         (A (point '1cm '2cm))
         (B (point '2cm '1cm))
         (alpha (op- (op-angle A)
                     (op-angle B))))
    (drawarrow (op-- origin A))
    (drawarrow (op-- origin B))
    (for ((i (in-range 3)))
         (drawarrow (rotate (op* (* i -1/3) alpha)
                            (op-- origin A))))
    ))
 

101.2 the result of ex-101

Examples:

> (require "examples/ex-101.rkt")
> (make-figure "ex-101" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-101.mp" (The system cannot find the path specified.;

errno=3)

102 ex-102

102.1 source code in ex-102.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(require (planet wcy/mpost-wrapper/label))
(provide main)
(define (main)
  (let* ((A (point 0 0))
         (B (point '3cm 0))
         (C (point '1cm '2cm)))
    (draw (op-- A B C 'cycle))
    (label-llft (TEX (decimal (op- (op-angle (op- C A))
                                   (op-angle (op- B A))))) A)
    (label-lrt (TEX (decimal (op- (op-angle (op- A B))
                                  (op-angle (op- C B))))) B)
    (label-urt (TEX (decimal (op- (op-angle (op- B C))
                                  (op-angle (op- A C))))) C)
    ))
 

102.2 the result of ex-102

Examples:

> (require "examples/ex-102.rkt")
> (make-figure "ex-102" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-102.mp" (The system cannot find the path specified.;

errno=3)

103 ex-103

103.1 source code in ex-103.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point 0 0))
         (B (point '3cm 0))
         (C (point '1cm '2cm))
         (AA (mediation 0.5 B C))
         (BB (mediation 0.5 A C))
         (CC (mediation 0.5 A B))
         (O (unknown-point))
         (polar (unknown-numeric)))
    (eqn= (op- O (mediation 0.5 BB CC))
          (op* (whatever) (rotate 90 (op- BB CC))))
    (eqn= (op- O (mediation 0.5 AA BB))
          (op* (whatever) (rotate 90 (op- AA BB))))
    (draw (op-- A B C 'cycle))
    (for ((x (in-list (list AA BB CC))))
         (draw x #:withpen (scale '4bp 'pencircle )))
    (draw (fullcircle (op* 2 (op-abs (op- O AA)))
                      O))
    (let ((AA (unknown-point))
          (BB (unknown-point))
          (CC (unknown-point))
          (H  (unknown-point)))
      (for ((vAA (in-list (list AA BB CC)))
            (vA (in-list (list A B C)))
            (vB (in-list (list B C A)))
            (vC (in-list (list C A B))))
           (eqn= (op- vAA vA)
                 (op* (whatever) (rotate  90 (op- vB vC))))
           (eqn= vAA (mediation (whatever) vB vC)))
      (for ((vA (in-list (list A B C)))
            (vAA (in-list (list AA BB CC))))
           (draw (op-- vA vAA)))
      (for ((x (in-list (list AA BB CC))))
           (draw x #:withpen (scale '4bp 'pencircle )))
      (eqn= H (mediation (whatever) A AA))
      (eqn= H (mediation (whatever) B BB))
      (for ((x (in-list (list A B C))))
           (draw (mediation 0.5 x H) #:withpen (scale '4bp 'pencircle)))
      )))
 

103.2 the result of ex-103

Examples:

> (require "examples/ex-103.rkt")
> (make-figure "ex-103" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-103.mp" (The system cannot find the path specified.;

errno=3)

104 ex-104

104.1 source code in ex-104.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '2cm)
         (A (point 0 0))
         (B (point (op* 2 u) (op* -0.5 u)))
         (C (point u u))
         (M (unknown-point))
         (h (unknown-point)))
    (draw (op-- A B C 'cycle))
    (eqn= (op- M A)
          (op* (whatever)
               (rotate (op* 0.5
                            (op-
                             (op-angle (op- B A))
                             (op-angle (op- C A))))
                       (op- A C))))
    (eqn= (op- M B)
          (op* (whatever)
               (rotate (op* 0.5
                            (op-
                             (op-angle (op- C B))
                             (op-angle (op- A B))))
                       (op- B A))))
    (for ((x (in-list (list A B C))))
         (draw (op-- M x)))
    (eqn= (op- M h)
          (op* (whatever) (rotate 90 (op- B C))))
    (eqn= h (mediation (whatever) B C) )
    (draw (fullcircle (op* 2 (op-abs (op- M h)))
                      M))))
 

104.2 the result of ex-104

Examples:

> (require "examples/ex-104.rkt")
> (make-figure "ex-104" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-104.mp" (The system cannot find the path specified.;

errno=3)

105 ex-105

105.1 source code in ex-105.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((p (path (point 0 0) (dir-spec 'up) '..
                  (point '2cm 0) (dir-spec 'down))))
    (draw p)
    (for ((i (in-list (list 0 0.5 1))))
         (draw (point-of i p) #:withpen (scale '4bp 'pencircle)))
    ))
 

105.2 the result of ex-105

Examples:

> (require "examples/ex-105.rkt")
> (make-figure "ex-105" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-105.mp" (The system cannot find the path specified.;

errno=3)

106 ex-106

106.1 source code in ex-106.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((p (path (point 0 0) (dir-spec 'up) '..
                  (point '2cm 0) (dir-spec 'down)))
         (A (point-of 0 p)))
    (draw p)
    (for ((i (in-list (list 0 0.5 1))))
         (let* ((A (point-of i p))
                (B (op+ A (polar '1cm (op-angle (direction-of i p))))))
           (drawarrow (op-- A B) #:withpen (scale '1bp 'pencircle))))))
 

106.2 the result of ex-106

Examples:

> (require "examples/ex-106.rkt")
> (make-figure "ex-106" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-106.mp" (The system cannot find the path specified.;

errno=3)

107 ex-107

107.1 source code in ex-107.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '5mm)
         (p (path (point 0 0) (dir-spec '(curl 0)) '..
                  (point u (op* 2 u)) '..
                  (point (op* 2 u) (op* 1.5 u)) '..
                  (point (op* 3 u) (op* 2   u)) '..
                  (dir-spec '(curl 0)) (point (op* 4 u) 0))))
    (draw (subpath-of 0 1 p) #:withcolor 'red)
    (draw (subpath-of 1 2 p) #:withcolor 'green)
    (draw (subpath-of 2 3 p) #:withcolor 'blue)
    (draw (subpath-of 3 3.5 p) #:dashed 'evenly)
    (draw (subpath-of 3.5 4 p) #:dashed 'withdots)))
 

107.2 the result of ex-107

Examples:

> (require "examples/ex-107.rkt")
> (make-figure "ex-107" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-107.mp" (The system cannot find the path specified.;

errno=3)

108 ex-108

108.1 source code in ex-108.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (p (path (point 0 0) (dir-spec 'up) '..
                  (point u (op* 2 u)) (dir-spec 'up)))
         (q (path (point u 0) (dir-spec 'up) '..
                  (point 0 (op* 2 u)) (dir-spec 'up))))
    (draw p)
    (draw (subpath-of 0 0.4 q) #:withpen (scale '1bp 'pencircle))
    (draw (subpath-of 0.6 1 q) #:withpen (scale '1bp 'pencircle))))
 

108.2 the result of ex-108

Examples:

> (require "examples/ex-108.rkt")
> (make-figure "ex-108" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-108.mp" (The system cannot find the path specified.;

errno=3)

109 ex-109

109.1 source code in ex-109.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (a (path (point (op* -1 u) (op* -0.2 u)) '..
                  'tension 1.2 '..
                  (point u (op* -0.2 u)) (dir-spec 'down)))
         (b (rotate 90 a))
         (c (rotate 90 b))
         (d (rotate 90 c)))
    (fill (buildcycle a b c d) #:withcolor (op* 0.8 'white))
    (map draw (list a b c d))))
 

109.2 the result of ex-109

Examples:

> (require "examples/ex-109.rkt")
> (make-figure "ex-109" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-109.mp" (The system cannot find the path specified.;

errno=3)

110 ex-110

110.1 source code in ex-110.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (c1 (fullcircle u))
         (c2 (fullcircle u (point 0 (op* 0.5 u)))))
    (draw c1 #:dashed 'evenly)
    (draw c2 #:dashed 'evenly)
    (draw (buildcycle c1 c2) #:withpen (scale '1bp 'pencircle))))
 

110.2 the result of ex-110

Examples:

> (require "examples/ex-110.rkt")
> (make-figure "ex-110" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-110.mp" (The system cannot find the path specified.;

errno=3)

111 ex-111

111.1 source code in ex-111.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (a (fullcircle (op* 2 u) (point (op* 0.5 u) 0)))
         (b (rotate (/ 360 3) a))
         (c (rotate (/ 360 3) b)))
    (fill a #:withcolor 'red)
    (fill b #:withcolor 'green)
    (fill c #:withcolor 'blue)
    (fill (buildcycle a b) #:withcolor (op+ 'red   'green))
    (fill (buildcycle b c) #:withcolor (op+ 'green 'blue))
    (fill (buildcycle c a) #:withcolor (op+ 'blue  'red))
    (fill (buildcycle a b c) #:withcolor 'white)
    (draw a) (draw b) (draw c)
    ))
 

111.2 the result of ex-111

Examples:

> (require "examples/ex-111.rkt")
> (make-figure "ex-111" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-111.mp" (The system cannot find the path specified.;

errno=3)

112 ex-112

112.1 source code in ex-112.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define (compute_curve f xmin xmax xinc)
    (apply op.. (for/list ((x (in-range xmin xmax xinc)))
                          (point x (f x)))))
  (define (f x)
    (op+ 1 (op** x 2)))
  (define (g x)
    (op- 2 (op** (op- x 1) 2)))
  (let* ((p (scale '1cm (compute_curve f -1 1.5 0.1)))
         (q (scale '1cm (compute_curve g -0.5 2 0.1))))
    (fill (buildcycle p (op-reverse q)) #:withcolor (op+ 'red 'green))
    (draw p #:withpen (scale '1bp 'pencircle))
    (draw q #:withpen (scale '1bp 'pencircle))
    (draw (op-- (point '-1cm 0)  (point '2cm 0)))
    (draw (op-- (point 0 (op* (g -0.5) '1cm))
                (point 0 (op* (f  1.5) '1cm))))
    ))
 

112.2 the result of ex-112

Examples:

> (require "examples/ex-112.rkt")
> (make-figure "ex-112" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-112.mp" (The system cannot find the path specified.;

errno=3)

113 ex-113

113.1 source code in ex-113.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((p (path (point 0 0) (dir-spec 'up) '..
                  (point '2cm 0) (dir-spec 'up)))
         (q (path (point 0 '1cm) (dir-spec (dir -60)) '..
                  (point '1cm '-1cm) '..
                  (dir-spec (dir 60)) (point '2cm '1cm))))
    (draw p)
    (draw q)
    (draw (intersectionpoint p q) #:withpen (scale '4bp 'pencircle))))
 

113.2 the result of ex-113

Examples:

> (require "examples/ex-113.rkt")
> (make-figure "ex-113" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-113.mp" (The system cannot find the path specified.;

errno=3)

114 ex-114

114.1 source code in ex-114.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((p (path (point 0 0) (dir-spec 'up) '..
                  (point '2cm 0) (dir-spec 'up)))
         (q (path (point 0 '1cm) (dir-spec (dir -60)) '..
                  (point '1cm '-1cm) '..
                  (dir-spec (dir 60)) (point '2cm '1cm)))
         (a (unknown-numeric))
         (b (unknown-numeric)))
    (draw p)
    (draw q)
    (eqn= (point a (whatever))
          (intersectiontimes p q))
    (draw (point-of a p) #:withpen (scale '4bp 'pencircle))))
 

114.2 the result of ex-114

Examples:

> (require "examples/ex-114.rkt")
> (make-figure "ex-114" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-114.mp" (The system cannot find the path specified.;

errno=3)

115 ex-115

115.1 source code in ex-115.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((A (point 0 '1cm))
         (B (rotate 120 A))
         (p (path A (dir-spec (dir 0)) '..
                  'tension 2 '..
                  B (dir-spec (dir 120))))
         (a (unknown-numeric)))
    (eqn= (point a (whatever))
          (intersectiontimes p (rotate 120 p)))
    (draw (subpath-of 0 (op- a 0.02) p))
    (draw (subpath-of (op+ a 0.02) 1 p))
    (draw (subpath-of 0 (op- a 0.02) (rotate 120 p)))
    (draw (subpath-of (op+ a 0.02) 1 (rotate 120 p)))
    (draw (subpath-of 0 (op- a 0.02) (rotate -120 p)))
    (draw (subpath-of (op+ a 0.02) 1 (rotate -120 p)))))
 

115.2 the result of ex-115

Examples:

> (require "examples/ex-115.rkt")
> (make-figure "ex-115" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-115.mp" (The system cannot find the path specified.;

errno=3)

116 ex-116

116.1 source code in ex-116.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (draw-extra n p op-x)
  (let ((pn (point-of n p)))
    (draw (op-- pn (op-x pn (op* '4mm (unitvector (direction-of n p))))))))
 
(define (main)
  (let* ((u '2cm)
         (A0 (op* u 'up))
         (A (reverse (for/fold ((r (list A0)))
                         ((i (in-range 1 11)))
                       (cons (rotate 72 (car r)) r))))
         (B*  (for/list ((A_i (in-list A))
                         (A_i+1 (in-list (cdr A)))
                         (i (in-range 0 10)))
                        (mediation 0.5 A_i A_i+1)))
         (B (for/list ((b_i (in-range 0 10)))
                      (list-ref B* (if (= b_i 5) 0 b_i))))
         (C (for/list ((b_i (in-list B)))
                      (op* 0.8 b_i))))
    (for ((A_i (in-list A))
          (A_i+1 (in-list (cdr A))))
         (let* ((p_i (op-- A_i A_i+1)))
           (draw p_i)
           (draw-extra 1 p_i op+)
           (draw-extra 0 p_i op-)))
    (let ((p (for/list ((i (in-range 0 5)))
                       (let* ((p_i (path (list-ref B i) '---
                                         (list-ref C i) '..
                                         (list-ref C (+ 2 i))  (dir-spec (dir  (* 72 i)))
                                         )))
                         (draw p_i)
                         (draw-extra 2 p_i op+ )
                         (draw-extra 0 p_i op- ) p_i))))
      (for ((p_i (in-list p)))
           (draw (subpath-of 1 1.4 p_i) #:withpen (scale '4bp 'pencircle) #:withcolor 'white)
           (draw (subpath-of 0 1.5 p_i) ))
      (for ((A_i (in-list A))
            (B_i (in-list B))
            (C_i (in-list C)))
           (for ((x (in-list (list A_i B_i C_i))))
                (draw x #:withpen (scale '4bp 'pencircle)))))))
 

116.2 the result of ex-116

Examples:

> (require "examples/ex-116.rkt")
> (make-figure "ex-116" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-116.mp" (The system cannot find the path specified.;

errno=3)

117 ex-117

117.1 source code in ex-117.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '2cm)
         (A (op* u 'up))
         (B (mediation 0.5 A (rotate 72 A)))
         (C (op* 0.8 B))
         (p (op-- (mediation  -0.2 A (rotate 72 A))
                  (mediation  1.2 A (rotate 72 A)))))
    (for ((i (in-range 6)))
         (draw (rotate (* i 72) p)))
    (let* ((p* (path B '--- C '.. (rotate (* 2 72) C) (dir-spec 'right)))
           (p  (op& (path (op- (point-of 0 p*)
                               (op* '4mm (unitvector (direction-of 0 p*))))
                          '--
                          (point-of 0 p*))
                    p*
                    (path (point-of 2 p*)
                          '--
                          (op+ (point-of 2 p*)
                               (op* '4mm (unitvector (direction-of 2 p*)))))))
           (E (intersectionpoint p (rotate 72 p)))
           (q (cutbefore p (fullcircle  '-2mm E)))
           (r (cutafter p (fullcircle '2mm E))))
      (for ((i (in-range 6)))
           (let ((rotate-it (lambda (x) (rotate (* 72 i) x))))
             (for ((x (in-list (list q r A))))
                  (draw (rotate-it x)))
             (for ((x (in-list (list A B C))))
                  (draw (rotate-it x) #:withpen (scale '4bp 'pencircle))))))))
 

117.2 the result of ex-117

Examples:

> (require "examples/ex-117.rkt")
> (make-figure "ex-117" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-117.mp" (The system cannot find the path specified.;

errno=3)

118 ex-118

118.1 source code in ex-118.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (for ((i (in-range 4)))
       (draw (rotate (* i 90) (op* '1cm 'right))
             #:withpen (scale '4bp 'pencircle))))
 

118.2 the result of ex-118

Examples:

> (require "examples/ex-118.rkt")
> (make-figure "ex-118" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-118.mp" (The system cannot find the path specified.;

errno=3)

119 ex-119

119.1 source code in ex-119.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (draw (apply op--
               `(,@(for/list ((i (in-range 4)))
                             (rotate (* i 90) (op* '1cm 'right)))
                 cycle))))
 

119.2 the result of ex-119

Examples:

> (require "examples/ex-119.rkt")
> (make-figure "ex-119" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-119.mp" (The system cannot find the path specified.;

errno=3)

120 ex-120

120.1 source code in ex-120.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((n 5))
    (draw (apply op--
                 `(,@(for/list ((i (in-range n)))
                               (rotate (/ (* i 360) n) (op* '1cm 'up)))
                   cycle)))))
 

120.2 the result of ex-120

Examples:

> (require "examples/ex-120.rkt")
> (make-figure "ex-120" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-120.mp" (The system cannot find the path specified.;

errno=3)

121 ex-121

121.1 source code in ex-121.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let ((n 7))
    (draw (apply op--
                 `(,@(for/list ((i (in-range n)))
                               (rotate (/ (* i 360) n) (op* '1cm 'up)))
                   cycle)))))
 

121.2 the result of ex-121

Examples:

> (require "examples/ex-121.rkt")
> (make-figure "ex-121" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-121.mp" (The system cannot find the path specified.;

errno=3)

122 ex-122

122.1 source code in ex-122.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((p (op.. (point 0 0)
                  (point '-1cm '2cm)
                  (point '2cm '1cm)
                  (point '1cm 0)))
         (n 10)
         (length-p (length p)))
    (draw p)
    (for ((i (in-range (+ 1 n))))
         (draw (point-of (op* (/ i n)
                              length-p)
                         p)
               #:withpen (scale '4bp 'pencircle)))))
 

122.2 the result of ex-122

Examples:

> (require "examples/ex-122.rkt")
> (make-figure "ex-122" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-122.mp" (The system cannot find the path specified.;

errno=3)

123 ex-123

123.1 source code in ex-123.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((p (op.. (point 0 0)
                  (point '-1cm '2cm)
                  (point '2cm '1cm)
                  (point '1cm 0)))
         (n 10)
         (length-p (length p)))
    (draw p)
    (for ((i (in-range 0 1 (/ 1 n))))
         (let ((pi (point-of (op* i length-p) p)))
           (drawarrow (op-- pi
                            (shift pi (op* '1cm (unitvector (direction-of (op* i length-p) p))))))))))
 

123.2 the result of ex-123

Examples:

> (require "examples/ex-123.rkt")
> (make-figure "ex-123" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-123.mp" (The system cannot find the path specified.;

errno=3)

124 ex-124

124.1 source code in ex-124.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm))
    (draw (op-- (point (op* -2 u) 0)
                (point (op*  2 u) 0)))
    (draw (op-- (point 0 (op* -2 u))
                (point 0 (op*  2 u))))
    (for ((i (in-range -2 3 1)))
         (draw (op-- (point (op* i u) (op/ u  20))
                     (point (op* i u) (op/ u -20))))
         (draw (op-- (point (op/ u  20) (op* i u))
                     (point (op/ u -20) (op* i u)))))))
 

124.2 the result of ex-124

Examples:

> (require "examples/ex-124.rkt")
> (make-figure "ex-124" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-124.mp" (The system cannot find the path specified.;

errno=3)

125 ex-125

125.1 source code in ex-125.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm))
    (draw (op-- (point (op* -2 u) 0)
                (point (op*  2 u) 0)))
    (draw (op-- (point 0 (op* -2 u))
                (point 0 (op*  2 u))))
    (for ((i (in-range -2 3 1)))
         (draw (op-- (point (op* i u) (op/ u 10))
                     (point (op* i u) (op/ u -10))))
         (draw (op-- (point (op/ u  10) (op* i u))
                     (point (op/ u -10) (op* i u)))))
    (for ((i (in-range -2 2.01 0.2)))
         (draw (op-- (point (op* i u) (op/ u  20))
                     (point (op* i u) (op/ u -20))))
         (draw (op-- (point (op/ u  20) (op* i u))
                     (point (op/ u -20) (op* i u)))))))
 

125.2 the result of ex-125

Examples:

> (require "examples/ex-125.rkt")
> (make-figure "ex-125" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-125.mp" (The system cannot find the path specified.;

errno=3)

126 ex-126

126.1 source code in ex-126.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm))
    (draw (op-- (point (op* -2 u) 0)
                (point (op*  2 u) 0)))
    (draw (op-- (point 0 (op* -2 u))
                (point 0 (op*  2 u))))
    (for ((i (in-range -2 2.01 1)))
         (draw (op-- (point (op* i u) (op* u  2))
                     (point (op* i u) (op* u -2))))
         (draw (op-- (point (op* u  2) (op* i u))
                     (point (op* u -2) (op* i u))))
         )))
 

126.2 the result of ex-126

Examples:

> (require "examples/ex-126.rkt")
> (make-figure "ex-126" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-126.mp" (The system cannot find the path specified.;

errno=3)

127 ex-127

127.1 source code in ex-127.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm))
    (draw (op-- (point (op* -2 u) 0)
                (point (op*  2 u) 0)))
    (draw (op-- (point 0 (op* -2 u))
                (point 0 (op*  2 u))))
    (for ((i (in-range -2 2.01 1)))
         (draw (op-- (point (op* i u) (op* u  2))
                     (point (op* i u) (op* u -2))))
         (draw (op-- (point (op* u  2) (op* i u))
                     (point (op* u -2) (op* i u))))
         )
    (for ((i (in-range -2 2.01 0.2)))
         (draw (op-- (point (op* i u) (op* u  2))
                     (point (op* i u) (op* u -2)))
               #:withpen (scale '0.2bp 'pencircle))
         (draw (op-- (point (op* u  2) (op* i u))
                     (point (op* u -2) (op* i u)))
               #:withpen (scale '0.2bp 'pencircle))
         )))
 

127.2 the result of ex-127

Examples:

> (require "examples/ex-127.rkt")
> (make-figure "ex-127" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-127.mp" (The system cannot find the path specified.;

errno=3)

128 ex-128

128.1 source code in ex-128.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '5mm))
    (define (f x)
      (op- (op** x 2 ) 0.1))
    (define (my-draw x)
      (draw (scale u x)))
    (define (f-x x)
      (point x (f x)))
    (define (axes xmin xmax ymin ymax)
      (my-draw  (op-- (point xmin 0) (point xmax 0)))
      (my-draw  (op-- (point 0 ymin) (point 0 ymax))))
    (define (courbe f xmin xmax M)
      (let ((x-range (in-range xmin xmax (/ (- xmax xmin) M))))
        (my-draw (apply op-- (map f-x (stream->list x-range))))))
    (define (newton f y h M)
      (define (diff-f x)
        (op/ (op- (f (op+ x h)) (f x)) h))
      (define (newton-helper x)
        (op- x (op/ (f x) (diff-f x))))
      (for/fold ((x y)
                 (t (newton-helper y)))
          ((i (in-range M)))
        (my-draw (op-- (f-x x) (point t 0) (f-x t)))
        (values t (newton-helper x))))
    (axes -0.5 2 -0.5 4)
    (courbe f -0.5 2 100)
    (newton f 2 0.01 10)))
 

128.2 the result of ex-128

Examples:

> (require "examples/ex-128.rkt")
> (make-figure "ex-128" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-128.mp" (The system cannot find the path specified.;

errno=3)

129 ex-128-b

129.1 source code in ex-128-b.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '5mm))
    (define (f x)
      (op- (op** x 2 ) 0.1))
    (define (my-draw x)
      (draw (scale u x)))
    (define (f-x x)
      (point x (f x)))
    (define (axes xmin xmax ymin ymax)
      (my-draw  (op-- (point xmin 0) (point xmax 0)))
      (my-draw  (op-- (point 0 ymin) (point 0 ymax))))
    (define (courbe f xmin xmax M)
      (let ((x-range (in-range xmin xmax (/ (- xmax xmin) M))))
        (my-draw (apply op-- (map f-x (stream->list x-range))))))
    (define (newton f y h M)
      (define (diff-f x)
        (op/ (op- (f (op+ x h)) (f x)) h))
      (define (newton-helper x)
        (op- x (op/ (f x) (diff-f x))))
      (for/fold ((x y)
                 (t (newton-helper y)))
          ((i (in-range M)))
        (my-draw (op-- (f-x x) (point t 0) (f-x t)))
        (values t (newton-helper x))))
    (axes -0.5 2 -0.5 4)
    (courbe f -0.5 2 100)
    (newton f 2 0.01 10)))
 

129.2 the result of ex-128-b

Examples:

> (require "examples/ex-128-b.rkt")
> (make-figure "ex-128-b" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-128-b.mp" (The system cannot find the path specified.;

errno=3)

130 ex-129

130.1 source code in ex-129.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((T (unknown-transform))
         (u '1cm)
         (z0 (point 0 0))
         (z1 (point (op* 2 u) 0))
         (z3 (rotate 90 z1))
         (z2 (op+ z1 z3))
         (p (op-- z0 z1 z2 z3 'cycle)))
    (for ((a (in-list (list z0 z1 z2)))
          (b (in-list (list z1 z2 z3))))
         (eqn= (transform T a) (mediation 0.1 a b)))
    (fill p #:withcolor (op* 0.8 'white))
    (fill (transform T p) #:withcolor 'white)
    ))
 

130.2 the result of ex-129

Examples:

> (require "examples/ex-129.rkt")
> (make-figure "ex-129" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-129.mp" (The system cannot find the path specified.;

errno=3)

131 ex-130

131.1 source code in ex-130.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((T (unknown-transform))
         (u '1cm)
         (z0 (point 0 0))
         (z1 (point (op* 2 u) 0))
         (z3 (rotate 90 z1))
         (z2 (op+ z1 z3))
         (p (op-- z0 z1 z2 z3 'cycle)))
    (for ((a (in-list (list z0 z1 z2)))
          (b (in-list (list z1 z2 z3))))
         (eqn= (transform T a) (mediation 0.1 a b)))
    (for/fold ((p p))
        ((i (in-range 201)))
      (fill p #:withcolor (if (= (modulo i 2) 0)
                              (op* 0.8 'white)
                              'white))
      (transform T p))))
 

131.2 the result of ex-130

Examples:

> (require "examples/ex-130.rkt")
> (make-figure "ex-130" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-130.mp" (The system cannot find the path specified.;

errno=3)

132 ex-131

132.1 source code in ex-131.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((T (unknown-transform))
         (u '1cm)
         (z (point 0 (op* 2 u)))
         (n 5)
         (zn (map (lambda (i) (rotate (/ (* 360 i) n)
                                      z))
                  (stream->list (in-range n))))
         (p (apply op--  `(,@zn cycle))))
    (for ((i (in-range 1 4)))
         (eqn= (transform T (list-ref zn i))
               (mediation 0.1
                          (list-ref zn i)
                          (list-ref zn (+ 1 i)))))
    (for/fold ((p p))
        ((i (in-range 201)))
      (fill p #:withcolor (if (= (modulo i 2) 0)
                              (op* 0.8 'white)
                              'white))
      (transform T p))))
 

132.2 the result of ex-131

Examples:

> (require "examples/ex-131.rkt")
> (make-figure "ex-131" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-131.mp" (The system cannot find the path specified.;

errno=3)

133 ex-132

133.1 source code in ex-132.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (n 7)
         (A0 (point u 0))
         (An (map (lambda (i) (rotate (/ (* 360 i) n)
                                      A0))
                  (stream->list (in-range n)))))
    (for ((Ai (in-list An)))
         (draw Ai #:withpen (scale '4bp 'pencircle)))
    (for* ((i (in-range n))
           (j (in-range n)))
          (when (not (= i j))
            (draw (op-- (list-ref An i)
                        (list-ref An j)))))))
 

133.2 the result of ex-132

Examples:

> (require "examples/ex-132.rkt")
> (make-figure "ex-132" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-132.mp" (The system cannot find the path specified.;

errno=3)

134 ex-133

134.1 source code in ex-133.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define (funcall f) (f))
  (let* ((u '2cm)
         (n 4)
         (m 5)
         (An (map funcall (make-list n unknown-point)))
         (Bn (map funcall (make-list m unknown-point))))
    (for ((Xn (in-list (list An Bn))))
         (for ((Xi (in-list Xn))
               (Xi+1 (in-list (cdr Xn))))
              (eqn= (op- Xi+1 Xi)
                    (point 0 (op* 0.2 u)))))
    (eqn= (apply op+ An) (point 0 0))
    (eqn= (apply op+ Bn) (point (op* 4 u) 0))
    (define (draw-point x) (draw x #:withpen (scale '4bp 'pencircle)))
    (map draw-point An)
    (map draw-point Bn)
    (for* ((Ai (in-list An))
           (Bi (in-list Bn)))
          (draw (op-- Ai Bi)))))
 

134.2 the result of ex-133

Examples:

> (require "examples/ex-133.rkt")
> (make-figure "ex-133" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-133.mp" (The system cannot find the path specified.;

errno=3)

135 ex-134

135.1 source code in ex-134.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define (funcall f) (f))
  (let* ((u '1cm)
         (n 3)
         (m 3)
         (An (map funcall (make-list n unknown-point)))
         (Bn (map funcall (make-list m unknown-point))))
    (for ((Xn (in-list (list An Bn))))
         (for ((Xi (in-list Xn))
               (Xi+1 (in-list (cdr Xn))))
              (eqn= (op- Xi+1 Xi)
                    (point (op* 0.5 u) 0))))
    (eqn= (apply op+ An) (point 0 0))
    (eqn= (apply op+ Bn) (point 0 (op* 4 u)))
    (define (draw-point x) (draw x #:withpen (scale '4bp 'pencircle)))
    (map draw-point An)
    (map draw-point Bn)
    (for* ((Ai (in-list An))
           (Bi (in-list Bn)))
          (draw (op-- Ai Bi)))))
 

135.2 the result of ex-134

Examples:

> (require "examples/ex-134.rkt")
> (make-figure "ex-134" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-134.mp" (The system cannot find the path specified.;

errno=3)

136 ex-135

136.1 source code in ex-135.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((n 6)
         (P (lambda (d)
              (for/list ((i (in-range (+ 1 n))))
                        (rotate (/ (* i 360) n)
                                (op* d 'right)))))
         (An (P '1cm))
         (Bn (P '2cm)))
    (define (draw-point x) (draw x #:withpen (scale '4bp 'pencircle)))
    (map draw-point An)
    (map draw-point Bn)
    (for ((Ai (in-list An))
          (Ai+1 (in-list (cdr An)))
          (Bi (in-list Bn))
          (Bi+1 (in-list (cdr Bn))))
         (draw (op-- Ai Ai+1 Bi+1 Bi)))))
 

136.2 the result of ex-135

Examples:

> (require "examples/ex-135.rkt")
> (make-figure "ex-135" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-135.mp" (The system cannot find the path specified.;

errno=3)

137 ex-136

137.1 source code in ex-136.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((n 5)
         (O (point 0 0))
         (A (op* '1cm 'up))
         (B ((rotate-around A 30 )
             (op* '2cm 'up)))
         (C (op* '2cm 'up))
         (D ((rotate-around A -30)
             (op* '2cm 'up))))
    (define (draw-point x) (draw x #:withpen (scale '4bp 'pencircle)))
    (define ((rotate-draw i f) obj) (f (rotate (/ (* i 360) n) obj)))
    (for ((i (in-range n)))
         ((rotate-draw i draw) (op-- O A C))
         ((rotate-draw i draw) (op-- B A D))
         (map (rotate-draw i draw-point) (list A B C D)))))
 

137.2 the result of ex-136

Examples:

> (require "examples/ex-136.rkt")
> (make-figure "ex-136" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-136.mp" (The system cannot find the path specified.;

errno=3)

138 ex-137

138.1 source code in ex-137.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '1cm)
         (p (yscale (op* 3 u) (xscale (op* -1 u) 'fullcircle))))
    (draw p)
    (define (draw-point x) (draw x #:withpen (scale '4bp 'pencircle)))
    (for ((i (in-range 2 6.1 0.5)))
         (draw (path (point-of 2 p) (dir-spec 'down)
                     '..
                     (point-of i p))))))
 

138.2 the result of ex-137

Examples:

> (require "examples/ex-137.rkt")
> (make-figure "ex-137" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-137.mp" (The system cannot find the path specified.;

errno=3)

139 ex-138

139.1 source code in ex-138.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define (i-of-360 i n) (/ (* 360 i ) n))
  (let* ((u '0.5cm)
         (P* (for/list ((i (in-range 5)))
                       (rotate (i-of-360 i 5)
                               (op* u 'down))))
         (P `(,@P* ,(car P*)))
         (Q* (for/list ((Pi (in-list P))
                        (Pi+1 (in-list (cdr P))))
                       (op* 3 (mediation 0.5 Pi Pi+1))))
         (Q `(,@Q* ,(car Q*)))
         (R* (for/list ((Qi (in-list Q))
                        (Qi+1 (in-list (cdr Q)))
                        (Pi+1 (in-list (cdr P))))
                       (op* 1/3 (op+ Qi Qi+1 Pi+1))))
         (R `(,@R* ,(car R*)))
         (S (map (curry op* 1.5) Q)))
    (for ((Pi (in-list P))
          (Pi+1 (in-list (cdr P)))
          (Qi (in-list Q))
          (Qi+1 (in-list (cdr Q)))
          (Ri (in-list R))
          (Si (in-list S))
          (Si+1 (in-list (cdr S))))
         (draw (op-- Pi Pi+1))
         (draw (op-- Pi+1 Ri))
         (draw (op-- Qi Ri))
         (draw (op-- Ri Qi+1))
         (draw (op-- Qi Si))
         (draw (op-- Si Si+1))
         )))
 

139.2 the result of ex-138

Examples:

> (require "examples/ex-138.rkt")
> (make-figure "ex-138" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-138.mp" (The system cannot find the path specified.;

errno=3)

140 ex-139

140.1 source code in ex-139.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define (i-of-360 i n) (/ (* 360 i ) n))
  (let* ((u '0.5cm)
         (P* (for/list ((i (in-range 5)))
                       (rotate (i-of-360 i 5)
                               (op* u 'down))))
         (P `(,@P* ,(car P*)))
         (Q* (for/list ((Pi (in-list P))
                        (Pi+1 (in-list (cdr P))))
                       (op* 3 (mediation 0.5 Pi Pi+1))))
         (Q `(,@Q* ,(car Q*)))
         (R* (for/list ((Qi (in-list Q))
                        (Qi+1 (in-list (cdr Q)))
                        (Pi+1 (in-list (cdr P))))
                       (op* 1/3 (op+ Qi Qi+1 Pi+1))))
         (R `(,@R* ,(car R*)))
         (S (map (curry op* 1.5) Q)))
    (for ((Pi (in-list P))
          (Pi+1 (in-list (cdr P)))
          (Qi (in-list Q))
          (Qi+1 (in-list (cdr Q)))
          (Ri (in-list R))
          (Si (in-list S))
          (Si+1 (in-list (cdr S))))
         (draw (op-- Pi Pi+1))
         (draw (op-- Pi+1 Ri))
         (draw (op-- Qi Ri))
         (draw (op-- Ri Qi+1))
         (draw (op-- Qi Si))
         (draw (op-- Si Si+1)))
    (draw (op-- (list-ref P 2)  (list-ref P 3)  (list-ref P 4)  (list-ref P 0)  (list-ref P 1)
                (list-ref R 0)  (list-ref Q 0)  (list-ref R 4)  (list-ref Q 4)  (list-ref R 3)
                (list-ref Q 3)  (list-ref R 2)  (list-ref Q 2)
                (list-ref S 2)  (list-ref S 3)  (list-ref S 4)  (list-ref S 0)  (list-ref S 1)
                (list-ref Q 1)  (list-ref R 1)  'cycle)
          #:withpen (scale '2bp 'pencircle))))
 

140.2 the result of ex-139

Examples:

> (require "examples/ex-139.rkt")
> (make-figure "ex-139" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-139.mp" (The system cannot find the path specified.;

errno=3)

141 ex-140

141.1 source code in ex-140.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (for ((i (in-range 1.0 0.0 -0.01 )))
       (fill (fullcircle (op* i '2cm))
             #:withcolor (op* i 'white)))
  (draw (fullcircle '2cm)
        #:withpen (scale '2bp 'pencircle)))
 

141.2 the result of ex-140

Examples:

> (require "examples/ex-140.rkt")
> (make-figure "ex-140" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-140.mp" (The system cannot find the path specified.;

errno=3)

142 ex-141

142.1 source code in ex-141.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((u '5mm)
         (p (shift (point -1 0)
                   (op.. (point 0 0)
                         (point -1 1)
                         (point 2 0)
                         (point 0 -3)
                         'cycle))))
    (for ((i (in-range 1.0 0.0 -0.01 )))
         (fill (scale  (op* i u) p)
             #:withcolor (op* i 'white)))
    (draw (scale u p)
        #:withpen (scale '2bp 'pencircle))))
 

142.2 the result of ex-141

Examples:

> (require "examples/ex-141.rkt")
> (make-figure "ex-141" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-141.mp" (The system cannot find the path specified.;

errno=3)

143 ex-142

143.1 source code in ex-142.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((z0 (point 50 50))
         (z1 (rotate 90 z0))
         (z2 (rotate 90 z1))
         (z3 (rotate 90 z2))
         (carre (op-- z0 z1 z2 z3 'cycle))
         (s 0.01)
         (z4 (mediation s z2 z3))
         (z5 (mediation s z1 z0))
         (rect (op-- z1 z2 z3 z4 z5 'cycle)))
    (for ((i (in-range 0.0 1.0 s )))
         (fill (shift (op* i (op- z0 z1)) rect)
               #:withcolor (op* i 'white)))
    (draw carre
          #:withpen (scale '2bp 'pencircle))))
 

143.2 the result of ex-142

Examples:

> (require "examples/ex-142.rkt")
> (make-figure "ex-142" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-142.mp" (The system cannot find the path specified.;

errno=3)

144 ex-143

144.1 source code in ex-143.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (let* ((z0 (point 50 50))
         (z1 (rotate 90 z0))
         (z2 (rotate 90 z1))
         (z3 (rotate 90 z2))
         (carre (op-- z0 z1 z2 z3 'cycle))
         (s 0.01))
    (for ((i (in-range 1  s (- s) )))
         (fill (scale i carre)
               #:withcolor (op* i 'white)))))
 

144.2 the result of ex-143

Examples:

> (require "examples/ex-143.rkt")
> (make-figure "ex-143" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-143.mp" (The system cannot find the path specified.;

errno=3)

145 ex-144

145.1 source code in ex-144.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define (degrade q p M N)
    (let ((a (length p))
          (b (length q)))
      (for ((i (in-range 0 (+ 1 M))))
           (draw (apply op..
                        `(,(mediation (/ i M) (point-of 0 p) (point-of 0 q))
                          ,@(for/list ((j (in-range 0 (+ 1 N))))
                                      (mediation (/ i M )
                                                 (point-of (op* a (/ j N)) p)
                                                 (point-of (op* b (/ j N)) q)))))))))
  (let* ((u '1cm))
    (degrade (op.. (point (op* -0.1 u)
                          (op* -0.1 u))
                   (point (op* 0.1 u)
                          (op* 0.1 u))
                   'cycle)
             (op-- (point (op* -1 u)
                          (op* -1 u))
                   (point (op*  1 u)
                          (op* -1 u))
                   (point (op*  1 u)
                          (op*  1 u))
                   (point (op* -1 u)
                          (op*  1 u))
                   'cycle) 10 100)))
    

145.2 the result of ex-144

Examples:

> (require "examples/ex-144.rkt")
> (make-figure "ex-144" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-144.mp" (The system cannot find the path specified.;

errno=3)

146 ex-145

146.1 source code in ex-145.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define (couleur c) (op* (- 1.0 c) 'white))
  (define (degrade q p M N)
    (let ((a (length p))
          (b (length q)))
      (for ((i (in-range 0 (+ 1 M))))
           (draw (apply op..
                        `(,(mediation (/ i M) (point-of 0 p) (point-of 0 q))
                          ,@(for/list ((j (in-range 0 (+ 1 N))))
                                      (mediation (/ i M )
                                                 (point-of (op* a (/ j N)) p)
                                                 (point-of (op* b (/ j N)) q)))))
                 #:withcolor (couleur (/ i M))))))
  (let* ((u '1cm))
    (degrade (op.. (point (op* -0.5 u)
                          (op* -0.5 u))
                   (point (op* 0.5 u)
                          (op* 0.5 u))
                   'cycle)
             (op-- (point (op* -1 u)
                          (op* -1 u))
                   (point (op*  1 u)
                          (op* -1 u))
                   (point (op*  1 u)
                          (op*  1 u))
                   (point (op* -1 u)
                          (op*  1 u))
                   'cycle) 70 100)))
    

146.2 the result of ex-145

Examples:

> (require "examples/ex-145.rkt")
> (make-figure "ex-145" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-145.mp" (The system cannot find the path specified.;

errno=3)

147 ex-146

147.1 source code in ex-146.rkt

#lang racket
(require (planet wcy/mpost-wrapper))
(provide main)
(define (main)
  (define (couleur c) (op* (- 1.0 c) 'white))
  (define (d-s-j-n c j M n p)
    (direction-of c
                  (subpath-of
                   (op/ (op* (- j 1) n) M)
                   (op/ (op* j n) M) p)))
  (define (degrade q p N)
    (let* ((n (length p))
           (m (length q))
           (M (*  8 4);; (op* m n)
              ))
      (for ((i (in-range 0 (+ 1 N))))
           (draw (apply path
                        `(,(mediation (/ i N) (point-of 0 p) (point-of 0 q))
                          ,(dir-spec (mediation (/ i N)
                                                (direction-of 0 p)
                                                (direction-of 0 q)))
                          ,@(flatten
                             (for/list ((j (in-range 1 M)))
                                       `(..
                                         ,(dir-spec
                                           (mediation
                                            (/ i N)
                                            (d-s-j-n 1 j M n p)
                                            (d-s-j-n 1 j M m q)))
                                         ,(mediation (/ i N)
                                                     (point-of (op/ (op* j n) M) p)
                                                     (point-of (op/ (op* j m) M) q))
                                         ,(dir-spec
                                           (mediation
                                            (/ i N)
                                            (d-s-j-n 1 (+ j 1) M n p)
                                            (d-s-j-n 1 (+ j 1) M m q))))))
                          ..
                          ,(dir-spec
                            (mediation (/ i N)
                                       (direction-of n p)
                                       (direction-of m q)))
                          ,(mediation (/ i N)
                                      (point-of n p)
                                      (point-of m q))))))))
  (let* ((u '2cm)
         (p (fullcircle u))
         (q (op-- (point (op* -1 u)
                         (op* -1 u))
                  (point (op*  1 u)
                         (op* -1 u))
                  (point (op*  1 u)
                         (op*  1 u))
                  (point (op* -1 u)
                         (op*  1 u))
                  'cycle)))
    (degrade p q 10)))
    

147.2 the result of ex-146

Examples:

> (require "examples/ex-146.rkt")
> (make-figure "ex-146" main)

open-output-file: cannot open output file:

"D:\userdata\chunywan\home\other-working\mpost-wrapper\ex\ex

-146.mp" (The system cannot find the path specified.;

errno=3)