Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

build open-axiom

54525 views
1
2
(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Shell|) |%DoubleFloat|) |ACPLOT;NFtoSF|))
3
4
(DECLAIM
5
(FTYPE (FUNCTION (|%DoubleFloat| |%DoubleFloat| |%Shell|) |%Thing|)
6
|ACPLOT;makePt|))
7
8
(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Shell|) |%Thing|) |ACPLOT;swapCoords|))
9
10
(DECLAIM
11
(FTYPE (FUNCTION (|%Thing| |%Thing| |%Shell|) |%Boolean|)
12
|ACPLOT;samePlottedPt?|))
13
14
(DECLAIM
15
(FTYPE
16
(FUNCTION (|%Thing| (|%List| |%Thing|) |%Shell|) (|%Pair| |%Short| |%Thing|))
17
|ACPLOT;findPtOnList|))
18
19
(DECLAIM
20
(FTYPE
21
(FUNCTION
22
(|%DoubleFloat| |%DoubleFloat| |%DoubleFloat| |%DoubleFloat| |%Shell|)
23
|%Shell|)
24
|ACPLOT;makeCorners|))
25
26
(PUT '|ACPLOT;makeCorners| '|SPADreplace| '|%vector|)
27
28
(DECLAIM (FTYPE (FUNCTION (|%Shell| |%Shell|) |%DoubleFloat|) |ACPLOT;getXMin|))
29
30
(PUT '|ACPLOT;getXMin| '|SPADreplace| '(XLAM (|corners|) (|%vref| |corners| 0)))
31
32
(DECLAIM (FTYPE (FUNCTION (|%Shell| |%Shell|) |%DoubleFloat|) |ACPLOT;getXMax|))
33
34
(PUT '|ACPLOT;getXMax| '|SPADreplace| '(XLAM (|corners|) (|%vref| |corners| 1)))
35
36
(DECLAIM (FTYPE (FUNCTION (|%Shell| |%Shell|) |%DoubleFloat|) |ACPLOT;getYMin|))
37
38
(PUT '|ACPLOT;getYMin| '|SPADreplace| '(XLAM (|corners|) (|%vref| |corners| 2)))
39
40
(DECLAIM (FTYPE (FUNCTION (|%Shell| |%Shell|) |%DoubleFloat|) |ACPLOT;getYMax|))
41
42
(PUT '|ACPLOT;getYMax| '|SPADreplace| '(XLAM (|corners|) (|%vref| |corners| 3)))
43
44
(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Shell|) |%Thing|) |ACPLOT;SFPolyToUPoly|))
45
46
(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Shell|) |%Thing|) |ACPLOT;RNPolyToUPoly|))
47
48
(DECLAIM
49
(FTYPE (FUNCTION (|%Thing| |%Shell|) |%Thing|) |ACPLOT;coerceCoefsToSFs|))
50
51
(DECLAIM
52
(FTYPE (FUNCTION (|%Thing| |%Shell|) |%Thing|) |ACPLOT;coerceCoefsToRNs|))
53
54
(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Shell|) |%DoubleFloat|) |ACPLOT;RNtoSF|))
55
56
(DECLAIM (FTYPE (FUNCTION (|%Thing| |%Shell|) |%Thing|) |ACPLOT;RNtoNF|))
57
58
(DECLAIM (FTYPE (FUNCTION (|%DoubleFloat| |%Shell|) |%Thing|) |ACPLOT;SFtoNF|))
59
60
(DECLAIM
61
(FTYPE
62
(FUNCTION (|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|)
63
(|%List| |%Thing|))
64
|ACPLOT;listPtsOnHorizBdry|))
65
66
(DECLAIM
67
(FTYPE
68
(FUNCTION (|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|)
69
(|%List| |%Thing|))
70
|ACPLOT;listPtsOnVertBdry|))
71
72
(DECLAIM
73
(FTYPE
74
(FUNCTION
75
((|%List| (|%List| |%Thing|)) |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|)
76
(|%List| |%Thing|))
77
|ACPLOT;listPtsInRect|))
78
79
(DECLAIM
80
(FTYPE (FUNCTION ((|%List| (|%List| |%Thing|)) |%Thing| |%Shell|) |%Boolean|)
81
|ACPLOT;ptsSuchThat?|))
82
83
(DECLAIM
84
(FTYPE
85
(FUNCTION ((|%List| |%Thing|) |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|)
86
|%Boolean|)
87
|ACPLOT;inRect?|))
88
89
(DECLAIM
90
(FTYPE
91
(FUNCTION ((|%List| |%Thing|) |%Thing| |%Thing| |%Thing| |%Shell|)
92
|%Boolean|)
93
|ACPLOT;onHorzSeg?|))
94
95
(DECLAIM
96
(FTYPE
97
(FUNCTION ((|%List| |%Thing|) |%Thing| |%Thing| |%Thing| |%Shell|)
98
|%Boolean|)
99
|ACPLOT;onVertSeg?|))
100
101
(DECLAIM
102
(FTYPE
103
(FUNCTION
104
((|%List| (|%List| |%Thing|)) (|%List| (|%List| |%Thing|)) |%Thing| |%Thing|
105
|%Thing| |%Thing| |%Thing| |%Shell|)
106
|%Thing|)
107
|ACPLOT;newX|))
108
109
(DECLAIM
110
(FTYPE
111
(FUNCTION
112
((|%List| (|%List| |%Thing|)) (|%List| (|%List| |%Thing|)) |%Thing| |%Thing|
113
|%Thing| |%Thing| |%Thing| |%Shell|)
114
|%Thing|)
115
|ACPLOT;newY|))
116
117
(DECLAIM
118
(FTYPE
119
(FUNCTION (|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|) |%Shell|)
120
|ACPLOT;makeSketch;P2S2S$;27|))
121
122
(DECLAIM
123
(FTYPE
124
(FUNCTION
125
(|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing|
126
|%Shell|)
127
|%Shell|)
128
|ACPLOT;makeOneVarSketch|))
129
130
(DECLAIM
131
(FTYPE
132
(FUNCTION
133
(|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|)
134
|%Shell|)
135
|ACPLOT;makeLineSketch|))
136
137
(DECLAIM
138
(FTYPE
139
(FUNCTION (|%DoubleFloat| |%DoubleFloat| (|%List| |%DoubleFloat|) |%Shell|)
140
|%Boolean|)
141
|ACPLOT;singValBetween?|))
142
143
(DECLAIM
144
(FTYPE
145
(FUNCTION
146
(|%Thing| |%DoubleFloat| |%DoubleFloat| (|%List| |%DoubleFloat|)
147
(|%List| |%DoubleFloat|) (|%List| |%DoubleFloat|) |%DoubleFloat|
148
|%DoubleFloat| |%Shell|)
149
|%Shell|)
150
|ACPLOT;segmentInfo|))
151
152
(DECLAIM
153
(FTYPE
154
(FUNCTION
155
(|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing|
156
|%Shell|)
157
|%Shell|)
158
|ACPLOT;makeRatFcnSketch|))
159
160
(DECLAIM
161
(FTYPE
162
(FUNCTION
163
(|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|)
164
|%Shell|)
165
|ACPLOT;makeGeneralSketch|))
166
167
(DECLAIM
168
(FTYPE (FUNCTION (|%Shell| |%DoubleFloat| |%Shell|) |%Shell|)
169
|ACPLOT;refine;$Df$;34|))
170
171
(DECLAIM
172
(FTYPE
173
(FUNCTION
174
(|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Shell| |%DoubleFloat|
175
|%DoubleFloat| (|%IntegerSection| 1) (|%List| |%Thing|) |%Shell| |%Shell|)
176
(|%List| (|%List| |%Thing|)))
177
|ACPLOT;traceBranches|))
178
179
(DECLAIM
180
(FTYPE
181
(FUNCTION
182
(|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| (|%List| |%Thing|)
183
(|%List| |%Thing|) (|%List| |%Thing|) (|%List| |%Thing|) |%Shell|)
184
|%Thing|)
185
|ACPLOT;dummyFirstPt|))
186
187
(DECLAIM
188
(FTYPE
189
(FUNCTION
190
(|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|
191
|%DoubleFloat| |%DoubleFloat| (|%IntegerSection| 1) (|%List| |%Thing|)
192
(|%List| |%Thing|) |%Shell|)
193
(|%List| (|%List| |%Thing|)))
194
|ACPLOT;listPtsOnSegment|))
195
196
(DECLAIM
197
(FTYPE
198
(FUNCTION
199
(|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|
200
|%DoubleFloat| |%DoubleFloat| (|%IntegerSection| 1) (|%List| |%Thing|)
201
(|%List| |%Thing|) |%Shell|)
202
(|%List| (|%List| |%Thing|)))
203
|ACPLOT;listPtsOnLoop|))
204
205
(DECLAIM
206
(FTYPE
207
(FUNCTION
208
(|%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Thing| |%Shell|
209
|%DoubleFloat| |%DoubleFloat| (|%IntegerSection| 1) (|%List| |%Thing|)
210
(|%List| |%Thing|) |%Shell|)
211
(|%Pair| |%Thing| |%Thing|))
212
|ACPLOT;computeNextPt|))
213
214
(DECLAIM
215
(FTYPE
216
(FUNCTION
217
(|%Thing| |%DoubleFloat| |%DoubleFloat| (|%IntegerSection| 1) |%Shell|)
218
(|%Pair| |%Short| |%Thing|))
219
|ACPLOT;newtonApprox|))
220
221
(DECLAIM
222
(FTYPE (FUNCTION (|%Shell| |%Shell|) (|%List| (|%List| |%Thing|)))
223
|ACPLOT;listBranches;$L;41|))
224
225
(PUT '|ACPLOT;listBranches;$L;41| '|SPADreplace|
226
'(XLAM (|acplot|) (|%vref| |acplot| 10)))
227
228
(DECLAIM (FTYPE (FUNCTION (|%Shell| |%Shell|) |%Thing|) |ACPLOT;coerce;$Of;42|))
229
230
(DEFUN |ACPLOT;NFtoSF| (|x| $) (+ 0.0 (SPADCALL |x| (|shellEntry| $ 27))))
231
232
(DEFUN |ACPLOT;makePt| (|xx| |yy| $)
233
(PROG (|l|)
234
(RETURN
235
(SPADCALL (LETT |l| (LIST |xx| |yy|) |ACPLOT;makePt|)
236
(|shellEntry| $ 31)))))
237
238
(DEFUN |ACPLOT;swapCoords| (|pt| $)
239
(|ACPLOT;makePt| (SPADCALL |pt| (|shellEntry| $ 33))
240
(SPADCALL |pt| (|shellEntry| $ 34)) $))
241
242
(DEFUN |ACPLOT;samePlottedPt?| (|p0| |p1| $)
243
(LET ((|x0| (SPADCALL |p0| (|shellEntry| $ 34)))
244
(|y0| (SPADCALL |p0| (|shellEntry| $ 33)))
245
(|x1| (SPADCALL |p1| (|shellEntry| $ 34)))
246
(|y1| (SPADCALL |p1| (|shellEntry| $ 33))))
247
(AND (< (ABS (- |x1| |x0|)) (|shellEntry| $ 18))
248
(< (ABS (- |y1| |y0|)) (|shellEntry| $ 18)))))
249
250
(DEFUN |ACPLOT;findPtOnList| (|pt| |pointList| $)
251
(PROGN
252
(LET ((#1=#:G1248 |pointList|))
253
(LOOP
254
(COND ((NOT (CONSP #1#)) (RETURN NIL))
255
(T
256
(LET ((|point| (CAR #1#)))
257
(COND
258
((|ACPLOT;samePlottedPt?| |pt| |point| $)
259
(RETURN-FROM |ACPLOT;findPtOnList| (CONS 0 |point|)))))))
260
(SETQ #1# (CDR #1#))))
261
(CONS 1 "failed")))
262
263
(DEFUN |ACPLOT;makeCorners| (|xMinSF| |xMaxSF| |yMinSF| |yMaxSF| $)
264
(DECLARE (IGNORE $))
265
(VECTOR |xMinSF| |xMaxSF| |yMinSF| |yMaxSF|))
266
267
(DEFUN |ACPLOT;getXMin| (|corners| $) (DECLARE (IGNORE $)) (SVREF |corners| 0))
268
269
(DEFUN |ACPLOT;getXMax| (|corners| $) (DECLARE (IGNORE $)) (SVREF |corners| 1))
270
271
(DEFUN |ACPLOT;getYMin| (|corners| $) (DECLARE (IGNORE $)) (SVREF |corners| 2))
272
273
(DEFUN |ACPLOT;getYMax| (|corners| $) (DECLARE (IGNORE $)) (SVREF |corners| 3))
274
275
(DEFUN |ACPLOT;SFPolyToUPoly| (|p| $)
276
(COND ((SPADCALL |p| (|shellEntry| $ 41)) (|spadConstant| $ 43))
277
(T
278
(SPADCALL
279
(SPADCALL (SPADCALL |p| (|shellEntry| $ 44))
280
(SPADCALL |p| (|shellEntry| $ 45)) (|shellEntry| $ 46))
281
(|ACPLOT;SFPolyToUPoly| (SPADCALL |p| (|shellEntry| $ 47)) $)
282
(|shellEntry| $ 48)))))
283
284
(DEFUN |ACPLOT;RNPolyToUPoly| (|p| $)
285
(COND ((SPADCALL |p| (|shellEntry| $ 51)) (|spadConstant| $ 53))
286
(T
287
(SPADCALL
288
(SPADCALL (SPADCALL |p| (|shellEntry| $ 54))
289
(SPADCALL |p| (|shellEntry| $ 55)) (|shellEntry| $ 56))
290
(|ACPLOT;RNPolyToUPoly| (SPADCALL |p| (|shellEntry| $ 57)) $)
291
(|shellEntry| $ 58)))))
292
293
(DEFUN |ACPLOT;coerceCoefsToSFs| (|p| $)
294
(SPADCALL (CONS #'(LAMBDA (|#1| $) (FLOAT |#1| |$DoubleFloatMaximum|)) NIL)
295
|p| (|shellEntry| $ 63)))
296
297
(DEFUN |ACPLOT;coerceCoefsToRNs| (|p| $)
298
(SPADCALL (|shellEntry| $ 64) |p| (|shellEntry| $ 67)))
299
300
(DEFUN |ACPLOT;RNtoSF| (|r| $) (SPADCALL |r| (|shellEntry| $ 68)))
301
302
(DEFUN |ACPLOT;RNtoNF| (|r| $) (SPADCALL |r| (|shellEntry| $ 69)))
303
304
(DEFUN |ACPLOT;SFtoNF| (|x| $) (SPADCALL |x| (|shellEntry| $ 70)))
305
306
(DEFUN |ACPLOT;listPtsOnHorizBdry| (|pRN| |y| |y0| |xMinNF| |xMaxNF| $)
307
(LET* ((|pointList| NIL)
308
(|ySF| (|ACPLOT;RNtoSF| |y0| $))
309
(|f| (SPADCALL |pRN| |y| |y0| (|shellEntry| $ 74)))
310
(|roots| (SPADCALL |f| (|shellEntry| $ 14) (|shellEntry| $ 77))))
311
(PROGN
312
(LET ((#1=#:G1249 |roots|))
313
(LOOP
314
(COND ((NOT (CONSP #1#)) (RETURN NIL))
315
(T
316
(LET ((|root| (CAR #1#)))
317
(COND
318
((AND (SPADCALL |xMinNF| |root| (|shellEntry| $ 78))
319
(SPADCALL |root| |xMaxNF| (|shellEntry| $ 78)))
320
(SETQ |pointList|
321
(CONS
322
(|ACPLOT;makePt| (|ACPLOT;NFtoSF| |root| $) |ySF|
323
$)
324
|pointList|)))))))
325
(SETQ #1# (CDR #1#))))
326
|pointList|)))
327
328
(DEFUN |ACPLOT;listPtsOnVertBdry| (|pRN| |x| |x0| |yMinNF| |yMaxNF| $)
329
(LET* ((|pointList| NIL)
330
(|xSF| (|ACPLOT;RNtoSF| |x0| $))
331
(|f| (SPADCALL |pRN| |x| |x0| (|shellEntry| $ 74)))
332
(|roots| (SPADCALL |f| (|shellEntry| $ 14) (|shellEntry| $ 77))))
333
(PROGN
334
(LET ((#1=#:G1250 |roots|))
335
(LOOP
336
(COND ((NOT (CONSP #1#)) (RETURN NIL))
337
(T
338
(LET ((|root| (CAR #1#)))
339
(COND
340
((AND (SPADCALL |yMinNF| |root| (|shellEntry| $ 80))
341
(SPADCALL |root| |yMaxNF| (|shellEntry| $ 80)))
342
(SETQ |pointList|
343
(CONS
344
(|ACPLOT;makePt| |xSF| (|ACPLOT;NFtoSF| |root| $)
345
$)
346
|pointList|)))))))
347
(SETQ #1# (CDR #1#))))
348
|pointList|)))
349
350
(DEFUN |ACPLOT;listPtsInRect| (|points| |xMin| |xMax| |yMin| |yMax| $)
351
(PROG (|yy| |xx|)
352
(RETURN
353
(LET ((|pointList| NIL))
354
(SEQ
355
(LET ((#1=#:G1251 |points|))
356
(LOOP
357
(COND ((NOT (CONSP #1#)) (RETURN NIL))
358
(T
359
(LET ((|point| (CAR #1#)))
360
(PROGN
361
(LETT |xx| (|SPADfirst| |point|)
362
. #2=(|ACPLOT;listPtsInRect|))
363
(LETT |yy| (SPADCALL |point| (|shellEntry| $ 82)) . #2#)
364
(COND
365
((AND (SPADCALL |xMin| |xx| (|shellEntry| $ 80))
366
(AND (SPADCALL |xx| |xMax| (|shellEntry| $ 80))
367
(AND
368
(SPADCALL |yMin| |yy| (|shellEntry| $ 80))
369
(SPADCALL |yy| |yMax| (|shellEntry| $ 80)))))
370
(SETQ |pointList|
371
(CONS
372
(|ACPLOT;makePt| (|ACPLOT;NFtoSF| |xx| $)
373
(|ACPLOT;NFtoSF| |yy| $) $)
374
|pointList|))))))))
375
(SETQ #1# (CDR #1#))))
376
(EXIT |pointList|))))))
377
378
(DEFUN |ACPLOT;ptsSuchThat?| (|points| |pred| $)
379
(PROGN
380
(LET ((#1=#:G1252 |points|))
381
(LOOP
382
(COND ((NOT (CONSP #1#)) (RETURN NIL))
383
(T
384
(COND
385
((FUNCALL (CAR |pred|) (CAR #1#) (CDR |pred|))
386
(RETURN-FROM |ACPLOT;ptsSuchThat?| T)))))
387
(SETQ #1# (CDR #1#))))
388
NIL))
389
390
(DEFUN |ACPLOT;inRect?| (|point| |xMinNF| |xMaxNF| |yMinNF| |yMaxNF| $)
391
(LET ((|xx| (|SPADfirst| |point|))
392
(|yy| (SPADCALL |point| (|shellEntry| $ 82))))
393
(AND (SPADCALL |xMinNF| |xx| (|shellEntry| $ 80))
394
(AND (SPADCALL |xx| |xMaxNF| (|shellEntry| $ 80))
395
(AND (SPADCALL |yMinNF| |yy| (|shellEntry| $ 80))
396
(SPADCALL |yy| |yMaxNF| (|shellEntry| $ 80)))))))
397
398
(DEFUN |ACPLOT;onHorzSeg?| (|point| |xMinNF| |xMaxNF| |yNF| $)
399
(LET ((|xx| (|SPADfirst| |point|))
400
(|yy| (SPADCALL |point| (|shellEntry| $ 82))))
401
(AND (SPADCALL |yy| |yNF| (|shellEntry| $ 84))
402
(AND (SPADCALL |xMinNF| |xx| (|shellEntry| $ 80))
403
(SPADCALL |xx| |xMaxNF| (|shellEntry| $ 80))))))
404
405
(DEFUN |ACPLOT;onVertSeg?| (|point| |yMinNF| |yMaxNF| |xNF| $)
406
(LET ((|xx| (|SPADfirst| |point|))
407
(|yy| (SPADCALL |point| (|shellEntry| $ 82))))
408
(AND (SPADCALL |xx| |xNF| (|shellEntry| $ 84))
409
(AND (SPADCALL |yMinNF| |yy| (|shellEntry| $ 80))
410
(SPADCALL |yy| |yMaxNF| (|shellEntry| $ 80))))))
411
412
(DEFUN |ACPLOT;newX|
413
(|vtanPts| |singPts| |yMinNF| |yMaxNF| |xNF| |xRN| |horizInc| $)
414
(PROG (|goo|)
415
(RETURN
416
(LET* ((|xNewNF|
417
(SPADCALL |xNF| (|ACPLOT;RNtoNF| |horizInc| $)
418
(|shellEntry| $ 85)))
419
(|xRtNF| (SPADCALL |xNF| |xNewNF| (|shellEntry| $ 86)))
420
(|xLftNF| (SPADCALL |xNF| |xNewNF| (|shellEntry| $ 87)))
421
(|foo|
422
(CONS #'|ACPLOT;newX!0|
423
(VECTOR $ |yMaxNF| |yMinNF| |xRtNF| |xLftNF|))))
424
(COND
425
((|ACPLOT;ptsSuchThat?| |singPts| |foo| $)
426
(|ACPLOT;newX| |vtanPts| |singPts| |yMinNF| |yMaxNF| |xNF| |xRN|
427
(SPADCALL |horizInc| (SPADCALL 2 (|shellEntry| $ 64))
428
(|shellEntry| $ 88))
429
$))
430
(T
431
(PROGN
432
(LETT |goo|
433
(CONS #'|ACPLOT;newX!1| (VECTOR $ |xNewNF| |yMaxNF| |yMinNF|))
434
|ACPLOT;newX|)
435
(COND
436
((|ACPLOT;ptsSuchThat?| |vtanPts| |goo| $)
437
(|ACPLOT;newX| |vtanPts| |singPts| |yMinNF| |yMaxNF| |xNF| |xRN|
438
(SPADCALL |horizInc| (SPADCALL 2 (|shellEntry| $ 64))
439
(|shellEntry| $ 88))
440
$))
441
(T (SPADCALL |xRN| |horizInc| (|shellEntry| $ 89)))))))))))
442
443
(DEFUN |ACPLOT;newX!1| (|#1| $$)
444
(|ACPLOT;onVertSeg?| |#1| (SVREF $$ 3) (SVREF $$ 2) (SVREF $$ 1)
445
(SVREF $$ 0)))
446
447
(DEFUN |ACPLOT;newX!0| (|#1| $$)
448
(|ACPLOT;inRect?| |#1| (SVREF $$ 4) (SVREF $$ 3) (SVREF $$ 2) (SVREF $$ 1)
449
(SVREF $$ 0)))
450
451
(DEFUN |ACPLOT;newY|
452
(|htanPts| |singPts| |xMinNF| |xMaxNF| |yNF| |yRN| |vertInc| $)
453
(PROG (|goo|)
454
(RETURN
455
(LET* ((|yNewNF|
456
(SPADCALL |yNF| (|ACPLOT;RNtoNF| |vertInc| $)
457
(|shellEntry| $ 85)))
458
(|yTopNF| (SPADCALL |yNF| |yNewNF| (|shellEntry| $ 86)))
459
(|yBotNF| (SPADCALL |yNF| |yNewNF| (|shellEntry| $ 87)))
460
(|foo|
461
(CONS #'|ACPLOT;newY!0|
462
(VECTOR $ |yTopNF| |yBotNF| |xMaxNF| |xMinNF|))))
463
(COND
464
((|ACPLOT;ptsSuchThat?| |singPts| |foo| $)
465
(|ACPLOT;newY| |htanPts| |singPts| |xMinNF| |xMaxNF| |yNF| |yRN|
466
(SPADCALL |vertInc| (SPADCALL 2 (|shellEntry| $ 64))
467
(|shellEntry| $ 88))
468
$))
469
(T
470
(PROGN
471
(LETT |goo|
472
(CONS #'|ACPLOT;newY!1| (VECTOR $ |yNewNF| |xMaxNF| |xMinNF|))
473
|ACPLOT;newY|)
474
(COND
475
((|ACPLOT;ptsSuchThat?| |htanPts| |goo| $)
476
(|ACPLOT;newY| |htanPts| |singPts| |xMinNF| |xMaxNF| |yNF| |yRN|
477
(SPADCALL |vertInc| (SPADCALL 2 (|shellEntry| $ 64))
478
(|shellEntry| $ 88))
479
$))
480
(T (SPADCALL |yRN| |vertInc| (|shellEntry| $ 89)))))))))))
481
482
(DEFUN |ACPLOT;newY!1| (|#1| $$)
483
(|ACPLOT;onHorzSeg?| |#1| (SVREF $$ 3) (SVREF $$ 2) (SVREF $$ 1)
484
(SVREF $$ 0)))
485
486
(DEFUN |ACPLOT;newY!0| (|#1| $$)
487
(|ACPLOT;inRect?| |#1| (SVREF $$ 4) (SVREF $$ 3) (SVREF $$ 2) (SVREF $$ 1)
488
(SVREF $$ 0)))
489
490
(DEFUN |ACPLOT;makeSketch;P2S2S$;27| (|p| |x| |y| |xRange| |yRange| $)
491
(PROG (|varList|)
492
(RETURN
493
(LET ((|xMin| (SPADCALL |xRange| (|shellEntry| $ 91)))
494
(|xMax| (SPADCALL |xRange| (|shellEntry| $ 92)))
495
(|yMin| (SPADCALL |yRange| (|shellEntry| $ 91)))
496
(|yMax| (SPADCALL |yRange| (|shellEntry| $ 92))))
497
(COND
498
((SPADCALL |xMax| |xMin| (|shellEntry| $ 93))
499
(|error| "makeSketch: bad range for first variable"))
500
((SPADCALL |yMax| |yMin| (|shellEntry| $ 93))
501
(|error| "makeSketch: bad range for second variable"))
502
(T
503
(SEQ
504
(LETT |varList| (SPADCALL |p| (|shellEntry| $ 95))
505
|ACPLOT;makeSketch;P2S2S$;27|)
506
(EXIT
507
(COND
508
((< 2 (LIST-LENGTH |varList|))
509
(|error| "makeSketch: polynomial in more than 2 variables"))
510
((ZEROP (LIST-LENGTH |varList|))
511
(|error| "makeSketch: constant polynomial"))
512
((EQL (LIST-LENGTH |varList|) 1)
513
(COND
514
((AND (NOT (SPADCALL |x| |varList| (|shellEntry| $ 99)))
515
(NOT (SPADCALL |y| |varList| (|shellEntry| $ 99))))
516
(|error| "makeSketch: bad variables"))
517
(T
518
(|ACPLOT;makeOneVarSketch| |p| |x| |y| |xMin| |xMax| |yMin|
519
|yMax| (|SPADfirst| |varList|) $))))
520
(T
521
(SEQ
522
(COND
523
((SPADCALL |x| |varList| (|shellEntry| $ 99))
524
(COND
525
((NOT (SPADCALL |y| |varList| (|shellEntry| $ 99)))
526
(EXIT (|error| #1="makeSketch: bad variables")))))
527
(T (EXIT (|error| #1#))))
528
(EXIT
529
(COND
530
((EQL (SPADCALL |p| (|shellEntry| $ 101)) 1)
531
(|ACPLOT;makeLineSketch| |p| |x| |y| |xMin| |xMax| |yMin|
532
|yMax| $))
533
((EQL (SPADCALL |p| |y| (|shellEntry| $ 102)) 1)
534
(|ACPLOT;makeRatFcnSketch| |p| |x| |y| |xMin| |xMax| |yMin|
535
|yMax| |y| $))
536
((EQL (SPADCALL |p| |x| (|shellEntry| $ 102)) 1)
537
(|ACPLOT;makeRatFcnSketch| |p| |x| |y| |xMin| |xMax| |yMin|
538
|yMax| |x| $))
539
(T
540
(|ACPLOT;makeGeneralSketch| |p| |x| |y| |xMin| |xMax| |yMin|
541
|yMax| $)))))))))))))))
542
543
(DEFUN |ACPLOT;makeOneVarSketch|
544
(|p| |x| |y| |xMin| |xMax| |yMin| |yMax| |var| $)
545
(PROG (|xMaxSF| |xMinSF| |yMaxSF| |yMinSF| |sketchRoots| |roots| |bran|
546
|vtans| |htans| |tp| |bt| |rt| |lf| |maxVal| |minVal| |branch| |pt2|
547
|pt1|)
548
(RETURN
549
(SEQ
550
(COND
551
((EQUAL |var| |x|)
552
(PROGN
553
(LETT |minVal| (|ACPLOT;RNtoNF| |xMin| $)
554
. #1=(|ACPLOT;makeOneVarSketch|))
555
(LETT |maxVal| (|ACPLOT;RNtoNF| |xMax| $) . #1#)))
556
(T
557
(PROGN
558
(LETT |minVal| (|ACPLOT;RNtoNF| |yMin| $) . #1#)
559
(LETT |maxVal| (|ACPLOT;RNtoNF| |yMax| $) . #1#))))
560
(LETT |lf| NIL . #1#) (LETT |rt| NIL . #1#) (LETT |bt| NIL . #1#)
561
(LETT |tp| NIL . #1#) (LETT |htans| NIL . #1#) (LETT |vtans| NIL . #1#)
562
(LETT |bran| NIL . #1#)
563
(LETT |roots| (SPADCALL |p| (|shellEntry| $ 14) (|shellEntry| $ 107))
564
. #1#)
565
(LETT |sketchRoots| NIL . #1#)
566
(LET ((#2=#:G1253 |roots|))
567
(LOOP
568
(COND ((NOT (CONSP #2#)) (RETURN NIL))
569
(T
570
(LET ((|root| (CAR #2#)))
571
(COND
572
((AND (SPADCALL |minVal| |root| (|shellEntry| $ 80))
573
(SPADCALL |root| |maxVal| (|shellEntry| $ 80)))
574
(SETQ |sketchRoots|
575
(CONS (|ACPLOT;NFtoSF| |root| $)
576
|sketchRoots|)))))))
577
(SETQ #2# (CDR #2#))))
578
(EXIT
579
(COND
580
((NULL |sketchRoots|)
581
(VECTOR |p| |x| |y| |xMin| |xMax| |yMin| |yMax|
582
(VECTOR |lf| |rt| |bt| |tp|) |htans| |vtans| |bran|))
583
(T
584
(SEQ
585
(COND
586
((EQUAL |var| |x|)
587
(SEQ (LETT |yMinSF| (|ACPLOT;RNtoSF| |yMin| $) . #1#)
588
(LETT |yMaxSF| (|ACPLOT;RNtoSF| |yMax| $) . #1#)
589
(EXIT
590
(LET ((#3=#:G1254 |sketchRoots|))
591
(LOOP
592
(COND ((NOT (CONSP #3#)) (RETURN NIL))
593
(T
594
(LET ((|rootSF| (CAR #3#)))
595
(PROGN
596
(LETT |pt1|
597
(|ACPLOT;makePt| |rootSF| |yMaxSF| $)
598
. #1#)
599
(SETQ |tp| (CONS |pt1| |tp|))
600
(LETT |pt2|
601
(|ACPLOT;makePt| |rootSF| |yMinSF| $)
602
. #1#)
603
(SETQ |bt| (CONS |pt2| |bt|))
604
(LETT |branch| (LIST |pt1| |pt2|) . #1#)
605
(SETQ |bran| (CONS |branch| |bran|))))))
606
(SETQ #3# (CDR #3#)))))))
607
(T
608
(SEQ (LETT |xMinSF| (|ACPLOT;RNtoSF| |xMin| $) . #1#)
609
(LETT |xMaxSF| (|ACPLOT;RNtoSF| |xMax| $) . #1#)
610
(EXIT
611
(LET ((#4=#:G1255 |sketchRoots|))
612
(LOOP
613
(COND ((NOT (CONSP #4#)) (RETURN NIL))
614
(T
615
(LET ((|rootSF| (CAR #4#)))
616
(PROGN
617
(LETT |pt1|
618
(|ACPLOT;makePt| |xMaxSF| |rootSF| $)
619
. #1#)
620
(SETQ |rt| (CONS |pt1| |rt|))
621
(LETT |pt2|
622
(|ACPLOT;makePt| |xMinSF| |rootSF| $)
623
. #1#)
624
(SETQ |lf| (CONS |pt2| |lf|))
625
(LETT |branch| (LIST |pt1| |pt2|) . #1#)
626
(SETQ |bran| (CONS |branch| |bran|))))))
627
(SETQ #4# (CDR #4#))))))))
628
(EXIT
629
(VECTOR |p| |x| |y| |xMin| |xMax| |yMin| |yMax|
630
(VECTOR |lf| |rt| |bt| |tp|) |htans| |vtans| |bran|))))))))))
631
632
(DEFUN |ACPLOT;makeLineSketch| (|p| |x| |y| |xMin| |xMax| |yMin| |yMax| $)
633
(PROG (|pt|)
634
(RETURN
635
(LET* ((|xMinSF| (|ACPLOT;RNtoSF| |xMin| $))
636
(|xMaxSF| (|ACPLOT;RNtoSF| |xMax| $))
637
(|yMinSF| (|ACPLOT;RNtoSF| |yMin| $))
638
(|yMaxSF| (|ACPLOT;RNtoSF| |yMax| $))
639
(|a|
640
(FLOAT
641
(SPADCALL (SPADCALL |p| |x| 1 (|shellEntry| $ 112))
642
(|shellEntry| $ 113))
643
|$DoubleFloatMaximum|))
644
(|b|
645
(FLOAT
646
(SPADCALL (SPADCALL |p| |y| 1 (|shellEntry| $ 112))
647
(|shellEntry| $ 113))
648
|$DoubleFloatMaximum|))
649
(|c|
650
(FLOAT
651
(SPADCALL
652
(SPADCALL (SPADCALL |p| |x| 0 (|shellEntry| $ 112)) |y| 0
653
(|shellEntry| $ 112))
654
(|shellEntry| $ 113))
655
|$DoubleFloatMaximum|))
656
(|lf| NIL)
657
(|rt| NIL)
658
(|bt| NIL)
659
(|tp| NIL)
660
(|htans| NIL)
661
(|vtans| NIL)
662
(|branch| NIL)
663
(|bran| NIL)
664
(|xBottom| (/ (- (- (* |b| |yMinSF|)) |c|) |a|))
665
(|xTop| (/ (- (- (* |b| |yMaxSF|)) |c|) |a|))
666
(|yLeft| (/ (- (- (* |a| |xMinSF|)) |c|) |b|))
667
(|yRight| (/ (- (- (* |a| |xMaxSF|)) |c|) |b|)))
668
(SEQ
669
(COND
670
((AND (< |xMinSF| |xBottom|) (< |xBottom| |xMaxSF|))
671
(PROGN
672
(LETT |pt| (|ACPLOT;makePt| |xBottom| |yMinSF| $)
673
. #1=(|ACPLOT;makeLineSketch|))
674
(SETQ |bt| (CONS |pt| |bt|))
675
(SETQ |branch| (CONS |pt| |branch|)))))
676
(COND
677
((AND (< |xMinSF| |xTop|) (< |xTop| |xMaxSF|))
678
(PROGN
679
(LETT |pt| (|ACPLOT;makePt| |xTop| |yMaxSF| $) . #1#)
680
(SETQ |tp| (CONS |pt| |tp|))
681
(SETQ |branch| (CONS |pt| |branch|)))))
682
(COND
683
((AND (<= |yMinSF| |yLeft|) (<= |yLeft| |yMaxSF|))
684
(PROGN
685
(LETT |pt| (|ACPLOT;makePt| |xMinSF| |yLeft| $) . #1#)
686
(SETQ |lf| (CONS |pt| |lf|))
687
(SETQ |branch| (CONS |pt| |branch|)))))
688
(COND
689
((AND (<= |yMinSF| |yRight|) (<= |yRight| |yMaxSF|))
690
(PROGN
691
(LETT |pt| (|ACPLOT;makePt| |xMaxSF| |yRight| $) . #1#)
692
(SETQ |rt| (CONS |pt| |rt|))
693
(SETQ |branch| (CONS |pt| |branch|)))))
694
(SETQ |bran| (CONS |branch| |bran|))
695
(EXIT
696
(VECTOR |p| |x| |y| |xMin| |xMax| |yMin| |yMax|
697
(VECTOR |lf| |rt| |bt| |tp|) |htans| |vtans| |bran|)))))))
698
699
(DEFUN |ACPLOT;singValBetween?| (|xCurrent| |xNext| |xSingList| $)
700
(PROGN
701
(LET ((#1=#:G1256 |xSingList|))
702
(LOOP
703
(COND ((NOT (CONSP #1#)) (RETURN NIL))
704
(T
705
(LET ((|xVal| (CAR #1#)))
706
(COND
707
((AND (< |xCurrent| |xVal|) (< |xVal| |xNext|))
708
(RETURN-FROM |ACPLOT;singValBetween?| T))))))
709
(SETQ #1# (CDR #1#))))
710
NIL))
711
712
(DEFUN |ACPLOT;segmentInfo|
713
(|f| |lo| |hi| |botList| |topList| |singList| |minSF| |maxSF| $)
714
(PROG (|val| |nextFrom| |nxt| |top| |bot| |currentFrom| |current|)
715
(RETURN
716
(LOOP
717
(SEQ
718
(COND
719
((NULL |topList|)
720
(COND
721
((NULL |botList|)
722
(RETURN-FROM |ACPLOT;segmentInfo|
723
(VECTOR (SPADCALL |lo| |hi| (|shellEntry| $ 119)) |hi| NIL NIL)))
724
(T
725
(PROGN
726
(LETT |current| (|SPADfirst| |botList|)
727
. #1=(|ACPLOT;segmentInfo|))
728
(SETQ |botList| (CDR |botList|))
729
(LETT |currentFrom| (|shellEntry| $ 22) . #1#)))))
730
((NULL |botList|)
731
(PROGN
732
(SETQ |current| (|SPADfirst| |topList|))
733
(SETQ |topList| (CDR |topList|))
734
(SETQ |currentFrom| (|shellEntry| $ 23))))
735
(T
736
(SEQ (LETT |bot| (|SPADfirst| |botList|) . #1#)
737
(LETT |top| (|SPADfirst| |topList|) . #1#)
738
(EXIT
739
(COND
740
((< |bot| |top|)
741
(PROGN
742
(SETQ |current| |bot|)
743
(SETQ |botList| (CDR |botList|))
744
(SETQ |currentFrom| (|shellEntry| $ 22))))
745
(T
746
(PROGN
747
(SETQ |current| |top|)
748
(SETQ |topList| (CDR |topList|))
749
(SETQ |currentFrom| (|shellEntry| $ 23)))))))))
750
(COND
751
((NULL |topList|)
752
(COND
753
((NULL |botList|)
754
(RETURN-FROM |ACPLOT;segmentInfo|
755
(VECTOR (SPADCALL |lo| |hi| (|shellEntry| $ 119)) |hi| NIL NIL)))
756
(T
757
(PROGN
758
(LETT |nxt| (|SPADfirst| |botList|) . #1#)
759
(SETQ |botList| (CDR |botList|))
760
(LETT |nextFrom| (|shellEntry| $ 22) . #1#)))))
761
((NULL |botList|)
762
(PROGN
763
(SETQ |nxt| (|SPADfirst| |topList|))
764
(SETQ |topList| (CDR |topList|))
765
(SETQ |nextFrom| (|shellEntry| $ 23))))
766
(T
767
(SEQ (SETQ |bot| (|SPADfirst| |botList|))
768
(SETQ |top| (|SPADfirst| |topList|))
769
(EXIT
770
(COND
771
((< |bot| |top|)
772
(PROGN
773
(SETQ |nxt| |bot|)
774
(SETQ |botList| (CDR |botList|))
775
(SETQ |nextFrom| (|shellEntry| $ 22))))
776
(T
777
(PROGN
778
(SETQ |nxt| |top|)
779
(SETQ |topList| (CDR |topList|))
780
(SETQ |nextFrom| (|shellEntry| $ 23)))))))))
781
(EXIT
782
(COND
783
((NOT (NULL (STRING= |currentFrom| |nextFrom|)))
784
(COND
785
((|ACPLOT;singValBetween?| |current| |nxt| |singList| $)
786
(RETURN-FROM |ACPLOT;segmentInfo|
787
(VECTOR (SPADCALL |lo| |current| (|shellEntry| $ 119)) |nxt|
788
|botList| |topList|)))
789
(T
790
(PROGN
791
(LETT |val|
792
(FUNCALL (CAR |f|)
793
(/ (- |nxt| |current|)
794
(FLOAT 2 |$DoubleFloatMaximum|))
795
(CDR |f|))
796
. #1#)
797
(COND
798
((OR (<= |val| |minSF|) (>= |val| |maxSF|))
799
(RETURN-FROM |ACPLOT;segmentInfo|
800
(VECTOR (SPADCALL |lo| |current| (|shellEntry| $ 119)) |nxt|
801
|botList| |topList|))))))))
802
((|ACPLOT;singValBetween?| |current| |nxt| |singList| $)
803
(RETURN-FROM |ACPLOT;segmentInfo|
804
(VECTOR (SPADCALL |lo| |current| (|shellEntry| $ 119)) |nxt|
805
|botList| |topList|))))))))))
806
807
(DEFUN |ACPLOT;makeRatFcnSketch|
808
(|p| |x| |y| |xMin| |xMax| |yMin| |yMax| |depVar| $)
809
(PROG (|lo| |segInfo| |segList| |maxSF| |minSF| |top| |bot| |hi| |bran|
810
|rightVal| |leftVal| |denUPolyRN| |botList| |outList| |roots|
811
|topList| |singList| |tp| |bt| |rt| |lf| |vtans| |htans| |vtanPts|
812
|htanPts| |depVarMaxSF| |depVarMinSF| |depVarMax| |depVarMin|
813
|indVarMaxSF| |indVarMinSF| |indVarMaxNF| |indVarMinNF| |indVarMax|
814
|indVarMin| |f| |denUPolySF| |numUPolySF| |den| |num| |yMaxNF|
815
|yMinNF| |xMaxNF| |xMinNF| |yMaxSF| |yMinSF| |xMaxSF| |xMinSF| |pRN|
816
|dpdy| |dpdx| |curve| |RFPlot|)
817
(RETURN
818
(LET ((|factoredP| (SPADCALL |p| (|shellEntry| $ 126))))
819
(COND
820
((< 1 (SPADCALL |factoredP| (|shellEntry| $ 127)))
821
(|error| "reducible polynomial"))
822
(T
823
(SEQ
824
(LETT |dpdx| (SPADCALL |p| |x| (|shellEntry| $ 128))
825
. #1=(|ACPLOT;makeRatFcnSketch|))
826
(LETT |dpdy| (SPADCALL |p| |y| (|shellEntry| $ 128)) . #1#)
827
(LETT |pRN| (|ACPLOT;coerceCoefsToRNs| |p| $) . #1#)
828
(LETT |xMinSF| (|ACPLOT;RNtoSF| |xMin| $) . #1#)
829
(LETT |xMaxSF| (|ACPLOT;RNtoSF| |xMax| $) . #1#)
830
(LETT |yMinSF| (|ACPLOT;RNtoSF| |yMin| $) . #1#)
831
(LETT |yMaxSF| (|ACPLOT;RNtoSF| |yMax| $) . #1#)
832
(LETT |xMinNF| (|ACPLOT;RNtoNF| |xMin| $) . #1#)
833
(LETT |xMaxNF| (|ACPLOT;RNtoNF| |xMax| $) . #1#)
834
(LETT |yMinNF| (|ACPLOT;RNtoNF| |yMin| $) . #1#)
835
(LETT |yMaxNF| (|ACPLOT;RNtoNF| |yMax| $) . #1#)
836
(LETT |num|
837
(SPADCALL (SPADCALL |p| |depVar| 0 (|shellEntry| $ 112))
838
(|shellEntry| $ 129))
839
. #1#)
840
(LETT |den| (SPADCALL |p| |depVar| 1 (|shellEntry| $ 112)) . #1#)
841
(LETT |numUPolySF|
842
(|ACPLOT;SFPolyToUPoly| (|ACPLOT;coerceCoefsToSFs| |num| $) $)
843
. #1#)
844
(LETT |denUPolySF|
845
(|ACPLOT;SFPolyToUPoly| (|ACPLOT;coerceCoefsToSFs| |den| $) $)
846
. #1#)
847
(LETT |f|
848
(CONS #'|ACPLOT;makeRatFcnSketch!0|
849
(VECTOR |denUPolySF| $ |numUPolySF|))
850
. #1#)
851
(COND
852
((EQUAL |depVar| |x|)
853
(PROGN
854
(LETT |indVarMin| |yMin| . #1#)
855
(LETT |indVarMax| |yMax| . #1#)
856
(LETT |indVarMinNF| |yMinNF| . #1#)
857
(LETT |indVarMaxNF| |yMaxNF| . #1#)
858
(LETT |indVarMinSF| |yMinSF| . #1#)
859
(LETT |indVarMaxSF| |yMaxSF| . #1#)
860
(LETT |depVarMin| |xMin| . #1#)
861
(LETT |depVarMax| |xMax| . #1#)
862
(LETT |depVarMinSF| |xMinSF| . #1#)
863
(LETT |depVarMaxSF| |xMaxSF| . #1#)))
864
(T
865
(PROGN
866
(LETT |indVarMin| |xMin| . #1#)
867
(LETT |indVarMax| |xMax| . #1#)
868
(LETT |indVarMinNF| |xMinNF| . #1#)
869
(LETT |indVarMaxNF| |xMaxNF| . #1#)
870
(LETT |indVarMinSF| |xMinSF| . #1#)
871
(LETT |indVarMaxSF| |xMaxSF| . #1#)
872
(LETT |depVarMin| |yMin| . #1#)
873
(LETT |depVarMax| |yMax| . #1#)
874
(LETT |depVarMinSF| |yMinSF| . #1#)
875
(LETT |depVarMaxSF| |yMaxSF| . #1#))))
876
(LETT |htanPts|
877
(SPADCALL (LIST |p| |dpdx|) (LIST |x| |y|) (|shellEntry| $ 14)
878
(|shellEntry| $ 133))
879
. #1#)
880
(LETT |vtanPts|
881
(SPADCALL (LIST |p| |dpdy|) (LIST |x| |y|) (|shellEntry| $ 14)
882
(|shellEntry| $ 133))
883
. #1#)
884
(LETT |htans|
885
(|ACPLOT;listPtsInRect| |htanPts| |xMinNF| |xMaxNF| |yMinNF|
886
|yMaxNF| $)
887
. #1#)
888
(LETT |vtans|
889
(|ACPLOT;listPtsInRect| |vtanPts| |xMinNF| |xMaxNF| |yMinNF|
890
|yMaxNF| $)
891
. #1#)
892
(LETT |lf| NIL . #1#) (LETT |rt| NIL . #1#) (LETT |bt| NIL . #1#)
893
(LETT |tp| NIL . #1#)
894
(LETT |singList|
895
(PROGN
896
(LETT |roots|
897
(SPADCALL |den| (|shellEntry| $ 14)
898
(|shellEntry| $ 107))
899
. #1#)
900
(LETT |outList| NIL . #1#)
901
(LET ((#2=#:G1257 |roots|))
902
(LOOP
903
(COND ((NOT (CONSP #2#)) (RETURN NIL))
904
(T
905
(LET ((|root| (CAR #2#)))
906
(COND
907
((AND
908
(SPADCALL |indVarMinNF| |root|
909
(|shellEntry| $ 78))
910
(SPADCALL |root| |indVarMaxNF|
911
(|shellEntry| $ 78)))
912
(SETQ |outList|
913
(CONS (|ACPLOT;NFtoSF| |root| $)
914
|outList|)))))))
915
(SETQ #2# (CDR #2#))))
916
(SPADCALL (CONS #'|ACPLOT;makeRatFcnSketch!1| NIL) |outList|
917
(|shellEntry| $ 135)))
918
. #1#)
919
(LETT |topList|
920
(PROGN
921
(LETT |roots|
922
(SPADCALL
923
(SPADCALL |pRN| |depVar| |depVarMax|
924
(|shellEntry| $ 74))
925
(|shellEntry| $ 14) (|shellEntry| $ 77))
926
. #1#)
927
(LETT |outList| NIL . #1#)
928
(LET ((#3=#:G1258 |roots|))
929
(LOOP
930
(COND ((NOT (CONSP #3#)) (RETURN NIL))
931
(T
932
(LET ((|root| (CAR #3#)))
933
(COND
934
((AND
935
(SPADCALL |indVarMinNF| |root|
936
(|shellEntry| $ 78))
937
(SPADCALL |root| |indVarMaxNF|
938
(|shellEntry| $ 78)))
939
(SETQ |outList|
940
(CONS (|ACPLOT;NFtoSF| |root| $)
941
|outList|)))))))
942
(SETQ #3# (CDR #3#))))
943
(SPADCALL (CONS #'|ACPLOT;makeRatFcnSketch!2| NIL) |outList|
944
(|shellEntry| $ 135)))
945
. #1#)
946
(LETT |botList|
947
(PROGN
948
(LETT |roots|
949
(SPADCALL
950
(SPADCALL |pRN| |depVar| |depVarMin|
951
(|shellEntry| $ 74))
952
(|shellEntry| $ 14) (|shellEntry| $ 77))
953
. #1#)
954
(LETT |outList| NIL . #1#)
955
(LET ((#4=#:G1259 |roots|))
956
(LOOP
957
(COND ((NOT (CONSP #4#)) (RETURN NIL))
958
(T
959
(LET ((|root| (CAR #4#)))
960
(COND
961
((AND
962
(SPADCALL |indVarMinNF| |root|
963
(|shellEntry| $ 78))
964
(SPADCALL |root| |indVarMaxNF|
965
(|shellEntry| $ 78)))
966
(SETQ |outList|
967
(CONS (|ACPLOT;NFtoSF| |root| $)
968
|outList|)))))))
969
(SETQ #4# (CDR #4#))))
970
(SPADCALL (CONS #'|ACPLOT;makeRatFcnSketch!3| NIL) |outList|
971
(|shellEntry| $ 135)))
972
. #1#)
973
(LETT |denUPolyRN|
974
(|ACPLOT;RNPolyToUPoly| (|ACPLOT;coerceCoefsToRNs| |den| $) $)
975
. #1#)
976
(COND
977
((SPADCALL (SPADCALL |denUPolyRN| |indVarMin| (|shellEntry| $ 136))
978
(|spadConstant| $ 137) (|shellEntry| $ 138))
979
(LETT |leftVal| (- |depVarMinSF| (+ (ABS |depVarMinSF|) 1.0))
980
. #1#))
981
(T
982
(LETT |leftVal| (FUNCALL (CAR |f|) |indVarMinSF| (CDR |f|))
983
. #1#)))
984
(COND
985
((SPADCALL (SPADCALL |denUPolyRN| |indVarMax| (|shellEntry| $ 136))
986
(|spadConstant| $ 137) (|shellEntry| $ 138))
987
(LETT |rightVal| (- |depVarMinSF| (+ (ABS |depVarMinSF|) 1.0))
988
. #1#))
989
(T
990
(LETT |rightVal| (FUNCALL (CAR |f|) |indVarMaxSF| (CDR |f|))
991
. #1#)))
992
(COND
993
((EQUAL |depVar| |x|)
994
(PROGN
995
(COND
996
((AND (< |xMinSF| |leftVal|) (< |leftVal| |xMaxSF|))
997
(SETQ |bt| (CONS (|ACPLOT;makePt| |leftVal| |yMinSF| $) |bt|))))
998
(COND
999
((AND (< |xMinSF| |rightVal|) (< |rightVal| |xMaxSF|))
1000
(SETQ |tp|
1001
(CONS (|ACPLOT;makePt| |rightVal| |yMaxSF| $) |tp|))))
1002
(LET ((#5=#:G1260 |botList|))
1003
(LOOP
1004
(COND ((NOT (CONSP #5#)) (RETURN NIL))
1005
(T
1006
(SETQ |lf|
1007
(CONS (|ACPLOT;makePt| |xMinSF| (CAR #5#) $)
1008
|lf|))))
1009
(SETQ #5# (CDR #5#))))
1010
(LET ((#6=#:G1261 |topList|))
1011
(LOOP
1012
(COND ((NOT (CONSP #6#)) (RETURN NIL))
1013
(T
1014
(SETQ |rt|
1015
(CONS (|ACPLOT;makePt| |xMaxSF| (CAR #6#) $)
1016
|rt|))))
1017
(SETQ #6# (CDR #6#))))))
1018
(T
1019
(PROGN
1020
(COND
1021
((AND (< |yMinSF| |leftVal|) (< |leftVal| |yMaxSF|))
1022
(SETQ |lf| (CONS (|ACPLOT;makePt| |xMinSF| |leftVal| $) |lf|))))
1023
(COND
1024
((AND (< |yMinSF| |rightVal|) (< |rightVal| |yMaxSF|))
1025
(SETQ |rt|
1026
(CONS (|ACPLOT;makePt| |xMaxSF| |rightVal| $) |rt|))))
1027
(LET ((#7=#:G1262 |botList|))
1028
(LOOP
1029
(COND ((NOT (CONSP #7#)) (RETURN NIL))
1030
(T
1031
(SETQ |bt|
1032
(CONS (|ACPLOT;makePt| (CAR #7#) |yMinSF| $)
1033
|bt|))))
1034
(SETQ #7# (CDR #7#))))
1035
(LET ((#8=#:G1263 |topList|))
1036
(LOOP
1037
(COND ((NOT (CONSP #8#)) (RETURN NIL))
1038
(T
1039
(SETQ |tp|
1040
(CONS (|ACPLOT;makePt| (CAR #8#) |yMaxSF| $)
1041
|tp|))))
1042
(SETQ #8# (CDR #8#)))))))
1043
(LETT |bran| NIL . #1#)
1044
(COND
1045
((< |depVarMinSF| |leftVal|)
1046
(COND ((< |leftVal| |depVarMaxSF|) (LETT |lo| |indVarMinSF| . #1#))
1047
((NULL |topList|)
1048
(COND
1049
((NULL |botList|)
1050
(RETURN-FROM |ACPLOT;makeRatFcnSketch|
1051
(VECTOR |p| |x| |y| |xMin| |xMax| |yMin| |yMax|
1052
(VECTOR |lf| |rt| |bt| |tp|) |htans| |vtans|
1053
|bran|)))
1054
(T
1055
(PROGN
1056
(LETT |lo| (|SPADfirst| |botList|) . #1#)
1057
(SETQ |botList| (CDR |botList|))))))
1058
((NULL |botList|)
1059
(PROGN
1060
(LETT |lo| (|SPADfirst| |topList|) . #1#)
1061
(SETQ |topList| (CDR |topList|))))
1062
(T
1063
(SEQ (LETT |bot| (|SPADfirst| |botList|) . #1#)
1064
(LETT |top| (|SPADfirst| |topList|) . #1#)
1065
(EXIT
1066
(COND
1067
((< |bot| |top|)
1068
(PROGN
1069
(LETT |lo| |bot| . #1#)
1070
(SETQ |botList| (CDR |botList|))))
1071
(T
1072
(PROGN
1073
(LETT |lo| |top| . #1#)
1074
(SETQ |topList| (CDR |topList|))))))))))
1075
((NULL |topList|)
1076
(COND
1077
((NULL |botList|)
1078
(RETURN-FROM |ACPLOT;makeRatFcnSketch|
1079
(VECTOR |p| |x| |y| |xMin| |xMax| |yMin| |yMax|
1080
(VECTOR |lf| |rt| |bt| |tp|) |htans| |vtans| |bran|)))
1081
(T
1082
(PROGN
1083
(LETT |lo| (|SPADfirst| |botList|) . #1#)
1084
(SETQ |botList| (CDR |botList|))))))
1085
((NULL |botList|)
1086
(PROGN
1087
(LETT |lo| (|SPADfirst| |topList|) . #1#)
1088
(SETQ |topList| (CDR |topList|))))
1089
(T
1090
(SEQ (LETT |bot| (|SPADfirst| |botList|) . #1#)
1091
(LETT |top| (|SPADfirst| |topList|) . #1#)
1092
(EXIT
1093
(COND
1094
((< |bot| |top|)
1095
(PROGN
1096
(LETT |lo| |bot| . #1#)
1097
(SETQ |botList| (CDR |botList|))))
1098
(T
1099
(PROGN
1100
(LETT |lo| |top| . #1#)
1101
(SETQ |topList| (CDR |topList|)))))))))
1102
(LETT |hi| 0.0 . #1#)
1103
(COND
1104
((< |depVarMinSF| |rightVal|)
1105
(COND ((< |rightVal| |depVarMaxSF|) (SETQ |hi| |indVarMaxSF|))
1106
((NULL |topList|)
1107
(COND
1108
((NULL |botList|)
1109
(|error| #9="makeRatFcnSketch: plot domain"))
1110
(T
1111
(PROGN
1112
(SETQ |hi| (SPADCALL |botList| (|shellEntry| $ 140)))
1113
(SETQ |botList|
1114
(SPADCALL |hi| |botList|
1115
(|shellEntry| $ 141)))))))
1116
((NULL |botList|)
1117
(PROGN
1118
(SETQ |hi| (SPADCALL |topList| (|shellEntry| $ 140)))
1119
(SETQ |topList|
1120
(SPADCALL |hi| |topList| (|shellEntry| $ 141)))))
1121
(T
1122
(SEQ
1123
(LETT |bot| (SPADCALL |botList| (|shellEntry| $ 140))
1124
. #1#)
1125
(LETT |top| (SPADCALL |topList| (|shellEntry| $ 140))
1126
. #1#)
1127
(EXIT
1128
(COND
1129
((< |top| |bot|)
1130
(PROGN
1131
(SETQ |hi| |bot|)
1132
(SETQ |botList|
1133
(SPADCALL |hi| |botList|
1134
(|shellEntry| $ 141)))))
1135
(T
1136
(PROGN
1137
(SETQ |hi| |top|)
1138
(SETQ |topList|
1139
(SPADCALL |hi| |topList|
1140
(|shellEntry| $ 141)))))))))))
1141
((NULL |topList|)
1142
(COND ((NULL |botList|) (|error| #9#))
1143
(T
1144
(PROGN
1145
(SETQ |hi| (SPADCALL |botList| (|shellEntry| $ 140)))
1146
(SETQ |botList|
1147
(SPADCALL |hi| |botList| (|shellEntry| $ 141)))))))
1148
((NULL |botList|)
1149
(PROGN
1150
(SETQ |hi| (SPADCALL |topList| (|shellEntry| $ 140)))
1151
(SETQ |topList| (SPADCALL |hi| |topList| (|shellEntry| $ 141)))))
1152
(T
1153
(SEQ (LETT |bot| (SPADCALL |botList| (|shellEntry| $ 140)) . #1#)
1154
(LETT |top| (SPADCALL |topList| (|shellEntry| $ 140)) . #1#)
1155
(EXIT
1156
(COND
1157
((< |top| |bot|)
1158
(PROGN
1159
(SETQ |hi| |bot|)
1160
(SETQ |botList|
1161
(SPADCALL |hi| |botList| (|shellEntry| $ 141)))))
1162
(T
1163
(PROGN
1164
(SETQ |hi| |top|)
1165
(SETQ |topList|
1166
(SPADCALL |hi| |topList|
1167
(|shellEntry| $ 141))))))))))
1168
(COND
1169
((EQUAL |depVar| |x|)
1170
(PROGN
1171
(LETT |minSF| |xMinSF| . #1#)
1172
(LETT |maxSF| |xMaxSF| . #1#)))
1173
(T
1174
(PROGN
1175
(LETT |minSF| |yMinSF| . #1#)
1176
(LETT |maxSF| |yMaxSF| . #1#))))
1177
(LETT |segList| NIL . #1#)
1178
(LOOP
1179
(PROGN
1180
(LETT |segInfo|
1181
(|ACPLOT;segmentInfo| |f| |lo| |hi| |botList| |topList|
1182
|singList| |minSF| |maxSF| $)
1183
. #1#)
1184
(SETQ |segList| (CONS (SVREF |segInfo| 0) |segList|))
1185
(LETT |lo| (SVREF |segInfo| 1) . #1#)
1186
(SETQ |botList| (SVREF |segInfo| 2))
1187
(SETQ |topList| (SVREF |segInfo| 3))
1188
(COND ((= |lo| |hi|) (RETURN |$NoValue|)))))
1189
(LET ((#10=#:G1264 |segList|))
1190
(LOOP
1191
(COND ((NOT (CONSP #10#)) (RETURN NIL))
1192
(T
1193
(PROGN
1194
(LETT |RFPlot|
1195
(SPADCALL |f| (CAR #10#) (|shellEntry| $ 149))
1196
. #1#)
1197
(LETT |curve|
1198
(|SPADfirst|
1199
(SPADCALL |RFPlot| (|shellEntry| $ 150)))
1200
. #1#)
1201
(COND
1202
((EQUAL |depVar| |y|)
1203
(SETQ |bran| (CONS |curve| |bran|)))
1204
(T
1205
(SETQ |bran|
1206
(CONS
1207
(SPADCALL (CONS #'|ACPLOT;swapCoords| $)
1208
|curve| (|shellEntry| $ 153))
1209
|bran|)))))))
1210
(SETQ #10# (CDR #10#))))
1211
(EXIT
1212
(VECTOR |p| |x| |y| |xMin| |xMax| |yMin| |yMax|
1213
(VECTOR |lf| |rt| |bt| |tp|) |htans| |vtans| |bran|)))))))))
1214
1215
(DEFUN |ACPLOT;makeRatFcnSketch!3| (|#1| |#2| $$) (< |#1| |#2|))
1216
1217
(DEFUN |ACPLOT;makeRatFcnSketch!2| (|#1| |#2| $$) (< |#1| |#2|))
1218
1219
(DEFUN |ACPLOT;makeRatFcnSketch!1| (|#1| |#2| $$) (< |#1| |#2|))
1220
1221
(DEFUN |ACPLOT;makeRatFcnSketch!0| (|#1| $$)
1222
(LET (($ (SVREF $$ 1)))
1223
(/ (SPADCALL (SVREF $$ 2) |#1| (|shellEntry| $ 130))
1224
(SPADCALL (SVREF $$ 0) |#1| (|shellEntry| $ 130)))))
1225
1226
(DEFUN |ACPLOT;makeGeneralSketch| (|pol| |x| |y| |xMin| |xMax| |yMin| |yMax| $)
1227
(PROG (|bran| |bdPts| |tp| |bt| |rt| |lf| |pRN| |bound| |err| |delta|
1228
|dpdySF| |dpdxSF| |pSF| |corners| |yMaxSF| |yMinSF| |xMaxSF| |xMinSF|
1229
|crits| |vtans| |htans| |vInc| |hInc| |critPts| |vtanPts| |htanPts|
1230
|foo| |singPts| |yMaxNF| |yMinNF| |xMaxNF| |xMinNF| |dpdy| |dpdx| |p|)
1231
(RETURN
1232
(LET ((|factoredPol| (SPADCALL |pol| (|shellEntry| $ 126))))
1233
(COND
1234
((< 1 (SPADCALL |factoredPol| (|shellEntry| $ 127)))
1235
(|error| "reducible polynomial"))
1236
(T
1237
(SEQ
1238
(LETT |p| (SPADCALL |factoredPol| 1 (|shellEntry| $ 154))
1239
. #1=(|ACPLOT;makeGeneralSketch|))
1240
(LETT |dpdx| (SPADCALL |p| |x| (|shellEntry| $ 128)) . #1#)
1241
(LETT |dpdy| (SPADCALL |p| |y| (|shellEntry| $ 128)) . #1#)
1242
(LETT |xMinNF| (|ACPLOT;RNtoNF| |xMin| $) . #1#)
1243
(LETT |xMaxNF| (|ACPLOT;RNtoNF| |xMax| $) . #1#)
1244
(LETT |yMinNF| (|ACPLOT;RNtoNF| |yMin| $) . #1#)
1245
(LETT |yMaxNF| (|ACPLOT;RNtoNF| |yMax| $) . #1#)
1246
(LETT |singPts|
1247
(SPADCALL (LIST |p| |dpdx| |dpdy|) (LIST |x| |y|)
1248
(|shellEntry| $ 14) (|shellEntry| $ 133))
1249
. #1#)
1250
(LETT |foo|
1251
(CONS #'|ACPLOT;makeGeneralSketch!0|
1252
(VECTOR $ |yMaxNF| |yMinNF| |xMaxNF| |xMinNF|))
1253
. #1#)
1254
(EXIT
1255
(COND
1256
((|ACPLOT;ptsSuchThat?| |singPts| |foo| $)
1257
(|error| "singular pts in region of sketch"))
1258
(T
1259
(SEQ
1260
(LETT |htanPts|
1261
(SPADCALL (LIST |p| |dpdx|) (LIST |x| |y|)
1262
(|shellEntry| $ 14) (|shellEntry| $ 133))
1263
. #1#)
1264
(LETT |vtanPts|
1265
(SPADCALL (LIST |p| |dpdy|) (LIST |x| |y|)
1266
(|shellEntry| $ 14) (|shellEntry| $ 133))
1267
. #1#)
1268
(LETT |critPts| (APPEND |htanPts| |vtanPts|) . #1#)
1269
(LETT |hInc|
1270
(SPADCALL (SPADCALL 1 20 (|shellEntry| $ 156))
1271
(SPADCALL |xMax| |xMin| (|shellEntry| $ 157))
1272
(|shellEntry| $ 158))
1273
. #1#)
1274
(LETT |vInc|
1275
(SPADCALL (SPADCALL 1 20 (|shellEntry| $ 156))
1276
(SPADCALL |yMax| |yMin| (|shellEntry| $ 157))
1277
(|shellEntry| $ 158))
1278
. #1#)
1279
(SETQ |foo|
1280
(CONS #'|ACPLOT;makeGeneralSketch!1|
1281
(VECTOR $ |xMinNF| |yMaxNF| |yMinNF|)))
1282
(COND
1283
((|ACPLOT;ptsSuchThat?| |critPts| |foo| $)
1284
(PROGN
1285
(SETQ |xMin|
1286
(|ACPLOT;newX| |critPts| |singPts| |yMinNF| |yMaxNF|
1287
|xMinNF| |xMin|
1288
(SPADCALL |hInc| (|shellEntry| $ 159)) $))
1289
(SETQ |xMinNF| (|ACPLOT;RNtoNF| |xMin| $)))))
1290
(SETQ |foo|
1291
(CONS #'|ACPLOT;makeGeneralSketch!2|
1292
(VECTOR $ |xMaxNF| |yMaxNF| |yMinNF|)))
1293
(COND
1294
((|ACPLOT;ptsSuchThat?| |critPts| |foo| $)
1295
(PROGN
1296
(SETQ |xMax|
1297
(|ACPLOT;newX| |critPts| |singPts| |yMinNF| |yMaxNF|
1298
|xMaxNF| |xMax| |hInc| $))
1299
(SETQ |xMaxNF| (|ACPLOT;RNtoNF| |xMax| $)))))
1300
(SETQ |foo|
1301
(CONS #'|ACPLOT;makeGeneralSketch!3|
1302
(VECTOR $ |yMinNF| |xMaxNF| |xMinNF|)))
1303
(COND
1304
((|ACPLOT;ptsSuchThat?| |critPts| |foo| $)
1305
(PROGN
1306
(SETQ |yMin|
1307
(|ACPLOT;newY| |critPts| |singPts| |xMinNF| |xMaxNF|
1308
|yMinNF| |yMin|
1309
(SPADCALL |vInc| (|shellEntry| $ 159)) $))
1310
(SETQ |yMinNF| (|ACPLOT;RNtoNF| |yMin| $)))))
1311
(SETQ |foo|
1312
(CONS #'|ACPLOT;makeGeneralSketch!4|
1313
(VECTOR $ |yMaxNF| |xMaxNF| |xMinNF|)))
1314
(COND
1315
((|ACPLOT;ptsSuchThat?| |critPts| |foo| $)
1316
(PROGN
1317
(SETQ |yMax|
1318
(|ACPLOT;newY| |critPts| |singPts| |xMinNF| |xMaxNF|
1319
|yMaxNF| |yMax| |vInc| $))
1320
(SETQ |yMaxNF| (|ACPLOT;RNtoNF| |yMax| $)))))
1321
(LETT |htans|
1322
(|ACPLOT;listPtsInRect| |htanPts| |xMinNF| |xMaxNF|
1323
|yMinNF| |yMaxNF| $)
1324
. #1#)
1325
(LETT |vtans|
1326
(|ACPLOT;listPtsInRect| |vtanPts| |xMinNF| |xMaxNF|
1327
|yMinNF| |yMaxNF| $)
1328
. #1#)
1329
(LETT |crits| (APPEND |htans| |vtans|) . #1#)
1330
(LETT |xMinSF| (|ACPLOT;RNtoSF| |xMin| $) . #1#)
1331
(LETT |xMaxSF| (|ACPLOT;RNtoSF| |xMax| $) . #1#)
1332
(LETT |yMinSF| (|ACPLOT;RNtoSF| |yMin| $) . #1#)
1333
(LETT |yMaxSF| (|ACPLOT;RNtoSF| |yMax| $) . #1#)
1334
(LETT |corners| (VECTOR |xMinSF| |xMaxSF| |yMinSF| |yMaxSF|)
1335
. #1#)
1336
(LETT |pSF| (|ACPLOT;coerceCoefsToSFs| |p| $) . #1#)
1337
(LETT |dpdxSF| (|ACPLOT;coerceCoefsToSFs| |dpdx| $) . #1#)
1338
(LETT |dpdySF| (|ACPLOT;coerceCoefsToSFs| |dpdy| $) . #1#)
1339
(LETT |delta|
1340
(MIN (/ (- |xMaxSF| |xMinSF|) 25)
1341
(/ (- |yMaxSF| |yMinSF|) 25))
1342
. #1#)
1343
(LETT |err| (MIN (/ |delta| 100) (/ (|shellEntry| $ 18) 100))
1344
. #1#)
1345
(LETT |bound| 10 . #1#)
1346
(LETT |pRN| (|ACPLOT;coerceCoefsToRNs| |p| $) . #1#)
1347
(LETT |lf|
1348
(|ACPLOT;listPtsOnVertBdry| |pRN| |x| |xMin| |yMinNF|
1349
|yMaxNF| $)
1350
. #1#)
1351
(LETT |rt|
1352
(|ACPLOT;listPtsOnVertBdry| |pRN| |x| |xMax| |yMinNF|
1353
|yMaxNF| $)
1354
. #1#)
1355
(LETT |bt|
1356
(|ACPLOT;listPtsOnHorizBdry| |pRN| |y| |yMin| |xMinNF|
1357
|xMaxNF| $)
1358
. #1#)
1359
(LETT |tp|
1360
(|ACPLOT;listPtsOnHorizBdry| |pRN| |y| |yMax| |xMinNF|
1361
|xMaxNF| $)
1362
. #1#)
1363
(LETT |bdPts| (VECTOR |lf| |rt| |bt| |tp|) . #1#)
1364
(LETT |bran|
1365
(|ACPLOT;traceBranches| |pSF| |dpdxSF| |dpdySF| |x| |y|
1366
|corners| |delta| |err| |bound| |crits| |bdPts| $)
1367
. #1#)
1368
(EXIT
1369
(VECTOR |p| |x| |y| |xMin| |xMax| |yMin| |yMax| |bdPts| |htans|
1370
|vtans| |bran|)))))))))))))
1371
1372
(DEFUN |ACPLOT;makeGeneralSketch!4| (|#1| $$)
1373
(|ACPLOT;onHorzSeg?| |#1| (SVREF $$ 3) (SVREF $$ 2) (SVREF $$ 1)
1374
(SVREF $$ 0)))
1375
1376
(DEFUN |ACPLOT;makeGeneralSketch!3| (|#1| $$)
1377
(|ACPLOT;onHorzSeg?| |#1| (SVREF $$ 3) (SVREF $$ 2) (SVREF $$ 1)
1378
(SVREF $$ 0)))
1379
1380
(DEFUN |ACPLOT;makeGeneralSketch!2| (|#1| $$)
1381
(|ACPLOT;onVertSeg?| |#1| (SVREF $$ 3) (SVREF $$ 2) (SVREF $$ 1)
1382
(SVREF $$ 0)))
1383
1384
(DEFUN |ACPLOT;makeGeneralSketch!1| (|#1| $$)
1385
(|ACPLOT;onVertSeg?| |#1| (SVREF $$ 3) (SVREF $$ 2) (SVREF $$ 1)
1386
(SVREF $$ 0)))
1387
1388
(DEFUN |ACPLOT;makeGeneralSketch!0| (|#1| $$)
1389
(|ACPLOT;inRect?| |#1| (SVREF $$ 4) (SVREF $$ 3) (SVREF $$ 2) (SVREF $$ 1)
1390
(SVREF $$ 0)))
1391
1392
(DEFUN |ACPLOT;refine;$Df$;34| (|plot| |stepFraction| $)
1393
(PROG (|vtans| |htans| |bran| |bdPts| |crits| |bound| |err| |delta|)
1394
(RETURN
1395
(LET* ((|p| (SVREF |plot| 0))
1396
(|x| (SVREF |plot| 1))
1397
(|y| (SVREF |plot| 2))
1398
(|dpdx| (SPADCALL |p| |x| (|shellEntry| $ 128)))
1399
(|dpdy| (SPADCALL |p| |y| (|shellEntry| $ 128)))
1400
(|pSF| (|ACPLOT;coerceCoefsToSFs| |p| $))
1401
(|dpdxSF| (|ACPLOT;coerceCoefsToSFs| |dpdx| $))
1402
(|dpdySF| (|ACPLOT;coerceCoefsToSFs| |dpdy| $))
1403
(|xMin| (SVREF |plot| 3))
1404
(|xMax| (SVREF |plot| 4))
1405
(|yMin| (SVREF |plot| 5))
1406
(|yMax| (SVREF |plot| 6))
1407
(|xMinSF| (|ACPLOT;RNtoSF| |xMin| $))
1408
(|xMaxSF| (|ACPLOT;RNtoSF| |xMax| $))
1409
(|yMinSF| (|ACPLOT;RNtoSF| |yMin| $))
1410
(|yMaxSF| (|ACPLOT;RNtoSF| |yMax| $))
1411
(|corners| (VECTOR |xMinSF| |xMaxSF| |yMinSF| |yMaxSF|)))
1412
(PROGN
1413
(SETQ |pSF| (|ACPLOT;coerceCoefsToSFs| |p| $))
1414
(SETQ |dpdxSF| (|ACPLOT;coerceCoefsToSFs| |dpdx| $))
1415
(SETQ |dpdySF| (|ACPLOT;coerceCoefsToSFs| |dpdy| $))
1416
(LETT |delta|
1417
(* |stepFraction|
1418
(MIN (/ (- |xMaxSF| |xMinSF|) 25)
1419
(/ (- |yMaxSF| |yMinSF|) 25)))
1420
. #1=(|ACPLOT;refine;$Df$;34|))
1421
(LETT |err| (MIN (/ |delta| 100) (/ (|shellEntry| $ 18) 100)) . #1#)
1422
(LETT |bound| 10 . #1#)
1423
(LETT |crits| (APPEND (SVREF |plot| 8) (SVREF |plot| 9)) . #1#)
1424
(LETT |bdPts| (SVREF |plot| 7) . #1#)
1425
(LETT |bran|
1426
(|ACPLOT;traceBranches| |pSF| |dpdxSF| |dpdySF| |x| |y| |corners|
1427
|delta| |err| |bound| |crits| |bdPts| $)
1428
. #1#)
1429
(LETT |htans| (SVREF |plot| 8) . #1#)
1430
(LETT |vtans| (SVREF |plot| 9) . #1#)
1431
(VECTOR |p| |x| |y| |xMin| |xMax| |yMin| |yMax| |bdPts| |htans| |vtans|
1432
|bran|))))))
1433
1434
(DEFUN |ACPLOT;traceBranches|
1435
(|pSF| |dpdxSF| |dpdySF| |x| |y| |corners| |delta| |err| |bound| |crits|
1436
|bdPts| $)
1437
(PROG (|segInfo| |pt| |p0|)
1438
(RETURN
1439
(LET* ((|lf| (SVREF |bdPts| 0))
1440
(|rt| (SVREF |bdPts| 1))
1441
(|tp| (SVREF |bdPts| 3))
1442
(|bt| (SVREF |bdPts| 2))
1443
(|bdry| (APPEND (APPEND |lf| |rt|) (APPEND |bt| |tp|)))
1444
(|bran| NIL))
1445
(SEQ
1446
(LOOP
1447
(COND ((NULL |bdry|) (RETURN NIL))
1448
(T
1449
(PROGN
1450
(LETT |pt| (|SPADfirst| |bdry|) . #1=(|ACPLOT;traceBranches|))
1451
(LETT |p0|
1452
(|ACPLOT;dummyFirstPt| |pt| |dpdxSF| |dpdySF| |x| |y|
1453
|lf| |rt| |bt| |tp| $)
1454
. #1#)
1455
(LETT |segInfo|
1456
(|ACPLOT;listPtsOnSegment| |pSF| |dpdxSF| |dpdySF| |x|
1457
|y| |p0| |pt| |corners| |delta| |err| |bound| |crits|
1458
|bdry| $)
1459
. #1#)
1460
(SETQ |bran| (CONS (|SPADfirst| |segInfo|) |bran|))
1461
(SETQ |crits| (SPADCALL |segInfo| (|shellEntry| $ 168)))
1462
(SETQ |bdry| (SPADCALL |segInfo| (|shellEntry| $ 169)))))))
1463
(LOOP
1464
(COND ((NULL |crits|) (RETURN NIL))
1465
(T
1466
(PROGN
1467
(LETT |pt| (|SPADfirst| |crits|) . #1#)
1468
(LETT |segInfo|
1469
(|ACPLOT;listPtsOnLoop| |pSF| |dpdxSF| |dpdySF| |x| |y|
1470
|pt| |corners| |delta| |err| |bound| |crits| |bdry| $)
1471
. #1#)
1472
(SETQ |bran| (CONS (|SPADfirst| |segInfo|) |bran|))
1473
(SETQ |crits| (SPADCALL |segInfo| (|shellEntry| $ 168)))))))
1474
(EXIT |bran|))))))
1475
1476
(DEFUN |ACPLOT;dummyFirstPt|
1477
(|p1| |dpdxSF| |dpdySF| |x| |y| |lf| |rt| |bt| |tp| $)
1478
(LET* ((|x1| (SPADCALL |p1| (|shellEntry| $ 34)))
1479
(|y1| (SPADCALL |p1| (|shellEntry| $ 33)))
1480
(|zero| 0.0)
1481
(|one| 1.0)
1482
(|px|
1483
(SPADCALL
1484
(SPADCALL |dpdxSF| (LIST |x| |y|) (LIST |x1| |y1|)
1485
(|shellEntry| $ 170))
1486
(|shellEntry| $ 171)))
1487
(|py|
1488
(SPADCALL
1489
(SPADCALL |dpdySF| (LIST |x| |y|) (LIST |x1| |y1|)
1490
(|shellEntry| $ 170))
1491
(|shellEntry| $ 171))))
1492
(COND
1493
((< (* |px| |py|) |zero|)
1494
(COND
1495
((OR (SPADCALL |p1| |lf| (|shellEntry| $ 172))
1496
(SPADCALL |p1| |bt| (|shellEntry| $ 172)))
1497
(|ACPLOT;makePt| (- |x1| |one|) (- |y1| |one|) $))
1498
(T (|ACPLOT;makePt| (+ |x1| |one|) (+ |y1| |one|) $))))
1499
((OR (SPADCALL |p1| |lf| (|shellEntry| $ 172))
1500
(SPADCALL |p1| |tp| (|shellEntry| $ 172)))
1501
(|ACPLOT;makePt| (- |x1| |one|) (+ |y1| |one|) $))
1502
(T (|ACPLOT;makePt| (+ |x1| |one|) (- |y1| |one|) $)))))
1503
1504
(DEFUN |ACPLOT;listPtsOnSegment|
1505
(|pSF| |dpdxSF| |dpdySF| |x| |y| |p0| |p1| |corners| |delta| |err|
1506
|bound| |crits| |bdry| $)
1507
(PROG (|pt1| |pt0| |p2| |ptInfo| |pointList|)
1508
(RETURN
1509
(SEQ (SETQ |bdry| (SPADCALL |p1| |bdry| (|shellEntry| $ 173)))
1510
(LETT |pointList| (LIST |p1|) . #1=(|ACPLOT;listPtsOnSegment|))
1511
(LETT |ptInfo|
1512
(|ACPLOT;computeNextPt| |pSF| |dpdxSF| |dpdySF| |x| |y| |p0|
1513
|p1| |corners| |delta| |err| |bound| |crits| |bdry| $)
1514
. #1#)
1515
(LETT |p2| (CAR |ptInfo|) . #1#)
1516
(EXIT
1517
(COND
1518
((NOT (NULL (STRING= (CDR |ptInfo|) (|shellEntry| $ 20))))
1519
(PROGN
1520
(SETQ |bdry| (SPADCALL |p2| |bdry| (|shellEntry| $ 173)))
1521
(SETQ |pointList| (CONS |p2| |pointList|))
1522
(LIST |pointList| |crits| |bdry|)))
1523
(T
1524
(SEQ
1525
(COND
1526
((NOT (NULL (STRING= (CDR |ptInfo|) (|shellEntry| $ 21))))
1527
(SETQ |crits| (SPADCALL |p2| |crits| (|shellEntry| $ 173)))))
1528
(SETQ |pointList| (CONS |p2| |pointList|))
1529
(LOOP
1530
(SEQ
1531
(LETT |pt0| (SPADCALL |pointList| (|shellEntry| $ 174)) . #1#)
1532
(LETT |pt1| (|SPADfirst| |pointList|) . #1#)
1533
(SETQ |ptInfo|
1534
(|ACPLOT;computeNextPt| |pSF| |dpdxSF| |dpdySF| |x| |y|
1535
|pt0| |pt1| |corners| |delta| |err| |bound| |crits|
1536
|bdry| $))
1537
(SETQ |p2| (CAR |ptInfo|))
1538
(EXIT
1539
(COND
1540
((NOT (NULL (STRING= (CDR |ptInfo|) (|shellEntry| $ 20))))
1541
(PROGN
1542
(SETQ |bdry| (SPADCALL |p2| |bdry| (|shellEntry| $ 173)))
1543
(SETQ |pointList| (CONS |p2| |pointList|))
1544
(RETURN-FROM |ACPLOT;listPtsOnSegment|
1545
(LIST |pointList| |crits| |bdry|))))
1546
(T
1547
(PROGN
1548
(COND
1549
((NOT (NULL (STRING= (CDR |ptInfo|) (|shellEntry| $ 21))))
1550
(SETQ |crits|
1551
(SPADCALL |p2| |crits| (|shellEntry| $ 173)))))
1552
(SETQ |pointList| (CONS |p2| |pointList|))))))))
1553
(EXIT (LIST |pointList| |crits| |bdry|))))))))))
1554
1555
(DEFUN |ACPLOT;listPtsOnLoop|
1556
(|pSF| |dpdxSF| |dpdySF| |x| |y| |p1| |corners| |delta| |err| |bound|
1557
|crits| |bdry| $)
1558
(PROG (|pt1| |pt0|)
1559
(RETURN
1560
(LET* ((|x1| (SPADCALL |p1| (|shellEntry| $ 34)))
1561
(|y1| (SPADCALL |p1| (|shellEntry| $ 33)))
1562
(|px|
1563
(SPADCALL
1564
(SPADCALL |dpdxSF| (LIST |x| |y|) (LIST |x1| |y1|)
1565
(|shellEntry| $ 170))
1566
(|shellEntry| $ 171)))
1567
(|py|
1568
(SPADCALL
1569
(SPADCALL |dpdySF| (LIST |x| |y|) (LIST |x1| |y1|)
1570
(|shellEntry| $ 170))
1571
(|shellEntry| $ 171)))
1572
(|p0| (|ACPLOT;makePt| (- |x1| 1.0) (- |y1| 1.0) $))
1573
(|pointList| (LIST |p1|))
1574
(|ptInfo|
1575
(|ACPLOT;computeNextPt| |pSF| |dpdxSF| |dpdySF| |x| |y| |p0| |p1|
1576
|corners| |delta| |err| |bound| |crits| |bdry| $))
1577
(|p2| (CAR |ptInfo|)))
1578
(COND
1579
((NOT (NULL (STRING= (CDR |ptInfo|) (|shellEntry| $ 20))))
1580
(|error| "boundary reached while on loop"))
1581
(T
1582
(SEQ
1583
(COND
1584
((NOT (NULL (STRING= (CDR |ptInfo|) (|shellEntry| $ 21))))
1585
(COND
1586
((SPADCALL |p1| |p2| (|shellEntry| $ 175))
1587
(|error| "first and second points on loop are identical"))
1588
(T (SETQ |crits| (SPADCALL |p2| |crits| (|shellEntry| $ 173)))))))
1589
(SETQ |pointList| (CONS |p2| |pointList|))
1590
(LOOP
1591
(SEQ
1592
(LETT |pt0| (SPADCALL |pointList| (|shellEntry| $ 174))
1593
. #1=(|ACPLOT;listPtsOnLoop|))
1594
(LETT |pt1| (|SPADfirst| |pointList|) . #1#)
1595
(SETQ |ptInfo|
1596
(|ACPLOT;computeNextPt| |pSF| |dpdxSF| |dpdySF| |x| |y|
1597
|pt0| |pt1| |corners| |delta| |err| |bound| |crits| |bdry|
1598
$))
1599
(SETQ |p2| (CAR |ptInfo|))
1600
(EXIT
1601
(COND
1602
((NOT (NULL (STRING= (CDR |ptInfo|) (|shellEntry| $ 20))))
1603
(|error| "boundary reached while on loop"))
1604
(T
1605
(SEQ
1606
(COND
1607
((NOT (NULL (STRING= (CDR |ptInfo|) (|shellEntry| $ 21))))
1608
(PROGN
1609
(SETQ |crits| (SPADCALL |p2| |crits| (|shellEntry| $ 173)))
1610
(COND
1611
((SPADCALL |p1| |p2| (|shellEntry| $ 175))
1612
(PROGN
1613
(SETQ |pointList| (CONS |p2| |pointList|))
1614
(RETURN-FROM |ACPLOT;listPtsOnLoop|
1615
(LIST |pointList| |crits| |bdry|))))))))
1616
(EXIT (SETQ |pointList| (CONS |p2| |pointList|)))))))))
1617
(EXIT (LIST |pointList| |crits| |bdry|)))))))))
1618
1619
(DEFUN |ACPLOT;computeNextPt|
1620
(|pSF| |dpdxSF| |dpdySF| |x| |y| |p0| |p1| |corners| |delta| |err|
1621
|bound| |crits| |bdry| $)
1622
(PROG (|critPt| |bdryPt| |pt| |x2| |x2New| |f| |y2| |y2New| |y2Approx|
1623
|incVar| |x2Approx| |critPt2| |critPt1| |pt2| |pt1| |x2Temp| |y2Temp|
1624
|yPointList| |xPointList| |y2Approxx| |x2Approxx| |yHi| |yLo| |xHi|
1625
|xLo| |lookingFor| |deltaY| |incVar0| |deltaX| |yy| |xx|)
1626
(RETURN
1627
(LET* ((|xMinSF| (SVREF |corners| 0))
1628
(|xMaxSF| (SVREF |corners| 1))
1629
(|yMinSF| (SVREF |corners| 2))
1630
(|yMaxSF| (SVREF |corners| 3))
1631
(|x0| (SPADCALL |p0| (|shellEntry| $ 34)))
1632
(|y0| (SPADCALL |p0| (|shellEntry| $ 33)))
1633
(|x1| (SPADCALL |p1| (|shellEntry| $ 34)))
1634
(|y1| (SPADCALL |p1| (|shellEntry| $ 33)))
1635
(|px|
1636
(SPADCALL
1637
(SPADCALL |dpdxSF| (LIST |x| |y|) (LIST |x1| |y1|)
1638
(|shellEntry| $ 170))
1639
(|shellEntry| $ 171)))
1640
(|py|
1641
(SPADCALL
1642
(SPADCALL |dpdySF| (LIST |x| |y|) (LIST |x1| |y1|)
1643
(|shellEntry| $ 170))
1644
(|shellEntry| $ 171))))
1645
(SEQ
1646
(COND
1647
((< (ABS |px|) (ABS |py|))
1648
(PROGN
1649
(LETT |incVar| |x| . #1=(|ACPLOT;computeNextPt|))
1650
(LETT |incVar0| |incVar| . #1#)
1651
(LETT |deltaX| (COND ((< |x0| |x1|) |delta|) (T (- |delta|))) . #1#)
1652
(LETT |x2Approx| (+ |x1| |deltaX|) . #1#)
1653
(LETT |y2Approx| (+ |y1| (* (- (/ |px| |py|)) |deltaX|)) . #1#)))
1654
(T
1655
(PROGN
1656
(LETT |incVar| |y| . #1#)
1657
(LETT |incVar0| |incVar| . #1#)
1658
(LETT |deltaY| (COND ((< |y0| |y1|) |delta|) (T (- |delta|))) . #1#)
1659
(LETT |x2Approx| (+ |x1| (* (- (/ |py| |px|)) |deltaY|)) . #1#)
1660
(LETT |y2Approx| (+ |y1| |deltaY|) . #1#))))
1661
(LETT |lookingFor| (|shellEntry| $ 19) . #1#)
1662
(COND
1663
((>= |x2Approx| |xMaxSF|)
1664
(PROGN
1665
(LETT |incVar| |x| . #1#)
1666
(SETQ |lookingFor| (|shellEntry| $ 20))
1667
(LETT |x2Approx| |xMaxSF| . #1#)
1668
(LETT |y2Approx| (+ |y1| (* (- (/ |px| |py|)) (- |x2Approx| |x1|)))
1669
. #1#)))
1670
((<= |x2Approx| |xMinSF|)
1671
(PROGN
1672
(LETT |incVar| |x| . #1#)
1673
(SETQ |lookingFor| (|shellEntry| $ 20))
1674
(LETT |x2Approx| |xMinSF| . #1#)
1675
(LETT |y2Approx| (+ |y1| (* (- (/ |px| |py|)) (- |x2Approx| |x1|)))
1676
. #1#))))
1677
(COND
1678
((>= |y2Approx| |yMaxSF|)
1679
(PROGN
1680
(LETT |incVar| |y| . #1#)
1681
(SETQ |lookingFor| (|shellEntry| $ 20))
1682
(LETT |y2Approx| |yMaxSF| . #1#)
1683
(LETT |x2Approx| (+ |x1| (* (- (/ |py| |px|)) (- |y2Approx| |y1|)))
1684
. #1#)))
1685
((<= |y2Approx| |yMinSF|)
1686
(PROGN
1687
(LETT |incVar| |y| . #1#)
1688
(SETQ |lookingFor| (|shellEntry| $ 20))
1689
(LETT |y2Approx| |yMinSF| . #1#)
1690
(LETT |x2Approx| (+ |x1| (* (- (/ |py| |px|)) (- |y2Approx| |y1|)))
1691
. #1#))))
1692
(COND
1693
((< |x1| |x2Approx|)
1694
(PROGN (LETT |xLo| |x1| . #1#) (LETT |xHi| |x2Approx| . #1#)))
1695
(T (PROGN (LETT |xLo| |x2Approx| . #1#) (LETT |xHi| |x1| . #1#))))
1696
(COND
1697
((< |y1| |y2Approx|)
1698
(PROGN (LETT |yLo| |y1| . #1#) (LETT |yHi| |y2Approx| . #1#)))
1699
(T (PROGN (LETT |yLo| |y2Approx| . #1#) (LETT |yHi| |y1| . #1#))))
1700
(LETT |x2Approxx| |x2Approx| . #1#) (LETT |y2Approxx| |y2Approx| . #1#)
1701
(LETT |xPointList| NIL . #1#) (LETT |yPointList| NIL . #1#)
1702
(LET ((#2=#:G1265 |crits|))
1703
(LOOP
1704
(COND ((NOT (CONSP #2#)) (RETURN NIL))
1705
(T
1706
(LET ((|pt| (CAR #2#)))
1707
(SEQ (LETT |xx| (SPADCALL |pt| (|shellEntry| $ 34)) . #1#)
1708
(LETT |yy| (SPADCALL |pt| (|shellEntry| $ 33)) . #1#)
1709
(COND
1710
((AND (AND (= |xx| |x2Approx|) (NOT (= |xx| |x1|)))
1711
(<
1712
(MIN (ABS (- |yy| |yLo|))
1713
(ABS (- |yy| |yHi|)))
1714
|delta|))
1715
(SETQ |xPointList| (CONS |pt| |xPointList|))))
1716
(COND
1717
((AND (AND (< |xLo| |xx|) (< |xx| |xHi|))
1718
(<
1719
(MIN (ABS (- |yy| |yLo|))
1720
(ABS (- |yy| |yHi|)))
1721
|delta|))
1722
(PROGN
1723
(SETQ |xPointList| (CONS |pt| NIL))
1724
(LETT |x2Approx| |xx| . #1#)
1725
(COND ((< |xx| |x1|) (LETT |xLo| |xx| . #1#))
1726
(T (LETT |xHi| |xx| . #1#))))))
1727
(COND
1728
((AND (= |yy| |y2Approx|) (NOT (= |yy| |y1|)))
1729
(SETQ |yPointList| (CONS |pt| |yPointList|))))
1730
(EXIT
1731
(COND
1732
((AND (AND (< |yLo| |yy|) (< |yy| |yHi|))
1733
(<
1734
(MIN (ABS (- |xx| |xLo|))
1735
(ABS (- |xx| |xHi|)))
1736
|delta|))
1737
(PROGN
1738
(SETQ |yPointList| (CONS |pt| NIL))
1739
(LETT |y2Approx| |yy| . #1#)
1740
(COND ((< |yy| |y1|) (LETT |yLo| |yy| . #1#))
1741
(T (LETT |yHi| |yy| . #1#)))))))))))
1742
(SETQ #2# (CDR #2#))))
1743
(COND
1744
((AND (NOT (NULL |xPointList|)) (NOT (NULL |yPointList|)))
1745
(COND
1746
((SPADCALL |xPointList| |yPointList| (|shellEntry| $ 176))
1747
(PROGN
1748
(LETT |incVar| |incVar0| . #1#)
1749
(COND
1750
((EQUAL |incVar| |x|)
1751
(LETT |y2Approx|
1752
(+ |y1| (* (- (/ |px| |py|)) (- |x2Approx| |x1|))) . #1#))
1753
(T
1754
(LETT |x2Approx|
1755
(+ |x1| (* (- (/ |py| |px|)) (- |y2Approx| |y1|)))
1756
. #1#)))
1757
(SETQ |lookingFor| (|shellEntry| $ 21))))
1758
((EQUAL |incVar0| |x|)
1759
(SEQ
1760
(LETT |x2Temp| (+ |x1| (* (- (/ |py| |px|)) (- |y2Approx| |y1|)))
1761
. #1#)
1762
(LETT |f|
1763
(|ACPLOT;SFPolyToUPoly|
1764
(SPADCALL |pSF| |y| |y2Approx| (|shellEntry| $ 177)) $)
1765
. #1#)
1766
(LETT |x2New| (|ACPLOT;newtonApprox| |f| |x2Temp| |err| |bound| $)
1767
. #1#)
1768
(EXIT
1769
(COND
1770
((EQL (CAR |x2New|) 1)
1771
(PROGN
1772
(LETT |y2Approx|
1773
(+ |y1| (* (- (/ |px| |py|)) (- |x2Approx| |x1|)))
1774
. #1#)
1775
(LETT |incVar| |x| . #1#)
1776
(SETQ |lookingFor| (|shellEntry| $ 21))))
1777
(T
1778
(SEQ
1779
(LETT |y2Temp|
1780
(+ |y1| (* (- (/ |px| |py|)) (- |x2Approx| |x1|)))
1781
. #1#)
1782
(SETQ |f|
1783
(|ACPLOT;SFPolyToUPoly|
1784
(SPADCALL |pSF| |x| |x2Approx| (|shellEntry| $ 177))
1785
$))
1786
(LETT |y2New|
1787
(|ACPLOT;newtonApprox| |f| |y2Temp| |err| |bound| $)
1788
. #1#)
1789
(EXIT
1790
(COND
1791
((EQL (CAR |y2New|) 1)
1792
(RETURN-FROM |ACPLOT;computeNextPt|
1793
(|ACPLOT;computeNextPt| |pSF| |dpdxSF| |dpdySF| |x| |y|
1794
|p0| |p1| |corners| (ABS (/ (- |x2Approx| |x1|) 2))
1795
|err| |bound| |crits| |bdry| $)))
1796
(T
1797
(SEQ
1798
(LETT |pt1| (|ACPLOT;makePt| |x2Approx| (CDR |y2New|) $)
1799
. #1#)
1800
(LETT |pt2| (|ACPLOT;makePt| (CDR |x2New|) |y2Approx| $)
1801
. #1#)
1802
(LETT |critPt1| (|ACPLOT;findPtOnList| |pt1| |crits| $)
1803
. #1#)
1804
(LETT |critPt2| (|ACPLOT;findPtOnList| |pt2| |crits| $)
1805
. #1#)
1806
(COND
1807
((AND (EQL (CAR |critPt1|) 1) (EQL (CAR |critPt2|) 1))
1808
(EXIT
1809
(COND
1810
((< (ABS (- |x2Temp| |x1|)) (ABS (- |x2Approx| |x1|)))
1811
(RETURN-FROM |ACPLOT;computeNextPt|
1812
(CONS |pt1| (|shellEntry| $ 19))))
1813
(T
1814
(RETURN-FROM |ACPLOT;computeNextPt|
1815
(CONS |pt2| (|shellEntry| $ 19))))))))
1816
(EXIT
1817
(COND
1818
((EQL (CAR |critPt1|) 1)
1819
(RETURN-FROM |ACPLOT;computeNextPt|
1820
(CONS
1821
(COND ((ZEROP (CAR |critPt2|)) (CDR |critPt2|))
1822
(T
1823
(|moanRetract| |critPt2|
1824
'(|Point| (|DoubleFloat|)))))
1825
(|shellEntry| $ 21))))
1826
((EQL (CAR |critPt2|) 1)
1827
(RETURN-FROM |ACPLOT;computeNextPt|
1828
(CONS (CDR |critPt1|) (|shellEntry| $ 21))))
1829
((< (ABS (- |x2Temp| |x1|)) (ABS (- |x2Approx| |x1|)))
1830
(RETURN-FROM |ACPLOT;computeNextPt|
1831
(CONS (CDR |critPt2|) (|shellEntry| $ 21))))
1832
(T
1833
(RETURN-FROM |ACPLOT;computeNextPt|
1834
(CONS (CDR |critPt1|)
1835
(|shellEntry| $ 21))))))))))))))))
1836
(T
1837
(SEQ
1838
(LETT |y2Temp| (+ |y1| (* (- (/ |px| |py|)) (- |x2Approx| |x1|)))
1839
. #1#)
1840
(LETT |f|
1841
(|ACPLOT;SFPolyToUPoly|
1842
(SPADCALL |pSF| |x| |x2Approx| (|shellEntry| $ 177)) $)
1843
. #1#)
1844
(LETT |y2New| (|ACPLOT;newtonApprox| |f| |y2Temp| |err| |bound| $)
1845
. #1#)
1846
(EXIT
1847
(COND
1848
((EQL (CAR |y2New|) 1)
1849
(PROGN
1850
(LETT |x2Approx|
1851
(+ |x1| (* (- (/ |py| |px|)) (- |y2Approx| |y1|)))
1852
. #1#)
1853
(LETT |incVar| |y| . #1#)
1854
(SETQ |lookingFor| (|shellEntry| $ 21))))
1855
(T
1856
(SEQ
1857
(LETT |x2Temp|
1858
(+ |x1| (* (- (/ |py| |px|)) (- |y2Approx| |y1|)))
1859
. #1#)
1860
(SETQ |f|
1861
(|ACPLOT;SFPolyToUPoly|
1862
(SPADCALL |pSF| |y| |y2Approx| (|shellEntry| $ 177))
1863
$))
1864
(LETT |x2New|
1865
(|ACPLOT;newtonApprox| |f| |x2Temp| |err| |bound| $)
1866
. #1#)
1867
(EXIT
1868
(COND
1869
((EQL (CAR |x2New|) 1)
1870
(RETURN-FROM |ACPLOT;computeNextPt|
1871
(|ACPLOT;computeNextPt| |pSF| |dpdxSF| |dpdySF| |x| |y|
1872
|p0| |p1| |corners| (ABS (/ (- |y2Approx| |y1|) 2))
1873
|err| |bound| |crits| |bdry| $)))
1874
(T
1875
(SEQ
1876
(LETT |pt1| (|ACPLOT;makePt| |x2Approx| (CDR |y2New|) $)
1877
. #1#)
1878
(LETT |pt2| (|ACPLOT;makePt| (CDR |x2New|) |y2Approx| $)
1879
. #1#)
1880
(LETT |critPt1| (|ACPLOT;findPtOnList| |pt1| |crits| $)
1881
. #1#)
1882
(LETT |critPt2| (|ACPLOT;findPtOnList| |pt2| |crits| $)
1883
. #1#)
1884
(COND
1885
((AND (EQL (CAR |critPt1|) 1) (EQL (CAR |critPt2|) 1))
1886
(EXIT
1887
(COND
1888
((< (ABS (- |y2Temp| |y1|)) (ABS (- |y2Approx| |y1|)))
1889
(RETURN-FROM |ACPLOT;computeNextPt|
1890
(CONS |pt2| (|shellEntry| $ 19))))
1891
(T
1892
(RETURN-FROM |ACPLOT;computeNextPt|
1893
(CONS |pt1| (|shellEntry| $ 19))))))))
1894
(EXIT
1895
(COND
1896
((EQL (CAR |critPt1|) 1)
1897
(RETURN-FROM |ACPLOT;computeNextPt|
1898
(CONS
1899
(COND ((ZEROP (CAR |critPt2|)) (CDR |critPt2|))
1900
(T
1901
(|moanRetract| |critPt2|
1902
'(|Point| (|DoubleFloat|)))))
1903
(|shellEntry| $ 21))))
1904
((OR (EQL (CAR |critPt2|) 1)
1905
(< (ABS (- |y2Temp| |y1|))
1906
(ABS (- |y2Approx| |y1|))))
1907
(RETURN-FROM |ACPLOT;computeNextPt|
1908
(CONS (CDR |critPt1|) (|shellEntry| $ 21))))
1909
(T
1910
(RETURN-FROM |ACPLOT;computeNextPt|
1911
(CONS (CDR |critPt2|)
1912
(|shellEntry| $ 21)))))))))))))))))))
1913
(COND
1914
((AND (NOT (NULL |xPointList|)) (NULL |yPointList|))
1915
(SEQ
1916
(LETT |y2Approx| (+ |y1| (* (- (/ |px| |py|)) (- |x2Approx| |x1|)))
1917
. #1#)
1918
(EXIT
1919
(COND
1920
((EQUAL |incVar0| |x|)
1921
(PROGN
1922
(LETT |incVar| |x| . #1#)
1923
(SETQ |lookingFor| (|shellEntry| $ 21))))
1924
(T
1925
(SEQ
1926
(LETT |f|
1927
(|ACPLOT;SFPolyToUPoly|
1928
(SPADCALL |pSF| |x| |x2Approx| (|shellEntry| $ 177)) $)
1929
. #1#)
1930
(LETT |y2New|
1931
(|ACPLOT;newtonApprox| |f| |y2Approx| |err| |bound| $)
1932
. #1#)
1933
(EXIT
1934
(COND
1935
((EQL (CAR |y2New|) 1)
1936
(PROGN
1937
(LETT |x2Approx| |x2Approxx| . #1#)
1938
(SETQ |y2Approx| |y2Approxx|)))
1939
(T
1940
(PROGN
1941
(LETT |pt| (|ACPLOT;makePt| |x2Approx| (CDR |y2New|) $)
1942
. #1#)
1943
(LETT |critPt| (|ACPLOT;findPtOnList| |pt| |crits| $) . #1#)
1944
(COND
1945
((EQL (CAR |critPt|) 1)
1946
(RETURN-FROM |ACPLOT;computeNextPt|
1947
(CONS |pt| (|shellEntry| $ 19))))
1948
(T
1949
(RETURN-FROM |ACPLOT;computeNextPt|
1950
(CONS (CDR |critPt|) (|shellEntry| $ 21))))))))))))))))
1951
(COND
1952
((AND (NULL |xPointList|) (NOT (NULL |yPointList|)))
1953
(SEQ
1954
(LETT |x2Approx| (+ |x1| (* (- (/ |py| |px|)) (- |y2Approx| |y1|)))
1955
. #1#)
1956
(EXIT
1957
(COND
1958
((EQUAL |incVar0| |y|)
1959
(PROGN
1960
(LETT |incVar| |y| . #1#)
1961
(SETQ |lookingFor| (|shellEntry| $ 21))))
1962
(T
1963
(SEQ
1964
(LETT |f|
1965
(|ACPLOT;SFPolyToUPoly|
1966
(SPADCALL |pSF| |y| |y2Approx| (|shellEntry| $ 177)) $)
1967
. #1#)
1968
(LETT |x2New|
1969
(|ACPLOT;newtonApprox| |f| |x2Approx| |err| |bound| $)
1970
. #1#)
1971
(EXIT
1972
(COND
1973
((EQL (CAR |x2New|) 1)
1974
(PROGN
1975
(SETQ |x2Approx| |x2Approxx|)
1976
(LETT |y2Approx| |y2Approxx| . #1#)))
1977
(T
1978
(PROGN
1979
(LETT |pt| (|ACPLOT;makePt| (CDR |x2New|) |y2Approx| $)
1980
. #1#)
1981
(LETT |critPt| (|ACPLOT;findPtOnList| |pt| |crits| $) . #1#)
1982
(COND
1983
((EQL (CAR |critPt|) 1)
1984
(RETURN-FROM |ACPLOT;computeNextPt|
1985
(CONS |pt| (|shellEntry| $ 19))))
1986
(T
1987
(RETURN-FROM |ACPLOT;computeNextPt|
1988
(CONS (CDR |critPt|) (|shellEntry| $ 21))))))))))))))))
1989
(COND
1990
((EQUAL |incVar| |x|)
1991
(PROGN
1992
(LETT |x2| |x2Approx| . #1#)
1993
(LETT |f|
1994
(|ACPLOT;SFPolyToUPoly|
1995
(SPADCALL |pSF| |x| |x2| (|shellEntry| $ 177)) $)
1996
. #1#)
1997
(LETT |y2New| (|ACPLOT;newtonApprox| |f| |y2Approx| |err| |bound| $)
1998
. #1#)
1999
(COND
2000
((EQL (CAR |y2New|) 1)
2001
(RETURN-FROM |ACPLOT;computeNextPt|
2002
(|ACPLOT;computeNextPt| |pSF| |dpdxSF| |dpdySF| |x| |y| |p0|
2003
|p1| |corners| (ABS (/ (- |x2| |x1|) 2)) |err| |bound| |crits|
2004
|bdry| $)))
2005
(T (LETT |y2| (CDR |y2New|) . #1#)))))
2006
(T
2007
(PROGN
2008
(LETT |y2| |y2Approx| . #1#)
2009
(LETT |f|
2010
(|ACPLOT;SFPolyToUPoly|
2011
(SPADCALL |pSF| |y| |y2| (|shellEntry| $ 177)) $)
2012
. #1#)
2013
(LETT |x2New| (|ACPLOT;newtonApprox| |f| |x2Approx| |err| |bound| $)
2014
. #1#)
2015
(COND
2016
((EQL (CAR |x2New|) 1)
2017
(RETURN-FROM |ACPLOT;computeNextPt|
2018
(|ACPLOT;computeNextPt| |pSF| |dpdxSF| |dpdySF| |x| |y| |p0|
2019
|p1| |corners| (ABS (/ (- |y2| |y1|) 2)) |err| |bound| |crits|
2020
|bdry| $)))
2021
(T (LETT |x2| (CDR |x2New|) . #1#))))))
2022
(LETT |pt| (|ACPLOT;makePt| |x2| |y2| $) . #1#)
2023
(EXIT
2024
(COND
2025
((NOT (NULL (STRING= |lookingFor| (|shellEntry| $ 19))))
2026
(CONS |pt| |lookingFor|))
2027
((NOT (NULL (STRING= |lookingFor| (|shellEntry| $ 20))))
2028
(PROGN
2029
(LETT |bdryPt| (|ACPLOT;findPtOnList| |pt| |bdry| $) . #1#)
2030
(COND
2031
((EQL (CAR |bdryPt|) 1) (|error| "couldn't find boundary point"))
2032
(T (CONS (CDR |bdryPt|) (|shellEntry| $ 20))))))
2033
(T
2034
(PROGN
2035
(LETT |critPt| (|ACPLOT;findPtOnList| |pt| |crits| $) . #1#)
2036
(COND ((EQL (CAR |critPt|) 1) (CONS |pt| (|shellEntry| $ 19)))
2037
(T (CONS (CDR |critPt|) (|shellEntry| $ 21)))))))))))))
2038
2039
(DEFUN |ACPLOT;newtonApprox| (|f| |a0| |err| |bound| $)
2040
(LET* ((|Df| (SPADCALL |f| (|shellEntry| $ 178)))
2041
(|oldApprox| |a0|)
2042
(|newApprox|
2043
(- |a0|
2044
(/ (SPADCALL |f| |a0| (|shellEntry| $ 130))
2045
(SPADCALL |Df| |a0| (|shellEntry| $ 130)))))
2046
(|i| 1))
2047
(SEQ
2048
(LOOP
2049
(COND ((NOT (< |err| (ABS (- |newApprox| |oldApprox|)))) (RETURN NIL))
2050
(T
2051
(COND
2052
((EQL |i| |bound|)
2053
(RETURN-FROM |ACPLOT;newtonApprox| (CONS 1 "failed")))
2054
(T
2055
(PROGN
2056
(SETQ |oldApprox| |newApprox|)
2057
(SETQ |newApprox|
2058
(- |oldApprox|
2059
(/ (SPADCALL |f| |oldApprox| (|shellEntry| $ 130))
2060
(SPADCALL |Df| |oldApprox|
2061
(|shellEntry| $ 130)))))
2062
(SETQ |i| (+ |i| 1))))))))
2063
(EXIT (CONS 0 |newApprox|)))))
2064
2065
(DEFUN |ACPLOT;listBranches;$L;41| (|acplot| $)
2066
(DECLARE (IGNORE $))
2067
(SVREF |acplot| 10))
2068
2069
(DEFUN |ACPLOT;coerce;$Of;42| (|acplot| $)
2070
(PROG (|ff| |ll|)
2071
(RETURN
2072
(LET* ((|pp| (SPADCALL (SVREF |acplot| 0) (|shellEntry| $ 183)))
2073
(|xx| (SPADCALL (SVREF |acplot| 1) (|shellEntry| $ 184)))
2074
(|yy| (SPADCALL (SVREF |acplot| 2) (|shellEntry| $ 184)))
2075
(|xLo| (SPADCALL (SVREF |acplot| 3) (|shellEntry| $ 185)))
2076
(|xHi| (SPADCALL (SVREF |acplot| 4) (|shellEntry| $ 185)))
2077
(|yLo| (SPADCALL (SVREF |acplot| 5) (|shellEntry| $ 185)))
2078
(|yHi| (SPADCALL (SVREF |acplot| 6) (|shellEntry| $ 185)))
2079
(|zip| (SPADCALL " = 0" (|shellEntry| $ 186)))
2080
(|com| (SPADCALL ", " (|shellEntry| $ 186)))
2081
(|les| (SPADCALL " <= " (|shellEntry| $ 186)))
2082
(|l|
2083
(LIST |pp| |zip| |com| |xLo| |les| |xx| |les| |xHi| |com| |yLo|
2084
|les| |yy| |les| |yHi|))
2085
(|f| NIL))
2086
(SEQ
2087
(LET ((#1=#:G1266 (SVREF |acplot| 10)))
2088
(LOOP
2089
(COND ((NOT (CONSP #1#)) (RETURN NIL))
2090
(T
2091
(PROGN
2092
(LETT |ll|
2093
(LET ((#2=#:G1267 (CAR #1#)) (#3=#:G1226 NIL))
2094
(LOOP
2095
(COND ((NOT (CONSP #2#)) (RETURN (|reverse!| #3#)))
2096
(T
2097
(SETQ #3#
2098
(CONS
2099
(SPADCALL (CAR #2#)
2100
(|shellEntry| $ 189))
2101
#3#))))
2102
(SETQ #2# (CDR #2#))))
2103
. #4=(|ACPLOT;coerce;$Of;42|))
2104
(SETQ |f|
2105
(CONS (SPADCALL |ll| (|shellEntry| $ 191)) |f|)))))
2106
(SETQ #1# (CDR #1#))))
2107
(LETT |ff|
2108
(SPADCALL (SPADCALL |l| (|shellEntry| $ 193))
2109
(SPADCALL |f| (|shellEntry| $ 191))
2110
(|shellEntry| $ 194))
2111
. #4#)
2112
(EXIT
2113
(SPADCALL (SPADCALL "ACPLOT" (|shellEntry| $ 186)) |ff|
2114
(|shellEntry| $ 194))))))))
2115
2116
(DEFUN |PlaneAlgebraicCurvePlot| ()
2117
(DECLARE (SPECIAL |$ConstructorCache|))
2118
(LET ((#1=#:G1268
2119
(|tableValue| |$ConstructorCache| '|PlaneAlgebraicCurvePlot|)))
2120
(COND (#1# (|CDRwithIncrement| (CDAR #1#)))
2121
(T
2122
(UNWIND-PROTECT
2123
(PROG1
2124
(CDDAR
2125
(SETF (|tableValue| |$ConstructorCache|
2126
'|PlaneAlgebraicCurvePlot|)
2127
(LIST
2128
(CONS NIL
2129
(CONS 1 (|PlaneAlgebraicCurvePlot;|))))))
2130
(SETQ #1# T))
2131
(COND
2132
((NOT #1#)
2133
(|tableRemove!| |$ConstructorCache|
2134
'|PlaneAlgebraicCurvePlot|))))))))
2135
2136
(DEFUN |PlaneAlgebraicCurvePlot;| ()
2137
(DECLARE (SPECIAL |$ConstructorCache|))
2138
(LET (($ (|newShell| 196)) (|pv$| (|buildPredVector| 0 0 NIL)))
2139
(PROGN
2140
(SETF (|shellEntry| $ 0) '(|PlaneAlgebraicCurvePlot|))
2141
(SETF (|shellEntry| $ 3) |pv$|)
2142
(|haddProp| |$ConstructorCache| '|PlaneAlgebraicCurvePlot| NIL (CONS 1 $))
2143
(|stuffDomainSlots| $)
2144
(SETF (|shellEntry| $ 6)
2145
(|Record| (|:| |poly| (|Polynomial| (|Integer|)))
2146
(|:| |xVar| (|Symbol|)) (|:| |yVar| (|Symbol|))
2147
(|:| |minXVal| (|Fraction| (|Integer|)))
2148
(|:| |maxXVal| (|Fraction| (|Integer|)))
2149
(|:| |minYVal| (|Fraction| (|Integer|)))
2150
(|:| |maxYVal| (|Fraction| (|Integer|)))
2151
(|:| |bdryPts|
2152
(|Record|
2153
(|:| |left| (|List| (|Point| (|DoubleFloat|))))
2154
(|:| |right| (|List| (|Point| (|DoubleFloat|))))
2155
(|:| |bottom| (|List| (|Point| (|DoubleFloat|))))
2156
(|:| |top| (|List| (|Point| (|DoubleFloat|))))))
2157
(|:| |hTanPts| (|List| (|Point| (|DoubleFloat|))))
2158
(|:| |vTanPts| (|List| (|Point| (|DoubleFloat|))))
2159
(|:| |branches|
2160
(|List| (|List| (|Point| (|DoubleFloat|)))))))
2161
(SETF (|shellEntry| $ 14) (SPADCALL 1 -6 10 (|shellEntry| $ 13)))
2162
(SETF (|shellEntry| $ 18) (SPADCALL 1 -3 10 (|shellEntry| $ 17)))
2163
(SETF (|shellEntry| $ 19) "nothing in particular")
2164
(SETF (|shellEntry| $ 20) "boundary point")
2165
(SETF (|shellEntry| $ 21) "critical point")
2166
(SETF (|shellEntry| $ 22) "bottom")
2167
(SETF (|shellEntry| $ 23) "top")
2168
$)))
2169
2170
(MAKEPROP '|PlaneAlgebraicCurvePlot| '|infovec|
2171
(LIST
2172
'#(NIL NIL NIL NIL NIL NIL '|Rep| (|PositiveInteger|) (0 . |One|)
2173
(|NonNegativeInteger|) (4 . |One|) (|Float|) (|Integer|)
2174
(8 . |float|) 'EPSILON (15 . -) (|DoubleFloat|) (20 . |float|)
2175
'PLOTERR 'NADA 'BDRY 'CRIT 'BOTTOM 'TOP (27 . |Zero|)
2176
(31 . |Zero|) (35 . |Zero|) (39 . |convert|) (44 . +)
2177
(|Point| 16) (|List| 16) (50 . |point|) (|PointPackage| 16)
2178
(55 . |yCoord|) (60 . |xCoord|) (65 . -) (71 . |abs|) (|Boolean|)
2179
(76 . <) (82 . |false|) (|Polynomial| 16) (86 . |zero?|)
2180
(|SparseUnivariatePolynomial| 16) (91 . |Zero|)
2181
(95 . |leadingCoefficient|) (100 . |totalDegree|)
2182
(105 . |monomial|) (111 . |reductum|) (116 . +) (|Fraction| 12)
2183
(|Polynomial| 49) (122 . |zero?|)
2184
(|SparseUnivariatePolynomial| 49) (127 . |Zero|)
2185
(131 . |leadingCoefficient|) (136 . |totalDegree|)
2186
(141 . |monomial|) (147 . |reductum|) (152 . +) (158 . |coerce|)
2187
(|PolynomialFunctions2| 12 16) (|Mapping| 16 12)
2188
(|Polynomial| 12) (163 . |map|) (169 . |coerce|)
2189
(|PolynomialFunctions2| 12 49) (|Mapping| 49 12) (174 . |map|)
2190
(180 . |coerce|) (185 . |coerce|) (190 . |convert|) (|List| 29)
2191
(195 . |nil|) (|Symbol|) (199 . |eval|) (|RealSolvePackage|)
2192
(|List| 11) (206 . |solve|) (212 . <) (218 . |cons|) (224 . <=)
2193
(230 . |first|) (235 . |second|) (240 . |true|) (244 . =)
2194
(250 . +) (256 . |max|) (262 . |min|) (268 . /) (274 . +)
2195
(|Segment| 49) (280 . |lo|) (285 . |hi|) (290 . <=) (|List| 73)
2196
(296 . |variables|) (301 . |#|) (306 . >) (312 . =)
2197
(318 . |member?|) (324 . |first|) (329 . |totalDegree|)
2198
(334 . |degree|) |ACPLOT;makeSketch;P2S2S$;27| (340 . =)
2199
(|List| 71) (346 . |nil|) (350 . |solve|) (356 . |nil|)
2200
(360 . |cons|) (366 . |null|) (371 . |cons|)
2201
(377 . |coefficient|) (384 . |ground|) (389 . *) (395 . -)
2202
(400 . /) (406 . <=) (|Segment| 16) (412 . |segment|)
2203
(418 . |first|) (423 . |rest|) (|String|) (428 . =) (434 . >=)
2204
(|Factored| 62) (440 . |coerce|) (445 . |numberOfFactors|)
2205
(450 . |differentiate|) (456 . -) (461 . |elt|) (|List| 76)
2206
(|List| 62) (467 . |realSolve|) (|Mapping| 37 16 16)
2207
(474 . |sort|) (480 . |elt|) (486 . |Zero|) (490 . =)
2208
(496 . |One|) (500 . |last|) (505 . |remove|) (511 . >)
2209
(|List| 118) (517 . |nil|) (521 . |cons|) (527 . =) (|Plot|)
2210
(|Mapping| 16 16) (533 . |plot|) (539 . |listBranches|)
2211
(544 . |first|) (|Mapping| 29 29) (549 . |map|)
2212
(555 . |nthFactor|) (561 . |append|) (567 . /) (573 . -)
2213
(579 . *) (585 . -) (590 . |append|) (596 . /) (602 . |min|)
2214
(608 . |min|) |ACPLOT;refine;$Df$;34| (612 . |null|)
2215
(617 . |not|) (622 . |first|) (627 . |second|) (632 . |third|)
2216
(637 . |eval|) (644 . |ground|) (649 . |member?|)
2217
(655 . |remove|) (661 . |second|) (666 . =) (672 . =)
2218
(678 . |eval|) (685 . |differentiate|) (690 . =) (696 . +)
2219
|ACPLOT;listBranches;$L;41| (|OutputForm|) (702 . |coerce|)
2220
(707 . |coerce|) (712 . |coerce|) (717 . |message|) (|List| 182)
2221
(722 . |nil|) (726 . |coerce|) (|List| $) (731 . |vconcat|)
2222
(736 . |cons|) (742 . |hconcat|) (747 . |vconcat|)
2223
|ACPLOT;coerce;$Of;42|)
2224
'#(|yRange| 753 |xRange| 758 |refine| 763 |makeSketch| 769
2225
|listBranches| 778 |coerce| 783)
2226
'NIL
2227
(CONS (|makeByteWordVec2| 1 '(0 0))
2228
(CONS '#(NIL NIL)
2229
(CONS
2230
'#((|PlottablePlaneCurveCategory|) (|CoercibleTo| 182))
2231
(|makeByteWordVec2| 195
2232
'(0 7 0 8 0 9 0 10 3 11 0 12 12 7
2233
13 1 12 0 0 15 3 16 0 12 12 7 17
2234
0 9 0 24 0 12 0 25 0 16 0 26 1 11
2235
16 0 27 2 16 0 0 0 28 1 29 0 30
2236
31 1 32 16 29 33 1 32 16 29 34 2
2237
16 0 0 0 35 1 16 0 0 36 2 16 37 0
2238
0 38 0 37 0 39 1 40 37 0 41 0 42
2239
0 43 1 40 16 0 44 1 40 9 0 45 2
2240
42 0 16 9 46 1 40 0 0 47 2 42 0 0
2241
0 48 1 50 37 0 51 0 52 0 53 1 50
2242
49 0 54 1 50 9 0 55 2 52 0 49 9
2243
56 1 50 0 0 57 2 52 0 0 0 58 1 16
2244
0 12 59 2 60 40 61 62 63 1 49 0
2245
12 64 2 65 50 66 62 67 1 16 0 49
2246
68 1 11 0 49 69 1 16 11 0 70 0 71
2247
0 72 3 50 0 0 73 49 74 2 75 76 50
2248
11 77 2 11 37 0 0 78 2 71 0 29 0
2249
79 2 11 37 0 0 80 1 76 11 0 81 1
2250
76 11 0 82 0 37 0 83 2 11 37 0 0
2251
84 2 11 0 0 0 85 2 11 0 0 0 86 2
2252
11 0 0 0 87 2 49 0 0 0 88 2 49 0
2253
0 0 89 1 90 49 0 91 1 90 49 0 92
2254
2 49 37 0 0 93 1 62 94 0 95 1 94
2255
9 0 96 2 9 37 0 0 97 2 9 37 0 0
2256
98 2 94 37 73 0 99 1 94 73 0 100
2257
1 62 9 0 101 2 62 9 0 73 102 2 73
2258
37 0 0 104 0 105 0 106 2 75 76 62
2259
11 107 0 30 0 108 2 30 0 16 0 109
2260
1 30 37 0 110 2 105 0 71 0 111 3
2261
62 0 0 73 9 112 1 62 12 0 113 2
2262
16 0 0 0 114 1 16 0 0 115 2 16 0
2263
0 0 116 2 16 37 0 0 117 2 118 0
2264
16 16 119 1 30 16 0 120 1 30 0 0
2265
121 2 122 37 0 0 123 2 16 37 0 0
2266
124 1 125 0 62 126 1 125 9 0 127
2267
2 62 0 0 73 128 1 62 0 0 129 2 42
2268
16 0 16 130 3 75 131 132 94 11
2269
133 2 30 0 134 0 135 2 52 49 0 49
2270
136 0 49 0 137 2 49 37 0 0 138 0
2271
16 0 139 1 30 16 0 140 2 30 0 16
2272
0 141 2 16 37 0 0 142 0 143 0 144
2273
2 143 0 118 0 145 2 16 37 0 0 146
2274
2 147 0 148 118 149 1 147 105 0
2275
150 1 105 71 0 151 2 71 0 152 0
2276
153 2 125 62 0 12 154 2 131 0 0 0
2277
155 2 49 0 12 12 156 2 49 0 0 0
2278
157 2 49 0 0 0 158 1 49 0 0 159 2
2279
71 0 0 0 160 2 16 0 0 12 161 2 16
2280
0 0 0 162 0 37 0 163 1 71 37 0
2281
165 1 37 0 0 166 1 71 29 0 167 1
2282
105 71 0 168 1 105 71 0 169 3 40
2283
0 0 94 30 170 1 40 16 0 171 2 71
2284
37 29 0 172 2 71 0 29 0 173 1 71
2285
29 0 174 2 29 37 0 0 175 2 71 37
2286
0 0 176 3 40 0 0 73 16 177 1 42 0
2287
0 178 2 7 37 0 0 179 2 7 0 0 0
2288
180 1 62 182 0 183 1 73 182 0 184
2289
1 49 182 0 185 1 182 0 122 186 0
2290
187 0 188 1 29 182 0 189 1 182 0
2291
190 191 2 187 0 182 0 192 1 182 0
2292
190 193 2 182 0 0 0 194 1 0 118 0
2293
1 1 0 118 0 1 2 0 0 0 16 164 5 0
2294
0 62 73 73 90 90 103 1 0 105 0
2295
181 1 0 182 0 195)))))
2296
'|lookupComplete|))
2297
2298
(SETF (|dbTemplate| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2299
#(NIL NIL NIL NIL NIL NIL '|Rep| (|PositiveInteger|) (0 . |One|)
2300
(|NonNegativeInteger|) (4 . |One|) (|Float|) (|Integer|)
2301
(8 . |float|) 'EPSILON (15 . -) (|DoubleFloat|) (20 . |float|)
2302
'PLOTERR 'NADA 'BDRY 'CRIT 'BOTTOM 'TOP (27 . |Zero|) (31 . |Zero|)
2303
(35 . |Zero|) (39 . |convert|) (44 . +) (|Point| 16) (|List| 16)
2304
(50 . |point|) (|PointPackage| 16) (55 . |yCoord|) (60 . |xCoord|)
2305
(65 . -) (71 . |abs|) (|Boolean|) (76 . <) (82 . |false|)
2306
(|Polynomial| 16) (86 . |zero?|) (|SparseUnivariatePolynomial| 16)
2307
(91 . |Zero|) (95 . |leadingCoefficient|) (100 . |totalDegree|)
2308
(105 . |monomial|) (111 . |reductum|) (116 . +) (|Fraction| 12)
2309
(|Polynomial| 49) (122 . |zero?|) (|SparseUnivariatePolynomial| 49)
2310
(127 . |Zero|) (131 . |leadingCoefficient|) (136 . |totalDegree|)
2311
(141 . |monomial|) (147 . |reductum|) (152 . +) (158 . |coerce|)
2312
(|PolynomialFunctions2| 12 16) (|Mapping| 16 12) (|Polynomial| 12)
2313
(163 . |map|) (169 . |coerce|) (|PolynomialFunctions2| 12 49)
2314
(|Mapping| 49 12) (174 . |map|) (180 . |coerce|) (185 . |coerce|)
2315
(190 . |convert|) (|List| 29) (195 . |nil|) (|Symbol|) (199 . |eval|)
2316
(|RealSolvePackage|) (|List| 11) (206 . |solve|) (212 . <)
2317
(218 . |cons|) (224 . <=) (230 . |first|) (235 . |second|)
2318
(240 . |true|) (244 . =) (250 . +) (256 . |max|) (262 . |min|)
2319
(268 . /) (274 . +) (|Segment| 49) (280 . |lo|) (285 . |hi|)
2320
(290 . <=) (|List| 73) (296 . |variables|) (301 . |#|) (306 . >)
2321
(312 . =) (318 . |member?|) (324 . |first|) (329 . |totalDegree|)
2322
(334 . |degree|) |ACPLOT;makeSketch;P2S2S$;27| (340 . =) (|List| 71)
2323
(346 . |nil|) (350 . |solve|) (356 . |nil|) (360 . |cons|)
2324
(366 . |null|) (371 . |cons|) (377 . |coefficient|) (384 . |ground|)
2325
(389 . *) (395 . -) (400 . /) (406 . <=) (|Segment| 16)
2326
(412 . |segment|) (418 . |first|) (423 . |rest|) (|String|) (428 . =)
2327
(434 . >=) (|Factored| 62) (440 . |coerce|) (445 . |numberOfFactors|)
2328
(450 . |differentiate|) (456 . -) (461 . |elt|) (|List| 76)
2329
(|List| 62) (467 . |realSolve|) (|Mapping| 37 16 16) (474 . |sort|)
2330
(480 . |elt|) (486 . |Zero|) (490 . =) (496 . |One|) (500 . |last|)
2331
(505 . |remove|) (511 . >) (|List| 118) (517 . |nil|) (521 . |cons|)
2332
(527 . =) (|Plot|) (|Mapping| 16 16) (533 . |plot|)
2333
(539 . |listBranches|) (544 . |first|) (|Mapping| 29 29)
2334
(549 . |map|) (555 . |nthFactor|) (561 . |append|) (567 . /)
2335
(573 . -) (579 . *) (585 . -) (590 . |append|) (596 . /)
2336
(602 . |min|) (608 . |min|) |ACPLOT;refine;$Df$;34| (612 . |null|)
2337
(617 . |not|) (622 . |first|) (627 . |second|) (632 . |third|)
2338
(637 . |eval|) (644 . |ground|) (649 . |member?|) (655 . |remove|)
2339
(661 . |second|) (666 . =) (672 . =) (678 . |eval|)
2340
(685 . |differentiate|) (690 . =) (696 . +)
2341
|ACPLOT;listBranches;$L;41| (|OutputForm|) (702 . |coerce|)
2342
(707 . |coerce|) (712 . |coerce|) (717 . |message|) (|List| 182)
2343
(722 . |nil|) (726 . |coerce|) (|List| $) (731 . |vconcat|)
2344
(736 . |cons|) (742 . |hconcat|) (747 . |vconcat|)
2345
|ACPLOT;coerce;$Of;42|))
2346
2347
(SETF (|dbLookupFunction| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2348
'|lookupComplete|)
2349
2350
(SETF (|dbConstructorForm| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2351
'(|PlaneAlgebraicCurvePlot|))
2352
2353
(SETF (|dbConstructorKind| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2354
'|domain|)
2355
2356
(SETF (|dbConstructorModemap| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2357
'(((|PlaneAlgebraicCurvePlot|)
2358
(|Join| (|PlottablePlaneCurveCategory|)
2359
(CATEGORY |domain|
2360
(SIGNATURE |makeSketch|
2361
($ (|Polynomial| (|Integer|)) (|Symbol|) (|Symbol|)
2362
(|Segment| (|Fraction| (|Integer|)))
2363
(|Segment| (|Fraction| (|Integer|)))))
2364
(SIGNATURE |refine| ($ $ (|DoubleFloat|))))))
2365
(T |PlaneAlgebraicCurvePlot|)))
2366
2367
(SETF (|dbDualSignature| (|constructorDB| '|PlaneAlgebraicCurvePlot|)) '(NIL))
2368
2369
(SETF (|dbSourceFile| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2370
'"acplot.spad")
2371
2372
(SETF (|dbModemaps| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2373
'((|makeSketch| (*1 *1 *2 *3 *3 *4 *4)
2374
(AND (|isDomain| *2 (|Polynomial| (|Integer|)))
2375
(|isDomain| *3 (|Symbol|))
2376
(|isDomain| *4 (|Segment| (|Fraction| (|Integer|))))
2377
(|isDomain| *1 (|PlaneAlgebraicCurvePlot|))))
2378
(|refine| (*1 *1 *1 *2)
2379
(AND (|isDomain| *2 (|DoubleFloat|))
2380
(|isDomain| *1 (|PlaneAlgebraicCurvePlot|))))))
2381
2382
(SETF (|dbOperations| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2383
'((|yRange| (#1=((|Segment| #2=(|DoubleFloat|)) $) NIL T ELT))
2384
(|xRange| (#1# NIL T ELT))
2385
(|refine| (($ $ (|DoubleFloat|)) 164 T ELT))
2386
(|makeSketch|
2387
(($ (|Polynomial| (|Integer|)) (|Symbol|) (|Symbol|)
2388
(|Segment| (|Fraction| (|Integer|)))
2389
(|Segment| (|Fraction| (|Integer|))))
2390
103 T ELT))
2391
(|listBranches| (((|List| (|List| (|Point| #2#))) $) 181 T ELT))
2392
(|coerce| (((|OutputForm|) $) 195 T ELT))))
2393
2394
(SETF (|dbOperationTable| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2395
#(|yRange| 753 |xRange| 758 |refine| 763 |makeSketch| 769
2396
|listBranches| 778 |coerce| 783))
2397
2398
(SETF (|dbCapsuleDefinitions| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2399
'((|ACPLOT;coerce;$Of;42| ((|OutputForm|) $))
2400
(|ACPLOT;listBranches;$L;41|
2401
((|List| (|List| (|Point| (|DoubleFloat|)))) $))
2402
(|ACPLOT;refine;$Df$;34| ($ $ (|DoubleFloat|)))
2403
(|ACPLOT;makeSketch;P2S2S$;27|
2404
($ (|Polynomial| (|Integer|)) (|Symbol|) (|Symbol|)
2405
(|Segment| (|Fraction| (|Integer|)))
2406
(|Segment| (|Fraction| (|Integer|)))))))
2407
2408
(SETF (|dbAbbreviation| (|constructorDB| '|PlaneAlgebraicCurvePlot|)) 'ACPLOT)
2409
2410
(SETF (|dbPrincipals| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2411
'(((|PlottablePlaneCurveCategory|) . T)))
2412
2413
(SETF (|dbAncestors| (|constructorDB| '|PlaneAlgebraicCurvePlot|))
2414
'(((|CoercibleTo| (|OutputForm|)) . T)
2415
((|PlottablePlaneCurveCategory|) . T)))
2416
2417