1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
|
% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved.
% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk.
\texht{\setcounter{chapter}{6}}{} % Chapter 7
\newcommand{\optArg}[1]{{{\tt [}{#1}{\tt ]}}}
\newcommand{\argDef}[1]{{\tt ({#1})}}
\newcommand{\funSyntax}[2]{\axiomFun{#1}{\tt ({\small\it{#2}})}}
\newcommand{\funArgs}[1]{{\tt ({\small\it {#1}})}\newline}
%
\newcommand{\ugGraphTitle}{Graphics}
\newcommand{\ugGraphNumber}{7.}
%
% =====================================================================
\begin{page}{ugGraphPage}{7. Graphics}
% =====================================================================
\beginscroll
%
This chapter shows how to use the \Language{} graphics facilities
%-% \HDindex{graphics}{ugGraphPage}{7.}{Graphics}
under the X Window System.
\Language{} has \twodim{} and \threedim{} drawing and rendering
packages that allow the drawing, coloring, transforming, mapping,
clipping, and combining of graphic output from \Language{}
computations.
This facility is particularly useful for investigating problems in
areas such as topology.
The graphics package is capable of plotting functions of one or
more variables or plotting parametric surfaces and curves.
Various coordinate systems are also available, such as polar and
spherical.
A graph is displayed in a viewport window and it has a
%-% \HDindex{viewport}{ugGraphPage}{7.}{Graphics}
control-panel that uses interactive mouse commands.
PostScript and other output forms are available so that \Language{}
%-% \HDindex{PostScript}{ugGraphPage}{7.}{Graphics}
images can be printed or used by other programs.\footnote{PostScript
is a trademark of Adobe Systems Incorporated, registered in the United
States.}
\beginmenu
\menudownlink{{7.1. Two-Dimensional Graphics}}{ugGraphTwoDPage}
\menudownlink{{7.2. Three-Dimensional Graphics}}{ugGraphThreeDPage}
\endmenu
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphTwoDTitle}{Two-Dimensional Graphics}
\newcommand{\ugGraphTwoDNumber}{7.1.}
%
% =====================================================================
\begin{page}{ugGraphTwoDPage}{7.1. Two-Dimensional Graphics}
% =====================================================================
\beginscroll
%
The \Language{} \twodim{} graphics package provides the ability to
%-% \HDindex{graphics!two-dimensional}{ugGraphTwoDPage}{7.1.}{Two-Dimensional Graphics}
display
%
\indent{4}
\beginitems
%
\item[-] curves defined by functions of a single real variable
%
\item[-] curves defined by parametric equations
%
\item[-] implicit non-singular curves defined by polynomial equations
%
\item[-] planar graphs generated from lists of point components.
\enditems
\indent{0}
These graphs
can be modified by specifying various options, such as
calculating points in the polar
coordinate system or changing the size of the graph viewport window.
\beginmenu
\menudownlink{{7.1.1. Plotting Two-Dimensional Functions of One Variable}}{ugGraphTwoDPlotPage}
\menudownlink{{7.1.2. Plotting Two-Dimensional Parametric Plane Curves}}{ugGraphTwoDParPage}
\menudownlink{{7.1.3. Plotting Plane Algebraic Curves}}{ugGraphTwoDPlanePage}
\menudownlink{{7.1.4. Two-Dimensional Options}}{ugGraphTwoDOptionsPage}
\menudownlink{{7.1.5. Color}}{ugGraphColorPage}
\menudownlink{{7.1.6. Palette}}{ugGraphColorPalettePage}
\menudownlink{{7.1.7. Two-Dimensional Control-Panel}}{ugGraphTwoDControlPage}
\menudownlink{{7.1.8. Operations for Two-Dimensional Graphics}}{ugGraphTwoDopsPage}
\menudownlink{{7.1.9. Addendum: Building Two-Dimensional Graphs}}{ugGraphTwoDbuildPage}
\menudownlink{{7.1.10. Addendum: Appending a Graph to a Viewport Window Containing a Graph}}{ugGraphTwoDappendPage}
\endmenu
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphTwoDPlotTitle}{Plotting Two-Dimensional Functions of One Variable}
\newcommand{\ugGraphTwoDPlotNumber}{7.1.1.}
%
% =====================================================================
\begin{page}{ugGraphTwoDPlotPage}{7.1.1. Plotting Two-Dimensional Functions of One Variable}
% =====================================================================
\beginscroll
%-% \HDindex{curve!one variable function}{ugGraphTwoDPlotPage}{7.1.1.}{Plotting Two-Dimensional Functions of One Variable}
The first kind of \twodim{} graph is that of a curve defined by a function
\axiom{y = f(x)} over a finite interval of the \axiom{x} axis.
%
\beginImportant
The general format for drawing a function defined by a formula
\axiom{f(x)} is:
%
\centerline{{{\tt draw(f(x), x = a..b, {\it options})}}}
where \axiom{a..b} defines the range of \axiom{x}, and where
{\it options} prescribes zero or more options as described in
\downlink{``\ugGraphTwoDOptionsTitle''}{ugGraphTwoDOptionsPage} in Section \ugGraphTwoDOptionsNumber\ignore{ugGraphTwoDOptions}.
An example of an option is \axiom{curveColor == bright red().}
An alternative format involving functions \axiom{f} and \axiom{g}
is also available.
\endImportant
A simple way to plot a function is to use a formula.
The first argument is the formula.
For the second argument, write the name of the independent variable (here, \axiom{x}),
followed by an \spadSyntax{=}, and the range of values.
\psXtc{
Display this formula over the range
\texht{$0 \leq x \leq 6$}{0 <= x <= 6}.
\Language{} converts your formula to a compiled
function so that the results can be computed
quickly and efficiently.
}{
\graphpaste{draw(sin(tan(x)) - tan(sin(x)),x = 0..6)}
}{
\epsffile[0 0 295 295]{../ps/2D1VarA.ps}
}
Notice that \Language{} compiled the function before the graph was put
on the screen.
\psXtc{
Here is the same graph on a different interval.
This time we give the graph a title.
}{
\graphpaste{draw(sin(tan(x)) - tan(sin(x)),x = 10..16)}
}{
%window was 300 x 300
\epsffile[0 0 295 295]{../ps/2D1VarB.ps}
}
%
Once again the formula is converted to a compiled function before
any points were computed.
If you want to graph the same function on several intervals, it is
a good idea to define the function first so that the function has
to be compiled only once.
\xtc{
This time we first define the function.
}{
\spadpaste{f(x) == (x-1)*(x-2)*(x-3) \bound{f}}
}
\psXtc{
To draw the function, the first argument is its name
and the second is just the range with no independent variable.
}{
\graphpaste{draw(f, 0..4) \free{f}}
}{
\epsffile[0 0 295 295]{../ps/2D1VarD.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphTwoDParTitle}{Plotting Two-Dimensional Parametric Plane Curves}
\newcommand{\ugGraphTwoDParNumber}{7.1.2.}
%
% =====================================================================
\begin{page}{ugGraphTwoDParPage}{7.1.2. Plotting Two-Dimensional Parametric Plane Curves}
% =====================================================================
\beginscroll
The second kind of \twodim{} graph is that of
%-% \HDindex{parametric plane curve}{ugGraphTwoDParPage}{7.1.2.}{Plotting Two-Dimensional Parametric Plane Curves}
curves produced by parametric equations.
%-% \HDindex{curve!parametric plane}{ugGraphTwoDParPage}{7.1.2.}{Plotting Two-Dimensional Parametric Plane Curves}
Let \axiom{x = f(t)} and \axiom{y = g(t)} be formulas or two
functions \axiom{f} and \axiom{g} as the parameter \axiom{t} ranges
over an interval \axiom{[a,b]}.
The function \axiomFun{curve} takes the two functions \axiom{f} and
\axiom{g} as its parameters.
\beginImportant
The general format for drawing a \twodim{} plane curve defined by
parametric formulas \axiom{x = f(t)} and \axiom{y = g(t)} is:
%
\centerline{{{\tt draw(curve(f(t), g(t)), t = a..b, {\it options})}}}
where \axiom{a..b} defines the range of the independent variable \axiom{t},
and where {\it options} prescribes zero or more options as
described in \downlink{``\ugGraphThreeDOptionsTitle''}{ugGraphThreeDOptionsPage} in Section \ugGraphThreeDOptionsNumber\ignore{ugGraphThreeDOptions}.
An example of an option is \axiom{curveColor == bright red().}
\endImportant
Here's an example:
\psXtc{
Define a parametric curve using a range involving
\axiom{\%pi}, \Language{}'s way of saying \texht{$\pi$}{``pi''}.
For parametric curves, \Language{} compiles two
functions, one for each of the functions \axiom{f} and \axiom{g}.
}{
\graphpaste{draw(curve(sin(t)*sin(2*t)*sin(3*t), sin(4*t)*sin(5*t)*sin(6*t)), t = 0..2*\%pi)}
}{
\epsffile[0 0 295 295]{../ps/2DppcA.ps}
}
%
%
\psXtc{
The title may be an arbitrary string and is an
optional argument to the \axiomFun{draw} command.
}{
\graphpaste{draw(curve(cos(t), sin(t)), t = 0..2*\%pi)}
}{
\epsffile[0 0 295 295]{../ps/2DppcB.ps}
}
%
If you plan on plotting \axiom{x = f(t)}, \axiom{y = g(t)} as \axiom{t} ranges over
several intervals, you may want to define functions \axiom{f} and \axiom{g} first, so
that they need not be recompiled every time you create a new graph.
Here's an example:
\xtc{
As before, you can first define the functions you wish to draw.
}{
\spadpaste{f(t:DFLOAT):DFLOAT == sin(3*t/4) \bound{f}}
}
\xtc{
\Language{} compiles them to map \axiomType{DoubleFloat}
values to \axiomType{DoubleFloat} values.
}{
\spadpaste{g(t:DFLOAT):DFLOAT == sin(t) \bound{g}}
}
\psXtc{
Give to {\tt curve} the names of the functions,
then write the range without the name of the
independent variable.
}{
\graphpaste{draw(curve(f,g),0..\%pi) \free{f g}}
}{
\epsffile[0 0 295 295]{../ps/2DppcC.ps}
}
%
%
\psXtc{
Here is another look at the same curve but over a different
range. Notice that \axiom{f} and \axiom{g} are not recompiled.
Also note that \Language{} provides a default title based on
the first function specified in \axiomFun{curve}.
}{
\graphpaste{draw(curve(f,g),-4*\%pi..4*\%pi) \free{f g}}
}{
\epsffile[0 0 295 295]{../ps/2DppcE.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphTwoDPlaneTitle}{Plotting Plane Algebraic Curves}
\newcommand{\ugGraphTwoDPlaneNumber}{7.1.3.}
%
% =====================================================================
\begin{page}{ugGraphTwoDPlanePage}{7.1.3. Plotting Plane Algebraic Curves}
% =====================================================================
\beginscroll
A third kind of \twodim{} graph is a non-singular ``solution curve''
%-% \HDindex{curve!plane algebraic}{ugGraphTwoDPlanePage}{7.1.3.}{Plotting Plane Algebraic Curves}
in a rectangular region of the plane.
A solution curve is a curve defined by a polynomial equation
\axiom{p(x,y) = 0}.
%-% \HDindex{plane algebraic curve}{ugGraphTwoDPlanePage}{7.1.3.}{Plotting Plane Algebraic Curves}
Non-singular means that the curve is ``smooth'' in that it does not
cross itself or come to a point (cusp).
Algebraically, this means that for any point \axiom{(x,y)} on the curve,
that is, a point such that \axiom{p(x,y) = 0}, the partial derivatives
\texht{${{\partial p}\over{\partial x}}(x,y)$ and
${{\partial p}\over{\partial y}}(x,y)$}{\axiom{dp/dx(x,y)}
and \axiom{dp/dy(a,b)}}
are not both zero.
%-% \HDindex{curve!smooth}{ugGraphTwoDPlanePage}{7.1.3.}{Plotting Plane Algebraic Curves}
%-% \HDindex{curve!non-singular}{ugGraphTwoDPlanePage}{7.1.3.}{Plotting Plane Algebraic Curves}
%-% \HDindex{smooth curve}{ugGraphTwoDPlanePage}{7.1.3.}{Plotting Plane Algebraic Curves}
%-% \HDindex{non-singular curve}{ugGraphTwoDPlanePage}{7.1.3.}{Plotting Plane Algebraic Curves}
%
\beginImportant
The general format for drawing a non-singular solution curve
given by a polynomial of the form \axiom{p(x,y) = 0} is:
%
\centerline{{{\tt draw(p(x,y) = 0, x, y, range == [a..b, c..d], {\it options})}}}
where the second and third arguments name the first and second
independent variables of \axiom{p}.
A {\tt range} option is always given to designate a bounding
rectangular region of the plane \texht{$a \leq x \leq b, c \leq y
\leq d$}{a <= x <= b, c <= y <= d}.
Zero or more additional options as described in
\downlink{``\ugGraphTwoDOptionsTitle''}{ugGraphTwoDOptionsPage} in Section \ugGraphTwoDOptionsNumber\ignore{ugGraphTwoDOptions} may be given.
\endImportant
\xtc{
We require that the polynomial has rational or integral coefficients.
Here is an algebraic curve example (``Cartesian ovals''):
%-% \HDindex{Cartesian!ovals}{ugGraphTwoDPlanePage}{7.1.3.}{Plotting Plane Algebraic Curves}
}{
\spadpaste{p := ((x**2 + y**2 + 1) - 8*x)**2 - (8*(x**2 + y**2 + 1)-4*x-1) \bound{p}}
}
\psXtc{
The first argument is always expressed as an equation of the form \axiom{p = 0}
where \axiom{p} is a polynomial.
}{
\graphpaste{draw(p = 0, x, y, range == [-1..11, -7..7]) \free{p}}
}{
\epsffile[0 0 295 295]{../ps/2DpacA.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphTwoDOptionsTitle}{Two-Dimensional Options}
\newcommand{\ugGraphTwoDOptionsNumber}{7.1.4.}
%
% =====================================================================
\begin{page}{ugGraphTwoDOptionsPage}{7.1.4. Two-Dimensional Options}
% =====================================================================
\beginscroll
The \axiomFun{draw} commands take an optional list of options,
such as {\tt title} shown above.
Each option is given by the syntax: {\it name} {\tt ==} {\it value}.
Here is a list of the available options in the order that they are
described below.
\table{ {adaptive} {clip} {unit} {clip} {curveColor} {range}
{toScale} {pointColor} {coordinates}}
The \axiom{adaptive} option turns adaptive plotting on or off.
%-% \HDindex{adaptive plotting}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
Adaptive plotting uses an algorithm that traverses a graph and computes
more points for those parts of the graph with high curvature.
The higher the curvature of a region is, the more points the algorithm
computes.
%-% \HDindex{graphics!2D options!adaptive}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
%
%
\psXtc{
The {\tt adaptive} option is normally on.
Here we turn it off.
}{
\graphpaste{draw(sin(1/x),x=-2*\%pi..2*\%pi, adaptive == false)}
}{
\epsffile[0 0 295 295]{../ps/2DOptAd.ps}
}
%
%
\psXtc{
The {\tt clip} option turns clipping on or off.
%-% \HDindex{graphics!2D options!clipping}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
If on, large values are cut off according to
\axiomFunFrom{clipPointsDefault}{GraphicsDefaults}.
}{
\graphpaste{draw(tan(x),x=-2*\%pi..2*\%pi, clip == true)}
}{
\epsffile[0 0 295 295]{../ps/2DOptCp.ps}
}
%
%
\psXtc{
Option {\tt toScale} does plotting to scale if {\tt true} or uses
the entire viewport if {\tt false}.
The default can be determined using
\axiomFunFrom{drawToScale}{GraphicsDefaults}.
%-% \HDindex{graphics!2D options!to scale}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
}{
\graphpaste{draw(sin(x),x=-\%pi..\%pi, toScale == true, unit == [1.0,1.0])}
}{
\epsffile[0 0 295 295]{../ps/2DOptSc.ps}
}
%
%
\psXtc{
Option {\tt clip} with a range sets point clipping of a graph within the
%-% \HDindex{graphics!2D options!clip in a range}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
ranges specified in the list \axiom{[x range,y range]}.
%-% \HDindex{clipping}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
If only one range is specified, clipping applies to the y-axis.
}{
\graphpaste{draw(sec(x),x=-2*\%pi..2*\%pi, clip == [-2*\%pi..2*\%pi,-\%pi..\%pi], unit == [1.0,1.0])}
}{
\epsffile[0 0 295 295]{../ps/2DOptCpR.ps}
}
%
\psXtc{
Option {\tt curveColor} sets the color of the graph curves or lines to be the
%-% \HDindex{graphics!2D options!curve color}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
indicated palette color
%-% \HDindex{curve!color}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
(see \downlink{``\ugGraphColorTitle''}{ugGraphColorPage} in Section \ugGraphColorNumber\ignore{ugGraphColor} and \downlink{``\ugGraphColorPaletteTitle''}{ugGraphColorPalettePage} in Section \ugGraphColorPaletteNumber\ignore{ugGraphColorPalette}).
%-% \HDindex{color!curve}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
}{
\graphpaste{draw(sin(x),x=-\%pi..\%pi, curveColor == bright red())}
}{
\epsffile[0 0 295 295]{../ps/2DOptCvC.ps}
}
%
\psXtc{
Option {\tt pointColor}
sets the color of the graph points to the indicated
%-% \HDindex{graphics!2D options!point color}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
palette color
(see \downlink{``\ugGraphColorTitle''}{ugGraphColorPage} in Section \ugGraphColorNumber\ignore{ugGraphColor} and \downlink{``\ugGraphColorPaletteTitle''}{ugGraphColorPalettePage} in Section \ugGraphColorPaletteNumber\ignore{ugGraphColorPalette}).
%-% \HDindex{color!point}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
}{
\graphpaste{draw(sin(x),x=-\%pi..\%pi, pointColor == pastel yellow())}
}{
\epsffile[0 0 295 295]{../ps/2DOptPtC.ps}
}
%
\psXtc{
Option {\tt unit} sets the intervals at which the axis units are plotted
%-% \HDindex{graphics!2D options!set units}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
according to the indicated steps [\axiom{x} interval, \axiom{y} interval].
}{
\graphpaste{draw(curve(9*sin(3*t/4),8*sin(t)), t = -4*\%pi..4*\%pi, unit == [2.0,1.0])}
}{
\epsffile[0 0 295 295]{../ps/2DOptUt.ps}
}
%
%
\psXtc{
Option {\tt range} sets the range of variables in a graph to be
within the ranges
%-% \HDindex{graphics!2D options!range}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
for solving plane algebraic curve plots.
}{
\graphpaste{draw(y**2 + y - (x**3 - x) = 0, x, y, range == [-2..2,-2..1], unit==[1.0,1.0])}
}{
\epsffile[0 0 295 295]{../ps/2DOptRgA.ps}
}
%
%
\psXtc{
A second example of a solution plot.
}{
\graphpaste{draw(x**2 + y**2 = 1, x, y, range == [-3/2..3/2,-3/2..3/2], unit==[0.5,0.5])}
}{
\epsffile[0 0 295 295]{../ps/2DOptRgB.ps}
}
%
%
\psXtc{
Option \axiom{coordinates} indicates the coordinate system
in which the graph
%-% \HDindex{graphics!2D options!coordinates}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
is plotted.
The default is to use the Cartesian coordinate system.
%-% \HDindex{Cartesian!coordinate system}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
For more details, see \downlink{``\ugGraphCoordTitle''}{ugGraphCoordPage} in Section \ugGraphCoordNumber\ignore{ugGraphCoord} \texht{.}{or
\axiomType{CoordinateSystems}.}
%-% \HDindex{coordinate system!Cartesian}{ugGraphTwoDOptionsPage}{7.1.4.}{Two-Dimensional Options}
}{
\graphpaste{draw(curve(sin(5*t),t),t=0..2*\%pi, coordinates == polar)}
}{
\epsffile[0 0 295 295]{../ps/2DOptPlr.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphColorTitle}{Color}
\newcommand{\ugGraphColorNumber}{7.1.5.}
%
% =====================================================================
\begin{page}{ugGraphColorPage}{7.1.5. Color}
% =====================================================================
\beginscroll
The domain \axiomType{Color}
%-% \HDexptypeindex{Color}{ugGraphColorPage}{7.1.5.}{Color}
provides operations for manipulating
%-% \HDindex{graphics!color}{ugGraphColorPage}{7.1.5.}{Color}
colors in \twodim{} graphs.
%-% \HDindex{color}{ugGraphColorPage}{7.1.5.}{Color}
Colors are objects of \axiomType{Color}.
Each color has a {\it hue} and a {\it weight}.
%-% \HDindex{hue}{ugGraphColorPage}{7.1.5.}{Color}
Hues are represented by integers that range from \axiom{1} to the
\axiomFunFrom{numberOfHues()}{Color}, normally
%-% \HDindex{graphics!color!number of hues}{ugGraphColorPage}{7.1.5.}{Color}
\axiom{27}.
%\footnote{Use \axiomFun{colorDef} to
%change these values to any range you want for a given \threedim{} viewport}
%-% \HDindex{weight}{ugGraphColorPage}{7.1.5.}{Color}
Weights are floats and have the value \axiom{1.0} by default.
%
\indent{0}
\beginitems
%
\item[\axiomFun{color}]\funArgs{integer}
creates a color of hue {\it integer} and weight \axiom{1.0}.
%
\item[\axiomFun{hue}]\funArgs{color}
returns the hue of {\it color} as an integer.
%-% \HDindex{graphics!color!hue function}{ugGraphColorPage}{7.1.5.}{Color}
%
\item[\axiomFun{red}]\funArgs{},
\funSyntax{blue}{},
\funSyntax{green}{}, and \funSyntax{yellow}{}
%-% \HDindex{graphics!color!primary color functions}{ugGraphColorPage}{7.1.5.}{Color}
create colors of that hue with weight \axiom{1.0}.
%
\item[\subscriptIt{color}{1} {\tt +} \subscriptIt{color}{2}] returns the
color that results from additively combining the indicated
\subscriptIt{color}{1} and \subscriptIt{color}{2}.
Color addition is not commutative: changing the order of the arguments
produces different results.
%
\item[{\it integer} {\tt *} {\it color}]
changes the weight of {\it color} by {\it integer}
without affecting its hue.
%-% \HDindex{graphics!color!multiply function}{ugGraphColorPage}{7.1.5.}{Color}
For example,
\axiom{red() + 3*yellow()} produces a color closer to yellow than to red.
Color multiplication is not associative: changing the order of grouping
%-% \HDindex{color!multiplication}{ugGraphColorPage}{7.1.5.}{Color}
produces different results.
\enditems
\indent{0}
%
\psXtc{
These functions can be used to change the point and curve colors
for two- and \threedim{} graphs.
Use the {\tt pointColor} option for points.
}{
\graphpaste{draw(x**2,x=-1..1,pointColor == green())}
}{
\epsffile[0 0 295 295]{../ps/23DColA.ps}
}
%
\psXtc{
Use the {\tt curveColor} option for curves.
}{
\graphpaste{draw(x**2,x=-1..1,curveColor == color(13) + 2*blue())}
}{
\epsffile[0 0 295 295]{../ps/23DColB.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphColorPaletteTitle}{Palette}
\newcommand{\ugGraphColorPaletteNumber}{7.1.6.}
%
% =====================================================================
\begin{page}{ugGraphColorPalettePage}{7.1.6. Palette}
% =====================================================================
\beginscroll
%-% \HDindex{graphics!palette}{ugGraphColorPalettePage}{7.1.6.}{Palette}
Domain \axiomType{Palette} is the domain of shades of colors:
\axiomFun{dark}, \axiomFun{dim}, \axiomFun{bright}, \axiomFun{pastel}, and \axiomFun{light},
designated by the integers \axiom{1} through \axiom{5}, respectively.
%-% \HDexptypeindex{Palette}{ugGraphColorPalettePage}{7.1.6.}{Palette}
\xtc{
Colors are normally ``bright.''
}{
\spadpaste{shade red()}
}
\xtc{
To change the shade of a color, apply the name of a shade to it.
%-% \HDindex{color!shade}{ugGraphColorPalettePage}{7.1.6.}{Palette}
%-% \HDindex{shade}{ugGraphColorPalettePage}{7.1.6.}{Palette}
}{
\spadpaste{myFavoriteColor := dark blue() \bound{mfc}}
}
\xtc{
The expression \axiom{shade(color)}
returns the value of a shade of \axiom{color}.
}{
\spadpaste{shade myFavoriteColor \free{mfc}}
}
\xtc{
The expression \axiom{hue(color)} returns its hue.
}{
\spadpaste{hue myFavoriteColor \free{mfc}}
}
\psXtc{
Palettes can be used in specifying colors in \twodim{} graphs.
}{
\graphpaste{draw(x**2,x=-1..1,curveColor == dark blue())}
}{
\epsffile[0 0 295 295]{../ps/23DPal.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphTwoDControlTitle}{Two-Dimensional Control-Panel}
\newcommand{\ugGraphTwoDControlNumber}{7.1.7.}
%
% =====================================================================
\begin{page}{ugGraphTwoDControlPage}{7.1.7. Two-Dimensional Control-Panel}
% =====================================================================
\beginscroll
%-% \HDindex{graphics!2D control-panel}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
Once you have created a viewport, move your mouse to the viewport and click
with your left mouse button to display a control-panel.
The panel is displayed on the side of the viewport closest to
where you clicked. Each of the buttons which toggle on and off show the
current state of the graph.
\subsubsection{Transformations}
%-% \HDindex{graphics!2D control-panel!transformations}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
Object transformations are executed from the control-panel by mouse-activated
potentiometer windows.
%
\indent{0}
\beginitems
%
\item[Scale:] To scale a graph, click on a mouse button
%-% \HDindex{graphics!2D control-panel!scale}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
within the {\bf Scale} window in the upper left corner of the control-panel.
The axes along which the scaling is to occur are indicated by setting the
toggles above the arrow.
With {\tt X On} and {\tt Y On} appearing, both axes are selected and scaling
is uniform.
If either is not selected, for example, if {\tt X Off} appears, scaling is
non-uniform.
%
\item[Translate:] To translate a graph, click the mouse in the
%-% \HDindex{graphics!2D control-panel!translate}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
{\bf Translate} window in the direction you wish the graph to move.
This window is located in the upper right corner of the control-panel.
Along the top of the {\bf Translate} window are two buttons for selecting
the direction of translation.
Translation along both coordinate axes results when {\tt X On} and {\tt Y
On} appear or along one axis when one is on, for example, {\tt X On} and
{\tt Y Off} appear.
\enditems
\indent{0}
\subsubsection{Messages}
%-% \HDindex{graphics!2D control-panel!messages}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
The window directly below the transformation potentiometer windows is
used to display system messages relating to the viewport and the control-panel.
The following format is displayed: \newline
%
\centerline{{[scaleX, scaleY] \axiom{>}graph\axiom{<} [translateX, translateY] \newline}}
The two values to the left show the scale factor along the {\tt X} and
{\tt Y} coordinate axes. The two values to the right show the distance of
translation from the center in the {\tt X} and {\tt Y} directions. The number
in the center shows which graph in the viewport this data pertains to.
When multiple graphs exist in the same viewport,
the graph must be selected (see ``Multiple Graphs,'' below) in
order for its transformation data to be shown, otherwise the number
is 1.
\subsubsection{Multiple Graphs}
%-% \HDindex{graphics!2D control-panel!multiple graphs}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
The {\bf Graphs} window contains buttons that allow the placement
of \twodim{} graphs into one of nine available slots in any other
\twodim{} viewport.
In the center of the window are numeral buttons from one to nine
that show whether a graph is displayed in the viewport.
Below each number button is a button showing whether a graph
that is present is selected for application of some
transformation.
When the caret symbol is displayed, then the graph in that slot
will be manipulated.
Initially, the graph for which the viewport is created occupies
the first slot, is displayed, and is selected.
%
%
\indent{0}
\beginitems
%
\item[Clear:] The {\bf Clear} button deselects every viewport graph slot.
%-% \HDindex{graphics!2D control-panel!clear}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
A graph slot is reselected by selecting the button below its number.
%
\item[Query:] The {\bf Query} button is used to display the scale and
%-% \HDindex{graphics!2D control-panel!query}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
translate data for the indicated graph. When this button is selected the
message ``Click on the graph to query'' appears. Select a slot
number button from the {\bf Graphs} window. The scaling factor and translation
offset of the graph are then displayed in the message window.
%
\item[Pick:] The {\bf Pick} button is used to select a graph
%-% \HDindex{graphics!2D control-panel!pick}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
to be placed or dropped into the indicated viewport. When this button is
selected, the message ``Click on the graph to pick'' appears.
Click on the slot with the graph number of the desired
graph. The graph information is held waiting for
you to execute a {\bf Drop} in some other graph.
%
\item[Drop:] Once a graph has been picked up using the {\bf Pick} button,
%-% \HDindex{graphics!2D control-panel!drop}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
the {\bf Drop} button places it into a new viewport slot.
The message ``Click on the graph to drop'' appears in the message
window when the {\bf Drop} button is selected.
By selecting one of the slot number buttons in the {\bf Graphs}
window, the graph currently being held is dropped into this slot
and displayed.
\enditems
\indent{0}
\subsubsection{Buttons}
%-% \HDindex{graphics!2D control-panel!buttons}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
%
\indent{0}
\beginitems
%
\item[Axes] turns the coordinate axes on or off.
%-% \HDindex{graphics!2D control-panel!axes}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
%
\item[Units] turns the units along the {\tt x}
and {\tt y} axis on or off.
%-% \HDindex{graphics!2D control-panel!units}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
%
\item[Box] encloses the area of the viewport graph
in a bounding box, or removes the box if already enclosed.
%-% \HDindex{graphics!2D control-panel!box}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
%
\item[Pts] turns on or off the display of points.
%-% \HDindex{graphics!2D control-panel!points}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
%
\item[Lines] turns on or off the display
of lines connecting points.
%-% \HDindex{graphics!2D control-panel!lines}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
%
\item[PS] writes the current viewport contents to
%-% \HDindex{graphics!2D control-panel!ps}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
a file {\bf axiom2D.ps} or to a name specified in the user's {\bf
%-% \HDindex{graphics!.Xdefaults!PostScript file name}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
.Xdefaults} file.
%-% \HDindex{file!.Xdefaults @{\bf .Xdefaults}}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
The file is placed in the directory from which \Language{} or the {\bf
viewAlone} program was invoked.
%-% \HDindex{PostScript}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
%
\item[Reset] resets the object transformation
characteristics and attributes back to their initial states.
%-% \HDindex{graphics!2D control-panel!reset}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
%
\item[Hide] makes the control-panel disappear.
%-% \HDindex{graphics!2D control-panel!hide}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
%
\item[Quit] queries whether the current viewport
%-% \HDindex{graphics!2D control-panel!quit}{ugGraphTwoDControlPage}{7.1.7.}{Two-Dimensional Control-Panel}
session should be terminated.
\enditems
\indent{0}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphTwoDopsTitle}{Operations for Two-Dimensional Graphics}
\newcommand{\ugGraphTwoDopsNumber}{7.1.8.}
%
% =====================================================================
\begin{page}{ugGraphTwoDopsPage}{7.1.8. Operations for Two-Dimensional Graphics}
% =====================================================================
\beginscroll
Here is a summary of useful \Language{} operations for \twodim{}
graphics.
Each operation name is followed by a list of arguments.
Each argument is written as a variable informally named according
to the type of the argument (for example, {\it integer}).
If appropriate, a default value for an argument is given in
parentheses immediately following the name.
%
\texht{\bgroup\hbadness = 10001\sloppy}{}
\indent{0}
\beginitems
%
\item[\axiomFun{adaptive}]\funArgs{\optArg{boolean\argDef{true}}}
%-% \HDindex{adaptive plotting}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
sets or indicates whether graphs are plotted
%-% \HDindex{graphics!set 2D defaults!adaptive}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
according to the adaptive refinement algorithm.
%
\item[\axiomFun{axesColorDefault}]\funArgs{\optArg{color\argDef{dark blue()}}}
sets or indicates the default color of the
%-% \HDindex{graphics!set 2D defaults!axes color}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
axes in a \twodim{} graph viewport.
%
\item[\axiomFun{clipPointsDefault}]\funArgs{\optArg{boolean\argDef{false}}}
sets or
indicates whether point clipping is
%-% \HDindex{graphics!set 2D defaults!clip points}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
to be applied as the default for graph plots.
%
\item[\axiomFun{drawToScale}]\funArgs{\optArg{boolean\argDef{false}}}
sets or
indicates whether the plot of a graph
%-% \HDindex{graphics!set 2D defaults!to scale}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
is ``to scale'' or uses the entire viewport space as the default.
%
\item[\axiomFun{lineColorDefault}]\funArgs{\optArg{color\argDef{pastel yellow()}}}
sets or indicates the default color of the
%-% \HDindex{graphics!set 2D defaults!line color}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
lines or curves in a \twodim{} graph viewport.
%
\item[\axiomFun{maxPoints}]\funArgs{\optArg{integer\argDef{500}}}
sets or indicates
the default maximum number of
%-% \HDindex{graphics!set 2D defaults!max points}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
possible points to be used when constructing a \twodim{} graph.
%
\item[\axiomFun{minPoints}]\funArgs{\optArg{integer\argDef{21}}}
sets or indicates the default minimum number of
%-% \HDindex{graphics!set 2D defaults!min points}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
possible points to be used when constructing a \twodim{} graph.
%
\item[\axiomFun{pointColorDefault}]\funArgs{\optArg{color\argDef{bright red()}}}
sets or indicates the default color of the
%-% \HDindex{graphics!set 2D defaults!point color}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
points in a \twodim{} graph viewport.
%
\item[\axiomFun{pointSizeDefault}]\funArgs{\optArg{integer\argDef{5}}}
sets or indicates the default size of the
%-% \HDindex{graphics!set 2D defaults!point size}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
dot used to plot points in a \twodim{} graph.
%
\item[\axiomFun{screenResolution}]\funArgs{\optArg{integer\argDef{600}}}
sets or indicates the default screen
%-% \HDindex{graphics!set 2D defaults!screen resolution}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
resolution constant used in setting the computation limit of adaptively
%-% \HDindex{adaptive plotting}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
generated curve plots.
%
\item[\axiomFun{unitsColorDefault}]\funArgs{\optArg{color\argDef{dim green()}}}
sets or indicates the default color of the
%-% \HDindex{graphics!set 2D defaults!units color}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
unit labels in a \twodim{} graph viewport.
%
\item[\axiomFun{viewDefaults}]\funArgs{}
resets the default settings for the following
%-% \HDindex{graphics!set 2D defaults!reset viewport}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
attributes: point color, line color, axes color, units color, point size,
viewport upper left-hand corner position, and the viewport size.
%
\item[\axiomFun{viewPosDefault}]\funArgs{\optArg{list\argDef{[100,100]}}}
sets or indicates the default position of the
%-% \HDindex{graphics!set 2D defaults!viewport position}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
upper left-hand corner of a \twodim{} viewport, relative to the
display root window.
The upper left-hand corner of the display is considered to be at the
(0, 0) position.
%
\item[\axiomFun{viewSizeDefault}]\funArgs{\optArg{list\argDef{[200,200]}}}
sets or
indicates the default size in which two
%-% \HDindex{graphics!set 2D defaults!viewport size}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
dimensional viewport windows are shown.
It is defined by a width and then a height.
%
\item[\axiomFun{viewWriteAvailable}]\funArgs{\optArg{list\argDef{["pixmap",
"bitmap", "postscript", \"image"}}}
indicates the possible file types
%-% \HDindex{graphics!2D defaults!available viewport writes}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
that can be created with the \axiomFunFrom{write}{TwoDimensionalViewport} function.
%
\item[\axiomFun{viewWriteDefault}]
\funArgs{\optArg{list\argDef{[]}}}
sets or indicates the default types of files, in
%-% \HDindex{graphics!set 2D defaults!write viewport}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
addition to the {\bf data} file, that are created when a
\axiomFun{write} function is executed on a viewport.
%
\item[\axiomFun{units}]\funArgs{viewport, integer\argDef{1}, string\argDef{"off"}}
turns the units on or off for the graph with index {\it integer}.
%
\item[\axiomFun{axes}]\funArgs{viewport, integer\argDef{1}, string\argDef{"on"}}
turns the axes on
%-% \HDindex{graphics!2D commands!axes}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
or off for the graph with index {\it integer}.
%
\item[\axiomFun{close}]\funArgs{viewport}
closes {\it viewport}.
%-% \HDindex{graphics!2D commands!close}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
%
\item[\axiomFun{connect}]\funArgs{viewport, integer\argDef{1}, string\argDef{"on"}}
declares whether lines
%-% \HDindex{graphics!2D commands!connect}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
connecting the points are displayed or not.
%
\item[\axiomFun{controlPanel}]\funArgs{viewport, string\argDef{"off"}}
declares
whether the \twodim{} control-panel is automatically displayed
or not.
%
\item[\axiomFun{graphs}]\funArgs{viewport}
returns a list
%-% \HDindex{graphics!2D commands!graphs}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
describing the state of each graph.
If the graph state is not being used this is shown by {\tt "undefined"},
otherwise a description of the graph's contents is shown.
%
\item[\axiomFun{graphStates}]\funArgs{viewport}
displays
%-% \HDindex{graphics!2D commands!state of graphs}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
a list of all the graph states available for {\it viewport}, giving the
values for every property.
%
\item[\axiomFun{key}]\funArgs{viewport}
returns the process
%-% \HDindex{graphics!2D commands!key}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
ID number for {\it viewport}.
%
\item[\axiomFun{move}]\funArgs{viewport,
\subscriptText{integer}{x}(viewPosDefault),
\subscriptText{integer}{y}(viewPosDefault)}
moves {\it viewport} on the screen so that the
%-% \HDindex{graphics!2D commands!move}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
upper left-hand corner of {\it viewport} is at the position {\it (x,y)}.
%
\item[\axiomFun{options}]\funArgs{\it viewport}
returns a list
%-% \HDindex{graphics!2D commands!options}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
of all the \axiomType{DrawOption}s used by {\it viewport}.
%
\item[\axiomFun{points}]\funArgs{viewport, integer\argDef{1}, string\argDef{"on"}}
specifies whether the graph points for graph {\it integer} are
%-% \HDindex{graphics!2D commands!points}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
to be displayed or not.
%
\item[\axiomFun{region}]\funArgs{viewport, integer\argDef{1}, string\argDef{"off"}}
declares whether graph {\it integer} is or is not to be displayed
with a bounding rectangle.
%
\item[\axiomFun{reset}]\funArgs{viewport}
resets all the properties of {\it viewport}.
%
\item[\axiomFun{resize}]\funArgs{viewport,
\subscriptText{integer}{width}, \subscriptText{integer}{height}}
%-% \HDindex{graphics!2D commands!resize}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
resizes {\it viewport} with a new {\it width} and {\it height}.
%
\item[\axiomFun{scale}]\funArgs{viewport, \subscriptText{integer}{n}\argDef{1},
\subscriptText{integer}{x}\argDef{0.9}, \subscriptText{integer}{y}\argDef{0.9}}
scales values for the
%-% \HDindex{graphics!2D commands!scale}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
{\it x} and {\it y} coordinates of graph {\it n}.
%
\item[\axiomFun{show}]\funArgs{viewport, \subscriptText{integer}{n}\argDef{1},
string\argDef{"on"}}
indicates if graph {\it n} is shown or not.
%
\item[\axiomFun{title}]\funArgs{viewport, string\argDef{"Axiom 2D"}}
designates the title for {\it viewport}.
%
\item[\axiomFun{translate}]\funArgs{viewport,
\subscriptText{integer}{n}\argDef{1},
\subscriptText{float}{x}\argDef{0.0}, \subscriptText{float}{y}\argDef{0.0}}
%-% \HDindex{graphics!2D commands!translate}{ugGraphTwoDopsPage}{7.1.8.}{Operations for Two-Dimensional Graphics}
causes graph {\it n} to be moved {\it x} and {\it y} units in the respective directions.
%
\item[\axiomFun{write}]\funArgs{viewport, \subscriptText{string}{directory},
\optArg{strings}}
if no third argument is given, writes the {\bf data} file onto the directory
with extension {\bf data}.
The third argument can be a single string or a list of strings with some or
all the entries {\tt "pixmap"}, {\tt "bitmap"}, {\tt "postscript"}, and
{\tt "image"}.
\enditems
\indent{0}
\texht{\egroup}{}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphTwoDbuildTitle}{Addendum: Building Two-Dimensional Graphs}
\newcommand{\ugGraphTwoDbuildNumber}{7.1.9.}
%
% =====================================================================
\begin{page}{ugGraphTwoDbuildPage}{7.1.9. Addendum: Building Two-Dimensional Graphs}
% =====================================================================
\beginscroll
In this section we demonstrate how to create \twodim{} graphs from
lists of points and give an example showing how to read the lists
of points from a file.
\subsubsection{Creating a Two-Dimensional Viewport from a List of Points}
\Language{} creates lists of points in a \twodim{} viewport by utilizing
the \axiomType{GraphImage} and \axiomType{TwoDimensionalViewport} domains.
In this example, the \axiomFunFrom{makeGraphImage}{GraphImage}
function takes a list of lists of points parameter, a list of colors for
each point in the graph, a list of colors for each line in the graph, and
a list of sizes for each point in the graph.
%
\xtc{
The following expressions create a list of lists of points which will be read
by \Language{} and made into a \twodim{} viewport.
}{
\spadpaste{p1 := point [1,1]\$(Point DFLOAT) \bound{p1}}
}
\xtc{
}{
\spadpaste{p2 := point [0,1]\$(Point DFLOAT) \bound{p2}}
}
\xtc{
}{
\spadpaste{p3 := point [0,0]\$(Point DFLOAT) \bound{p3}}
}
\xtc{
}{
\spadpaste{p4 := point [1,0]\$(Point DFLOAT) \bound{p4}}
}
\xtc{
}{
\spadpaste{p5 := point [1,.5]\$(Point DFLOAT) \bound{p5}}
}
\xtc{
}{
\spadpaste{p6 := point [.5,0]\$(Point DFLOAT) \bound{p6}}
}
\xtc{
}{
\spadpaste{p7 := point [0,0.5]\$(Point DFLOAT) \bound{p7}}
}
\xtc{
}{
\spadpaste{p8 := point [.5,1]\$(Point DFLOAT) \bound{p8}}
}
\xtc{
}{
\spadpaste{p9 := point [.25,.25]\$(Point DFLOAT) \bound{p9}}
}
\xtc{
}{
\spadpaste{p10 := point [.25,.75]\$(Point DFLOAT) \bound{p10}}
}
\xtc{
}{
\spadpaste{p11 := point [.75,.75]\$(Point DFLOAT) \bound{p11}}
}
\xtc{
}{
\spadpaste{p12 := point [.75,.25]\$(Point DFLOAT) \bound{p12}}
}
\xtc{
Finally, here is the list.
}{
\spadpaste{llp := [[p1,p2], [p2,p3], [p3,p4], [p4,p1], [p5,p6], [p6,p7], [p7,p8], [p8,p5], [p9,p10], [p10,p11], [p11,p12], [p12,p9]] \free{p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12} \bound{llp}}
}
\xtc{
Now we set the point sizes for all components of the graph.
}{
\spadpaste{size1 := 6::PositiveInteger \bound{size1}}
}
\xtc{
}{
}
\xtc{
}{
\spadpaste{size2 := 8::PositiveInteger \bound{size2}}
}
\xtc{
}{
\spadpaste{size3 := 10::PositiveInteger \bound{size3}}
}
\xtc{
}{
\spadpaste{lsize := [size1, size1, size1, size1, size2, size2, size2, size2, size3, size3, size3, size3] \bound{lsize} \free{size1 size2 size3}}
}
\xtc{
Here are the colors for the points.
}{
\spadpaste{pc1 := pastel red() \bound{pc1}}
}
\xtc{
}{
\spadpaste{pc2 := dim green() \bound{pc2}}
}
\xtc{
}{
\spadpaste{pc3 := pastel yellow() \bound{pc3}}
}
\xtc{
}{
\spadpaste{lpc := [pc1, pc1, pc1, pc1, pc2, pc2, pc2, pc2, pc3, pc3, pc3, pc3] \free{pc1 pc2 pc3} \bound{lpc}}
}
\xtc{
Here are the colors for the lines.
}{
\spadpaste{lc := [pastel blue(), light yellow(), dim green(), bright red(), light green(), dim yellow(), bright blue(), dark red(), pastel red(), light blue(), dim green(), light yellow()] \bound{lc}}
}
\xtc{
Now the \axiomType{GraphImage} is created according to the component
specifications indicated above.
}{
\spadpaste{g := makeGraphImage(llp,lpc,lc,lsize)\$GRIMAGE \bound{g} \free{llp lpc lc lsize}}
}
\psXtc{
The \axiomFunFrom{makeViewport2D}{TwoDimensionalViewport} function now
creates a \axiomType{TwoDimensionalViewport} for this graph according to the
list of options specified within the brackets.
}{
\graphpaste{makeViewport2D(g,[title("Lines")])\$VIEW2D \free{g}}
}{
%
}
%See Figure #.#.
\xtc{
This example demonstrates the use of the \axiomType{GraphImage} functions
\axiomFunFrom{component}{GraphImage} and \axiomFunFrom{appendPoint}{GraphImage}
in adding points to an empty \axiomType{GraphImage}.
}{
\spadpaste{)clear all \bound{clearAll}}
}
\xtc{
}{
\spadpaste{g := graphImage()\$GRIMAGE \bound{Sg}\free{clearAll}}
}
\xtc{
}{
\spadpaste{p1 := point [0,0]\$(Point DFLOAT) \bound{Sp1}}
}
\xtc{
}{
\spadpaste{p2 := point [.25,.25]\$(Point DFLOAT) \bound{Sp2}}
}
\xtc{
}{
\spadpaste{p3 := point [.5,.5]\$(Point DFLOAT) \bound{Sp3}}
}
\xtc{
}{
\spadpaste{p4 := point [.75,.75]\$(Point DFLOAT) \bound{Sp4}}
}
\xtc{
}{
\spadpaste{p5 := point [1,1]\$(Point DFLOAT) \bound{Sp5}}
}
\xtc{
}{
\spadpaste{component(g,p1)\$GRIMAGE\free{Sg Sp1}\bound{gp1}}
}
\xtc{
}{
\spadpaste{component(g,p2)\$GRIMAGE\free{Sg Sp2}\bound{gp2}}
}
\xtc{
}{
\spadpaste{appendPoint(g,p3)\$GRIMAGE\free{gp1 gp2 Sp3}\bound{gp3}}
}
\xtc{
}{
\spadpaste{appendPoint(g,p4)\$GRIMAGE\free{gp3 Sp4}\bound{gp4}}
}
\xtc{
}{
\spadpaste{appendPoint(g,p5)\$GRIMAGE\free{gp4 Sp5}\bound{gp5}}
}
\xtc{
}{
\spadpaste{g1 := makeGraphImage(g)\$GRIMAGE \bound{Sg1} \free{gp5}}
}
\psXtc{
Here is the graph.
}{
\graphpaste{makeViewport2D(g1,[title("Graph Points")])\$VIEW2D \free{Sg1}}
}{
%
}
%
%See Figure #.#.
%
\xtc{
A list of points can also be made into a \axiomType{GraphImage} by using
the operation \axiomFunFrom{coerce}{GraphImage}. It is equivalent to adding
each point to \axiom{g2} using \axiomFunFrom{component}{GraphImage}.
}{
\spadpaste{g2 := coerce([[p1],[p2],[p3],[p4],[p5]])\$GRIMAGE \free{Sp1 Sp2 Sp3 Sp4 Sp5} \bound{Sg2}}
}
\xtc{
Now, create an empty \axiomType{TwoDimensionalViewport}.
}{
\spadpaste{v := viewport2D()\$VIEW2D \bound{Sv}}
}
\xtc{
}{
\spadpaste{options(v,[title("Just Points")])\$VIEW2D \free{Sv}\bound{Svo}}
}
\xtc{
Place the graph into the viewport.
}{
\spadpaste{putGraph(v,g2,1)\$VIEW2D \free{Sg2 Svo}\bound{Svog2}}
}
\psXtc{
Take a look.
}{
\graphpaste{makeViewport2D(v)\$VIEW2D \free{Svog2}}
}{
%
}
%See Figure #.#.
\subsubsection{Creating a Two-Dimensional Viewport of a List of Points from a File}
The following three functions read a list of points from a
file and then draw the points and the connecting lines. The
points are stored in the file in readable form as floating point numbers
(specifically, \axiomType{DoubleFloat} values) as an alternating
stream of \axiom{x}- and \axiom{y}-values. For example,
\begin{verbatim}
0.0 0.0 1.0 1.0 2.0 4.0
3.0 9.0 4.0 16.0 5.0 25.0
\end{verbatim}
\beginImportant
\noindent
{\tt 1.\ \ \ drawPoints(lp:List\ Point\ DoubleFloat):VIEW2D\ ==}\newline
{\tt 2.\ \ \ \ \ g\ :=\ graphImage()\$GRIMAGE}\newline
{\tt 3.\ \ \ \ \ for\ p\ in\ lp\ repeat}\newline
{\tt 4.\ \ \ \ \ \ \ component(g,p,pointColorDefault(),lineColorDefault(),}\newline
{\tt 5.\ \ \ \ \ \ \ \ \ pointSizeDefault())}\newline
{\tt 6.\ \ \ \ \ gi\ :=\ makeGraphImage(g)\$GRIMAGE}\newline
{\tt 7.\ \ \ \ \ makeViewport2D(gi,[title("Points")])\$VIEW2D}\newline
{\tt 8.\ \ \ }\newline
{\tt 9.\ \ \ drawLines(lp:List\ Point\ DoubleFloat):VIEW2D\ ==}\newline
{\tt 10.\ \ \ \ g\ :=\ graphImage()\$GRIMAGE}\newline
{\tt 11.\ \ \ \ component(g,\ lp,\ pointColorDefault(),\ lineColorDefault(),}\newline
{\tt 12.\ \ \ \ \ \ pointSizeDefault())\$GRIMAGE}\newline
{\tt 13.\ \ \ \ gi\ :=\ makeGraphImage(g)\$GRIMAGE}\newline
{\tt 14.\ \ \ \ makeViewport2D(gi,[title("Points")])\$VIEW2D}\newline
{\tt 15.\ \ }\newline
{\tt 16.\ \ plotData2D(name,\ title)\ ==}\newline
{\tt 17.\ \ \ \ f:File(DFLOAT)\ :=\ open(name,"input")}\newline
{\tt 18.\ \ \ \ lp:LIST(Point\ DFLOAT)\ :=\ empty()}\newline
{\tt 19.\ \ \ \ while\ ((x\ :=\ readIfCan!(f))\ case\ DFLOAT)\ repeat}\newline
{\tt 20.\ \ \ \ \ \ y\ :\ DFLOAT\ :=\ read!(f)}\newline
{\tt 21.\ \ \ \ \ \ lp\ :=\ cons(point\ [x,y]\$(Point\ DFLOAT),\ lp)}\newline
{\tt 22.\ \ \ \ \ \ lp}\newline
{\tt 23.\ \ \ \ close!(f)}\newline
{\tt 24.\ \ \ \ drawPoints(lp)}\newline
{\tt 25.\ \ \ \ drawLines(lp)}\newline
\endImportant
%
This command will actually create the viewport and the graph if
the point data is in the file \axiom{"file.data"}.
\beginImportant
\noindent
{\tt 1.\ \ \ plotData2D("file.data",\ "2D\ Data\ Plot")}\newline
\endImportant
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphTwoDappendTitle}{Addendum: Appending a Graph to a Viewport Window Containing a Graph}
\newcommand{\ugGraphTwoDappendNumber}{7.1.10.}
%
% =====================================================================
\begin{page}{ugGraphTwoDappendPage}{7.1.10. Addendum: Appending a Graph to a Viewport Window Containing a Graph}
% =====================================================================
\beginscroll
This section demonstrates how to append a \twodim{} graph to a viewport
already containing other graphs.
The default \axiomFun{draw} command places a graph into the first
\axiomType{GraphImage} slot position of the \axiomType{TwoDimensionalViewport}.
\xtc{
This graph is in the first slot in its viewport.
}{
\spadpaste{v1 := draw(sin(x),x=0..2*\%pi) \bound{v1}}
}
\xtc{
So is this graph.
}{
\spadpaste{v2 := draw(cos(x),x=0..2*\%pi, curveColor==light red()) \bound{v2}}
}
\xtc{
The operation \axiomFunFrom{getGraph}{TwoDimensionalViewport}
retrieves the \axiomType{GraphImage} \axiom{g1} from the first slot position
in the viewport \axiom{v1}.
}{
\spadpaste{g1 := getGraph(v1,1) \bound{g1}\free{v1}}
}
\xtc{
Now \axiomFunFrom{putGraph}{TwoDimensionalViewport}
places \axiom{g1} into the the second slot position of \axiom{v2}.
}{
\spadpaste{putGraph(v2,g1,2) \bound{v22}\free{g1 v2}}
}
\psXtc{
Display the new \axiomType{TwoDimensionalViewport} containing both graphs.
}{
\graphpaste{makeViewport2D(v2) \free{v22}}
}{
%
}
%
%See Figure #.#.
%
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphThreeDTitle}{Three-Dimensional Graphics}
\newcommand{\ugGraphThreeDNumber}{7.2.}
%
% =====================================================================
\begin{page}{ugGraphThreeDPage}{7.2. Three-Dimensional Graphics}
% =====================================================================
\beginscroll
%
The \Language{} \threedim{} graphics package provides the ability to
%-% \HDindex{graphics!three-dimensional}{ugGraphThreeDPage}{7.2.}{Three-Dimensional Graphics}
%
\indent{4}
\beginitems
%
\item[-] generate surfaces defined by a function of two real variables
%
\item[-] generate space curves and tubes defined by parametric equations
%
\item[-] generate surfaces defined by parametric equations
\enditems
\indent{0}
These graphs can be modified by using various options, such as calculating
points in the spherical coordinate system or changing the polygon grid size
of a surface.
\beginmenu
\menudownlink{{7.2.1. Plotting Three-Dimensional Functions of Two Variables}}{ugGraphThreeDPlotPage}
\menudownlink{{7.2.2. Plotting Three-Dimensional Parametric Space Curves}}{ugGraphThreeDParmPage}
\menudownlink{{7.2.3. Plotting Three-Dimensional Parametric Surfaces}}{ugGraphThreeDParPage}
\menudownlink{{7.2.4. Three-Dimensional Options}}{ugGraphThreeDOptionsPage}
\menudownlink{{7.2.5. The makeObject Command}}{ugGraphMakeObjectPage}
\menudownlink{{7.2.6. Building Three-Dimensional Objects From Primitives}}{ugGraphThreeDBuildPage}
\menudownlink{{7.2.7. Coordinate System Transformations}}{ugGraphCoordPage}
\menudownlink{{7.2.8. Three-Dimensional Clipping}}{ugGraphClipPage}
\menudownlink{{7.2.9. Three-Dimensional Control-Panel}}{ugGraphThreeDControlPage}
\menudownlink{{7.2.10. Operations for Three-Dimensional Graphics}}{ugGraphThreeDopsPage}
\menudownlink{{7.2.11. Customization using .Xdefaults}}{ugXdefaultsPage}
\endmenu
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphThreeDPlotTitle}{Plotting Three-Dimensional Functions of Two Variables}
\newcommand{\ugGraphThreeDPlotNumber}{7.2.1.}
%
% =====================================================================
\begin{page}{ugGraphThreeDPlotPage}{7.2.1. Plotting Three-Dimensional Functions of Two Variables}
% =====================================================================
\beginscroll
%-% \HDindex{surface!two variable function}{ugGraphThreeDPlotPage}{7.2.1.}{Plotting Three-Dimensional Functions of Two Variables}
The simplest \threedim{} graph is that of a surface defined by a function
of two variables, \axiom{z = f(x,y)}.
%
\beginImportant
The general format for drawing a surface defined by a formula \axiom{f(x,y)}
of two variables \axiom{x} and \axiom{y} is:
%
\centerline{{{\tt draw(f(x,y), x = a..b, y = c..d, {\it options})}}}
where \axiom{a..b} and \axiom{c..d} define the range of \axiom{x}
and \axiom{y}, and where {\it options} prescribes zero or more
options as described in \downlink{``\ugGraphThreeDOptionsTitle''}{ugGraphThreeDOptionsPage} in Section \ugGraphThreeDOptionsNumber\ignore{ugGraphThreeDOptions}.
An example of an option is \axiom{title == "Title of Graph".}
An alternative format involving a function \axiom{f} is also
available.
\endImportant
%
\psXtc{
The simplest way to plot a function of two variables is to use a formula.
With formulas you always precede the range specifications with
the variable name and an \spadSyntax{=} sign.
}{
\graphpaste{draw(cos(x*y),x=-3..3,y=-3..3)}
}{
\epsffile[0 0 295 295]{../ps/3D2VarA.ps}
}
%
\xtc{
If you intend to use a function more than once,
or it is long and complex, then first
give its definition to \Language{}.
}{
\spadpaste{f(x,y) == sin(x)*cos(y) \bound{f}}
}
%
%
\psXtc{
To draw the function, just give its name and drop the variables
from the range specifications.
\Language{} compiles your function for efficient computation
of data for the graph.
Notice that \Language{} uses the text of your function as a
default title.
}{
\graphpaste{draw(f,-\%pi..\%pi,-\%pi..\%pi) \free{f}}
}{
\epsffile[0 0 295 295]{../ps/3D2VarB.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphThreeDParmTitle}{Plotting Three-Dimensional Parametric Space Curves}
\newcommand{\ugGraphThreeDParmNumber}{7.2.2.}
%
% =====================================================================
\begin{page}{ugGraphThreeDParmPage}{7.2.2. Plotting Three-Dimensional Parametric Space Curves}
% =====================================================================
\beginscroll
A second kind of \threedim{} graph is a \threedim{} space curve
%-% \HDindex{curve!parametric space}{ugGraphThreeDParmPage}{7.2.2.}{Plotting Three-Dimensional Parametric Space Curves}
defined by the parametric equations for \axiom{x(t)}, \axiom{y(t)},
%-% \HDindex{parametric space curve}{ugGraphThreeDParmPage}{7.2.2.}{Plotting Three-Dimensional Parametric Space Curves}
and \axiom{z(t)} as a function of an independent variable \axiom{t}.
%
\beginImportant
The general format for drawing a \threedim{} space curve defined by
parametric formulas \axiom{x = f(t)}, \axiom{y = g(t)}, and
\axiom{z = h(t)} is:
%
\centerline{{{\tt draw(curve(f(t),g(t),h(t)), t = a..b, {\it options})}}}
where \axiom{a..b} defines the range of the independent variable
\axiom{t}, and where {\it options} prescribes zero or more options
as described in \downlink{``\ugGraphThreeDOptionsTitle''}{ugGraphThreeDOptionsPage} in Section \ugGraphThreeDOptionsNumber\ignore{ugGraphThreeDOptions}.
An example of an option is \axiom{title == "Title of Graph".}
An alternative format involving functions \axiom{f}, \axiom{g} and
\axiom{h} is also available.
\endImportant
%
\psXtc{
If you use explicit formulas to draw a space curve, always precede
the range specification with the variable name and an
\spadSyntax{=} sign.
}{
\graphpaste{draw(curve(5*cos(t), 5*sin(t),t), t=-12..12)}
}{
\epsffile[0 0 295 295]{../ps/3DpscA.ps}
}
%
\xtc{
Alternatively, you can draw space curves by referring to functions.
}{
\spadpaste{i1(t:DFLOAT):DFLOAT == sin(t)*cos(3*t/5) \bound{i1}}
}
\xtc{
This is useful if the functions are to be used more than once \ldots
}{
\spadpaste{i2(t:DFLOAT):DFLOAT == cos(t)*cos(3*t/5) \bound{i2}}
}
\xtc{
or if the functions are long and complex.
}{
\spadpaste{i3(t:DFLOAT):DFLOAT == cos(t)*sin(3*t/5) \bound{i3}}
}
%
%
\psXtc{
Give the names of the functions and
drop the variable name specification in the second argument.
Again, \Language{} supplies a default title.
}{
\graphpaste{draw(curve(i1,i2,i3),0..15*\%pi) \free{i1 i2 i3}}
}{
\epsffile[0 0 295 295]{../ps/3DpscB.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphThreeDParTitle}{Plotting Three-Dimensional Parametric Surfaces}
\newcommand{\ugGraphThreeDParNumber}{7.2.3.}
%
% =====================================================================
\begin{page}{ugGraphThreeDParPage}{7.2.3. Plotting Three-Dimensional Parametric Surfaces}
% =====================================================================
\beginscroll
%-% \HDindex{surface!parametric}{ugGraphThreeDParPage}{7.2.3.}{Plotting Three-Dimensional Parametric Surfaces}
A third kind of \threedim{} graph is a surface defined by
%-% \HDindex{parametric surface}{ugGraphThreeDParPage}{7.2.3.}{Plotting Three-Dimensional Parametric Surfaces}
parametric equations for \axiom{x(u,v)}, \axiom{y(u,v)}, and
\axiom{z(u,v)} of two independent variables \axiom{u} and \axiom{v}.
%
\beginImportant
The general format for drawing a \threedim{} graph defined by
parametric formulas \axiom{x = f(u,v)}, \axiom{y = g(u,v)},
and \axiom{z = h(u,v)} is:
%
\centerline{{{\tt draw(surface(f(u,v),g(u,v),h(u,v)), u = a..b, v = c..d, {\it options})}}}
where \axiom{a..b} and \axiom{c..d} define the range of the
independent variables \axiom{u} and \axiom{v}, and where
{\it options} prescribes zero or more options as described in
\downlink{``\ugGraphThreeDOptionsTitle''}{ugGraphThreeDOptionsPage} in Section \ugGraphThreeDOptionsNumber\ignore{ugGraphThreeDOptions}.
An example of an option is \axiom{title == "Title of Graph".}
An alternative format involving functions \axiom{f}, \axiom{g} and
\axiom{h} is also available.
\endImportant
%
\psXtc{
This example draws a graph of a surface plotted using the
parabolic cylindrical coordinate system option.
%-% \HDindex{coordinate system!parabolic cylindrical}{ugGraphThreeDParPage}{7.2.3.}{Plotting Three-Dimensional Parametric Surfaces}
The values of the functions supplied to \axiomFun{surface} are
%-% \HDindex{parabolic cylindrical coordinate system}{ugGraphThreeDParPage}{7.2.3.}{Plotting Three-Dimensional Parametric Surfaces}
interpreted in coordinates as given by a {\tt coordinates} option,
here as parabolic cylindrical coordinates (see
\downlink{``\ugGraphCoordTitle''}{ugGraphCoordPage} in Section \ugGraphCoordNumber\ignore{ugGraphCoord}).
}{
\graphpaste{draw(surface(u*cos(v), u*sin(v), v*cos(u)), u=-4..4, v=0..\%pi, coordinates== parabolicCylindrical)}
}{
\epsffile[0 0 295 295]{../ps/3DpsA.ps}
}
%
Again, you can graph these parametric surfaces using functions,
if the functions are long and complex.
\xtc{
Here we declare the types of arguments and values to be of type
\axiomType{DoubleFloat}.
}{
\spadpaste{n1(u:DFLOAT,v:DFLOAT):DFLOAT == u*cos(v) \bound{n1}}
}
\xtc{
As shown by previous examples, these declarations are necessary.
}{
\spadpaste{n2(u:DFLOAT,v:DFLOAT):DFLOAT == u*sin(v) \bound{n2}}
}
\xtc{
In either case, \Language{} compiles the functions
when needed to graph a result.
}{
\spadpaste{n3(u:DFLOAT,v:DFLOAT):DFLOAT == u \bound{n3}}
}
\xtc{
Without these declarations, you have to suffix floats
with \axiom{@DFLOAT} to get a \axiomType{DoubleFloat} result.
However, a call here with an unadorned float produces a \axiomType{DoubleFloat}.
}{
\spadpaste{n3(0.5,1.0)\free{n3}}
}
%
%
\psXtc{
Draw the surface by referencing the function names, this time
choosing the toroidal coordinate system.
%-% \HDindex{coordinate system!toroidal}{ugGraphThreeDParPage}{7.2.3.}{Plotting Three-Dimensional Parametric Surfaces}
%-% \HDindex{toroidal coordinate system}{ugGraphThreeDParPage}{7.2.3.}{Plotting Three-Dimensional Parametric Surfaces}
}{
\graphpaste{draw(surface(n1,n2,n3), 1..4, 1..2*\%pi, coordinates == toroidal(1\$DFLOAT)) \free{n1 n2 n3}}
}{
\epsffile[0 0 295 295]{../ps/3DpsB.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphThreeDOptionsTitle}{Three-Dimensional Options}
\newcommand{\ugGraphThreeDOptionsNumber}{7.2.4.}
%
% =====================================================================
\begin{page}{ugGraphThreeDOptionsPage}{7.2.4. Three-Dimensional Options}
% =====================================================================
\beginscroll
%-% \HDindex{graphics!3D options}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
The \axiomFun{draw} commands optionally take an optional list of options such
as {\tt coordinates} as shown in the last example.
Each option is given by the syntax: \axiom{name} {\tt ==} \axiom{value}.
Here is a list of the available options in the order that they are
described below:
\table{ {title} {coordinates} {var1Steps} {style} {tubeRadius} {var2Steps}
{colorFunction} {tubePoints} {space}}
\psXtc{
The option \axiom{title} gives your graph a title.
%-% \HDindex{graphics!3D options!title}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
}{
\graphpaste{draw(cos(x*y),x=0..2*\%pi,y=0..\%pi,title == "Title of Graph") }
}{
\epsffile[0 0 295 295]{../ps/3DOptTtl.ps}
}
%
\psXtc{
The \axiom{style} determines which of four rendering algorithms is used for
%-% \HDindex{rendering}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
the graph.
The choices are
{\tt "wireMesh"}, {\tt "solid"}, {\tt "shade"}, and {\tt "smooth"}.
}{
\graphpaste{draw(cos(x*y),x=-3..3,y=-3..3, style=="smooth", title=="Smooth Option")}
}{
\epsffile[0 0 295 295]{../ps/3DOptSty.ps}
}
%
In all but the wire-mesh style, polygons in a surface or tube plot
are normally colored in a graph according to their
\axiom{z}-coordinate value. Space curves are colored according to their
parametric variable value.
%-% \HDindex{graphics!3D options!color function}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
To change this, you can give a coloring function.
%-% \HDindex{function!coloring}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
The coloring function is sampled across the range of its arguments, then
normalized onto the standard \Language{} colormap.
\xtc{
A function of one variable makes the color depend on the
value of the parametric variable specified for a tube plot.
}{
\spadpaste{color1(t) == t \bound{colorFxn1}}
}
\psXtc{
}{
\graphpaste{draw(curve(sin(t), cos(t),0), t=0..2*\%pi, tubeRadius == .3, colorFunction == color1) \free{colorFxn1}}
}{
\epsffile[0 0 295 295]{../ps/3DOptCf1.ps}
}
%
\xtc{
A function of two variables makes the color depend on the
values of the independent variables.
}{
\spadpaste{color2(u,v) == u**2 - v**2 \bound{colorFxn2}}
}
\psXtc{
Use the option {\tt colorFunction} for special coloring.
}{
\graphpaste{draw(cos(u*v), u=-3..3, v=-3..3, colorFunction == color2) \free{colorFxn2}}
}{
\epsffile[0 0 295 295]{../ps/3DOptCf2.ps}
}
%
\xtc{
With a three variable function, the
color also depends on the value of the function.
}{
\spadpaste{color3(x,y,fxy) == sin(x*fxy) + cos(y*fxy) \bound{colorFxn3}}
}
\psXtc{
}{
\graphpaste{draw(cos(x*y), x=-3..3, y=-3..3, colorFunction == color3) \free{colorFxn3}}
}{
\epsffile[0 0 295 295]{../ps/3DOptCf3.ps}
}
%
Normally the Cartesian coordinate system is used.
%-% \HDindex{Cartesian!coordinate system}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
To change this, use the {\tt coordinates} option.
%-% \HDindex{coordinate system!Cartesian}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
For details, see \downlink{``\ugGraphCoordTitle''}{ugGraphCoordPage} in Section \ugGraphCoordNumber\ignore{ugGraphCoord}.
%
%
\xtc{
}{
\spadpaste{m(u:DFLOAT,v:DFLOAT):DFLOAT == 1 \bound{m}}
}
\psXtc{
Use the spherical
%-% \HDindex{spherical coordinate system}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
coordinate system.
%-% \HDindex{coordinate system!spherical}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
}{
\graphpaste{draw(m, 0..2*\%pi,0..\%pi, coordinates == spherical, style=="shade") \free{m}}
}{
\epsffile[0 0 295 295]{../ps/3DOptCrd.ps}
}
%
Space curves may be displayed as tubes with polygonal cross sections.
%-% \HDindex{tube}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
Two options, {\tt tubeRadius} and {\tt tubePoints}, control the size and
shape of this cross section.
%
\psXtc{
The {\tt tubeRadius} option specifies the radius of the tube that
%-% \HDindex{tube!radius}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
encircles the specified space curve.
}{
\graphpaste{draw(curve(sin(t),cos(t),0),t=0..2*\%pi, style=="shade", tubeRadius == .3)}
}{
\epsffile[0 0 295 295]{../ps/3DOptRad.ps}
}
%
%
\psXtc{
The {\tt tubePoints} option specifies the number of vertices
%-% \HDindex{tube!points in polygon}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
defining the polygon that is used to create a tube around the
specified space curve.
The larger this number is, the more cylindrical the tube becomes.
}{
\graphpaste{draw(curve(sin(t), cos(t), 0), t=0..2*\%pi, style=="shade", tubeRadius == .25, tubePoints == 3)}
}{
\epsffile[0 0 295 295]{../ps/3DOptPts.ps}
}
%
%-% \HDindex{graphics!3D options!variable steps}{ugGraphThreeDOptionsPage}{7.2.4.}{Three-Dimensional Options}
%
%
\psXtc{
Options \axiomFunFrom{var1Steps}{DrawOption} and
\axiomFunFrom{var2Steps}{DrawOption} specify the number of intervals into
which the grid defining a surface plot is subdivided with respect to the
first and second parameters of the surface function(s).
}{
\graphpaste{draw(cos(x*y),x=-3..3,y=-3..3, style=="shade", var1Steps == 30, var2Steps == 30)}
}{
\epsffile[0 0 295 295]{../ps/3DOptvB.ps}
}
%
The {\tt space} option
of a \axiomFun{draw} command lets you build multiple graphs in three space.
To use this option, first create an empty three-space object,
then use the {\tt space} option thereafter.
There is no restriction as to the number or kinds
of graphs that can be combined this way.
\xtc{
Create an empty three-space object.
}{
\spadpaste{s := create3Space()\$(ThreeSpace DFLOAT) \bound{s}}
}
%
%
\xtc{
}{
\spadpaste{m(u:DFLOAT,v:DFLOAT):DFLOAT == 1 \bound{m}}
}
\psXtc{
Add a graph to this three-space object.
The new graph destructively inserts the graph
into \axiom{s}.
}{
\graphpaste{draw(m,0..\%pi,0..2*\%pi, coordinates == spherical, space == s) \free{s m}}
}{
\epsffile[0 0 295 295]{../ps/3Dmult1A.ps}
}
%
%
\psXtc{
Add a second graph to \axiom{s}.
}{
\graphpaste{v := draw(curve(1.5*sin(t), 1.5*cos(t),0), t=0..2*\%pi, tubeRadius == .25, space == s) \free{s} \bound{v}}
}{
\epsffile[0 0 295 295]{../ps/3Dmult1B.ps}
}
%
A three-space object can also be obtained from an existing \threedim{} viewport
using the \axiomFunFrom{subspace}{ThreeSpace} command.
You can then use \axiomFun{makeViewport3D} to create a viewport window.
\xtc{
Assign to \axiom{subsp} the three-space object in viewport \axiom{v}.
}{
\spadpaste{subsp := subspace v \free{v} \bound{su}}
}
\xtc{
Reset the space component of \axiom{v} to the value of \axiom{subsp}.
}{
\spadpaste{subspace(v, subsp) \bound{sp} \free{su}}
}
\noOutputXtc{
Create a viewport window from a three-space object.
}{
\graphpaste{makeViewport3D(subsp,"Graphs") \free{sp}}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphMakeObjectTitle}{The makeObject Command}
\newcommand{\ugGraphMakeObjectNumber}{7.2.5.}
%
% =====================================================================
\begin{page}{ugGraphMakeObjectPage}{7.2.5. The makeObject Command}
% =====================================================================
\beginscroll
An alternate way to create multiple graphs is to use
\axiomFun{makeObject}.
The \axiomFun{makeObject} command is similar to the \axiomFun{draw}
command, except that it returns a three-space object rather than a
\axiomType{ThreeDimensionalViewport}.
In fact, \axiomFun{makeObject} is called by the \axiomFun{draw}
command to create the \axiomType{ThreeSpace} then
\axiomFunFrom{makeViewport3D}{ThreeDimensionalViewport} to create a
viewport window.
\xtc{
}{
\spadpaste{m(u:DFLOAT,v:DFLOAT):DFLOAT == 1 \bound{m}}
}
\noOutputXtc{
Do the last example a new way.
First use \axiomFun{makeObject} to
create a three-space object \axiom{sph}.
}{
\spadpaste{sph := makeObject(m, 0..\%pi, 0..2*\%pi, coordinates==spherical)\bound{sph}\free{m}}
}
\noOutputXtc{
Add a second object to \axiom{sph}.
}{
\spadpaste{makeObject(curve(1.5*sin(t), 1.5*cos(t), 0), t=0..2*\%pi, space == sph, tubeRadius == .25) \free{sph}\bound{v1}}
}
\noOutputXtc{
Create and display a viewport
containing \axiom{sph}.
}{
\graphpaste{makeViewport3D(sph,"Multiple Objects") \free{v1}}
}
Note that an undefined \axiomType{ThreeSpace} parameter declared in a
\axiomFun{makeObject} or \axiomFun{draw} command results in an error.
Use the \axiomFunFrom{create3Space}{ThreeSpace} function to define a
\axiomType{ThreeSpace}, or obtain a \axiomType{ThreeSpace} that has been
previously generated before including it in a command line.
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphThreeDBuildTitle}{Building Three-Dimensional Objects From Primitives}
\newcommand{\ugGraphThreeDBuildNumber}{7.2.6.}
%
% =====================================================================
\begin{page}{ugGraphThreeDBuildPage}{7.2.6. Building Three-Dimensional Objects From Primitives}
% =====================================================================
\beginscroll
Rather than using the \axiomFun{draw} and \axiomFun{makeObject} commands,
%-% \HDindex{graphics!advanced!build 3D objects}{ugGraphThreeDBuildPage}{7.2.6.}{Building Three-Dimensional Objects From Primitives}
you can create \threedim{} graphs from primitives.
Operation \axiomFunFrom{create3Space}{ThreeSpace} creates a
three-space object to which points, curves and polygons
can be added using the operations from the \axiomType{ThreeSpace}
domain.
The resulting object can then be displayed in a viewport using
\axiomFunFrom{makeViewport3D}{ThreeDimensionalViewport}.
\xtc{
Create the empty three-space object \axiom{space}.
}{
\spadpaste{space := create3Space()\$(ThreeSpace DFLOAT) \bound{space}}
}
Objects can be sent to this \axiom{space} using the operations
exported by the \axiomType{ThreeSpace} domain.
%-% \HDexptypeindex{ThreeSpace}{ugGraphThreeDBuildPage}{7.2.6.}{Building Three-Dimensional Objects From Primitives}
The following examples place curves into \axiom{space}.
\xtc{
Add these eight curves to the space.
}{
\spadpaste{closedCurve(space,[[0,30,20], [0,30,30], [0,40,30], [0,40,100], [0,30,100],[0,30,110], [0,60,110], [0,60,100], [0,50,100], [0,50,30], [0,60,30], [0,60,20]]) \bound{curve1} \free{space}}
}
\xtc{
}{
\spadpaste{closedCurve(space,[[80,0,30], [80,0,100], [70,0,110], [40,0,110], [30,0,100], [30,0,90], [40,0,90], [40,0,95], [45,0,100], [65,0,100], [70,0,95], [70,0,35]]) \bound{curve2} \free{space}}
}
\xtc{
}{
\spadpaste{closedCurve(space,[[70,0,35], [65,0,30], [45,0,30], [40,0,35], [40,0,60], [50,0,60], [50,0,70], [30,0,70], [30,0,30], [40,0,20], [70,0,20], [80,0,30]]) \bound{curve3} \free{space}}
}
\xtc{
}{
\spadpaste{closedCurve(space,[[0,70,20], [0,70,110], [0,110,110], [0,120,100], [0,120,70], [0,115,65], [0,120,60], [0,120,30], [0,110,20], [0,80,20], [0,80,30], [0,80,20]]) \bound{curve4} \free{space}}
}
\xtc{
}{
\spadpaste{closedCurve(space,[[0,105,30], [0,110,35], [0,110,55], [0,105,60], [0,80,60], [0,80,70], [0,105,70], [0,110,75], [0,110,95], [0,105,100], [0,80,100], [0,80,20], [0,80,30]]) \bound{curve5} \free{space}}
}
\xtc{
}{
\spadpaste{closedCurve(space,[[140,0,20], [140,0,110], [130,0,110], [90,0,20], [101,0,20],[114,0,50], [130,0,50], [130,0,60], [119,0,60], [130,0,85], [130,0,20]]) \bound{curve6} \free{space}}
}
\xtc{
}{
\spadpaste{closedCurve(space,[[0,140,20], [0,140,110], [0,150,110], [0,170,50], [0,190,110], [0,200,110], [0,200,20], [0,190,20], [0,190,75], [0,175,35], [0,165,35],[0,150,75], [0,150,20]]) \bound{curve7} \free{space}}
}
\xtc{
}{
\spadpaste{closedCurve(space,[[200,0,20], [200,0,110], [189,0,110], [160,0,45], [160,0,110], [150,0,110], [150,0,20], [161,0,20], [190,0,85], [190,0,20]]) \bound{curve8} \free{space}}
}
\psXtc{
Create and display the viewport using \axiomFun{makeViewport3D}.
Options may also be given but here are displayed as a list with values
enclosed in parentheses.
}{
\graphpaste{makeViewport3D(space, title == "Letters") \free{space curve1 curve2 curve3 curve4 curve5 curve6 curve7 curve8}}
}{
\epsffile[0 0 295 295]{../ps/3DBuildA.ps}
}
\subsubsection{Cube Example}
As a second example of the use of primitives, we generate a cube using a
polygon mesh.
It is important to use a consistent orientation of the polygons for
correct generation of \threedim{} objects.
\xtc{
Again start with an empty three-space object.
}{
\spadpaste{spaceC := create3Space()\$(ThreeSpace DFLOAT) \bound{spaceC}}
}
\xtc{
For convenience,
give \axiomType{DoubleFloat} values \axiom{+1} and \axiom{-1} names.
}{
\spadpaste{x: DFLOAT := 1 \bound{x}}
}
\xtc{
}{
\spadpaste{y: DFLOAT := -1 \bound{y}}
}
\xtc{
Define the vertices of the cube.
}{
\spadpaste{a := point [x,x,y,1::DFLOAT]\$(Point DFLOAT) \bound{a} \free{x y}}
}
\xtc{
}{
\spadpaste{b := point [y,x,y,4::DFLOAT]\$(Point DFLOAT) \bound{b} \free{x y}}
}
\xtc{
}{
\spadpaste{c := point [y,x,x,8::DFLOAT]\$(Point DFLOAT) \bound{c} \free{x y}}
}
\xtc{
}{
\spadpaste{d := point [x,x,x,12::DFLOAT]\$(Point DFLOAT) \bound{d} \free{x y}}
}
\xtc{
}{
\spadpaste{e := point [x,y,y,16::DFLOAT]\$(Point DFLOAT) \bound{e} \free{x y}}
}
\xtc{
}{
\spadpaste{f := point [y,y,y,20::DFLOAT]\$(Point DFLOAT) \bound{f} \free{x y}}
}
\xtc{
}{
\spadpaste{g := point [y,y,x,24::DFLOAT]\$(Point DFLOAT) \bound{g} \free{x y}}
}
\xtc{
}{
\spadpaste{h := point [x,y,x,27::DFLOAT]\$(Point DFLOAT) \bound{h} \free{x y}}
}
\xtc{
Add the faces of the cube as polygons to the space using a
consistent orientation.
}{
\spadpaste{polygon(spaceC,[d,c,g,h]) \free{d c g h spaceC} \bound{pol1}}
}
\xtc{
}{
\spadpaste{polygon(spaceC,[d,h,e,a]) \free{d h e a spaceC} \bound{pol2}}
}
\xtc{
}{
\spadpaste{polygon(spaceC,[c,d,a,b]) \free{c d a b spaceC} \bound{pol3}}
}
\xtc{
}{
\spadpaste{polygon(spaceC,[g,c,b,f]) \free{g c b f spaceC} \bound{pol4}}
}
\xtc{
}{
\spadpaste{polygon(spaceC,[h,g,f,e]) \free{h g f e spaceC} \bound{pol5}}
}
\xtc{
}{
\spadpaste{polygon(spaceC,[e,f,b,a]) \free{e f b a spaceC} \bound{pol6}}
}
\psXtc{
Create and display the viewport.
}{
\graphpaste{makeViewport3D(spaceC, title == "Cube") \free{pol1 pol2 pol3 pol4 pol5 pol6}}
}{
\epsffile[0 0 295 295]{../ps/3DBuildB.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphCoordTitle}{Coordinate System Transformations}
\newcommand{\ugGraphCoordNumber}{7.2.7.}
%
% =====================================================================
\begin{page}{ugGraphCoordPage}{7.2.7. Coordinate System Transformations}
% =====================================================================
\beginscroll
%-% \HDindex{graphics!advanced!coordinate systems}{ugGraphCoordPage}{7.2.7.}{Coordinate System Transformations}
The \axiomType{CoordinateSystems} package provides coordinate transformation
functions that map a given data point from the coordinate system specified
into the Cartesian coordinate system.
%-% \HDexptypeindex{CoordinateSystems}{ugGraphCoordPage}{7.2.7.}{Coordinate System Transformations}
The default coordinate system, given a triplet \axiom{(f(u,v), u, v)}, assumes
that \axiom{z = f(u, v)}, \axiom{x = u} and \axiom{y = v},
that is, reads the coordinates in \axiom{(z, x, y)} order.
\xtc{
}{
\spadpaste{m(u:DFLOAT,v:DFLOAT):DFLOAT == u**2 \bound{m}}
}
%
\psXtc{
Graph plotted in default coordinate system.
}{
\graphpaste{draw(m,0..3,0..5) \free{m}}
}{
\epsffile[0 0 295 295]{../ps/defcoord.ps}
}
The \axiom{z} coordinate comes first since the first argument of
the \axiomFun{draw} command gives its values.
In general, the coordinate systems \Language{} provides, or any
that you make up, must provide a map to an \axiom{(x, y, z)} triplet in
order to be compatible with the
\axiomFunFrom{coordinates}{DrawOption} \axiomType{DrawOption}.
%-% \HDexptypeindex{DrawOption}{ugGraphCoordPage}{7.2.7.}{Coordinate System Transformations}
Here is an example.
\xtc{
Define the identity function.
}{
\spadpaste{cartesian(point:Point DFLOAT):Point DFLOAT == point \bound{cart}}
}
\psXtc{
Pass \axiom{cartesian} as the \axiomFunFrom{coordinates}{DrawOption}
parameter to the \axiomFun{draw} command.
}{
\graphpaste{draw(m,0..3,0..5,coordinates==cartesian) \free{m cart}}
}{
\epsffile[0 0 295 295]{../ps/cartcoord.ps}
}
%
What happened?
The option {\tt coordinates == cartesian} directs \Language{} to
treat the dependent variable \axiom{m} defined by
\texht{$m=u^2$}{m=u**2} as the \axiom{x} coordinate.
Thus the triplet of values \axiom{(m, u, v)} is transformed to
coordinates \axiom{(x, y, z)} and so we get the graph of
\texht{$x=y^2$}{x=y**2}.
Here is another example.
The \axiomFunFrom{cylindrical}{CoordinateSystems} transform takes
%-% \HDindex{coordinate system!cylindrical}{ugGraphCoordPage}{7.2.7.}{Coordinate System Transformations}
input of the form \axiom{(w,u,v)}, interprets it in the order
%-% \HDindex{cylindrical coordinate system}{ugGraphCoordPage}{7.2.7.}{Coordinate System Transformations}
\texht{($r$,$\theta$,$z$)}{(\axiom{r}, \axiom{theta}, \axiom{z})}
and maps it to the Cartesian coordinates
\texht{$x=r\cos(\theta)$, $y=r\sin(\theta)$, $z=z$}
{\axiom{x = r * cos(theta)}, \axiom{y = r * sin(theta)}, \axiom{z = z}}
in which
\texht{$r$}{\axiom{r}} is the radius,
\texht{$\theta$}{\axiom{theta}} is the angle and
\texht{$z$}{\axiom{z}} is the z-coordinate.
\xtc{
An example using the \axiomFunFrom{cylindrical}{CoordinateSystems}
coordinates for the constant \axiom{r = 3}.
}{
\spadpaste{f(u:DFLOAT,v:DFLOAT):DFLOAT == 3 \bound{f}}
}
\psXtc{
Graph plotted in cylindrical coordinates.
}{
\graphpaste{draw(f,0..\%pi,0..6,coordinates==cylindrical) \free{f}}
}{
\epsffile[0 0 295 295]{../ps/cylCoord.ps}
}
Suppose you would like to specify \smath{z} as a function of
\smath{r} and \texht{$\theta$}{\axiom{theta}} instead of just
\smath{r}?
Well, you still can use the \axiomFun{cylindrical} \Language{}
transformation but we have to reorder the triplet before
passing it to the transformation.
\xtc{
First, let's create a point to
work with and call it \axiom{pt} with some color \axiom{col}.
}{
\spadpaste{col := 5 \bound{c}}
}
\xtc{
}{
\spadpaste{pt := point[1,2,3,col]\$(Point DFLOAT) \free{c} \bound{pt}}
}
The reordering you want is
\texht{$(z,r, \theta)$}{\axiom{(z,r,theta)}} to
\texht{$(r, \theta,z)$}{\axiom{(r,theta,z)}}
so that the first element is moved to the third element, while the second
and third elements move forward and the color element does not change.
\xtc{
Define a function \userfun{reorder} to reorder the point elements.
}{
\spadpaste{reorder(p:Point DFLOAT):Point DFLOAT == point[p.2, p.3, p.1, p.4] \bound{freo}}
}
\xtc{
The function moves the second and third elements
forward but the color does not change.
}{
\spadpaste{reorder pt \free{pt freo}}
}
\xtc{
The function \userfun{newmap} converts our reordered version of
the cylindrical coordinate system to the standard
\texht{$(x,y,z)$}{\axiom{(x,y,z)}} Cartesian system.
}{
\spadpaste{newmap(pt:Point DFLOAT):Point DFLOAT == cylindrical(reorder pt) \free{freo} \bound{fnewmap}}
}
\xtc{
}{
\spadpaste{newmap pt \free{fnewmap pt} \bound{new}}
}
%
\psXtc{
Graph the same function \axiom{f} using the coordinate mapping of the function
\axiom{newmap}, so it is now interpreted as
\texht{$z=3$}{\axiom{z = 3}}:
}{
\graphpaste{draw(f,0..3,0..2*\%pi,coordinates==newmap) \free{f new}}
}{
\epsffile[0 0 295 295]{../ps/newmap.ps}
}
{\texht{\sloppy}{}
The \axiomType{CoordinateSystems} package exports the following
%-% \HDindex{coordinate system}{ugGraphCoordPage}{7.2.7.}{Coordinate System Transformations}
operations:
\axiomFun{bipolar},
\axiomFun{bipolarCylindrical},
\axiomFun{cartesian},
\axiomFun{conical},
\axiomFun{cylindrical},
\axiomFun{elliptic},
\axiomFun{ellipticCylindrical},
\axiomFun{oblateSpheroidal},
\axiomFun{parabolic},
\axiomFun{parabolicCylindrical},
\axiomFun{paraboloidal},
\axiomFun{polar},
\axiomFun{prolateSpheroidal},
\axiomFun{spherical}, and
\axiomFun{toroidal}.
Use \Browse{} or the \spadcmd{)show} system command
%-% \HDsyscmdindex{show}{ugGraphCoordPage}{7.2.7.}{Coordinate System Transformations}
to get more information.
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphClipTitle}{Three-Dimensional Clipping}
\newcommand{\ugGraphClipNumber}{7.2.8.}
%
% =====================================================================
\begin{page}{ugGraphClipPage}{7.2.8. Three-Dimensional Clipping}
% =====================================================================
\beginscroll
A \threedim{} graph can be explicitly clipped within the \axiomFun{draw}
%-% \HDindex{graphics!advanced!clip}{ugGraphClipPage}{7.2.8.}{Three-Dimensional Clipping}
command by indicating a minimum and maximum threshold for the
%-% \HDindex{clipping}{ugGraphClipPage}{7.2.8.}{Three-Dimensional Clipping}
given function definition.
These thresholds can be defined using the \Language{} \axiomFun{min}
and \axiomFun{max} functions.
\xtc{
}{
\begin{spadsrc}[\bound{g}]
gamma(x,y) ==
g := Gamma complex(x,y)
point [x, y, max( min(real g, 4), -4), argument g]
\end{spadsrc}
}
\psXtc{
Here is an example that clips
the gamma function in order to eliminate the extreme divergence it creates.
}{
\graphpaste{draw(gamma,-\%pi..\%pi,-\%pi..\%pi,var1Steps==50,var2Steps==50) \free{g}}
}{
\epsffile[0 0 295 295]{../ps/clipGamma.ps}
}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphThreeDControlTitle}{Three-Dimensional Control-Panel}
\newcommand{\ugGraphThreeDControlNumber}{7.2.9.}
%
% =====================================================================
\begin{page}{ugGraphThreeDControlPage}{7.2.9. Three-Dimensional Control-Panel}
% =====================================================================
\beginscroll
%-% \HDindex{graphics!3D control-panel}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
Once you have created a viewport, move your mouse to the viewport
and click with your left mouse button.
This displays a control-panel on the side of the viewport
that is closest to where you clicked.
\subsubsection{Transformations}
We recommend you first select the {\bf Bounds} button while
%-% \HDindex{graphics!3D control-panel!transformations}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
executing transformations since the bounding box displayed
indicates the object's position as it changes.
%
\indent{0}
\beginitems
%
\item[Rotate:] A rotation transformation occurs by clicking the mouse
%-% \HDindex{graphics!3D control-panel!rotate}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
within the {\bf Rotate} window in the upper left corner of the
control-panel.
The rotation is computed in spherical coordinates, using the
horizontal mouse position to increment or decrement the value of
the longitudinal angle \texht{$\theta$}{\axiom{theta}} within the
range of 0 to \texht{2$\pi$}{2*pi} and the vertical mouse position
to increment or decrement the value of the latitudinal angle
\texht{$\phi$}{\axiom{phi}} within the range of \texht{-$\pi$}{pi}
to \texht{$\pi$}{pi}.
The active mode of rotation is displayed in green on a color
monitor or in clear text on a black and white monitor, while the
inactive mode is displayed in red for color display or a mottled
pattern for black and white.
%
\indent{0}
\beginitems
%
\item[origin:] The {\bf origin} button indicates that the
rotation is to occur with respect to the origin of the viewing space, that is
indicated by the axes.
%
\item[object:] The {\bf object} button indicates that the
rotation is to occur with respect to the center of volume of the object,
independent of the axes' origin position.
\enditems
\indent{0}
%
\item[Scale:] A scaling transformation occurs by clicking the mouse
%-% \HDindex{graphics!3D control-panel!scale}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
within the {\bf Scale} window in the upper center of the
control-panel, containing a zoom arrow.
The axes along which the scaling is to occur are indicated by
selecting the appropriate button above the zoom arrow window.
The selected axes are displayed in green on a color monitor or in
clear text on a black and white monitor, while the unselected axes
are displayed in red for a color display or a mottled pattern for
black and white.
%
\indent{0}
\beginitems
%
\item[uniform:] Uniform scaling along the {\tt x}, {\tt y}
and {\tt z} axes occurs when all the axes buttons are selected.
%
\item[non-uniform:] If any of the axes buttons are
not selected, non-uniform scaling occurs, that is, scaling occurs only in the
direction of the axes that are selected.
\enditems
\indent{0}
%
\item[Translate:] Translation occurs by indicating with the mouse in the
%-% \HDindex{graphics!3D control-panel!translate}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
{\bf Translate} window the direction you want the graph to move.
This window is located in the upper right corner of the
control-panel and contains a potentiometer with crossed arrows
pointing up, down, left and right.
Along the top of the {\bf Translate} window are three buttons
({\bf XY},
{\bf XZ}, and {\bf YZ}) indicating the three orthographic projection planes.
Each orientates the group as a view into that plane.
Any translation of the graph occurs only along this plane.
\enditems
\indent{0}
\subsubsection{Messages}
%-% \HDindex{graphics!3D control-panel!messages}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
The window directly below the potentiometer windows for transformations is
used to display system messages relating to the viewport, the control-panel
and the current graph displaying status.
\subsubsection{Colormap}
%-% \HDindex{graphics!3D control-panel!color map}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
Directly below the message window is the colormap range indicator
window.
%-% \HDindex{colormap}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
The \Language{} Colormap shows a sampling of the spectrum from
which hues can be drawn to represent the colors of a surface.
The Colormap is composed of five shades for each of the hues along
this spectrum.
By moving the markers above and below the Colormap, the range of
hues that are used to color the existing surface are set.
The bottom marker shows the hue for the low end of the color range
and the top marker shows the hue for the upper end of the range.
Setting the bottom and top markers at the same hue results in
monochromatic smooth shading of the graph when {\bf Smooth} mode is selected.
At each end of the Colormap are {\bf +} and {\bf -} buttons.
When clicked on, these increment or decrement the top or bottom
marker.
\subsubsection{Buttons}
%-% \HDindex{graphics!3D control-panel!buttons}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
Below the Colormap window and to the left are located various
buttons that determine the characteristics of a graph.
The buttons along the bottom and right hand side all have special
meanings; the remaining buttons in the first row indicate the mode
or style used to display the graph.
The second row are toggles that turn on or off a property of the
graph.
On a color monitor, the property is on if green (clear text, on a
monochrome monitor) and off if red (mottled pattern, on a
monochrome monitor).
Here is a list of their functions.
%
\indent{0}
\beginitems
%
\item[Wire] displays surface and tube plots as a
%-% \HDindex{graphics!3D control-panel!wire}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
wireframe image in a single color (blue) with no hidden surfaces removed,
or displays space curve plots in colors based upon their parametric variables.
This is the fastest mode for displaying a graph.
This is very useful when you
want to find a good orientation of your graph.
%
\item[Solid] displays the graph with hidden
%-% \HDindex{graphics!3D control-panel!solid}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
surfaces removed, drawing each polygon beginning with the furthest
from the viewer.
The edges of the polygons are displayed in the hues specified by
the range in the Colormap window.
%
\item[Shade] displays the graph with hidden
%-% \HDindex{graphics!3D control-panel!shade}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
surfaces removed and with the polygons shaded, drawing each
polygon beginning with the furthest from the viewer.
Polygons are shaded in the hues specified by the range in the
Colormap window using the Phong illumination model.
%-% \HDindex{Phong!illumination model}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
%
\item[Smooth] displays the graph using a
%-% \HDindex{graphics!3D control-panel!smooth}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
renderer that computes the graph one line at a time.
The location and color of the graph at each visible point on the
screen are determined and displayed using the Phong illumination
%-% \HDindex{Phong!illumination model}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
model.
Smooth shading is done in one of two ways, depending on the range
selected in the colormap window and the number of colors available
from the hardware and/or window manager.
When the top and bottom markers of the colormap range are set to
different hues, the graph is rendered by dithering between the
%-% \HDindex{dithering}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
transitions in color hue.
When the top and bottom markers of the colormap range are set to
the same hue, the graph is rendered using the Phong smooth shading
model.
%-% \HDindex{Phong!smooth shading model}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
However, if enough colors cannot be allocated for this purpose,
the renderer reverts to the color dithering method until a
sufficient color supply is available.
For this reason, it may not be possible to render multiple Phong
smooth shaded graphs at the same time on some systems.
%
\item[Bounds] encloses the entire volume of the
viewgraph within a bounding box, or removes the box if previously selected.
%-% \HDindex{graphics!3D control-panel!bounds}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
The region that encloses the entire volume of the viewport graph is displayed.
%
\item[Axes] displays Cartesian
%-% \HDindex{graphics!3D control-panel!axes}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
coordinate axes of the space, or turns them off if previously selected.
%
\item[Outline] causes
%-% \HDindex{graphics!3D control-panel!outline}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
quadrilateral polygons forming the graph surface to be outlined in black when
the graph is displayed in {\bf Shade} mode.
%
\item[BW] converts a color viewport to black and white, or vice-versa.
%-% \HDindex{graphics!3D control-panel!bw}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
When this button is selected the
control-panel and viewport switch to an immutable colormap composed of a range
of grey scale patterns or tiles that are used wherever shading is necessary.
%
\item[Light] takes you to a control-panel described below.
%
\item[ViewVolume] takes you to another control-panel as described below.
%-% \HDindex{graphics!3D control-panel!save}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
%
\item[Save] creates a menu of the possible file types that can
be written using the control-panel.
The {\bf Exit} button leaves the save menu.
The {\bf Pixmap} button writes an \Language{} pixmap of
%-% \HDindex{graphics!3D control-panel!pixmap}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
the current viewport contents. The file is called {\bf axiom3D.pixmap} and is
located in the directory from which \Language{} or {\bf viewAlone} was
started.
The {\bf PS} button writes the current viewport contents to
%-% \HDindex{graphics!3D control-panel!ps}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
PostScript output rather than to the viewport window.
By default the file is called {\bf axiom3D.ps}; however, if a file
%-% \HDindex{file!.Xdefaults @{\bf .Xdefaults}}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
name is specified in the user's {\bf .Xdefaults} file it is
%-% \HDindex{graphics!.Xdefaults!PostScript file name}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
used.
The file is placed in the directory from which the \Language{} or
{\bf viewAlone} session was begun.
See also the \axiomFunFrom{write}{ThreeDimensionalViewport}
function.
%-% \HDindex{PostScript}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
%
\item[Reset] returns the object transformation
%-% \HDindex{graphics!3D control-panel!reset}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
characteristics back to their initial states.
%
\item[Hide] causes the control-panel for the
%-% \HDindex{graphics!3D control-panel!hide}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
corresponding viewport to disappear from the screen.
%
\item[Quit] queries whether the current viewport
%-% \HDindex{graphics!3D control-panel!quit}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
session should be terminated.
\enditems
\indent{0}
\subsubsection{Light}
%-% \HDindex{graphics!3D control-panel!light}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
%
%>>>\begin{texonly}
%
%>>>\begin{figure}[htbp]
%>>>\begin{picture}(183,252)(-125,0)
%>>>\special{psfile=../ps/3Dlight.ps}
%>>>\end{picture}
%>>>\caption{Three-Dimensional Lighting Panel.}
%>>>\end{figure}
%>>>\end{texonly}
%
The {\bf Light} button changes the control-panel into the
{\bf Lighting Control-Panel}. At the top of this panel, the three axes
are shown with the same orientation as the object. A light vector from
the origin of the axes shows the current position of the light source
relative to the object. At the bottom of the panel is an {\bf Abort}
button that cancels any changes to the lighting that were made, and a
{\bf Return} button that carries out the current set of lighting changes
on the graph.
%
\indent{0}
\beginitems
%
\item[XY:] The {\bf XY} lighting axes window is below the
%-% \HDindex{graphics!3D control-panel!move xy}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
{\bf Lighting Control-Panel} title and to the left.
This changes the light vector within the {\bf XY} view plane.
%
\item[Z:] The {\bf Z} lighting axis window is below the
%-% \HDindex{graphics!3D control-panel!move z}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
{\bf Lighting Control-Panel} title and in the center. This
changes the {\bf Z}
location of the light vector.
%
\item[Intensity:]
Below the {\bf Lighting Control-Panel} title
%-% \HDindex{graphics!3D control-panel!intensity}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
and to the right is the light intensity meter.
Moving the intensity indicator down decreases the amount of
light emitted from the light source.
When the indicator is at the top of the meter the light source is
emitting at 100\% intensity.
At the bottom of the meter the light source is emitting at a level
slightly above ambient lighting.
\enditems
\indent{0}
\subsubsection{View Volume}
%-% \HDindex{graphics!3D control-panel!view volume}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
The {\bf View Volume} button changes the control-panel into
the {\bf Viewing Volume Panel}.
At the bottom of the viewing panel is an {\bf Abort} button that
cancels any changes to the viewing volume that were made and a
{\it Return} button that carries out the current set of
viewing changes to the graph.
%
%>>>\begin{texonly}
%
%>>>\begin{figure}[htbp]
%>>>\begin{picture}(183,252)(-125,0)
%>>>\special{psfile=../ps/3Dvolume.ps}
%>>>\end{picture}
%>>>\caption{Three-Dimensional Volume Panel.}
%>>>\end{figure}
%>>>\end{texonly}
%
\indent{0}
\beginitems
%
\item[Eye Reference:] At the top of this panel is the
%-% \HDindex{graphics!3D control-panel!eye reference}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
{\bf Eye Reference} window.
It shows a planar projection of the viewing pyramid from the eye
of the viewer relative to the location of the object.
This has a bounding region represented by the rectangle on the
left.
Below the object rectangle is the {\bf Hither} window.
By moving the slider in this window the hither clipping plane sets
%-% \HDindex{hither clipping plane}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
the front of the view volume.
As a result of this depth clipping all points of the object closer
to the eye than this hither plane are not shown.
The {\bf Eye Distance} slider to the right of the {\bf Hither}
slider is used to change the degree of perspective in the image.
%
\item[Clip Volume:] The {\bf Clip Volume} window is at the
%-% \HDindex{graphics!3D control-panel!clip volume}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
bottom of the {\bf Viewing Volume Panel}.
On the right is a {\bf Settings} menu.
In this menu are buttons to select viewing attributes.
Selecting the {\bf Perspective} button computes the image using
perspective projection.
%-% \HDindex{graphics!3D control-panel!perspective}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
The {\bf Show Region} button indicates whether the clipping region
of the
%-% \HDindex{graphics!3D control-panel!show clip region}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
volume is to be drawn in the viewport and the {\bf Clipping On}
button shows whether the view volume clipping is to be in effect
when the image
%-% \HDindex{graphics!3D control-panel!clipping on}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
is drawn.
The left side of the {\bf Clip Volume} window shows the clipping
%-% \HDindex{graphics!3D control-panel!clip volume}{ugGraphThreeDControlPage}{7.2.9.}{Three-Dimensional Control-Panel}
boundary of the graph.
Moving the knobs along the {\bf X}, {\bf Y}, and {\bf Z} sliders
adjusts the volume of the clipping region accordingly.
\enditems
\indent{0}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugGraphThreeDopsTitle}{Operations for Three-Dimensional Graphics}
\newcommand{\ugGraphThreeDopsNumber}{7.2.10.}
%
% =====================================================================
\begin{page}{ugGraphThreeDopsPage}{7.2.10. Operations for Three-Dimensional Graphics}
% =====================================================================
\beginscroll
Here is a summary of useful \Language{} operations for \threedim{}
graphics.
Each operation name is followed by a list of arguments.
Each argument is written as a variable informally named according
to the type of the argument (for example, {\it integer}).
If appropriate, a default value for an argument is given in
parentheses immediately following the name.
%
\texht{\bgroup\hbadness = 10001\sloppy}{}
\indent{0}
\beginitems
%
\item[\axiomFun{adaptive3D?}]\funArgs{}
tests whether space curves are to be plotted
%-% \HDindex{graphics!plot3d defaults!adaptive}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
according to the
%-% \HDindex{adaptive plotting}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
adaptive refinement algorithm.
%
\item[\axiomFun{axes}]\funArgs{viewport, string\argDef{"on"}}
turns the axes on and off.
%-% \HDindex{graphics!3D commands!axes}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
%
\item[\axiomFun{close}]\funArgs{viewport}
closes the viewport.
%-% \HDindex{graphics!3D commands!close}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
%
\item[\axiomFun{colorDef}]\funArgs{viewport,
\subscriptIt{color}{1}\argDef{1}, \subscriptIt{color}{2}\argDef{27}}
sets the colormap
%-% \HDindex{graphics!3D commands!define color}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
range to be from
\subscriptIt{color}{1} to \subscriptIt{color}{2}.
%
\item[\axiomFun{controlPanel}]\funArgs{viewport, string\argDef{"off"}}
declares whether the
%-% \HDindex{graphics!3D commands!control-panel}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
control-panel for the viewport is to be displayed or not.
%
\item[\axiomFun{diagonals}]\funArgs{viewport, string\argDef{"off"}}
declares whether the
%-% \HDindex{graphics!3D commands!diagonals}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
polygon outline includes the diagonals or not.
%
\item[\axiomFun{drawStyle}]\funArgs{viewport, style}
selects which of four drawing styles
%-% \HDindex{graphics!3D commands!drawing style}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
are used: {\tt "wireMesh", "solid", "shade",} or {\tt "smooth".}
%
\item[\axiomFun{eyeDistance}]\funArgs{viewport,float\argDef{500}}
sets the distance of the eye from the origin of the object
%-% \HDindex{graphics!3D commands!eye distance}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
for use in the \axiomFunFrom{perspective}{ThreeDimensionalViewport}.
%
\item[\axiomFun{key}]\funArgs{viewport}
returns the operating
%-% \HDindex{graphics!3D commands!key}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
system process ID number for the viewport.
%
\item[\axiomFun{lighting}]\funArgs{viewport,
\subscriptText{float}{x}\argDef{-0.5},
\subscriptText{float}{y}\argDef{0.5}, \subscriptText{float}{z}\argDef{0.5}}
sets the Cartesian
%-% \HDindex{graphics!3D commands!lighting}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
coordinates of the light source.
%
\item[\axiomFun{modifyPointData}]\funArgs{viewport,integer,point}
replaces the coordinates of the point with
%-% \HDindex{graphics!3D commands!modify point data}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
the index {\it integer} with {\it point}.
%
\item[\axiomFun{move}]\funArgs{viewport,
\subscriptText{integer}{x}\argDef{viewPosDefault},
\subscriptText{integer}{y}\argDef{viewPosDefault}}
moves the upper
%-% \HDindex{graphics!3D commands!move}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
left-hand corner of the viewport to screen position
\allowbreak
({\small \subscriptText{integer}{x}, \subscriptText{integer}{y}}).
%
\item[\axiomFun{options}]\funArgs{viewport}
returns a list of all current draw options.
%
\item[\axiomFun{outlineRender}]\funArgs{viewport, string\argDef{"off"}}
turns polygon outlining
%-% \HDindex{graphics!3D commands!outline}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
off or on when drawing in {\tt "shade"} mode.
%
\item[\axiomFun{perspective}]\funArgs{viewport, string\argDef{"on"}}
turns perspective
%-% \HDindex{graphics!3D commands!perspective}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
viewing on and off.
%
\item[\axiomFun{reset}]\funArgs{viewport}
resets the attributes of a viewport to their
%-% \HDindex{graphics!3D commands!reset}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
initial settings.
%
\item[\axiomFun{resize}]\funArgs{viewport,
\subscriptText{integer}{width} \argDef{viewSizeDefault},
\subscriptText{integer}{height} \argDef{viewSizeDefault}}
resets the width and height
%-% \HDindex{graphics!3D commands!resize}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
values for a viewport.
%
\item[\axiomFun{rotate}]\funArgs{viewport,
\subscriptText{number}{\texht{$\theta$}{\axiom{theta}}}\argDef{viewThetaDefault},
\subscriptText{number}{\texht{$\phi$}{\axiom{phi}}}\argDef{viewPhiDefault}}
rotates the viewport by rotation angles for longitude
({\it \texht{$\theta$}{\axiom{theta}}}) and
latitude ({\it \texht{$\phi$}{\axiom{phi}}}).
Angles designate radians if given as floats, or degrees if given
%-% \HDindex{graphics!3D commands!rotate}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
as integers.
%
\item[\axiomFun{setAdaptive3D}]\funArgs{boolean\argDef{true}}
sets whether space curves are to be plotted
%-% \HDindex{graphics!plot3d defaults!set adaptive}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
according to the adaptive
%-% \HDindex{adaptive plotting}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
refinement algorithm.
%
\item[\axiomFun{setMaxPoints3D}]\funArgs{integer\argDef{1000}}
sets the default maximum number of possible
%-% \HDindex{graphics!plot3d defaults!set max points}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
points to be used when constructing a \threedim{} space curve.
%
\item[\axiomFun{setMinPoints3D}]\funArgs{integer\argDef{49}}
sets the default minimum number of possible
%-% \HDindex{graphics!plot3d defaults!set min points}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
points to be used when constructing a \threedim{} space curve.
%
\item[\axiomFun{setScreenResolution3D}]\funArgs{integer\argDef{500}}
sets the default screen resolution constant
%-% \HDindex{graphics!plot3d defaults!set screen resolution}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
used in setting the computation limit of adaptively
%-% \HDindex{adaptive plotting}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
generated \threedim{} space curve plots.
%
\item[\axiomFun{showRegion}]\funArgs{viewport, string\argDef{"off"}}
declares whether the bounding
%-% \HDindex{graphics!3D commands!showRegion}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
box of a graph is shown or not.
%
\item[\axiomFun{subspace}]\funArgs{viewport}
returns the space component.
%
\item[\axiomFun{subspace}]\funArgs{viewport, subspace}
resets the space component
%-% \HDindex{graphics!3D commands!subspace}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
to {\it subspace}.
%
\item[\axiomFun{title}]\funArgs{viewport, string}
gives the viewport the
%-% \HDindex{graphics!3D commands!title}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
title {\it string}.
%
\item[\axiomFun{translate}]\funArgs{viewport,
\subscriptText{float}{x}\argDef{viewDeltaXDefault},
\subscriptText{float}{y}\argDef{viewDeltaYDefault}}
translates
%-% \HDindex{graphics!3D commands!translate}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
the object horizontally and vertically relative to the center of the viewport.
%
\item[\axiomFun{intensity}]\funArgs{viewport,float\argDef{1.0}}
resets the intensity {\it I} of the light source,
%-% \HDindex{graphics!3D commands!intensity}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
\texht{$0 \le I \le 1.$}{{\it 0 \le I \le 1}.}
%
\item[\axiomFun{tubePointsDefault}]\funArgs{\optArg{integer\argDef{6}}}
sets or indicates the default number of
%-% \HDindex{graphics!3D defaults!tube points}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
vertices defining the polygon that is used to create a tube around
a space curve.
%
\item[\axiomFun{tubeRadiusDefault}]\funArgs{\optArg{float\argDef{0.5}}}
sets or indicates the default radius of
%-% \HDindex{graphics!3D defaults!tube radius}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
the tube that encircles a space curve.
%
\item[\axiomFun{var1StepsDefault}]\funArgs{\optArg{integer\argDef{27}}}
sets or indicates the default number of
%-% \HDindex{graphics!3D defaults!var1 steps}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
increments into which the grid defining a surface plot is subdivided with
respect to the first parameter declared in the surface function.
%
\item[\axiomFun{var2StepsDefault}]\funArgs{\optArg{integer\argDef{27}}}
sets or indicates the default number of
%-% \HDindex{graphics!3D defaults!var2 steps}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
increments into which the grid defining a surface plot is subdivided with
respect to the second parameter declared in the surface function.
%
\item[\axiomFun{viewDefaults}]\funArgs{{\tt [}\subscriptText{integer}{%
point}, \subscriptText{integer}{line}, \subscriptText{integer}{axes},
\subscriptText{integer}{units}, \subscriptText{float}{point},
\allowbreak\subscriptText{list}{position},
\subscriptText{list}{size}{\tt ]}}
resets the default settings for the
%-% \HDindex{graphics!3D defaults!reset viewport defaults}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
point color, line color, axes color, units color, point size,
viewport upper left-hand corner position, and the viewport size.
%
\item[\axiomFun{viewDeltaXDefault}]\funArgs{\optArg{float\argDef{0}}}
resets the default horizontal offset
%-% \HDindex{graphics!3D commands!deltaX default}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
from the center of the viewport, or returns the current default offset if no argument is given.
%
\item[\axiomFun{viewDeltaYDefault}]\funArgs{\optArg{float\argDef{0}}}
resets the default vertical offset
%-% \HDindex{graphics!3D commands!deltaY default}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
from the center of the viewport, or returns the current default offset if no argument is given.
%
\item[\axiomFun{viewPhiDefault}]\funArgs{\optArg{float\argDef{-\texht{$\pi$}{{\it pi}}/4}}}
resets the default latitudinal view angle,
or returns the current default angle if no argument is given.
%-% \HDindex{graphics!3D commands!phi default}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
\texht{$\phi$}{{\it phi}} is set to this value.
%
\item[\axiomFun{viewpoint}]\funArgs{viewport, \subscriptText{float}{x},
\subscriptText{float}{y}, \subscriptText{float}{z}}
sets the viewing position in Cartesian coordinates.
%
\item[\axiomFun{viewpoint}]\funArgs{viewport,
\subscriptText{float}{\texht{$\theta$}{\axiom{theta}}},
\subscriptText{Float}{\texht{$\phi$}{\axiom{phi}}}}
sets the viewing position in spherical coordinates.
%
\item[\axiomFun{viewpoint}]\funArgs{viewport,
\subscriptText{Float}{\texht{$\theta$}{\axiom{theta}}},
\subscriptText{Float}{\texht{$\phi$}{\axiom{phi}}},
\subscriptText{Float}{scaleFactor},
\subscriptText{Float}{xOffset}, \subscriptText{Float}{yOffset}}
sets the viewing position in spherical coordinates,
the scale factor, and offsets.
%-% \HDindex{graphics!3D commands!viewpoint}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
\texht{$\theta$}{{\it theta}} (longitude) and
\texht{$\phi$}{{\it phi}} (latitude) are in radians.
%
\item[\axiomFun{viewPosDefault}]\funArgs{\optArg{list\argDef{[0,0]}}}
sets or indicates the position of the upper
%-% \HDindex{graphics!3D defaults!viewport position}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
left-hand corner of a \twodim{} viewport, relative to the display root
window (the upper left-hand corner of the display is \axiom{[0, 0]}).
%
\item[\axiomFun{viewSizeDefault}]\funArgs{\optArg{list\argDef{[400,400]}}}
sets or indicates the width and height dimensions
%-% \HDindex{graphics!3D defaults!viewport size}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
of a viewport.
%
\item[\axiomFun{viewThetaDefault}]\funArgs{\optArg{float\argDef{\texht{$\pi$}{{\it pi}}/4}}}
resets the default longitudinal view angle,
or returns the current default angle if no argument is given.
%-% \HDindex{graphics!3D commands!theta default}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
When a parameter is specified, the default longitudinal view angle
\texht{$\theta$}{{\it theta}} is set to this value.
%
\item[\axiomFun{viewWriteAvailable}]\funArgs{\optArg{list\argDef{["pixmap",
"bitmap", "postscript", "image"}}}
indicates the possible file types
%-% \HDindex{graphics!3D defaults!available viewport writes}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
that can be created with the \axiomFunFrom{write}{ThreeDimensionalViewport} function.
%
\item[\axiomFun{viewWriteDefault}]\funArgs{\optArg{list\argDef{[]}}}
sets or indicates the default types of files
that are created in addition to the {\bf data} file when a
\axiomFunFrom{write}{ThreeDimensionalViewport} command
%-% \HDindex{graphics!3D defaults!viewport writes}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
is executed on a viewport.
%
\item[\axiomFun{viewScaleDefault}]\funArgs{\optArg{float}}
sets the default scaling factor, or returns
%-% \HDindex{graphics!3D commands!scale default}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
the current factor if no argument is given.
%
\item[\axiomFun{write}]\funArgs{viewport, directory, \optArg{option}}
writes the file {\bf data} for {\it viewport}
in the directory {\it directory}.
An optional third argument specifies a file type (one of {\tt
pixmap}, {\tt bitmap}, {\tt postscript}, or {\tt image}), or a
list of file types.
An additional file is written for each file type listed.
%
\item[\axiomFun{scale}]\funArgs{viewport, float\argDef{2.5}}
specifies the scaling factor.
%-% \HDindex{graphics!3D commands!scale}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
%-% \HDindex{scaling graphs}{ugGraphThreeDopsPage}{7.2.10.}{Operations for Three-Dimensional Graphics}
\enditems
\indent{0}
\texht{\egroup}{}
\endscroll
\autobuttons
\end{page}
%
%
\newcommand{\ugXdefaultsTitle}{Customization using .Xdefaults}
\newcommand{\ugXdefaultsNumber}{7.2.11.}
%
% =====================================================================
\begin{page}{ugXdefaultsPage}{7.2.11. Customization using .Xdefaults}
% =====================================================================
\beginscroll
%-% \HDindex{graphics!.Xdefaults}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
Both the \twodim{} and \threedim{} drawing facilities consult
the {\bf .Xdefaults} file for various defaults.
%-% \HDindex{file!.Xdefaults @{\bf .Xdefaults}}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
The list of defaults that are recognized by the graphing routines
is discussed in this section.
These defaults are preceded by {\tt Axiom.3D.}
for \threedim{} viewport defaults, {\tt Axiom.2D.}
for \twodim{} viewport defaults, or {\tt Axiom*} (no dot) for
those defaults that are acceptable to either viewport type.
%
\indent{0}
\beginitems
%
\item[{\tt Axiom*buttonFont:\ \it font}] \ \newline
This indicates which
%-% \HDindex{graphics!.Xdefaults!button font}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
font type is used for the button text on the control-panel.
\xdefault{Rom11}
%
\item[{\tt Axiom.2D.graphFont:\ \it font}] \quad (2D only) \newline
This indicates
%-% \HDindex{graphics!.Xdefaults!graph number font}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
which font type is used for displaying the graph numbers and
slots in the {\bf Graphs} section of the \twodim{} control-panel.
\xdefault{Rom22}
%
\item[{\tt Axiom.3D.headerFont:\ \it font}] \ \newline
This indicates which
%-% \HDindex{graphics!.Xdefaults!graph label font}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
font type is used for the axes labels and potentiometer
header names on \threedim{} viewport windows.
This is also used for \twodim{} control-panels for indicating
which font type is used for potentionmeter header names and
multiple graph title headers.
%for example, {\tt Axiom.2D.headerFont: 8x13}.
\xdefault{Itl14}
%
\item[{\tt Axiom*inverse:\ \it switch}] \ \newline
This indicates whether the
%-% \HDindex{graphics!.Xdefaults!inverting background}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
background color is to be inverted from white to black.
If {\tt on}, the graph viewports use black as the background
color.
If {\tt off} or no declaration is made, the graph viewports use a
white background.
\xdefault{off}
%
\item[{\tt Axiom.3D.lightingFont:\ \it font}] \quad (3D only) \newline
This indicates which font type is used for the {\bf x},
%-% \HDindex{graphics!.Xdefaults!lighting font}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
{\bf y}, and {\bf z} labels of the two lighting axes potentiometers, and for
the {\bf Intensity} title on the lighting control-panel.
\xdefault{Rom10}
%
\item[{\tt Axiom.2D.messageFont, Axiom.3D.messageFont:\ \it font}] \ \newline
These indicate the font type
%-% \HDindex{graphics!.Xdefaults!message font}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
to be used for the text in the control-panel message window.
\xdefault{Rom14}
%
\item[{\tt Axiom*monochrome:\ \it switch}] \ \newline
This indicates whether the
%-% \HDindex{graphics!.Xdefaults!monochrome}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
graph viewports are to be displayed as if the monitor is black and
white, that is, a 1 bit plane.
If {\tt on} is specified, the viewport display is black and white.
If {\tt off} is specified, or no declaration for this default is
given, the viewports are displayed in the normal fashion for the
monitor in use.
\xdefault{off}
%
\item[{\tt Axiom.2D.postScript:\ \it filename}] \ \newline
This specifies
%-% \HDindex{graphics!.Xdefaults!PostScript file name}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
the name of the file that is generated when a 2D PostScript graph
%-% \HDindex{PostScript}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
is saved.
\xdefault{axiom2D.ps}
%
\item[{\tt Axiom.3D.postScript:\ \it filename}] \ \newline
This specifies
%-% \HDindex{graphics!.Xdefaults!PostScript file name}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
the name of the file that is generated when a 3D PostScript graph
%-% \HDindex{PostScript}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
is saved.
\xdefault{axiom3D.ps}
%
\item[{\tt Axiom*titleFont \it font}] \ \newline
This
%-% \HDindex{graphics!.Xdefaults!title font}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
indicates which font type is used
for the title text and, for \threedim{} graphs,
in the lighting and viewing-volume control-panel windows.
%-% \HDindex{graphics!Xdefaults!2d}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
\xdefault{Rom14}
%
\item[{\tt Axiom.2D.unitFont:\ \it font}] \quad (2D only) \newline
This indicates
%-% \HDindex{graphics!.Xdefaults!unit label font}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
which font type is used for displaying the unit labels on
\twodim{} viewport graphs.
\xdefault{6x10}
%
\item[{\tt Axiom.3D.volumeFont:\ \it font}] \quad (3D only) \newline
This indicates which font type is used for the {\bf x},
%-% \HDindex{graphics!.Xdefaults!volume label font}{ugXdefaultsPage}{7.2.11.}{Customization using .Xdefaults}
{\bf y}, and {\bf z} labels of the clipping region sliders; for the
{\bf Perspective}, {\bf Show Region}, and {\bf Clipping On} buttons under
{\bf Settings}, and above the windows for the {\bf Hither} and
{\bf Eye Distance} sliders in the {\bf Viewing Volume Panel} of the
\threedim{} control-panel.
\xdefault{Rom8}
\enditems
\indent{0}
\endscroll
\autobuttons
\end{page}
%
|