summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pstricks-add/pstricks-add-doc.tex
blob: ccfe20c18ea9eee2845b84db8e4740336a9a381b (plain)
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
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
%% $Id: pstricks-add-doc.tex 20 2008-04-15 18:40:18Z herbert $
\documentclass[12pt]{article}
\listfiles
\usepackage{filecontents}
\begin{filecontents*}{demo0.dat}
    0.1414    0.0052
    0.2828    0.0217
    0.4243    0.0480
    0.5657    0.0890
    0.7071    0.1375
    0.8485    0.1906
    0.9899    0.2663
    1.1314    0.3580
    1.2728    0.4644
    1.4142    0.5801
    1.5556    0.7033
    1.6971    0.8899
    1.8385    1.1143
    1.9799    1.2593
    2.1213    1.5692
    2.2627    3.2331
    2.4042    4.4097
    2.5456    5.8186
    2.6870    7.4441
    2.8284    8.2287
\end{filecontents*}

\begin{filecontents*}{demo1.dat}
1 99447169
2 110351058
3 123557238
4 138346129
5 145050826
6 160363212
7 174000394
8 183856559
9 189128691
10 197634845
11 213257357
12 216899512
13 230152738
14 224144907
15 247410024
16 261168438
17 252920343
18 326153799
19 319442110
20 310351522
21 381919943
22 438043888
23 357527766
24 603304997
\end{filecontents*}

\begin{filecontents*}{demo2.dat}
  1989 3.08
  1990 3.84
  1991 4.08
  1992 3.21
  1993 5.23
  1994 2.97
  1995 2.53
  1996 2.8
  1997 2.78
  1998 3.15
  1999 2.32
  2000 2.4
  2001 2.46
\end{filecontents*}
\begin{filecontents*}{demo3.dat}
  1989 3.08
  1990 3.1
  1991 3.08
  1992 3.21
  1993 5.0
  1994 2.27
  1995 3.53
  1996 3.8
  1997 2.8
  1998 4.15
  1999 3.32
  2000 1.4
  2001 2.46
\end{filecontents*}

\begin{filecontents*}{data3.dat}
 0.000  -2.50   0.005  -1.99  0.010  -0.30
 0.015  4.13  0.020  13.38  0.025  28.98  0.030  50.90  0.035  77.54  0.040  107.38
 0.045  140.64  0.050  178.40  0.055  219.83  0.060  261.04  0.065  296.91  0.070  324.44
 0.075  343.62  0.080  355.50  0.085  361.69  0.090  365.03  0.095  368.62  0.100  373.63
 0.105  378.46  0.110  380.61  0.115  379.02  0.120  373.82  0.125  365.64  0.130  356.65
 0.135  350.11  0.140  346.68  0.145  342.68  0.150  333.46  0.155  318.08  0.160  300.16
 0.165  284.50  0.170  274.03  0.175  269.79  0.180  271.15  0.185  275.29  0.190  278.41
 0.195  278.36  0.200  276.25  0.205  274.57  0.210  273.76  0.215  271.64  0.220  266.67
 0.225  259.84  0.230  253.63  0.235  249.81  0.240  248.42  0.245  248.77  0.250  250.60
 0.255  254.21  0.260  259.40  0.265  264.37  0.270  266.65  0.275  265.49  0.280  262.59
 0.285  260.82  0.290  261.87  0.295  264.55  0.300  265.84  0.305  263.56  0.310  257.47
 0.315  248.74  0.320  238.67  0.325  227.49  0.330  214.46  0.335  198.64  0.340  179.05
 0.345  154.73  0.350  125.23  0.355  91.14  0.360  53.95  0.365  15.45  0.370  -21.37
 0.375  -49.99  0.380  -62.54  0.385  -56.58  0.390  -37.83  0.395  -15.76  0.400  1.86
 0.405  11.54  0.410  13.66  0.415  10.78  0.420  5.87  0.425  1.24  0.430  -1.95
 0.435  -3.54  0.440  -3.98  0.445  -3.80  0.450  -3.43  0.455  -3.16  0.460  -3.09
 0.465  -3.21  0.470  -3.44  0.475  -3.76  0.480  -4.13  0.485  -4.46  0.490  -4.74
 0.495  -4.99  0.500  -5.30  0.505  -5.66  0.510  -6.05  0.515  -6.44  0.520  -6.73
 0.525  -6.81  0.530  -6.67  0.535  -6.38  0.540  -6.08  0.545  -5.83  0.550  -5.66
 0.555  -5.56  0.560  -5.49  0.565  -5.45  0.570  -5.46  0.575  -5.51  0.580  -5.61
 0.585  -5.73  0.590  -5.81  0.595  -5.84  0.600  -5.83  0.605  -5.82  0.610  -5.84
 0.615  -5.87  0.620  -5.91  0.625  -5.98  0.630  -6.07  0.635  -6.17  0.640  -6.30
 0.645  -6.41  0.650  -6.43  0.655  -6.30  0.660  -6.01  0.665  -5.55  0.670  -4.96
 0.675  -4.37  0.680  -3.94  0.685  -3.79  0.690  -3.94  0.695  -4.33  0.700  -4.83
 0.705  -5.31  0.710  -5.65  0.715  -5.85  0.720  -5.95  0.725  -6.02  0.730  -6.10
 0.735  -6.19  0.740  -6.29  0.745  -6.37  0.750  -6.40  0.755  -6.32  0.760  -6.07
 0.765  -5.64  0.770  -5.08  0.775  -4.47  0.780  -3.84  0.785  -3.19  0.790  -2.58
 0.795  -2.11  0.800  -1.84  0.805  -1.78  0.810  -1.90  0.815  -2.15  0.820  -2.45
 0.825  -2.71  0.830  -2.86  0.835  -2.91  0.840  -2.96  0.845  -3.02  0.850  -3.10
 0.855  -3.20  0.860  -3.36  0.865  -3.52  0.870  -3.63  0.875  -3.64  0.880  -3.52
 0.885  -3.30  0.890  -3.04  0.895  -2.80  0.900  -2.59  0.905  -2.42  0.910  -2.27
 0.915  -0.53 0.920  -0.16 0.925  0.08  0.930  0.13  0.935  -0.05  0.940  -0.41
 0.945  -0.90  0.950  -1.44  0.955  -1.99  0.960  -2.46  0.965  -2.79  0.970  -2.98
 0.975  -3.08  0.980  -3.13  0.985  -3.13  0.990  -3.05  0.995  -2.86  1.000  -2.57
\end{filecontents*}

\begin{filecontents*}{data.dat}
0 0
1 1
2 3
3 6
4 6
5 11
6 15
7 18
8 25
9 26
10 32
11 37
12 37
13 44
14 52
15 65
16 67
17 82
18 89
19 104
20 104
21 111
22 133
23 142
24 144
25 166
26 171
27 182
28 205
29 230
30 235
31 256
32 268
33 289
34 322
35 356
36 363
37 394
38 413
39 430
40 461
41 496
42 527
43 563
44 590
45 616
46 616
47 652
48 685
49 694
50 728
51 779
52 785
53 791
54 823
55 846
56 891
57 892
58 894
59 922
60 976
61 1002
62 1025
63 1083
64 1130
65 1173
66 1176
67 1208
68 1211
69 1221
70 1272
71 1281
72 1290
73 1329
74 1379
75 1428
76 1460
77 1489
78 1550
79 1600
80 1666
81 1678
82 1680
83 1760
84 1785
85 1796
86 1874
87 1881
88 1932
89 1936
90 1968
91 2016
92 2091
93 2111
94 2181
95 2227
96 2260
97 2354
98 2371
99 2423
100 2498
101 2552
102 2585
103 2622
104 2676
105 2678
106 2752
107 2842
108 2904
109 2984
110 3029
111 3037
112 3062
113 3162
114 3181
115 3266
116 3364
117 3461
118 3479
119 3494
120 3523
121 3630
122 3668
123 3699
124 3815
125 3939
126 4003
127 4107
128 4168
129 4199
130 4231
131 4304
132 4331
133 4354
134 4416
135 4435
136 4448
137 4514
138 4601
139 4672
140 4736
141 4843
142 4845
143 4923
144 5059
145 5095
146 5240
147 5255
148 5289
149 5393
150 5475
151 5586
152 5647
153 5669
154 5733
155 5837
156 5871
157 5881
158 5970
159 5973
160 6055
161 6107
162 6266
163 6399
164 6402
165 6474
166 6605
167 6669
168 6837
169 6908
170 6958
171 7103
172 7183
173 7319
174 7464
175 7513
176 7672
177 7693
178 7841
179 7891
180 8035
181 8200
182 8337
183 8515
184 8545
185 8546
186 8632
187 8793
188 8822
189 8996
190 9073
191 9227
192 9317
193 9381
194 9394
195 9494
196 9614
197 9744
198 9805
199 9923
200 9942
201 10079
202 10169
203 10322
204 10393
205 10570
206 10723
207 10802
208 10862
209 10958
210 11054
211 11216
212 11409
213 11528
214 11659
215 11793
216 11888
217 11900
218 12081
219 12082
220 12161
221 12311
222 12345
223 12403
224 12469
225 12678
226 12695
227 12732
228 12863
229 12896
230 13120
231 13142
232 13361
233 13549
234 13702
235 13821
236 13978
237 14182
238 14356
239 14472
240 14668
241 14794
242 15008
243 15092
244 15148
245 15172
246 15218
247 15430
248 15639
249 15744
250 15973
251 16076
252 16233
253 16466
254 16572
255 16752
256 16987
257 17013
258 17034
259 17101
260 17301
261 17495
262 17576
263 17604
264 17610
265 17720
266 17924
267 17933
268 17997
269 18152
270 18353
271 18417
272 18553
273 18663
274 18897
275 18934
276 19092
277 19366
278 19615
279 19783
280 19980
281 20044
282 20249
283 20484
284 20623
285 20641
286 20718
287 20937
288 21202
289 21401
290 21403
291 21657
292 21667
293 21693
294 21893
295 22053
296 22115
297 22207
298 22342
299 22617
300 22724
301 22851
302 23048
303 23263
304 23379
305 23586
306 23597
307 23761
308 23853
309 24112
310 24421
311 24718
312 24904
313 25001
314 25298
315 25387
316 25430
317 25611
318 25895
319 26138
320 26186
321 26482
322 26753
323 27073
324 27266
325 27497
326 27663
327 27871
328 27982
329 28032
330 28037
331 28082
332 28363
333 28416
334 28626
335 28672
336 28995
337 29143
338 29192
339 29491
340 29515
341 29618
342 29731
343 30003
344 30259
345 30288
346 30312
347 30613
348 30730
349 30941
350 30951
351 31118
352 31438
353 31582
354 31722
355 31984
356 32116
357 32425
358 32780
359 32841
360 33017
361 33378
362 33523
363 33742
364 33859
365 34163
366 34349
367 34687
368 34755
369 34939
370 35136
371 35226
372 35456
373 35802
374 35957
375 36266
376 36623
377 36876
378 37192
379 37566
380 37901
381 37914
382 37974
383 38260
384 38311
385 38329
386 38347
387 38354
388 38724
389 38794
390 39163
391 39372
392 39656
393 39959
394 40224
395 40446
396 40550
397 40604
398 40932
399 41331
400 41533
401 41920
402 42274
403 42338
404 42644
405 42815
406 42962
407 43222
408 43457
409 43615
410 44001
411 44263
412 44274
413 44427
414 44545
415 44916
416 45298
417 45523
418 45537
419 45659
420 45793
421 46125
422 46455
423 46725
424 46751
425 46820
426 46954
427 47162
428 47361
429 47709
430 47981
431 48040
432 48241
433 48585
434 48745
435 49167
436 49215
437 49652
438 49977
439 50108
440 50161
441 50399
442 50421
443 50523
444 50637
445 50846
446 51223
447 51592
448 51740
449 52142
450 52447
451 52813
452 53012
453 53333
454 53380
455 53556
456 53876
457 54028
458 54231
459 54642
460 54935
461 55191
462 55618
463 55978
464 56029
465 56051
466 56356
467 56503
468 56582
469 56709
470 57169
471 57598
472 57751
473 58214
474 58566
475 58695
476 58963
477 59314
478 59719
479 60158
480 60380
481 60582
482 60674
483 61030
484 61163
485 61328
486 61752
487 61764
488 61978
489 62369
490 62556
491 62997
492 63268
493 63736
494 63796
495 63874
496 63896
497 64259
498 64582
499 65061
500 65410
501 65879
502 66153
503 66445
504 66799
505 67153
506 67345
507 67747
508 67976
509 68216
510 68324
511 68635
512 68883
513 69203
514 69359
515 69871
516 69924
517 70071
518 70523
519 70604
520 70849
521 71038
522 71307
523 71553
524 72026
525 72365
526 72788
527 72928
528 73199
529 73601
530 73648
531 73825
532 74113
533 74258
534 74283
535 74611
536 75104
537 75609
538 75804
539 76075
540 76480
541 76837
542 77166
543 77602
544 77886
545 78348
546 78793
547 79243
548 79711
549 80033
550 80149
551 80449
552 80563
553 80750
554 80930
555 81198
556 81252
557 81324
558 81835
559 82227
560 82730
561 82861
562 83211
563 83399
564 83482
565 83678
566 84126
567 84131
568 84501
569 84542
570 84772
571 85126
572 85250
573 85594
574 85694
575 85710
576 85776
577 86099
578 86327
579 86451
580 86512
581 86955
582 87037
583 87541
584 87928
585 88137
586 88585
587 88877
588 89170
589 89241
590 89780
591 89880
592 89990
593 90462
594 90538
595 90720
596 91265
597 91809
598 92109
599 92707
600 93188
601 93341
602 93621
603 94003
604 94474
605 94659
606 95163
607 95281
608 95511
609 95837
610 96311
611 96859
612 97314
613 97744
614 97854
615 98301
616 98710
617 99216
618 99678
619 99820
620 100357
621 100957
622 101109
623 101361
624 101383
625 101726
626 101765
627 101848
628 102168
629 102246
630 102392
631 102516
632 102949
633 102973
634 103258
635 103663
636 104075
637 104558
638 104941
639 105149
640 105342
641 105760
642 105926
643 106075
644 106412
645 106561
646 106900
647 107513
648 108090
649 108266
650 108268
651 108901
652 108959
653 109365
654 109642
655 110203
656 110707
657 111246
658 111438
659 111922
660 112262
661 112916
662 113319
663 113661
664 114136
665 114291
666 114722
667 115066
668 115095
669 115461
670 115697
671 116359
672 116550
673 116919
674 116974
675 117531
676 117767
677 118054
678 118510
679 118664
680 119002
681 119298
682 119431
683 119704
684 120280
685 120542
686 120998
687 121446
688 121450
689 121882
690 122081
691 122738
692 122853
693 123331
694 123626
695 124268
696 124389
697 124497
698 125149
699 125734
700 126280
701 126797
702 127219
703 127346
704 127842
705 128531
706 128899
707 129465
708 129540
709 130021
710 130072
711 130693
712 131143
713 131843
714 131949
715 132401
716 132554
717 132861
718 133249
719 133770
720 134488
721 135178
722 135190
723 135404
724 135851
725 136059
726 136174
727 136739
728 136997
729 137702
730 138214
731 138587
732 139096
733 139241
734 139840
735 140159
736 140309
737 140922
738 141616
739 142352
740 142763
741 143147
742 143484
743 144165
744 144608
745 144686
746 145034
747 145417
748 145939
749 145981
750 146171
751 146608
752 147226
753 147718
754 148254
755 148487
756 148668
757 149226
758 149314
759 149434
760 150073
761 150366
762 150797
763 150951
764 151291
765 151813
766 152307
767 152588
768 153185
769 153313
770 153483
771 154016
772 154602
773 154805
774 154890
775 155126
776 155806
777 156377
778 156692
779 156734
780 156883
781 157412
782 157929
783 158547
784 158764
785 158973
786 159385
787 159416
788 159637
789 159670
790 160103
791 160549
792 160679
793 161283
794 161951
795 162320
796 162776
797 163374
798 164039
799 164090
800 164460
801 164947
802 165162 803 165373 804 165703 805 165906 806 166207 807 166815
808 167412 809 168041 810 168758 811 168994 812 169548 813 170116
814 170134 815 170275 816 170725 817 171110 818 171652 819 172034
820 172524 821 172996 822 173240 823 174005 824 174380 825 175092
826 175597 827 176176 828 176920 829 177290 830 177982 831 178062
832 178824 833 179596 834 179693 835 180165 836 180650 837 181475
838 182033 839 182121 840 182814 841 183388 842 183971 843 184270
844 184786 845 185560 846 186048 847 186777 848 187228 849 187467
850 187788 851 187831 852 187835 853 187979 854 188220 855 188853
856 189642 857 190249 858 190994 859 191590 860 192304 861 192904
862 193122 863 193575 864 194069 865 194874 866 195488 867 196335
868 197090 869 197859 870 198241 871 198948  872 199153 873 199264
874 199531 875 200155 876 200335 877 201046 878 201848 879 201885
880 201979 881 202107 882 202892 883 203113 884 203406 885 203888
886 204508 887 204880 888 205419 889 206285 890 206301 891 206455
892 206902 893 207157 894 207246 895 207758 896 208566 897 208977
898 209635 899 209773 900 210085 901 210951 902 211525 903 211557
904 212143 905 212342 906 212833 907 213309 908 213515 909 214052
910 214773 911 215134 912 215895 913 216268 914 216808 915 217435
916 217828 917 217888 918 218804 919 219013 920 219563 921 219629
922 220022 923 220829 924 221335 925 221385 926 221772 927 222538
928 223369 929 223421 930 224214 931 224950 932 225376 933 225441
934 225647 935 225874 936 226647 937 227340 938 227981 939 228754
940 229465 941 230385 942 230550 943 231021 944 231829 945 232030
946 232657 947 232855 948 233463 949 234013 950 234622 951 235472
952 235775 953 235914 954 236551 955 236951 956 237532 957 237668
958 238018 959 238404 960 239162 961 239195 962 240002 963 240893
964 241209 965 242172 966 242201 967 242263 968 242465 969 243094
970 243710 971 243799 972 244333 973 244861 974 245416 975 246031
976 246139 977 246486 978 247242 979 247666 980 247869 981 248654
982 249249 983 249324 984 249402 985 250116 986 250382 987 250517
988 251198 989 251929 990 252212 991 252213 992 252493 993 253441
994 253948 995 254830 996 254984 997 255322 998 256249 999 256500
\end{filecontents*}

\begin{filecontents*}{dataMul.dat}
[% file dataMul.dat
0    0    3.375    0.0625 10    5.375    7.1875    4.5
20    7.1875    8.375    6.25 30    5.75    7.75    6.6875
40    2.1875    5.75    5.9375 50    -1.9375    2.1875    4.3125
60    -5.125    -1.8125    0.875 70    -6.4375    -5.3125    -2.6875
80    -4.875    -7.1875    -4.875 90    0    -7.625    -5.625
100    5.5    -6.3125    -5.8125 110    6.8125    -2.75    -4.75
120    5.25    2.875    -0.75
]%
\end{filecontents*}

\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{pamathx}
\usepackage[scaled]{luximono}
%\usepackage{mathptmx}
\usepackage[lmargin=2.5cm,bmargin=3cm]{geometry}
\usepackage{tabularx}
\usepackage{graphicx,ragged2e}
\usepackage{xkvview}
\usepackage[svgnames,dvipsnames,table]{pstricks}
\usepackage{framed,xspace,multirow,caption}
\usepackage{pst-eucl,pst-fun}
\usepackage{pstricks-add}
\let\pstricksaddFV\fileversion
\def\PST{\texttt{PSTricks}}
\newcommand*\PostScript{\textsf{PostScript}\xspace}
%
%
\usepackage{longtable}
\usepackage{pifont}
\def\textat{\protect\makeatletter\texttt{@}\protect\makeatother}
\makeatletter
\renewcommand*\l@section{\@dottedtocline{1}{1.5em}{2.5em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{3.8em}{3.2em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{7.0em}{4.1em}}
\renewcommand*\l@paragraph{\@dottedtocline{4}{10em}{5em}}
\renewcommand*\l@subparagraph{\@dottedtocline{5}{12em}{6em}}
\makeatother
\let\psEllipticArc\psellipticarc
\let\psEllipticArcN\psellipticarcn
\let\psWedgeEllipse\psellipticwedge
%\parindent=0pt
\newcommand\verbI[1]{{\small\texttt{#1}}}
\newcommand\CMD[1]{{\texttt{\textbackslash#1}}}
\let\param\texttt
%
\newcommand{\pstEllipse}[5][]{%
  \psset{#1}
  \parametricplot{#4}{#5}{#2\space t cos mul #3\space t sin mul}%
}
%
\newcommand{\pstEllipseWedge}[5][]{%
  \psset{#1}
  \pscustom{%
    \parametricplot{#4}{#5}{#2\space t cos mul #3\space t sin mul}%
    \psline(! #2\space #5\space cos mul #3\space #5\space sin mul)%
       (0,0)%
       (! #2\space #4\space cos mul #3\space #4\space sin mul)%
  }%
}
%
\psset{subgriddiv=0,griddots=5,gridlabels=7pt}
%
\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
\def\PS{PostScript}
%
%\renewcommand{\ttdefault}{ul9}% Luxi Mono

\parindent=0pt
\parskip=1ex plus 5pt

\usepackage[colorlinks,linktocpage]{hyperref}
\makeatletter
\def\verbatim@font{\small\normalfont\ttfamily}
\makeatother
\usepackage{showexpl}
\lstset{preset=\RaggedRight}
\lstdefinestyle{syntax}{backgroundcolor=\color{blue!20},numbers=none,xleftmargin=0pt,xrightmargin=0pt,
    frame=single}
\usepackage{amsmath}

\newdimen\fullWidth 
\makeatletter
\renewcommand\ON{%
  \gdef\lst@alloverstyle##1{%
    \fboxrule=0pt
    \fboxsep=0pt
    \fcolorbox{DarkBlue}{DarkBlue}{\textcolor{white}{\bfseries\strut##1}}%
}}
\renewcommand\OFF{%
  \xdef\lst@alloverstyle##1{##1}%
}

\makeatother
\lstset{escapechar=§}


\begin{document}
\fullWidth=\linewidth
\advance\fullWidth by \marginparsep
\advance\fullWidth by \marginparwidth

\title{\texttt{pstricks-add}\\additionals Macros for \texttt{pstricks}%
%\thanks{%
%    This document was written with \texttt{Kile: 1.7 (Qt: 3.1.1; KDE: 3.3;}
%    \url{http://sourceforge.net/projects/kile/}) and the PDF output
%    was build with VTeX/Free (\url{http://www.micropress-inc.com/linux})}
\\
    \small v.\pstricksaddFV}
\author{Dominique Rodriguez and Herbert Vo\ss}
\date{\today}

\maketitle

\begin{abstract}
This version of \verb+pstricks-add+ needs \verb+pstricks.tex+ version >1.04 from June 2004,
otherwise the additional macros may not work as espected. The ellipsis
material and the option \verb+asolid+ (renamed to \verb+eofill+) are 
\index{fillstyle!eofill@\texttt{eofill}}
now part of the new \verb+pstricks.tex+ package, available at CTAN or at
\url{http://perce.de/LaTeX/}. \verb+pstricks-add+ will for ever be an experimental and
dynamical package, try it at your own risk.
 
\begin{itemize}
\item It is important to load \verb+pstricks-add+ as \textbf{last} PSTricks related package, otherwise
a lot of the macros won't work in the expected way. 
\item \verb+pstricks-add+ uses the extended version of the keyval package. So be sure, that
you have installed \verb+pst-xkey+ which is part of the \verb+xkeyval+-package and that all
packages, that uses the old keyval interface are loaded \textbf{before} the \verb+xkeyval+.\cite{xkeyval}
\item the option \verb+tickstyle+ from \verb+pst-plot+ is no more supported, use \verb+ticksize+ instead.
\item the option \verb+xyLabel+ is no more supported, use the option \verb+labelFontSize+ instead.
\end{itemize}

\end{abstract}

\clearpage
\tableofcontents

\clearpage
%--------------------------------------------------------------------------------------
\part{\texttt{pstricks}}
%--------------------------------------------------------------------------------------

%--------------------------------------------------------------------------------------
\section{Numeric functions}
%--------------------------------------------------------------------------------------

All macronames contain a \textat{} in their name, because they are only for internal use,
but it is no problem to use it as the other macros. One can define another name without 
a \textat{}:
\begin{lstlisting}[style=syntax]
\makeatletter
\let\pstdivide\pst@divide
\makeatother
\end{lstlisting}

or put the macro inside of the \verb+\makeatletter+ -- \verb+\makeatother+ sequence.

%--------------------------------------------------------------------------------------
\subsection{\CMD{pst\textat{}divide}}
%--------------------------------------------------------------------------------------

\verb+pstricks+ itself has its own divide macro, called \verb+\pst@divide+ which 
can divide two lengthes and saves the quotient as a floating point number:
\index{Division}
%
\begin{lstlisting}[style=syntax]
\pst@divide{<dividend>}{<divisor>}{<result as a macro>}
\end{lstlisting}

\begin{LTXexample}[width=2cm]
\makeatletter
\pst@divide{34pt}{6pt}\quotient \quotient\\
\pst@divide{-6pt}{34pt}\quotient \quotient
\makeatother
\end{LTXexample}

\noindent this gives the output $5.66666$. The result is not a length!

%--------------------------------------------------------------------------------------
\subsection{\CMD{pst\textat{}mod}}
%--------------------------------------------------------------------------------------
\verb+pstricks-add+ defines an additional numeric function for the modulus:
\index{Modulus}

\begin{lstlisting}[style=syntax]
\pst@mod{<integer>}{<integer>}{<result as a macro>}
\end{lstlisting}

\begin{LTXexample}[width=2cm]
\makeatletter
\pst@mod{34}{6}\modulo \modulo\\
\pst@mod{25}{-6}\modulo \modulo
\makeatother
\end{LTXexample}

\noindent this gives the output $4$. Using this internal numeric functions in documents
requires a setting inside the \verb+makeatletter+ and \verb+makeatother+ environment.
It makes some sense to define a new macroname in the preamble to use it throughou, e.g.
\verb+\let\modulo\pst@mod+.

%--------------------------------------------------------------------------------------
\subsection{\CMD{pst\textat{}max}}
%--------------------------------------------------------------------------------------

\begin{lstlisting}[style=syntax]
\pst@max{<integer>}{<integer>}{<result as count register>}
\end{lstlisting}

\begin{LTXexample}[width=2cm]
\newcount\maxNo
\makeatletter
\pst@max{-34}{-6}\maxNo \the\maxNo\\
\pst@max{0}{11}\maxNo \the\maxNo
\makeatother
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{\CMD{pst\textat{}maxdim}}
%--------------------------------------------------------------------------------------

\begin{lstlisting}[style=syntax]
\pst@maxdim{<dimension>}{<dimension>}{<result as dimension register>}
\end{lstlisting}

\begin{LTXexample}[width=2cm]
\newdimen\maxDim
\makeatletter
\pst@maxdim{34cm}{1234pt}\maxDim \the\maxDim\\
\pst@maxdim{34cm}{123pt}\maxDim \the\maxDim
\makeatother
\end{LTXexample}

%--------------------------------------------------------------------------------------
\subsection{\CMD{pst\textat{}abs}}
%--------------------------------------------------------------------------------------

\begin{lstlisting}[style=syntax]
\pst@abs{<integer>}{<result as a count register>}
\end{lstlisting}

\begin{LTXexample}[width=2cm]
\newcount\absNo
\makeatletter
\pst@abs{-34}\absNo \the\absNo\\
\pst@abs{4}\absNo \the\absNo
\makeatother
\end{LTXexample}

%--------------------------------------------------------------------------------------
\subsection{\CMD{pst\textat{}absdim}}
%--------------------------------------------------------------------------------------

\begin{lstlisting}[style=syntax]
\pst@absdim{<dimension>}{<result as a dimension register>}
\end{lstlisting}

\begin{LTXexample}[width=2cm]
\newdimen\absDim
\makeatletter
\pst@absdim{-34cm}\absDim \the\absDim\\
\pst@absdim{4sp}\absDim \the\absDim
\makeatother
\end{LTXexample}

%--------------------------------------------------------------------------------------
\section{Dashed Lines}
%--------------------------------------------------------------------------------------
Tobias Nähring implemented an enhanced feature for dashed lines. The number
of arguments is no more limited.

\begin{lstlisting}[style=syntax]
dash=value1[unit] value2[unit] ...
\end{lstlisting}

\begin{LTXexample}[width=0.4\linewidth]
\psset{linewidth=2.5pt,unit=0.6}
\begin{pspicture}(-5,-4)(5,4)
 \psgrid[subgriddiv=0,griddots=10,gridlabels=0pt]
  \psset{linestyle=dashed}
  \pscurve[dash=5mm 1mm 1mm 1mm,linewidth=0.1](-5,4)(-4,3)(-3,4)(-2,3)
  \psline[dash=5mm 1mm 1mm 1mm 1mm 1mm 1mm 1mm 1mm 1mm](-5,0.9)(5,0.9)
  \psccurve[linestyle=solid](0,0)(1,0)(1,1)(0,1)
  \psccurve[linestyle=dashed,dash=5mm 2mm 0.1 0.2,linetype=0](0,0)(-2.5,0)(-2.5,-2.5)(0,-2.5)
  \pscurve[dash=3mm 3mm 1mm 1mm,linecolor=red,linewidth=2pt](5,-4)(5,2)(4.5,3.5)(3,4)(-5,4)
\end{pspicture}
\end{LTXexample}

%--------------------------------------------------------------------------------------
\section{\CMD{rmultiput}: a multiple \CMD{rput}}
%--------------------------------------------------------------------------------------
\verb+PSTricks+ already knows a \verb+multirput+, which puts a box n times with
a difference of $dx$ and $dy$ relativ to each other. It is not possible to put
it with a different distance from one point to the next one. This is possible
with \verb+rmultiput+:
\begin{lstlisting}[style=syntax]
\rmultiput[<options>]{<any material>}(x1,y1)(x2,y2) ... (xn,yn)
\rmultiput*[<options>]{<any material>}(x1,y1)(x2,y2) ... (xn,yn)
\end{lstlisting}

\begin{LTXexample}[width=6.2cm]
\psset{unit=0.75}
\begin{pspicture}(-4,-4)(4,4)
\rmultiput[rot=45]{\red\psscalebox{3}{\ding{250}}}%
    (-2,-4)(-2,-3)(-3,-3)(-2,-1)(0,0)(1,2)(1.5,3)(3,3)
\rmultiput[rot=90,ref=lC]{\blue\psscalebox{2}{\ding{253}}}%
    (-2,2.5)(-2,2.5)(-3,2.5)(-2,1)(1,-2)(1.5,-3)(3,-3)
\psgrid[subgriddiv=0,gridcolor=lightgray]
\end{pspicture}
\end{LTXexample}

%--------------------------------------------------------------------------------------
\section{\CMD{psrotate}: Rotating objects}
%--------------------------------------------------------------------------------------
\CMD{rput} also has an optional argument for rotating objects, but always
depending to the \CMD{rput} coordinates. With \CMD{psrotate}  the rotating
center can be placed anywhere. The rotation is done with \verb+\pscustom+,
all optional arguments are only valid if they are part of the \verb+\pscustom+
macro.
\begin{lstlisting}[style=syntax]
\psrotate[options](x,y){rot angle}{<object>}
\end{lstlisting}

\begin{LTXexample}[width=0.4\linewidth]
\psset{unit=0.75}
\begin{pspicture}(-0.5,-3.5)(8.5,4.5)
  \psaxes{->}(0,0)(-0.5,-3)(8.5,4.5)
  \psdots[linecolor=red,dotscale=1.5](2,1)
  \psarc[linecolor=red,linewidth=0.4pt,showpoints=true]
        {->}(2,1){3}{0}{60}
  \pspolygon[linecolor=green,linewidth=1pt](2,1)(5,1.1)(6,-1)(2,-2)
  \psrotate(2,1){60}{%
    \pspolygon[linecolor=blue,linewidth=1pt](2,1)(5,1.1)(6,-1)(2,-2)}
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=6cm]
\def\canne{%  Idea by Manuel Luque
  \psgrid[subgriddiv=0](-1,0)(1,5)
  \pscustom[linewidth=2mm]{\psline(0,4)\psarcn(0.3,4){0.3}{180}{360}}%
  \pscircle*(0.6,4){0.1}\pstriangle*(0,0)(0.2,-0.3)}
\def\Object{}
\begin{pspicture}(-1,-1)(3,6)
  \canne
  \psrotate(0.3,4){45}{\psset{linecolor=red!50}\canne}
  \psrotate(0.3,4){90}{\psset{linecolor=blue!50}\canne}
  \psrotate(0.3,4){360}{\psset{linecolor=cyan!50}\canne}
  \psdot[linecolor=red](0.3,4)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[pos=t,wide]
\def\majorette{\psline[linewidth=0.5mm](0,2)%  Idea by Manuel Luque
               \pscircle[fillstyle=solid]{0.1}
               \pscircle[fillstyle=solid](0,2){0.1}}
\begin{pspicture}(0,-6)(15,5)
  \psaxes[linewidth=0.5pt]{->}(0,0)(0,-5)(15,5)
  \pstVerb{/V0 10 def /Alpha 45 def}% vitesse initiale, angle de lancement
  \multido{\nT=0.0+0.05,\iA=0+40}{41}{%
    \pstVerb{/nT \nT\space def}%
    \rput(!V0 Alpha cos mul nT mul -9.81 2 div nT dup mul mul V0 Alpha sin mul nT mul add){%
       \psrotate(0,1){\iA}{\majorette\psdot[linecolor=red](0,1)\psdot[linecolor=green](0,2)}}}
  \parametricplot[linecolor=red]{0}{2}{% trajectoire du milieu
     V0 Alpha cos mul t mul -9.81 2 div t dup mul mul V0 Alpha sin mul t mul add 1 add}
  \parametricplot[linecolor=green,plotpoints=360]{0}{2}{% d'une extrémité
     V0 Alpha cos mul t mul 800 t mul sin sub % x(t)
     -9.81 2 div t dup mul mul V0 Alpha sin mul t mul add 1 add 800 t mul cos add }%y(t)
\end{pspicture}
\end{LTXexample}


\clearpage
%--------------------------------------------------------------------------------------
\section{\CMD{psPie}: a pie chart}
%--------------------------------------------------------------------------------------

\begin{lstlisting}[style=syntax]
\psPie[<options>]{comma separated value list}{comma separated value list}{radius}
\end{lstlisting}

The special optional arguments for the \CMD{psPie} macro are as follows:

\begin{tabularx}{\linewidth}{@{}>{\ttfamily}lX>{\ttfamily}l@{}}
\textrm{\emph{name}} & \textrm{\emph{description}} & \textrm{\emph{default}}\\\hline
pieSep	& distance from the pie chart center center to an outraged pie piece & 10pt\\
pieColor & gray or colored pie (values are: \texttt{gray} or \texttt{color})& gray\\
userColor & a comma separated list of user defined colors for the pie & \{\}
\end{tabularx}

\bigskip
The first mandatory argument is the list of the values and may not be empty. The second
one is a list of outraged pieces, numbered consecutively from 1 to up the total number
of values. The list of user defined colors must be enclosed in braces!

The macro \CMD{psPie} defines for every value three nodes at the half angle and
in distances from 0.75, 1, and 1.25 times of the radius from the origin. The nodes
are named as \verb+psPieI?+, \verb+psPie?+, and \verb+psPieO?+, where ? is the number of
the pie. The letter I leads to the inner node and the letter O to the outer node. The
other one is the node on the circle line.
The
origin is by default \texttt{(0,0)}. Moving the pie to another position can be done as
usual with the \CMD{rput}-macro. The used colors are named internally as \verb+pieFillColor?+
and can be used by the user for coloring lines or text.


\begin{LTXexample}[width=6cm]
\begin{pspicture}(-3,-3)(3,3)
\psPie{ 23, 29, 3, 26, 28, 14 }{}{2}
\multido{\iA=1+1}{6}{%
  \psdot(psPie\iA)\psdot(psPieI\iA)\psdot(psPieO\iA)%
  \psline[linestyle=dashed,linecolor=white](psPie\iA)
  \psline[linestyle=dashed](psPie\iA)(psPieO\iA)}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6cm]
\begin{pspicture}(-3,-3)(3,3)
\psPie[pieColor=color]{ 45, 90 }{ 1 }{2}
\ncline[linecolor=-pieFillColor1,
  nodesepB=-20pt]{psPieO1}{psPie1}
\rput[l](psPieO1){%
  \textcolor{pieFillColor1}{pie no 1}}
\ncline[linecolor=-pieFillColor2,
  nodesepB=-20pt]{psPieO2}{psPie2}
\rput[lt](psPieO2){%
  \textcolor{pieFillColor2}{pie no 2}}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=7.5cm]
\psframebox[fillcolor=black!20,
  fillstyle=solid]{%
\begin{pspicture}(-3.5,-3.5)(4.25,3.5)
\psPie[pieColor=color]%
  {23, 29, 3, 26, 28, 14, 17, 4, 9}{}{2}
\multido{\iA=1+1}{9}{%
  \ncline[linecolor=-pieFillColor\iA,
    nodesepB=-10pt]{psPieO\iA}{psPie\iA}
  \rput[l](psPieO\iA){%
    \textcolor{pieFillColor\iA}{pie no \iA}}}
\end{pspicture}}
\end{LTXexample}

\begin{LTXexample}[width=6cm]
\begin{pspicture}(-3,-3)(3,3)
\psPie[userColor={red!30,green!30,
    blue!40,gray,magenta!60,cyan}]%
      { 23, 29, 3, 26, 28, 14 }{1,4}{2}
\end{pspicture}
\end{LTXexample}



\begin{LTXexample}[width=6cm]
\begin{pspicture}(-3,-3)(3,3)
\psPie{ 23, 29, 3, 26, 28, 14 }{}{2}
\multido{\iA=1+1}{6}{\rput*(psPieI\iA){\iA}}
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\section{\CMD{psHomothetie}: central dilatation}
%--------------------------------------------------------------------------------------

\begin{lstlisting}[style=syntax]
\psHomothetie[<options>](<center>){<factor>}{<object>}
\end{lstlisting}

\begin{LTXexample}[width=9cm]
\begin{pspicture}[showgrid=true](-5,-4)(4,8)
\psBill% needs package pst-fun
\psHomothetie[linecolor=blue](4,-3){2}{\psBill}
\psdots[dotsize=3pt,linecolor=red](4,-3)
\pstVerb{ /m -3 -0.85 sub 4 0.6 sub div def }
\psplot[linestyle=dashed,linecolor=red]{-5}{4}{ m x mul m 4 mul sub 3 sub }
\psHomothetie[linecolor=green](4,-3){-0.2}{\psBill}
\end{pspicture}
\end{LTXexample}



\clearpage

%--------------------------------------------------------------------------------------
\section{\CMD{psbrace}}
%--------------------------------------------------------------------------------------
\subsection{Syntax}
\begin{lstlisting}[style=syntax]
\psbrace[<options>](<A>)(<B>){<text>}
\psbrace*[<options>](<A>)(<B>){<text>}
\end{lstlisting}


\begin{LTXexample}[width=4.5cm]
\begin{pspicture}(4,4)
\psgrid[subgriddiv=0,griddots=10]
\pnode(0,0){A}
\pnode(4,4){B}
\psbrace[linecolor=red,ref=lC](A)(B){Text I}
\psbrace*[linecolor=blue,ref=lC](3,4)(0,1){Text II}
\psbrace[fillcolor=white](3,0)(3,4){III}
\end{pspicture}
\end{LTXexample}

\bigskip
The option \verb|\specialCoor| is enabled, so that all types of coordinates 
are possible, (nodename), ($x,y$), ($nodeA|nodeB$), \ldots
The star version fills the inner of the brace with the current linecolor.
With the fillcolor \verb+white+ or any other background color the brace can
be "`unfilled"'.
%--------------------------------------------------------------------------------------
\subsection{Options}
%--------------------------------------------------------------------------------------

Additional to all other available options from \verb|pstricks| or the other 
related packages,  there are two new option, named  \verb|braceWidth| and 
\verb|bracePos|. All important ones are shown in the following graphics
and table.

\begin{center}
\begin{pspicture}[showgrid=true](10,5)
  \psbrace[braceWidth=1cm,braceWidthInner=1cm,
    braceWidthOuter=1cm,bracePos=0.6,fillcolor=white,
    nodesepA=10mm,nodesepB=10mm](0,5)(10,5){\fbox{Label}}
\pcline{<->}(3,3)(3,4)\ncput*{\footnotesize\ttfamily braceWidth}
\pcline{<->}(3,4)(3,5)\ncput*{\footnotesize\ttfamily braceWidthInner}
\pcline{<->}(3,2)(3,3)\ncput*{\footnotesize\ttfamily braceWidthOuter}
\pcline{<->}(6,1)(6,2)\ncput{\footnotesize\ttfamily nodesepB}
\pcline{<->}(6,1)(7,1)\ncput*{\footnotesize\ttfamily A}
\pcline{<->}(0,0.5)(6,0.5)\ncput*{\footnotesize\ttfamily bracePos}
\psdot[dotscale=2](0,5)\uput[0](0,5){\textbf{A}}
\psdot[dotscale=2](10,5)\uput[180](10,5){\textbf{B}}
\end{pspicture}
\end{center}

A positive value for \verb+nodesepA+ and \verb+B+ shifts the label to the right
(\verb+nodesepA+) and down (\verb+nodesepB+). This does not depends the the
value for the rotating of the label!

\begin{center}
\begin{tabular}{l|l}
name & meaning\\\hline
\verb|braceWidth| & default is \verb+2\pslinewidth+\\
\verb|braceWidthInner| & default is \verb+10\pslinewidth+\\
\verb|braceWidthOuter| & default is \verb+10\pslinewidth+\\
\verb|bracePos| & relative position (default is $0.5$)\\
\verb|nodesepA| & x-separation (default is $0pt$)\\
\verb|nodesepB| & y-separation (default is $0pt$)\\
\verb|rot| & additional rotating for the text (default is $0$)\\
\verb|ref| & reference point for the text (default is c)\\
\verb|fillcolor| & default is black
\end{tabular}
\end{center}

By default the text is written perpedicular to the brace line and can be changed with
the \verb|pstricks| option \verb|rot=...|. The text parameter can take any object and
may also be empty. The reference point can be any value of the combination of \verb|l| (left) 
or \verb|r| (right) and \verb|b| (bottom) or \verb|B| (Baseline) or \verb|C| (center) 
or \verb|t| (top), where the default is \verb|c|, the center of the object.

%--------------------------------------------------------------------------------------
%\subsection{Examples}
%--------------------------------------------------------------------------------------

\begin{LTXexample}
\begin{pspicture}(8,2.5)
\psbrace(0,0)(0,2){\fbox{Text}}%
\psbrace[nodesepA=10pt](2,0)(2,2){\fbox{Text}}
\psbrace[ref=lC](4,0)(4,2){\fbox{Text}}
\psbrace[ref=lt,rot=90,nodesepB=-15pt](6,0)(6,2){\fbox{Text}}
\psbrace[ref=lt,rot=90,nodesepA=-5pt,nodesepB=15pt](8,2)(8,0){\fbox{Text}}
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}
\def\someMath{$\int\limits_1^{\infty}\frac{1}{x^2}\,dx=1$}
\begin{pspicture}(8,2.5)
\psbrace[ref=lC](0,0)(0,2){\someMath}%
\psbrace[rot=90](2,0)(2,2){\someMath}
\psbrace[ref=lC](4,0)(4,2){\someMath}
\psbrace[ref=lt,rot=90,nodesepB=-30pt](6,0)(6,2){\someMath}
\psbrace[ref=lt,rot=90,nodesepB=30pt](8,2)(8,0){\someMath}
\end{pspicture}
\end{LTXexample}

%$

\begin{LTXexample}
\begin{pspicture}(\linewidth,5)
\psbrace(0,0.5)(\linewidth,0.5){\fbox{Text}}%
\psbrace[bracePos=0.25,nodesepB=10pt,rot=90](0,2)(\linewidth,2){\fbox{Text}}
\psbrace[ref=lC,nodesepA=-3.5cm,nodesepB=15pt,rot=90](0,4)(\linewidth,4){%
   \fbox{some very, very long wonderful Text}}
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=8cm,wide]
\psset{unit=0.8}
\begin{pspicture}(10,11)
\psgrid[subgriddiv=0,griddots=10]
\pnode(0,0){A}
\pnode(4,6){B}
\psbrace[ref=lC](A)(B){One}
\psbrace[rot=180,nodesepA=-5pt,ref=rb](B)(A){Two}
\psbrace[linecolor=blue,bracePos=0.25,ref=lB](8,1)(1,7){Three}
\psbrace[braceWidth=-1mm,rot=180,ref=rB](8,1)(1,7){Four}
\psbrace*[linearc=0.5,linecolor=red,linewidth=3pt,braceWidth=1.5pt,
  bracePos=0.25,ref=lC](8,1)(8,9){A}
\psbrace(4,9)(6,9){}
\psbrace(6,9)(6,7){}
\psbrace(6,7)(4,7){}
\psbrace(4,7)(4,9){}
\psset{linecolor=red}
\psbrace*[ref=lb](7,10)(3,10){I}
\psbrace*[ref=lb,bracePos=0.75](3,10)(3,6){II}
\psbrace*[ref=lb](3,6)(7,6){III}
\psbrace*[ref=lb](7,6)(7,10){IV}
\end{pspicture}
\end{LTXexample}

%$

\begin{LTXexample}[wide,width=5cm]
\[
\begin{pmatrix}
    \Rnode[vref=2ex]{A}{~1} \\
    & \ddots \\
    && \Rnode[href=2]{B}{1} \\
    &&& \Rnode[vref=2ex]{C}{0} \\
    &&&& \ddots \\
    &&&&& \Rnode[href=2]{D}{0}~ \\
\end{pmatrix}
\]
\psbrace[rot=-90,nodesepB=-0.5,nodesepA=-0.2](B)(A){\small n times}
\psbrace[rot=-90,nodesepB=-0.5,nodesepA=-0.2](D)(C){\small n times}
\end{LTXexample}


\clearpage
It is also possible to put a vertical brace around a default paragraph. This works
with setting two invisible nodes at the beginning and the end of the paragraph.
Inentation is possible with a minipage.

\begin{framed}
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.

\noindent\rnode{A}{}

\vspace*{-1ex}
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.

\vspace*{-2ex}\noindent\rnode{B}{}\psbrace*[linecolor=red](A)(B){}

Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.

\medskip\hfill\begin{minipage}{0.95\linewidth}
\noindent\rnode{A}{}

\vspace*{-1ex}
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.

\vspace*{-2ex}
\noindent\rnode{B}{}\psbrace[linecolor=red](A)(B){}
\end{minipage}
\end{framed}

\begin{lstlisting}
\begin{framed}
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.

\noindent\rnode{A}{}

\vspace*{-1ex}
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.

\vspace*{-2ex}\noindent\rnode{B}{}\psbrace[linecolor=red](A)(B){}

Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.

\medskip\hfill\begin{minipage}{0.95\linewidth}
\noindent\rnode{A}{}

\vspace*{-1ex}
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.
Some nonsense text, which is nothing more than nonsense.

\vspace*{-2ex}\noindent\rnode{B}{}\psbrace[linecolor=red](A)(B){}
\end{minipage}
\end{framed}
\end{lstlisting}

\clearpage

%--------------------------------------------------------------------------------------
\section{Random dots}
%--------------------------------------------------------------------------------------
The syntax of the new macro \verb+\psRandom+ is:

\begin{lstlisting}[style=syntax]
\psRandom[<option>]{}
\psRandom[<option>]{<clip path>}
\psRandom[<option>](<xMax,yMax>){<clip path>}
\psRandom[<option>](<xMin,yMin>)(<xMax,yMax>){<clip path>}
\end{lstlisting}

If there is no area for the dots defined, then \verb+(0,0)(1,1)+ in the actual
scale is used for placing the dots. This area should be greater than the clipping
path to be sure that the dots are placed over the full area. The clipping path can
be everything. If no clipping path is given, then the frame \verb+(0,0)(1,1)+
in user coordinates is used.  The new options are:
 
\begin{center}
\begin{tabular}{l|l|l}
name & default\\\hline
\verb|randomPoints| &   \verb|1000| & number of random dots\tabularnewline
\verb|color| & \verb+false+ & random color\tabularnewline
\end{tabular}
\end{center}


\begin{LTXexample}[width=0.3\linewidth]
\psset{unit=5cm}
\begin{pspicture}(1,1)
  \psRandom[dotsize=1pt,fillstyle=solid](1,1){\pscircle(0.5,0.5){0.5}}
\end{pspicture}
\begin{pspicture}(1,1)
  \psRandom[dotsize=2pt,randomPoints=5000,color,%
      fillstyle=solid](1,1){\pscircle(0.5,0.5){0.5}}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=0.4\linewidth]
\psset{unit=5cm}
\begin{pspicture}(1,1)
  \psRandom[randomPoints=200,dotsize=8pt,dotstyle=+]{}
\end{pspicture}
\begin{pspicture}(1.5,1)
  \psRandom[dotsize=5pt,color](0,0)(1.5,0.8){\psellipse(0.75,0.4)(0.75,0.4)}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}
\psset{unit=2.5cm}
\begin{pspicture}(0,-1)(3,1)
  \psRandom[dotsize=4pt,dotstyle=o,linecolor=blue,fillcolor=red,%
     fillstyle=solid,randomPoints=1000]%
      (0,-1)(3,1){\psplot{0}{3.14}{ x 114 mul sin }}
\end{pspicture}
\end{LTXexample}

\psset{unit=1cm}

\clearpage
%%  %--------------------------------------------------------------------------------------
%%  \section{Dice}
%%  %--------------------------------------------------------------------------------------
%%  \CMD{psdice} creates the view of a dice. The number on the dice is the only parameter. 
%%  The optional parameters, like the color can be used as usual. The macro is a box of 
%%  dimension zero and is placed
%%  at the current point. Use  the \CMD{rput} macro to place it anywhere. The only 
%%  special option name is \verb+dicescale+, with a default setting of \verb+1+. In this
%%  case the dice has a size of $1\mathrm{cm}\times1\mathrm{cm}$.
%%  
%%  \begin{center}
%%  \begin{pspicture}(-1,-1)(8,8)
%%  \multido{\iA=1+1}{6}{%
%%    \rput(\iA,7.5){\Huge\psdice[dicescale=0.75,linecolor=red]{\iA}}
%%    \rput(! -0.5 7 \iA\space sub){\Huge\psdice[dicescale=0.75,linecolor=green]{\iA}}%
%%    \multido{\iB=1+1}{6}{%
%%      \fpAdd{\iA}{\iB}{\iSum}
%%      \pnode(! \iA\space 7 \iB\space sub ){p\iA\iB}
%%      \rput(! \iA\space 7 \iB\space sub){\iSum}
%%  }}
%%  %
%%  \ncbox[linearc=0.35,nodesep=0.4,linestyle=dashed]{p15}{p51}
%%  \ncbox[linearc=0.35,nodesep=0.4,linestyle=dotted]{p11}{p66}
%%  \rput{90}(-1.5,3.5){1. dice}
%%  \rput{0}(3.5,8.5){2. dice}
%%  \psline[linewidth=1.5pt](0.25,0.5)(0.25,8)
%%  \psline[linewidth=1.5pt](-1,6.75)(6.5,6.75)
%%  %
%%  \end{pspicture}
%%  \end{center}
%%  
%%  \begin{lstlisting}
%%  \begin{pspicture}(-1,-1)(8,8)
%%  \multido{\iA=1+1}{6}{%
%%    \rput(\iA,7.5){\Huge\psdice[dicescale=0.75,linecolor=red]{\iA}}
%%    \rput(! -0.5 7 \iA\space sub){\Huge\psdice[dicescale=0.75,linecolor=green]{\iA}}%
%%    \multido{\iB=1+1}{6}{%
%%      \fpAdd{\iA}{\iB}{\iSum}
%%      \pnode(! \iA\space 7 \iB\space sub ){p\iA\iB}
%%      \rput(! \iA\space 7 \iB\space sub){\iSum}
%%  }}
%%  %
%%  \ncbox[linearc=0.35,nodesep=0.4,linestyle=dashed]{p15}{p51}
%%  \ncbox[linearc=0.35,nodesep=0.4,linestyle=dotted]{p11}{p66}
%%  \rput{90}(-1.5,3.5){1. dice}
%%  \rput{0}(3.5,8.5){2. dice}
%%  \psline[linewidth=1.5pt](0.25,0.5)(0.25,8)
%%  \psline[linewidth=1.5pt](-1,6.75)(6.5,6.75)
%%  %
%%  \end{pspicture}
%%  \end{lstlisting}
%%  
%%  
%%  \clearpage
%--------------------------------------------------------------------------------------
\section{Arrows}
%--------------------------------------------------------------------------------------
\subsection{Definition}
%--------------------------------------------------------------------------------------
\verb|pstricks-add| defines the following ''arrows``:

\begin{center}
  \bgroup
  \def\myline#1{\psline[linecolor=red,linewidth=0.5pt,arrowscale=1.5]{#1}(0,1ex)(1.3,1ex)}%
  \psset{arrowscale=1.5}
  \begin{tabular}{c@{\qquad}p{3cm}l}%
    Value & Example & Name \\[2pt]\hline
    \verb/-/      & \myline{-}      & None\\
    \verb/<->/    & \myline{<->}    & Arrowheads.\\
    \verb/>-</    & \myline{>-<}    & Reverse arrowheads.\\
    \verb/<<->>/  & \myline{<<->>}  & Double arrowheads.\\
    \verb/>>-<</  & \myline{>>-<<}  & Double reverse arrowheads.\\
    \verb/|-|/    & \myline{|-|}    & T-bars, flush to endpoints.\\
    \verb/|*-|*/  & \myline{|*-|*}  & T-bars, centered on endpoints.\\
    \verb/[-]/    & \myline{[-]}    & Square brackets.\\
    \verb/]-[/    & \myline{]-[}    & Reversed square brackets.\\
    \verb/(-)/    & \myline{(-)}    & Rounded brackets.\\
    \verb/)-(/    & \myline{)-(}    & Reversed rounded brackets.\\
    \verb/o-o/    & \myline{o-o}    & Circles, centered on endpoints.\\
    \verb/*-*/    & \myline{*-*}    & Disks, centered on endpoints.\\
    \verb/oo-oo/  & \myline{oo-oo}  & Circles, flush to endpoints.\\
    \verb/**-**/  & \myline{**-**}  & Disks, flush to endpoints.\\
    \verb/|<->|/  & \myline{|<->|}  & T-bars and arrows.\\
    \verb/|>-<|/  & \myline{|>-<|}  & T-bars and reverse arrows.\\
    \verb/h-h|/   & \myline{h-h}    & left/right hook arrows.\\
    \verb/H-H|/   & \myline{H-H}    & left/right hook arrows.\\
    \verb/v-v|/   & \myline{v-v}    & left/right inside vee arrows.\\
    \verb/V-V|/   & \myline{V-V}    & left/right outside vee arrows.\\
    \verb/f-f|/   & \myline{f-f}    & left/right inside filled arrows.\\
    \verb/F-F|/   & \myline{F-F}    & left/right outside filled arrows.\\
    \verb/t-t|/   & \myline{t-t}    & left/right inside slash arrows.\\[5pt]
    \verb/T-T|/   & \myline{T-T}    & left/right outside slash arrows.\\
  \end{tabular}
  \egroup
\end{center}



You can also mix and match, e.g., \verb/->/, \verb/*-)/ and \verb/[->/ are all valid values
of the \verb|arrows| parameter. The parameter can be set with
\begin{lstlisting}[style=syntax]
\psset{arrows=<type>}
\end{lstlisting}

\noindent or for some macros with a special option, like\\[5pt]
\noindent\verb|\psline[<general options>]{<arrow type>}(A)(B)|\\
\noindent\verb/\psline[linecolor=red,linewidth=2pt]{|->}(0,0)(0,2)/ \ \psline[linecolor=red,linewidth=2pt]{|->}(0,0)(0,2)

\subsection{Multiple arrows}
There are two new options which are only valid for the arrow type \verb+<<+ or \verb+>>+.
\verb+nArrow+ sets both, the \verb+nArrowA+ and the  \verb+nArrowB+ parameter. The meaning 
is declared in the following tables. Without setting one of these parameters the behaviour
is like the one described in the old PSTricks manual.

\begin{center}
  \begin{tabular}{lc}%
    Value & Meaning \\[2pt]\hline
    \verb+->>+   & \ -A \\
    \verb+<<->>+ & A-A\\
    \verb+<<-+   & A-\ \\
    \verb+>>-+   & B-\ \\
    \verb+-<<+   & \ -B\\
    \verb+>>-<<+ & B-B\\
    \verb+>>->>+ & B-A\\
    \verb+<<-<<+ & A-B
  \end{tabular}
\end{center}




\begin{center}
  \bgroup
  \psset{linecolor=red,linewidth=1pt,arrowscale=2}%
  \begin{tabular}{lp{2.8cm}}%
    Value & Example \\[2pt]\hline
    \verb+\psline{->>}(0,1ex)(2.3,1ex)+  & \psline{->>}(0,1ex)(2.3,1ex) \\
    \verb+\psline[nArrowsA=3]{->>}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=3]{->>}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=5]{->>}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=5]{->>}(0,1ex)(2.3,1ex)\\
    \verb+\psline{<<-}(0,1ex)(2.3,1ex)+  & \psline{<<-}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=3]{<<-}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=3]{<<-}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=5]{<<-}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=5]{<<-}(0,1ex)(2.3,1ex)\\
    \verb+\psline{<<->>}(0,1ex)(2.3,1ex)+  & \psline{<<->>}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=3]{<<->>}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=3]{<<->>}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=5]{<<->>}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=5]{<<->>}(0,1ex)(2.3,1ex)\\
    \verb+\psline{<<-|}(0,1ex)(2.3,1ex)+  & \psline{<<-|}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=3]{<<-<<}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=3]{<<-<<}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=5]{<<-o}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=5]{<<-o}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=3,nArrowsB=4]{<<-<<}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=3,nArrowsB=4]{<<-<<}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=3,nArrowsB=4]{>>->>}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=3,nArrowsB=4]{>>->>}(0,1ex)(2.3,1ex)\\
    \verb+\psline[nArrowsA=1,nArrowsB=4]{>>->>}(0,1ex)(2.3,1ex)+  & \psline[nArrowsA=1,nArrowsB=4]{>>->>}(0,1ex)(2.3,1ex)\\
  \end{tabular}
  \egroup
\end{center}



\clearpage
\subsection{\texttt{hookarrow}}
\begin{LTXexample}
\psset{arrowsize=8pt,arrowlength=1,linewidth=1pt,nodesep=2pt,shortput=tablr}
\large
\begin{psmatrix}[colsep=12mm,rowsep=10mm]
        &   & $R_2$            \\
        &   &   0   &   & $R_3$\\
$e_b:S$ & 1 &       & 1 & 0    \\
        &   &   0              \\
        &   &   $R_1$          \\
\end{psmatrix}
\ncline{h-}{1,3}{2,3}<{$e_{r2}$}>{$f_{r2}$}
\ncline{-h}{2,3}{3,2}<{$e_1$}
\ncline{-h}{3,1}{3,2}^{$e_s$}_{$f_{s}$}
\ncline{-h}{3,2}{4,3}>{$e_3$}<{$f_3$}
\ncline{-h}{4,3}{3,4}>{$e_4$}<{$f_4$}
\ncline{-h}{3,4}{2,3}>{$e_2$}<{$f_2$}
\ncline{-h}{3,4}{3,5}^{$e_5$}
\ncline{-h}{3,5}{2,5}<{$e_{r3}$}>{$f_{r3}$}
\ncline{-h}{4,3}{5,3}<{$e_{r1}$}>{$f_{r1}$}
\end{LTXexample}



\subsection{\texttt{hookrightarrow} and \texttt{hookleftarrow}}
This is another type of an arrow and abbreviated with \verb+H+. The length and width of the hook
is set by the new options \verb+hooklength+ and \verb+hookwidth+, which are by default set to
%
\begin{lstlisting}[style=syntax]
\psset{hooklength=3mm,hookwidth=1mm}
\end{lstlisting}
%
If the line begins with a right hook then the line ends with a left hook and vice versa:

\begin{LTXexample}[width=3cm]
\begin{pspicture}(3,4)
\psline[linewidth=5pt,linecolor=blue,hooklength=5mm,hookwidth=-3mm]{H->}(0,3.5)(3,3.5)
\psline[linewidth=5pt,linecolor=red,hooklength=5mm,hookwidth=3mm]{H->}(0,2.5)(3,2.5)
\psline[linewidth=5pt,hooklength=5mm,hookwidth=3mm]{H-H}(0,1.5)(3,1.5)
\psline[linewidth=1pt]{H-H}(0,0.5)(3,0.5)
\end{pspicture}
\end{LTXexample}



\begin{LTXexample}[width=7.25cm]
$\begin{psmatrix}
E&W_i(X)&&Y\\
&&W_j(X)
\psset{arrows=->,nodesep=3pt,linewidth=2pt}
\everypsbox{\scriptstyle}
\ncline[linecolor=red,arrows=H->,%
  hooklength=4mm,hookwidth=2mm]{1,1}{1,2}       
\ncline{1,2}{1,4}^{\tilde{t}}
\ncline{1,2}{2,3}<{W_{ij}}
\ncline{2,3}{1,4}>{\tilde{s}}
\end{psmatrix}$
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{\texttt{ArrowInside} Option}
%--------------------------------------------------------------------------------------

It is now possible to have arrows inside the lines and not only at the beginning or
the end. The new defined options

\psset{arrowscale=2,linecolor=red,unit=1cm,linewidth=1.5pt}
\begin{longtable}{l|p{9cm}|p{2.2cm}}
Name & Example & Output\\\hline
\endfirsthead
Name & Example & Output\\\hline
\endhead
\texttt{ArrowInside} &
	\texttt{\textbackslash psline[ArrowInside=->](0,0)(2,0)} &
	\psline[ArrowInside=->](0,0.1)(2,0.1) \\
\texttt{ArrowInsidePos} & \texttt{\textbackslash psline[ArrowInside=->,\%}
	\hspace*{20pt}\texttt{ArrowInsidePos=0.25](0,0)(2,0)}
& \psline[ArrowInside=->, ArrowInsidePos=0.25](0,0.1)(2,0.1) \\
\texttt{ArrowInsidePos} & \texttt{\textbackslash psline[ArrowInside=->,\%}
	\hspace*{20pt}\texttt{ArrowInsidePos=10](0,0)(2,0)}
& \psline[ArrowInside=->, ArrowInsidePos=10](0,0.1)(2,0.1) \\
\texttt{ArrowInsideNo} & \texttt{\textbackslash psline[ArrowInside=->,\%}
	\hspace*{20pt}\texttt{ArrowInsideNo=2](0,0)(2,0)}
& \psline[ArrowInside=->, ArrowInsideNo=2](0,0.1)(2,0.1) \\
\texttt{ArrowInsideOffset} & \texttt{\textbackslash psline[ArrowInside=->,\%}
	\hspace*{20pt}\texttt{ArrowInsideNo=2,\%}
	\hspace*{20pt}\texttt{ArrowInsideOffset=0.1](0,0)(2,0)}
& \psline[ArrowInside=->, ArrowInsideNo=2,ArrowInsideOffset=0.1](0,0.1)(2,0.1) \\
%
\texttt{ArrowInside} & \texttt{\textbackslash psline[ArrowInside=->]\{->\}(0,0)(2,0)} &
	\psline[ArrowInside=->]{->}(0,0)(2,0)\\
\texttt{ArrowInsidePos} & \texttt{\textbackslash psline[ArrowInside=->,\%}
	\hspace*{20pt}\texttt{ArrowInsidePos=0.25]\{->\}(0,0)(2,0)}
	& \psline[ArrowInside=->, ArrowInsidePos=0.25]{->}(0,0)(2,0) \\
\texttt{ArrowInsidePos} & \texttt{\textbackslash psline[ArrowInside=->,\%}
	\hspace*{20pt}\texttt{ArrowInsidePos=10]\{->\}(0,0)(2,0)}
	& \psline[ArrowInside=->, ArrowInsidePos=10]{->}(0,0)(2,0) \\
\texttt{ArrowInsideNo} & \texttt{\textbackslash psline[ArrowInside=->,\%}
	\hspace*{20pt}\texttt{ArrowInsideNo=2]\{->\}(0,0)(2,0)}
	& \psline[ArrowInside=->, ArrowInsideNo=2]{->}(0,0)(2,0) \\
\texttt{ArrowInsideOffset} & \texttt{\textbackslash psline[ArrowInside=->,\%}
	\hspace*{20pt}\texttt{ArrowInsideNo=2,\%}
	\hspace*{20pt}\texttt{ArrowInsideOffset=0.1]\{->\}(0,0)(2,0)}
	& \psline[ArrowInside=->, ArrowInsideNo=2,ArrowInsideOffset=0.1]{->}(0,0)(2,0) \\
%
\texttt{ArrowFill} & \texttt{\textbackslash psline[ArrowFill=false,\%}
	\hspace*{20pt}\texttt{arrowinset=0]\{->\}(0,0)(2,0)} &
	\psline[ArrowFill=false,arrowinset=0]{->}(0,0)(2,0)\\
\texttt{ArrowFill} & \texttt{\textbackslash psline[ArrowFill=false,\%}
	\hspace*{20pt}\texttt{arrowinset=0]\{<<->>\}(0,0)(2,0)} &
	\psline[ArrowFill=false,arrowinset=0]{<<->>}(0,0)(2,0)\\
\texttt{ArrowFill} & \texttt{\textbackslash psline[ArrowInside=->,\%}
	\hspace*{20pt}\texttt{arrowinset=0,\%}\hspace{30pt}
	\hspace*{20pt}\texttt{ArrowFill=false,\%}\hspace{30pt}
	\hspace*{20pt}\texttt{ArrowInsideNo=2,\%}
	\hspace*{20pt}\texttt{ArrowInsideOffset=0.1]\{->\}(0,0)(2,0)}
	& \psline[ArrowInside=->, ArrowFill=false,ArrowInsideNo=2,ArrowInsideOffset=0.1]{->}(0,0)(2,0) \\
\end{longtable}

\medskip
Without the default arrow definition there is only the one inside the line, defined
by the type and
the position. The position is relative to the length of the whole line. $0.25$ means
at $25\%$ of the
line length. The peak of the arrow gets the coordinates which are calculated by the
macro. If you want arrows with an abolute position difference, then choose a
value greater than \verb|1|, e.g. \verb|10| which places an arrow every 10 pt. The
default unit \verb|pt| cannot be changed.

\noindent
\begin{tabularx}{\linewidth}{@{\color{red}\vrule width 2pt}lX@{}}
& The \verb+ArrowInside+ takes only arrow definitions like \verb+->+ into account. 
Arrows from right to left (\verb+<-+) are not possible and ignored. If you need
such arrows, change the order of the pairs of coordinates for the line or curve macro. 
\end{tabularx}

%--------------------------------------------------------------------------------------
\subsection{\texttt{ArrowFill} Option}
%--------------------------------------------------------------------------------------

By default all arrows are filled polygons. With the option \verb|ArrowFill=false| there
are ''white``  arrows. Only for the beginning/end arrows they are empty, the inside arrows
are overpainted with the line.


\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=3}
\psline[linecolor=red,arrowinset=0]{<->}(0,0)(3,0)
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=3}
\psline[linecolor=red,arrowinset=0,ArrowFill=false]{<->}(0,0)(3,0)
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=3}
\psline[linecolor=red,arrowinset=0,arrowsize=0.2,ArrowFill=false]{<->}(0,0)(3,0)
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=3}
\psline[linecolor=blue,arrowscale=6,ArrowFill=true]{>>->>}(0,0)(3,0)
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=3}
\psline[linecolor=blue,arrowscale=6,ArrowFill=false]{>>->>}(0,0)(3,0)
\rule{3cm}{0pt}\\[30pt]
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=3}
\psline[linecolor=blue,arrowscale=6,ArrowFill=true]{>|->|}(0,0)(3,0)
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=3}
\psline[linecolor=blue,arrowscale=6,ArrowFill=false]{>|->|}(0,0)(3,0)%
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{Examples}
%--------------------------------------------------------------------------------------

All examples are printed with \verb|\psset{arrowscale=2,linecolor=red}|.
\subsubsection{\CMD{psline}}

\bigskip
\begin{LTXexample}[width=2.5cm]
\begin{pspicture}(2,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=->]{|<->|}(2,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=2.5cm]
\begin{pspicture}(2,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=-|]{|-|}(2,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=2.5cm]
\begin{pspicture}(2,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=->,ArrowInsideNo=2]{->}(2,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=2.5cm]
\begin{pspicture}(2,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=->,ArrowInsideNo=2,ArrowInsideOffset=0.1]{->}(2,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=-*]{->}(0,0)(2,1)(3,0)(4,0)(6,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=-*,ArrowInsidePos=0.25]{->}(0,0)(2,1)(3,0)(4,0)(6,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=-*,ArrowInsidePos=0.25,ArrowInsideNo=2]{->}%
   (0,0)(2,1)(3,0)(4,0)(6,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=->, ArrowInsidePos=0.25]{->}%
        (0,0)(2,1)(3,0)(4,0)(6,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[linestyle=none,ArrowInside=->,ArrowInsidePos=0.25]{->}%
        (0,0)(2,1)(3,0)(4,0)(6,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=-<, ArrowInsidePos=0.75]{->}%
     (0,0)(2,1)(3,0)(4,0)(6,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,2)
\psset{arrowscale=2,ArrowFill=true,ArrowInside=-*}
\psline(0,0)(2,1)(3,0)(4,0)(6,2)
\psset{linestyle=none}
\psline[ArrowInsidePos=0](0,0)(2,1)(3,0)(4,0)(6,2)
\psline[ArrowInsidePos=1](0,0)(2,1)(3,0)(4,0)(6,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,5)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=->,ArrowInsidePos=20](0,0)(3,0)%
       (3,3)(1,3)(1,5)(5,5)(5,0)(7,0)(6,3)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,2)
\psset{arrowscale=2,ArrowFill=true}
\psline[ArrowInside=-|]{<->}(0,2)(2,0)(3,2)(4,0)(6,2)
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsubsection{\CMD{pspolygon}}
%--------------------------------------------------------------------------------------
% Polygons (\pspolygon macro)

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,3)
\psset{arrowscale=2}
\pspolygon[ArrowInside=-|](0,0)(3,3)(6,3)(6,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,3)
\psset{arrowscale=2}
\pspolygon[ArrowInside=->,ArrowInsidePos=0.25]%
     (0,0)(3,3)(6,3)(6,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,3)
\psset{arrowscale=2}
\pspolygon[ArrowInside=->,ArrowInsideNo=4]%
       (0,0)(3,3)(6,3)(6,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,3)
\psset{arrowscale=2}
\pspolygon[ArrowInside=->,ArrowInsideNo=4,%
   ArrowInsideOffset=0.1](0,0)(3,3)(6,3)(6,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,3)
\psset{arrowscale=2}
 \pspolygon[ArrowInside=-|](0,0)(3,3)(6,3)(6,1)
 \psset{linestyle=none,ArrowInside=-*}
 \pspolygon[ArrowInsidePos=0](0,0)(3,3)(6,3)(6,1)
 \pspolygon[ArrowInsidePos=1](0,0)(3,3)(6,3)(6,1)
 \psset{ArrowInside=-o}
 \pspolygon[ArrowInsidePos=0.25](0,0)(3,3)(6,3)(6,1)
 \pspolygon[ArrowInsidePos=0.75](0,0)(3,3)(6,3)(6,1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\begin{pspicture}(6,5)
\psset{arrowscale=2}
  \pspolygon[ArrowInside=->,ArrowInsidePos=20]%
    (0,0)(3,0)(3,3)(1,3)(1,5)(5,5)(5,0)(7,0)(6,3)
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsubsection{\CMD{psbezier}}
%--------------------------------------------------------------------------------------
% Bezier curves (\psbezier macro)

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(3,3)
\psset{arrowscale=2}
  \psbezier[ArrowInside=-|](1,1)(2,2)(3,3)
  \psset{linestyle=none,ArrowInside=-o}
  \psbezier[ArrowInsidePos=0.25](1,1)(2,2)(3,3)
  \psbezier[ArrowInsidePos=0.75](1,1)(2,2)(3,3)
  \psset{linestyle=none,ArrowInside=-*}
  \psbezier[ArrowInsidePos=0](1,1)(2,2)(3,3)
  \psbezier[ArrowInsidePos=1](1,1)(2,2)(3,3)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=4.5cm]
\begin{pspicture}(4,3)
\psset{arrowscale=2}
  \psbezier[ArrowInside=->,showpoints=true]%
     {*-*}(2,3)(3,0)(4,2)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=4.5cm]
\begin{pspicture}(4,3)
\psset{arrowscale=2}
  \psbezier[ArrowInside=->,showpoints=true,%
      ArrowInsideNo=2](2,3)(3,0)(4,2)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=4.5cm]
\begin{pspicture}(4,3)
\psset{arrowscale=2}
  \psbezier[ArrowInside=->,showpoints=true,%
      ArrowInsideNo=2,ArrowInsideOffset=-0.2]{->}(2,3)(3,0)(4,2)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=5.5cm]
\begin{pspicture}(5,3)
\psset{arrowscale=2}
  \psbezier[ArrowInsideNo=9,ArrowInside=-|,%
    showpoints=true]{*-*}(1,3)(3,0)(5,3)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=4.5cm]
\begin{pspicture}(4,3)
\psset{arrowscale=2}
  \psset{ArrowInside=-|}
  \psbezier[ArrowInsidePos=0.25,showpoints=true]{*-*}(2,3)(3,0)(4,2)
  \psset{linestyle=none}
  \psbezier[ArrowInsidePos=0.75](2,3)(3,0)(4,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=5.5cm]
\begin{pspicture}(5,6)
\psset{arrowscale=2}
  \pnode(3,4){A}\pnode(5,6){B}\pnode(5,0){C}
  \psbezier[ArrowInside=->,%
     showpoints=true](A)(B)(C)
  \psset{linestyle=none,ArrowInside=-<}
  \psbezier[ArrowInsideNo=4](A)(B)(C)
  \psset{ArrowInside=-o}
  \psbezier[ArrowInsidePos=0.1](A)(B)(C)
  \psbezier[ArrowInsidePos=0.9](A)(B)(C)
  \psset{ArrowInside=-*}
  \psbezier[ArrowInsidePos=0.3](A)(B)(C)
  \psbezier[ArrowInsidePos=0.7](A)(B)(C)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[pos=t]
\begin{pspicture}(-3,-5)(15,5)
  \psbezier[ArrowInsideNo=19,%
      ArrowInside=->,ArrowFill=false,%
      showpoints=true]{->}(-3,0)(5,-5)(8,5)(15,-5)
\end{pspicture}
\end{LTXexample}


\clearpage

%--------------------------------------------------------------------------------------
\subsubsection{\CMD{pcline}}
%--------------------------------------------------------------------------------------
These examples need the package \verb|pst-node|.

% Lines (\pcline macro)
\begin{LTXexample}[width=2.5cm]
\begin{pspicture}(2,1)
\psset{arrowscale=2}
\pcline[ArrowInside=->](0,0)(2,1)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=2.5cm]
\begin{pspicture}(2,1)
\psset{arrowscale=2}
\pcline[ArrowInside=->]{<->}(0,0)(2,1)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=2.5cm]
\begin{pspicture}(2,1)
\psset{arrowscale=2}
\pcline[ArrowInside=-|,ArrowInsidePos=0.75]{|-|}(0,0)(2,1)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=2.5cm]
\psset{arrowscale=2}
\pcline[ArrowInside=->,ArrowInsidePos=0.65]{*-*}(0,0)(2,0)
\naput[labelsep=0.3]{\large$g$}
\end{LTXexample}


\begin{LTXexample}[width=2.5cm]
\psset{arrowscale=2}
\pcline[ArrowInside=->,ArrowInsidePos=10]{|-|}(0,0)(2,0)
\naput[labelsep=0.3]{\large$l$}
\end{LTXexample}



%--------------------------------------------------------------------------------------
\subsubsection{\CMD{pccurve}}
%--------------------------------------------------------------------------------------
These examples also need the package \verb|pst-node|.

\begin{LTXexample}[width=2.5cm]
\begin{pspicture}(2,2)
\psset{arrowscale=2}
\pccurve[ArrowInside=->,ArrowInsidePos=0.65,showpoints=true]{*-*}(0,0)(2,2)
\naput[labelsep=0.3]{\large$h$}
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=2.5cm]
\begin{pspicture}(2,2)
\psset{arrowscale=2}
\pccurve[ArrowInside=->,ArrowInsideNo=3,showpoints=true]{|->}(0,0)(2,2)
\naput[labelsep=0.3]{\large$i$}
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=4.5cm]
\begin{pspicture}(4,4)
\psset{arrowscale=2}
\pccurve[ArrowInside=->,ArrowInsidePos=20]{|-|}(0,0)(4,4)
\naput[labelsep=0.3]{\large$k$}
\end{pspicture}
\end{LTXexample}


\subsection{Special arrows \texttt{v--V},\texttt{t--T}, and \texttt{f--F}} 

Possible optional arguments are

\psset{linecolor=black}

\begin{center}
\begin{tabular}{l|l}
name & meaning\\\hline
\verb|veearrowlength| & default is 3mm\\
\verb|veearrowangle| & default is 30\\
\verb|veearrowlinewidth| & default is 0.35mm\\
\verb|filledveearrowlength| & default is 3mm\\
\verb|filledveearrowangle| & default is 15\\
\verb|filledveearrowlinewidth| & default is 0.35mm\\
\verb|tickarrowlength| & default is 1.5mm\\
\verb|tickarrowlinewidth| & default is 0.35mm\\
\end{tabular}
\end{center}


\begin{LTXexample}[width=4cm]
\psset{unit=5mm}
\begin{pspicture}(4,6)
  \psset{dimen=middle,arrows=c-c,
    arrowscale=2,linewidth=.25mm}
  \psline[linecolor=red,linewidth=.05mm](0,0)(0,6)
  \psline[linecolor=red,linewidth=.05mm](4,0)(4,6)
  \psline{v-v}(0,6)(4,6)
  \psline{v-V}(0,4)(4,4)
  \psline{V-v}(0,2)(4,2)
  \psline{V-V}(0,0)(4,0)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=4cm]
\psset{unit=5mm}
\begin{pspicture}(4,6)
  \psset{dimen=middle,arrows=c-c,
    arrowscale=2,linewidth=.25mm}
  \psline[linecolor=red,linewidth=.05mm](0,0)(0,6)
  \psline[linecolor=red,linewidth=.05mm](4,0)(4,6)
  \psline{f-f}(0,6)(4,6)
  \psline{f-F}(0,4)(4,4)
  \psline{F-f}(0,2)(4,2)
  \psline{F-F}(0,0)(4,0)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=4cm]
\psset{unit=5mm}
\begin{pspicture}(4,6)
  \psset{dimen=middle,arrows=c-c,linewidth=.25mm}
  \psline[linecolor=red,linewidth=.05mm](0,0)(0,6)
  \psline[linecolor=red,linewidth=.05mm](4,0)(4,6)
  \psline{t-t}(0,6)(4,6)
  \psline{t-T}(0,4)(4,4)
  \psline{T-t}(0,2)(4,2)
  \psline{T-T}(0,0)(4,0)
\end{pspicture}
\end{LTXexample}

\subsection{Special arrow option \texttt{arrowLW}} 

Only for the arrowtype \texttt{o} and \texttt{*} it is possible to
set the arrowlinewidth with the optional keyword \texttt{arrowLW}.
Otherwise

\begin{LTXexample}[width=4cm]
\begin{pspicture}(4,6)
\psline[arrowscale=3,arrows=*-o](0,5)(4,5)
\psline[arrowscale=3,arrows=*-o,
  arrowLW=0.5pt](0,3)(4,3)
\psline[arrowscale=3,arrows=*-o,
  arrowLW=0.3333\pslinewidth](0,1)(4,1)
\end{pspicture}
\end{LTXexample}


\clearpage
%--------------------------------------------------------------------------------------
\section{\CMD{psFormatInt}}
%--------------------------------------------------------------------------------------
There exist some packages and a lot of code to format an integer like $1\,000\,000$
or $1,234,567$ (in Europe $1.234.567$). But all packages expect a real number as
argument and cannot handle macros as an argument. For this case \verb|pstricks-add|
has a macro \verb|psFormatInt| which can handle both:

\begin{LTXexample}[width=3cm]
\psFormatInt{1234567}\\
\psFormatInt[intSeparator={,}]{1234567}\\
\psFormatInt[intSeparator=.]{1234567}\\
\psFormatInt[intSeparator=$\cdot$]{1234567}\\
\def\temp{965432}
\psFormatInt{\temp}
\end{LTXexample}

With the option \verb|intSeparator| the symbol can be changed to any any non-number character.


%--------------------------------------------------------------------------------------
\section{Color}
%--------------------------------------------------------------------------------------
%--------------------------------------------------------------------------------------
\subsection{Transparent colors}
%--------------------------------------------------------------------------------------

Transparency ist now part of the main \texttt{pstricks} package. But pay attention,
the names and syntax changed and you need to run \verb+ps2pdf+ with the option
\verb+-dCompatibilityLevel=1.4+.


%--------------------------------------------------------------------------------------
\subsection{,,Manipulating Transparent colors''}
%--------------------------------------------------------------------------------------

\verb+pstricks-add+ simulates transparency with hatch lines:
\begin{lstlisting}
\def\defineTColor{\@ifnextchar[{\defineTColor@i}{\defineTColor@i[]}}
\def\defineTColor@i[#1]#2#3{%     transparency "Colors"
  \newpsstyle{#2}{%
     fillstyle=vlines,hatchwidth=0.1\pslinewidth,
     hatchsep=1\pslinewidth,hatchcolor=#3,#1%
  }%
}
\defineTColor{TRed}{red}
\defineTColor{TGreen}{green}
\defineTColor{TBlue}{blue}
\end{lstlisting}

There are three predefined "'transparent"` colors \verb+TRed+, \verb+TGreen+, \verb+TBlue+.
They are used as \PST styles and not as colors:

\resetOptions
\bgroup
\begin{LTXexample}[pos=t,preset=\centering]
\begin{pspicture}(-3,-5)(5,5)
\psframe(-1,-3)(5,5) % objet de base
\psrotate(2,-2){15}{%
  \psframe[style=TRed](-1,-3)(5,5)}
\psrotate(2,-2){30}{%
  \psframe[style=TGreen](-1,-3)(5,5)}
\psrotate(2,-2){45}{%
  \psframe[style=TBlue](-1,-3)(5,5)}
\psframe[linewidth=3pt](-1,-3)(5,5)
\psdots[dotstyle=+,dotangle=45,dotscale=3](2,-2) % centre de la rotation
\end{pspicture}
\end{LTXexample}
\egroup

%--------------------------------------------------------------------------------------
\subsection{Calculated colors}
%--------------------------------------------------------------------------------------
The \verb+xcolor+ package (version 2.6) has a new feature for defining colors:
\begin{lstlisting}[style=syntax]
  \definecolor[ps]{<name>}{<model>}{< PS code >}
\end{lstlisting}

\verb+model+ can be one of the color models, which PostScript will understand, e.g. \verb+rgb+.
With this definition the color is calculated on PostScript side.
\begin{LTXexample}[pos=t,preset=\centering]
\definecolor[ps]{bl}{rgb}{tx@addDict begin  Red Green Blue end}%
\psset{unit=1bp}
\begin{pspicture}(0,-30)(400,100)
\multido{\iLAMBDA=0+1}{400}{%
  \pstVerb{
    \iLAMBDA\space 379 add dup /lambda exch def
    tx@addDict begin  wavelengthToRGB end 
  }%
  \psline[linecolor=bl](\iLAMBDA,0)(\iLAMBDA,100)%
}
\psaxes[yAxis=false,Ox=350,dx=50bp,Dx=50]{->}(-29,-10)(420,100)
\uput[-90](420,-10){$\lambda$[\textsf{nm}]}
\end{pspicture}
\end{LTXexample}


\begin{center}
\newcommand{\Touch}{%
\psframe[linestyle=none,fillstyle=solid,fillcolor=bl,dimen=middle](0.1,0.75)}
\definecolor[ps]{bl}{rgb}{tx@addDict begin Red Green Blue end}%
% Echelle 1cm <-> 40 nm
%         1 nm <-> 0.025 cm
\psframebox[fillstyle=solid,fillcolor=black]{%
\begin{pspicture}(-1,-0.5)(12,1.5)
\multido{\iLAMBDA=380+2}{200}{%
  \pstVerb{
    /lambda \iLAMBDA\space def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! lambda 0.025 mul 9.5 sub 0){\Touch}
}
\multido{\n=0+1,\iDiv=380+40}{11}{%
    \psline[linecolor=white](\n,0.1)(\n,-0.1)
    \uput[270](\n,0){\textbf{\white\iDiv}}}
    \psline[linecolor=white]{->}(11,0)
    \uput[270](11,0){\textbf{\white$\lambda$(nm)}}
\end{pspicture}}

\psframebox[fillstyle=solid,fillcolor=black]{%
\begin{pspicture}(-1,-0.5)(12,1)
  \pstVerb{
    /lambda 656 def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! 656 0.025 mul 9.5 sub 0){\Touch}
  \pstVerb{
    /lambda 486 def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! 486 0.025 mul 9.5 sub 0){\Touch}
   \pstVerb{
    /lambda 434 def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! 434 0.025 mul 9.5 sub 0){\Touch}
  \pstVerb{
    /lambda 410 def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! 410 0.025 mul 9.5 sub 0){\Touch}
\multido{\n=0+1,\iDiv=380+40}{11}{%
    \psline[linecolor=white](\n,0.1)(\n,-0.1)
    \uput[270](\n,0){\textbf{\white\iDiv}}}
    \psline[linecolor=white]{->}(11,0)
    \uput[270](11,0){\textbf{\white$\lambda$(nm)}}
\end{pspicture}}

Spectrum of hydrogen emission (Manuel Luque)
\end{center}

\begin{lstlisting}
\newcommand{\Touch}{%
\psframe[linestyle=none,fillstyle=solid,fillcolor=bl,dimen=middle](0.1,0.75)}
\definecolor[ps]{bl}{rgb}{tx@addDict begin Red Green Blue end}%
% Echelle 1cm <-> 40 nm
%         1 nm <-> 0.025 cm
\psframebox[fillstyle=solid,fillcolor=black]{%
\begin{pspicture}(-1,-0.5)(12,1.5)
\multido{\iLAMBDA=380+2}{200}{%
  \pstVerb{
    /lambda \iLAMBDA\space def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! lambda 0.025 mul 9.5 sub 0){\Touch}
}
\multido{\n=0+1,\iDiv=380+40}{11}{%
    \psline[linecolor=white](\n,0.1)(\n,-0.1)
    \uput[270](\n,0){\textbf{\white\iDiv}}}
    \psline[linecolor=white]{->}(11,0)
    \uput[270](11,0){\textbf{\white$\lambda$(nm)}}
\end{pspicture}}

\psframebox[fillstyle=solid,fillcolor=black]{%
\begin{pspicture}(-1,-0.5)(12,1)
  \pstVerb{
    /lambda 656 def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! 656 0.025 mul 9.5 sub 0){\Touch}
  \pstVerb{
    /lambda 486 def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! 486 0.025 mul 9.5 sub 0){\Touch}
   \pstVerb{
    /lambda 434 def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! 434 0.025 mul 9.5 sub 0){\Touch}
  \pstVerb{
    /lambda 410 def
    lambda
    tx@addDict begin  wavelengthToRGB end
  }%
 \rput(! 410 0.025 mul 9.5 sub 0){\Touch}
\multido{\n=0+1,\iDiv=380+40}{11}{%
    \psline[linecolor=white](\n,0.1)(\n,-0.1)
    \uput[270](\n,0){\textbf{\white\iDiv}}}
    \psline[linecolor=white]{->}(11,0)
    \uput[270](11,0){\textbf{\white$\lambda$(nm)}}
\end{pspicture}}

Spectrum of hydrogen emission (Manuel Luque)
\end{lstlisting}



%--------------------------------------------------------------------------------------
\subsection{Gouraud shading}
%--------------------------------------------------------------------------------------
\begin{quotation}
Gouraud shading is a method used in computer graphics to simulate the differing effects of 
light and colour across the surface of an object. In practice, Gouraud shading is used to 
achieve smooth lighting on low-polygon surfaces without the heavy computational requirements 
of calculating lighting for each pixel. The technique was first presented by Henri Gouraud in 1971.\\
~\hfill{\small \url{http://www.wikipedia.org}}
\end{quotation}

PostScript level 3 supports this kind of shading and it could only be seen with Acroread 7
or younger. Die Syntax is easy:

\begin{lstlisting}[style=syntax]
  \psGTriangle(x1,y1)(x2,y2)(x3,y3){color1}{color2}{color3}
\end{lstlisting}

\psset{unit=0.75cm}

\begin{LTXexample}[pos=t,preset=\centering]
\begin{pspicture}(0,-.25)(10,10)
  \psGTriangle(0,0)(5,10)(10,0){red}{green}{blue}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[pos=t,preset=\centering]
\begin{pspicture}(0,-.25)(10,10)
  \psGTriangle*(0,0)(9,10)(10,3){black}{white!50}{red!50!green!95}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[pos=t,preset=\centering]
\begin{pspicture}(0,-.25)(10,10)
  \psGTriangle*(0,0)(5,10)(10,0){-red!100!green!84!blue!86}
                               {-red!80!green!100!blue!40}
                               {-red!60!green!30!blue!100}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[pos=t,preset=\centering]
\definecolor{rose}{rgb}{1.00, 0.84, 0.88}
\definecolor{vertpommepasmure}{rgb}{0.80, 1.0, 0.40}
\definecolor{fushia}{rgb}{0.60, 0.30, 1.0}
\begin{pspicture}(0,-.25)(10,10)
  \psGTriangle(0,0)(5,10)(10,0){rose}{vertpommepasmure}{fushia}
\end{pspicture}
\end{LTXexample}

\newpage
%--------------------------------------------------------------------------------------
\part{\texttt{pst-node}}
%--------------------------------------------------------------------------------------

%--------------------------------------------------------------------------------------
\section{Relative nodes with \CMD{psGetNodeCenter}}
%--------------------------------------------------------------------------------------
The command \CMD{psGetNodeCenter}\verb+{node}+ makes only sense on PostScript level, it defines
the two variables \verb+node.x+ and \verb+node.y+ which can be used to define relative
nodes. The following example defines the node \verb+MyNode+ and a second one relative
to the first one, with 4 units left and 4 units up. \verb+node+ must be an
existing node name.

\begin{LTXexample}[width=5cm]
\begin{pspicture}[showgrid=true,arrowscale=2](5,5)
\pnode(4.5,0.5){MyNode}
\psdot(MyNode)
\pnode(! \psGetNodeCenter{MyNode} 
   MyNode.x 4 sub MyNode.y 4 add){MySecondNode}
\psdot(MySecondNode)
\ncline[linecolor=red]{<->}{MyNode}{MySecondNode}
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\section{\CMD{ncdiag} and \CMD{pcdiag}}
%--------------------------------------------------------------------------------------
With the new option \verb|lineAngle| the lines drawn by the \verb|ncdiag| macro
can now have a specified gradient. Without this option one has to define the two
arms (which maybe zero) and PSTricks draws the connection between them. Now there
is only a static \verb|armA|, the second one \verb|armB| is calculated when an angle
\verb|lineAngle| is defined. This angle is the gradient of the intermediate line
between the two arms. The syntax of \verb|ncdiag| is

\begin{lstlisting}[style=syntax]
\ncdiag[<options>]{<Node A>}{<Node B>}
\pcdiag[<options>](<Node A>)(<Node B>)
\end{lstlisting}


\begin{tabularx}{\linewidth}{l|X}
name & meaning\\\hline
\verb|lineAngle| & angle of the intermediate line segment. Default is 0, which is the same than using \verb|ncdiag| without the \verb|lineAngle| option.\tabularnewline
\end{tabularx}


\resetOptions
\begin{LTXexample}[width=5.5cm]
\begin{pspicture}(5,6)
  \circlenode{A}{A}\quad\circlenode{C}{C}%
    \quad\circlenode{E}{E}
  \rput(0,4){\circlenode{B}{B}}
  \rput(1,5){\circlenode{D}{D}}
  \rput(2,6){\circlenode{F}{F}}
  \psset{arrowscale=2,linearc=0.2,%
    linecolor=red,armA=0.5, angleA=90,angleB=-90}
  \ncdiag[lineAngle=20]{->}{A}{B}
  \ncput*[nrot=:U]{line I}
  \ncdiag[lineAngle=20]{->}{C}{D}
  \ncput*[nrot=:U]{line II}
  \ncdiag[lineAngle=20]{->}{E}{F}
  \ncput*[nrot=:U]{line III}
\end{pspicture}
\end{LTXexample}


The \verb|ncdiag| macro sets the \verb|armB| dynamically to the calculated value. Any
user setting of \verb|armB| is overwritten by the macro. The \verb|armA| could be set to
a zero length:


\begin{LTXexample}[width=4.5cm]
\begin{pspicture}(4,3)
  \rput(0.5,0.5){\circlenode{A}{A}}
  \rput(3.5,3){\circlenode{B}{B}}
  {\psset{linecolor=red,arrows=<-,arrowscale=2}
  \ncdiag[lineAngle=60,%
      armA=0,angleA=0,angleB=180]{A}{B}
  \ncdiag[lineAngle=60,%
      armA=0,angleA=90,angleB=180]{A}{B}}
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[width=4.5cm]
\begin{pspicture}(4,3)
  \rput(1,0.5){\circlenode{A}{A}}
  \rput(4,3){\circlenode{B}{B}}
  {\psset{linecolor=red,arrows=<-,arrowscale=2}
  \ncdiag[lineAngle=60,%
      armA=0.5,angleA=0,angleB=180]{A}{B}
  \ncdiag[lineAngle=60,%
      armA=0,angleA=70,angleB=180]{A}{B}
  \ncdiag[lineAngle=60,%
      armA=0.5,angleA=180,angleB=180]{A}{B}}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=4.5cm]
\begin{pspicture}(4,5.5)
  \cnode*(0,0){2pt}{A}%
  \cnode*(0.25,0){2pt}{C}%
  \cnode*(0.5,0){2pt}{E}%
  \cnode*(0.75,0){2pt}{G}%
  \cnode*(2,4){2pt}{B}%
  \cnode*(2.5,4.5){2pt}{D}%
  \cnode*(3,5){2pt}{F}%
  \cnode*(3.5,5.5){2pt}{H}%
  {\psset{arrowscale=2,linearc=0.2,%
    linecolor=red,armA=0.5, angleA=90,angleB=-90}
  \pcdiag[lineAngle=20]{->}(A)(B)
  \pcdiag[lineAngle=20]{->}(C)(D)
  \pcdiag[lineAngle=20]{->}(E)(F)
  \pcdiag[lineAngle=20]{->}(G)(H)}
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\section{\CMD{ncdiagg} and \CMD{pcdiagg}}
%--------------------------------------------------------------------------------------
This is nearly the same than \verb+\ncdiag+ except that \verb+armB=0+ and the \verb+angleB+
value is computed by the macro, so that the line ends at the node with an angle
like a \verb+\pcdiagg+ line. The syntax of \verb|ncdiagg|/\verb+pcdiagg+ is

\begin{lstlisting}[style=syntax]
\ncdiag[<options>]{<Node A>}{<Node B>}
\pcdiag[<options>](<Node A>)(<Node B>)
\end{lstlisting}

\begin{LTXexample}[width=5cm]
\begin{pspicture}(4,6)
  \psset{linecolor=black}
  \circlenode{A}{A}%
  \quad\circlenode{C}{C}%
  \quad\circlenode{E}{E}
  \rput(0,4){\circlenode{B}{B}}
  \rput(1,5){\circlenode{D}{D}}
  \rput(2,6){\circlenode{F}{F}}
  {\psset{arrowscale=2,linearc=0.2,linecolor=red,armA=0.5, angleA=90}
  \ncdiagg[lineAngle=-160]{->}{A}{B}
  \ncput*[nrot=:U]{line I}
  \ncdiagg[lineAngle=-160]{->}{C}{D}
  \ncput*[nrot=:U]{line II}
  \ncdiagg[lineAngle=-160]{->}{E}{F}
  \ncput*[nrot=:U]{line III}}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=5cm]
\begin{pspicture}(4,6)
  \psset{linecolor=black}
  \cnode*(0,0){2pt}{A}%
  \cnode*(0.25,0){2pt}{C}%
  \cnode*(0.5,0){2pt}{E}%
  \cnode*(0.75,0){2pt}{G}%
  \cnode*(2,4){2pt}{B}%
  \cnode*(2.5,4.5){2pt}{D}%
  \cnode*(3,5){2pt}{F}%
  \cnode*(3.5,5.5){2pt}{H}%
  {\psset{arrowscale=2,linearc=0.2,linecolor=red,armA=0.5, angleA=90}
  \pcdiagg[lineAngle=20]{->}(A)(B)
  \pcdiagg[lineAngle=20]{->}(C)(D)
  \pcdiagg[lineAngle=20]{->}(E)(F)
  \pcdiagg[lineAngle=20]{->}(G)(H)}
\end{pspicture}
\end{LTXexample}

The only catch for \verb+\ncdiagg+ is, that you need the right value for \verb+lineAngle+.
If the node connection is on the wrong side
of the second node, then choose the corresponding angle, e.g.: if $20$ is wrong then take
$-160$, the corresponding to $180$.


\begin{LTXexample}[width=4cm]
\begin{pspicture}(4,1.5)
  \circlenode{a}{A}
  \rput[l](3,1){\rnode{b}{H}}
  \ncdiagg[lineAngle=60,angleA=180,armA=.5,nodesepA=3pt,linecolor=blue]{b}{a}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=4cm]
\begin{pspicture}(4,1.5)
  \circlenode{a}{A}
  \rput[l](3,1){\rnode{b}{H}}
  \ncdiagg[lineAngle=60,armA=.5,nodesepB=3pt,linecolor=blue]{a}{b}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=4cm]
\begin{pspicture}(4,1.5)
  \circlenode{a}{A}
  \rput[l](3,1){\rnode{b}{H}}
  \ncdiagg[lineAngle=-120,armA=.5,nodesepB=3pt,linecolor=blue]{a}{b}
\end{pspicture}
\end{LTXexample}

%--------------------------------------------------------------------------------------
\section{\CMD{ncbarr}}
%--------------------------------------------------------------------------------------
This has the same behaviour as \verb+ncbar+, but has 5 segments and all are
horizontal ones. This is the reason why \verb+angleA+ must be $0$ or alternative $180$.
All other values are set to $0$ by the macro. The intermediate horizontal line is
symmetrical to the distance of the two nodes.


\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=2}%
\circlenode{X}{X}\\[1cm]
\circlenode{Y}{Y}
\ncbarr[angleA=0,arrows=->,arrowscale=2]{X}{Y}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=2}%
\ovalnode{X}{Xxxxx}\\[1cm]
\circlenode{Y}{Yyyy}
\ncbarr[angleA=180,arrows=->,arrowscale=2,linecolor=red]{X}{Y}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\psset{arrowscale=2}%
\ovalnode{X}{Xxxxx}\\[1cm]
\circlenode{Y}{Yyyy}
\ncbarr[angleA=20,arm=1cm,arrows=->,arrowscale=2]{X}{Y}
\end{LTXexample}

%--------------------------------------------------------------------------------------
\section{\CMD{psRelNode} and \CMD{psDefPSPNodes}}
%--------------------------------------------------------------------------------------
With these macros it is possible to put a node relative to a given line or given
\verb+pspicture+-environment. In the frist case the parameters are
the angle and the length factor:
\begin{lstlisting}[style=syntax]
\psRelNode(<P0>)(<P1>){<length factor>}{<end node name>}
\psRelLine[<options>](<P0>)(<P1>){<length factor>}{<end node name>}
\end{lstlisting}

The length factor depends to the distance of $\overline{P_0P_1}$ and the end node name must
be a valid nodename and shouldn't contain any of the special PostScript characters. There are
two valid options:

\begin{tabularx}{\linewidth}{l|l|X}
name & default & meaning\\\hline
\verb|angle| & $0$ & angle between the given line $\overline{P_0P_1}$ and the new one
$\overline{P_0P_{endNode}}$\tabularnewline
\verb+trueAngle+ & false & defines whether the angle depends to the seen line or to the
mathematical one, which respect the scaling factors \verb+xunit+ and \verb+yunit+.
\end{tabularx}

\begin{LTXexample}[width=7cm]
\begin{pspicture}(7,6)
  \psgrid[gridwidth=0pt,gridcolor=gray,gridlabels=0pt,subgriddiv=2]
  \pnode(3,3){A}\pnode(4,2){B}
  \psline[nodesep=-3,linewidth=0.5pt](A)(B)
  \multido{\iA=0+30}{12}{%
    \psRelNode[angle=\iA](A)(B){2}{C}%
    \qdisk(C){2pt}
    \uput[0](C){\iA}}  
\end{pspicture}
\end{LTXexample}

In the second case the new macro \verb+\psDefPSPNodes+ defines nine nodes that corresponds to
nine particular points (namely bottom left, bottom center,
bottom right, center left, center center, center right, top left,
top center, top right) of the \verb+pspicture+ box.

\begin{LTXexample}[width=6cm,wide=false]
\begin{pspicture}[showgrid=true](-1,-1)(4,4)
  \psDefPSPNodes
  \psdots(PSPbl)(PSPbc)(PSPbr)
      (PSPcl)(PSPcc)(PSPcr)(PSPtl)(PSPtc)(PSPtr)
  \uput[90](PSPbl){PSPbl} \uput[90](PSPbc){PSPbc}
  \uput[90](PSPbr){PSPbr} \uput[90](PSPcl){PSPcl}
  \uput[90](PSPcc){PSPcc} \uput[90](PSPcr){PSPcr}
  \uput[90](PSPtl){PSPtl} \uput[90](PSPtc){PSPtc}
  \uput[90](PSPtr){PSPtr}
\end{pspicture}
\end{LTXexample}

The name of the nodes are predefined as:

\begin{lstlisting}[style=syntax]
\psset[pst-PSPNodes]{blName=PSPbl,bcName=PSPbc,brName=PSPbr,
  clName=PSPcl,ccName=PSPcc,crName=PSPcr,tlName=PSPtl,tcName=PSPtc,trName=PSPtr}
\end{lstlisting}

and can be modified in the same way.
%I guess you modified the family to have the pstricks-add one so the
%\xkvview would have to be adapted.




%--------------------------------------------------------------------------------------
\section{\CMD{psRelLine}}
%--------------------------------------------------------------------------------------
With this macro it is possible to plot lines relative to a given one. Parameter are
the angle and the length factor:

\begin{lstlisting}[style=syntax]
\psRelLine(<P0>)(<P1>){<length factor>}{<end node name>}
\psRelLine{<arrows>}(<P0>)(<P1>){<length factor>}{<end node name>}
\psRelLine[<options>](<P0>)(<P1>){<length factor>}{<end node name>}
\psRelLine[<options>]{<arrows>}(<P0>)(<P1>){<length factor>}{<end node name>}
\end{lstlisting}

The length factor depends to the distance of $\overline{P_0P_1}$ and the end node name must
be a valid nodename and shouldn't contain any of the special PostScript characters. There are
two valid options which are described in the forgoing section for \verb+\psRelNode+.

The following two figures show the same, the first one with a scaling different to $1:1$,
this is the reason why the end points are on an ellipse and not on a circle like in the
second figure.

\begin{LTXexample}[width=5cm]
\psset{yunit=2,xunit=1}
\begin{pspicture}(-2,-2)(3,2)
\psgrid[subgriddiv=2,subgriddots=10,gridcolor=lightgray]
\pnode(-1,0){A}\pnode(3,2){B}
\psline[linecolor=red](A)(B)
\psRelLine[linecolor=blue,angle=30](-1,0)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\psRelLine[linecolor=blue,angle=-30](A)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\psRelLine[linecolor=magenta,angle=90](-1,0)(3,2){0.5}{EndNode}
\qdisk(EndNode){2pt}
\psRelLine[linecolor=magenta,angle=-90](A)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=5cm]
\begin{pspicture}(-2,-2)(3,2)
\psgrid[subgriddiv=2,subgriddots=10,gridcolor=lightgray]
\pnode(-1,0){A}\pnode(3,2){B}
\psline[linecolor=red](A)(B)
\psarc[linestyle=dashed](A){2.23}{-90}{135}
\psRelLine[linecolor=blue,angle=30](-1,0)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\psRelLine[linecolor=blue,angle=-30](A)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\psRelLine[linecolor=magenta,angle=90](-1,0)(3,2){0.5}{EndNode}
\qdisk(EndNode){2pt}
\psRelLine[linecolor=magenta,angle=-90](A)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\end{pspicture}
\end{LTXexample}

\medskip
The following figure has also a different scaling, but has set the option \verb+trueAngle+,
all angles depends to what "you see".

\begin{LTXexample}[width=6.5cm]
\psset{yunit=2,xunit=1}
\begin{pspicture}(-3,-1)(3,2)\psgrid[subgridcolor=lightgray]
\pnode(-1,0){A}\pnode(3,2){B}
\psline[linecolor=red](A)(B)
\psarc(A){2.83}{-45}{135}
\psRelLine[linecolor=blue,angle=30,trueAngle](A)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\psRelLine[linecolor=blue,angle=-30,trueAngle](A)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\psRelLine[linecolor=magenta,angle=90,trueAngle](A)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\psRelLine[linecolor=magenta,angle=-90,trueAngle](A)(B){0.5}{EndNode}
\qdisk(EndNode){2pt}
\end{pspicture}
\end{LTXexample}

\medskip
Two examples with using \verb+\multido+ to show the behaviour of the options \verb+trueAngle+
and \verb+angle+.

\medskip
\begin{LTXexample}[width=8cm]
\psset{yunit=4,xunit=2}
\begin{pspicture}(-1,0)(3,2)\psgrid[subgridcolor=lightgray]
\pnode(-1,0){A}\pnode(1,1){B}
\psline[linecolor=red](A)(3,2)
\multido{\iA=0+10}{36}{%
  \psRelLine[linecolor=blue,angle=\iA](B)(A){-0.5}{EndNode}
  \qdisk(EndNode){2pt}
}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=8cm]
\psset{yunit=4,xunit=2}
\begin{pspicture}(-1,0)(3,2)\psgrid[subgridcolor=lightgray]
\pnode(-1,0){A}\pnode(1,1){B}
\psline[linecolor=red](A)(3,2)
\multido{\iA=0+10}{36}{%
  \psRelLine[linecolor=magenta,angle=\iA,trueAngle]{->}(B)(A){-0.5}{EndNode}
}
\end{pspicture}
\end{LTXexample}

\begin{center}
\bgroup
\psset{xunit=0.75\linewidth,yunit=0.75\linewidth,trueAngle}%
\begin{pspicture}(1,0.6)%\psgrid
  \pnode(.3,.35){Vk} \pnode(.375,.35){D} \pnode(0,.4){DST1} \pnode(1,.18){DST2}
  \pnode(0,.1){A1}   \pnode(1,.31){A1}
  { \psset{linewidth=.02,linestyle=dashed,linecolor=gray}%
    \pcline(DST1)(DST2) % <- Druckseitentangente
    \pcline(A2)(A1) % <- Anstr"omrichtung
    \lput*{:U}{\small Anstr"omrichtung $v_{\infty}$} }%
  \psIntersectionPoint(A1)(A2)(DST1)(DST2){Hk}
  \pscurve(Hk)(.4,.38)(Vk)(.36,.33)(.5,.32)(Hk)
  \psParallelLine[linecolor=red!75!green,arrows=->,arrowscale=2](Vk)(Hk)(D){.1}{FtE}
  \psRelLine[linecolor=red!75!green,arrows=->,arrowscale=2,angle=90](D)(FtE){4}{Fn}% why "4"?
  \psParallelLine[linestyle=dashed](D)(FtE)(Fn){.1}{Fnr1}
  \psRelLine[linestyle=dashed,angle=90](FtE)(D){-4}{Fnr2} % why "-4"?
  \psline[linewidth=1.5pt,arrows=->,arrowscale=2](D)(Fnr2)
  \psIntersectionPoint(D)([nodesep=2]D)(Fnr1)([offset=-4]Fnr1){Fh}
  \psIntersectionPoint(D)([offset=2]D)(Fnr1)([nodesep=4]Fnr1){Fv}
  \psline[linecolor=blue,arrows=->,arrowscale=2](D)(Fh)
  \psline[linecolor=blue,arrows=->,arrowscale=2](D)(Fv)
  \psline[linestyle=dotted](Fh)(Fnr1)  \psline[linestyle=dotted](Fv)(Fnr1)
  \uput{.1}[0](Fh){\blue $F_{H}$}   \uput{.1}[180](Fv){\blue $F_{V}$}
  \uput{.1}[-45](Fnr1){$F_{R}$}     \uput{.1}[90](Fn){\color{red!75!green}$F_{N}$}
  \uput{.25}[-90](FtE){\color{red!75!green}$F_{T}$}
\end{pspicture}
\egroup
\end{center}
\begin{lstlisting}
\psset{xunit=0.75\linewidth,yunit=0.75\linewidth,trueAngle}%
\end{center}
\begin{pspicture}(1,0.6)%\psgrid
  \pnode(.3,.35){Vk} \pnode(.375,.35){D} \pnode(0,.4){DST1} \pnode(1,.18){DST2}
  \pnode(0,.1){A1}   \pnode(1,.31){A1}
  { \psset{linewidth=.02,linestyle=dashed,linecolor=gray}%
    \pcline(DST1)(DST2) % <- Druckseitentangente
    \pcline(A2)(A1) % <- Anstr"omrichtung
    \lput*{:U}{\small Anstr"omrichtung $v_{\infty}$} }%
  \psIntersectionPoint(A1)(A2)(DST1)(DST2){Hk}
  \pscurve(Hk)(.4,.38)(Vk)(.36,.33)(.5,.32)(Hk)
  \psParallelLine[linecolor=red!75!green,arrows=->,arrowscale=2](Vk)(Hk)(D){.1}{FtE}
  \psRelLine[linecolor=red!75!green,arrows=->,arrowscale=2,angle=90](D)(FtE){4}{Fn}% why "4"?
  \psParallelLine[linestyle=dashed](D)(FtE)(Fn){.1}{Fnr1}
  \psRelLine[linestyle=dashed,angle=90](FtE)(D){-4}{Fnr2} % why "-4"?
  \psline[linewidth=1.5pt,arrows=->,arrowscale=2](D)(Fnr2)
  \psIntersectionPoint(D)([nodesep=2]D)(Fnr1)([offset=-4]Fnr1){Fh}
  \psIntersectionPoint(D)([offset=2]D)(Fnr1)([nodesep=4]Fnr1){Fv}
  \psline[linecolor=blue,arrows=->,arrowscale=2](D)(Fh)
  \psline[linecolor=blue,arrows=->,arrowscale=2](D)(Fv)
  \psline[linestyle=dotted](Fh)(Fnr1)  \psline[linestyle=dotted](Fv)(Fnr1)
  \uput{.1}[0](Fh){\blue $F_{H}$}   \uput{.1}[180](Fv){\blue $F_{V}$}
  \uput{.1}[-45](Fnr1){$F_{R}$}     \uput{.1}[90](Fn){\color{red!75!green}$F_{N}$}
  \uput{.25}[-90](FtE){\color{red!75!green}$F_{T}$}
\end{pspicture}
\end{lstlisting}


%--------------------------------------------------------------------------------------
\section{\CMD{psParallelLine}}
%--------------------------------------------------------------------------------------
With this macro it is possible to plot lines relative to a given one, which is parallel. 
There is no special parameter here.

\begin{lstlisting}[style=syntax]
\psParallelLine(<P0>)(<P1>)(<P2>){<length>}{<end node name>}
\psParallelLine{<arrows>}(<P0>)(<P1>)(<P2>){<length>}{<end node name>}
\psParallelLine[<options>](<P0>)(<P1>)(<P2>){<length>}{<end node name>}
\psParallelLine[<options>]{<arrows>}(<P0>)(<P1>)(<P2>){<length>}{<end node name>}
\end{lstlisting}

The line starts at $P_2$, is parallel to $\overline{P_0P_1}$ and the length of this
parallel line depends to the length factor. The end node name must
be a valid nodename and shouldn't contain any of the special PostScript characters.

\begin{LTXexample}
\begin{pspicture*}(-5,-4)(5,3.5)
  \psgrid[subgriddiv=0,griddots=5]
  \pnode(2,-2){FF}\qdisk(FF){1.5pt}
  \pnode(-5,5){A}\pnode(0,0){O}
  \multido{\nCountA=-2.4+0.4}{9}{%
    \psParallelLine[linecolor=red](O)(A)(0,\nCountA){9}{P1}
    \psline[linecolor=red](0,\nCountA)(FF)
    \psRelLine[linecolor=red](0,\nCountA)(FF){9}{P2}
  }
  \psline[linecolor=blue](A)(FF)
  \psRelLine[linecolor=blue](A)(FF){5}{END1}
  \psline[linewidth=2pt,arrows=->](2,0)(FF)
\end{pspicture*}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\section{\CMD{psIntersectionPoint}}
%--------------------------------------------------------------------------------------
This macro calculates the intersection point of two lines, given by the four coordinates.
There is no special parameter here.
\begin{lstlisting}[style=syntax]
\psIntersectionPoint(<P0>)(<P1>)(<P2>)(<P3>){<node name>}
\end{lstlisting}

\begin{LTXexample}[width=5.5cm]
\psset{unit=0.5cm}
\begin{pspicture}(-5,-4)(5,5)
  \psaxes{->}(0,0)(-5,-4)(5,5)
  \psline[linecolor=red,linewidth=2pt](-5,-1)(5,5)
  \psline[linecolor=blue,linewidth=2pt](-5,3)(5,-4)
  \qdisk(-5,-1){3pt}\uput[-90](-5,-1){A}
  \qdisk(5,5){3pt}\uput[-90](5,5){B}
  \qdisk(-5,3){3pt}\uput[-90](-5,3){C}
  \qdisk(5,-4){3pt}\uput[-90](5,-4){D}
  \psIntersectionPoint(-5,-1)(5,5)(-5,3)(5,-4){IP}
  \qdisk(IP){5pt}\uput{0.3}[90](IP){IP}
  \psline[linestyle=dashed](IP|0,0)(IP)(0,0|IP)
\end{pspicture}
\end{LTXexample}

\clearpage
%--------------------------------------------------------------------------------------
\section{\CMD{psLNode} and \CMD{psLCNode}}
%--------------------------------------------------------------------------------------
\CMD{psLNode} interpolates the Line $\overline{AB}$ by the given value and sets a node at this
point. The syntax is
%
\begin{lstlisting}[style=syntax]
\psLNode(P1)(P2){value}{Node name}
\end{lstlisting}

\begin{LTXexample}[width=5cm]
\begin{pspicture}(5,5)
\psgrid[subgriddiv=0,griddots=10]
\psset{linecolor=red}
\psline{o-o}(1,1)(5,5)
\psLNode(1,1)(5,5){0.75}{PI}
\qdisk(PI){4pt}
\psset{linecolor=blue}
\psline{o-o}(4,3)(2,5)
\psLNode(4,3)(2,5){-0.5}{PII}
\qdisk(PII){4pt}
\end{pspicture}
\end{LTXexample}


\bigskip
The \CMD{psLCNode} macro builds the linear combination of the two given 
vectors and stores the end of
the new vector as a node. All vectors start at $(0,0)$, so a \verb+\rput+ maybe appropriate.
The syntax is
%
\begin{lstlisting}[style=syntax]
\psLCNode(P1){value 1}(P2){value 2}{Node name}
\end{lstlisting}

\begin{LTXexample}[width=5cm]
\begin{pspicture}(5,5)
\psgrid[subgriddiv=0,griddots=10]
\psset{linecolor=black}
\psline[linestyle=dashed]{->}(3,1.5)
\psline[linestyle=dashed]{->}(0.375,1.5)
\psset{linecolor=red}
\psline{->}(2,1)\psline{->}(0.5,2)
\psLCNode(2,1){1.5}(0.5,2){0.75}{PI}
\psline[linewidth=2pt]{->}(PI)
\psset{linecolor=black}
\psline[linestyle=dashed](3,1.5)(PI)
\psline[linestyle=dashed](0.375,1.5)(PI)
\end{pspicture}
\end{LTXexample}

\clearpage

%--------------------------------------------------------------------------------------
\section{\CMD{nlput} and \CMD{psLDNode}}
%--------------------------------------------------------------------------------------
\CMD{ncput} allows to set a label relative to the first node of the last
node connection. With \CMD{nlput} this can be done absolute to a given
node. The syntax is different to the other node connection makros. It uses
internally the macro \CMD{psLDNode} which places a node absolute to 
two given points, starting from the first one.

\begin{lstlisting}[style=syntax]
\nlput[options](A)(B){distance}{text}
\psLDNode[options](A)(B){distance}{node name}
\end{lstlisting}


\begin{LTXexample}[width=5cm]
\begin{pspicture}(5,2)
\pnode(0,0){A}
\pnode(5,2){B}
\ncline{A}{B}
\psLDNode(A)(B){1.5cm}{KN}\qdisk(KN){2pt}
\nlput[nrot=:U](A)(B){1cm}{Test}
\nlput[nrot=:D](A)(B){2cm}{Test}
\nlput[nrot=:U](A)(B){3cm}{Test}
\nlput(A)(B){4cm}{Test}
\end{pspicture}
\end{LTXexample}




\clearpage
%--------------------------------------------------------------------------------------
\part{\texttt{pst-plot}}
%--------------------------------------------------------------------------------------
\section{ New options}
%--------------------------------------------------------------------------------------

The axes macro has now two additional optional arguments for placing labels at
the end of the axes:

\begin{lstlisting}[style=syntax]
\psaxes[settings]{arrows}(x0,y0)(x1,y1)(x2,y2)[Xlabel,Xangle][Ylabel,Yangle]
\end{lstlisting}

It has now four optional arguments, one for the setting, one for the arrows, one for
the x-label and one for the y-label. If you want only a y-label, then leave the
x one empty. A missing y label is possible. The following examples show how it
can be used.



The option \verb+tickstyle=full|top|bottom+ is no more working in the \verb+pstricks-add+
package, because everything can be set by the \verb+ticksize+ option. When using the
\verb+comma+ or \verb+trigLabels+ option, the macros \verb+\pshlabel+ and \verb+\psvlabel+
shouldn't be redefined, because the package does it itself in these cases.
{
\ttfamily
\rowcolors{0}{blue!20}{red!30}
\begin{longtable}{lll}
\caption{All new parameters for \texttt{pst-plot}}\\[-5pt]
\textrm{Name}         & \textrm{Type}  & \textrm{Default}\\\hline
\endfirsthead
\textrm{Name}         & \textrm{Type}  & \textrm{Default}\\\hline
\endhead
labelFontSize	      & <fontsize macro>    & \{\} \\
algebraic             & false|true & false\\ %ok
comma                 & false|true & false\\ %ok
xAxis                 & false|true & true\\%ok
yAxis                 & false|true & true\\%ok
xyAxes                & false|true & true\\%ok
xDecimals            & <number> or empty  & \{\}\\%ok
yDecimals            & <number> or empty  & \{\}\\%ok
xyDecimals            & <number> or empty   & \{\}\\%ok
%xLabel               & <anything> & \{\}\\%ok
%yLabel               & <anything> & \{\}\\%ok
%xyLabel               & <anything> & \{\}\\%ok
%tickstyle            & full|top|bottom & full\\%ok
ticks                & <all|x|y|none>   & all\\%ok
labels               & <all|x|y|none>   & all\\%ok
subticks             & <number>         & 0\\
xsubticks            & <number>         & 0\\
ysubticks            & <number>         & 0\\
ticksize             & <length [length]>         & -4pt 4pt\\
subticksize          & <number>         & 0.75\\
tickwidth            & <length>         & 0.5\verb+\pslinewidth+\\
subtickwidth         & <length>         & 0.25\verb+\pslinewidth+\\
tickcolor            & <color>          & black\\
xtickcolor           & <color>          & black\\
ytickcolor           & <color>          & black\\
subtickcolor         & <color>          & darkgray\\
xsubtickcolor        & <color>          & darkgray\\
ysubtickcolor        & <color>          & darkgray\\
ticklinestyle        & solid | dashed | dotted | none & solid\\
subticklinestyle        & solid | dashed | dotted | none & solid\\
xlabelFactor         & <anything> & \{\textbackslash\@ empty\}\\
ylabelFactor         & <anything> & \{\textbackslash\@ empty\}\\
xlogBase              & <number> or empty   & \{\}\\
ylogBase              & <number> or empty   & \{\}\\
xylogBase              & <number> or empty   & \{\}\\
logLines             & <none|x|y|all>   & none\\
ignoreLines          & <number>          & 0\\
nStep                & <number>          & 1\\
nStart               & <number>          & 0\\
nEnd                 & <number> or empty          & \{\}\\
xStep                & <number>          & 0\\
yStep               & <number>          & 0\\
xStart               & <number> or empty         & \{\}\\
yStart               & <number> or empty         & \{\}\\
xEnd               & <number> or empty         & \{\}\\
yEnd               & <number> or empty         & \{\}\\
plotNo            & <number>          & 1\\
plotNoMax         & <number>          & 1\\
xAxisLabel        & <anything> & \{\textbackslash\@ empty\}\\
yAxisLabel        & <anything> & \{\textbackslash\@ empty\}\\
xAxisLabelPos     & <(x,y)> or empty & \{\textbackslash\@ empty\}\\
yAxisLabelPos     & <(x,y)> or empty & \{\textbackslash\@ empty\}\\
llx               & <length>  & 0pt\\
lly               & <length>  & 0pt\\
urx               & <length>  & 0pt\\
ury               & <length>  & 0pt\\
polarplot         & false|true    & false\\
trigLabels        & false|true    & false\\
trigLabelBase        & <number>    & 0\\
ChangeOrder        & false|true    & false\\
\end{longtable}
}


\clearpage
%--------------------------------------------------------------------------------------
\subsection{Changing the label font size with \texttt{labelFontSize}}
%--------------------------------------------------------------------------------------

This option sets the horizontal \textbf{and} vertical font size for the labels.
It will be overwritten when another package or a user defines
\begin{lstlisting}[style=syntax]
\def\pshlabel#1{...}
\def\psvlabel#1{...}
\end{lstlisting}

\begin{LTXexample}[width=6cm]
\begin{pspicture}(-0.25,-0.25)(5,2.25)
\psaxes{->}(5,2.25)[$x$,0][$y$,90]
\end{pspicture}\\[20pt]
\begin{pspicture}(-0.25,-0.25)(5,2.25)
\psaxes[labelFontSize=\small]{->}(5,2.25)
\end{pspicture}\\[20pt]
\begin{pspicture}(-0.25,-0.25)(5,2.25)
\psaxes[labelFontSize=\footnotesize]{->}(5,2.25)
\end{pspicture}\\[20pt]
\begin{pspicture}(-0.25,-0.25)(5,2.25)
\psaxes[labelFontSize=\tiny]{->}(5,2.25)[\textbf{x},-90][\textbf{y},0]
\end{pspicture}%
\end{LTXexample}


\clearpage

%--------------------------------------------------------------------------------------
\subsection[\texttt{algebraic}]{\texttt{algebraic}\footnote{This part is adapted 
    from the package \texttt{pst-eqdf}, written by Dominique Rodriguez.}}
%--------------------------------------------------------------------------------------
By default the function of \verb+\psplot+ has to be described in Reversed Polish Notation.
The option \verb+algebraic+ allows to do this in the common algebraic notation. E.g.:

\begin{tabular}{l|l}
RPN & algebraic\\\hline
\verb+x ln+ & \verb+ln(x)+\\
\verb+x cos 2.71 x neg 10 div exp mul+ & \verb+cos(x)*2.71^(-x/10)+\\
\verb+1 x div cos 4 mul+ & \verb+4*cos(1/x)+\\
\verb+t cos t sin+ & \verb+cos(t)|sin(t)+
\end{tabular}

Setting the option \verb$algebraic$ to \verb$true$, allow the user to describe all
expression to be written in the classical algebraic notation (infix notation). The four arithmetic
operarions are obviously defined \verb$+-*/$, and also the exponential operator
\verb$^$. The natural priorities are used : $3+4\times 5^5=3+(4\times (5^5))$, and by default
the computation is done from left to right. The following functions are defined :

\medskip
\begin{tabular}{ll}
\verb$sin$, \verb$cos$, \verb$tan$, \verb$acos$, \verb$asin$ & in radians\\
\verb$log$, \verb$ln$\\
\verb$ceiling$, \verb$floor$, \verb$truncate$, \verb$round$\\
\verb$sqrt$ & square root\\
\verb$abs$ & absolute value\\
\verb$fact$ & for the factorial\\
\verb$Sum$ & for building sums\\
\verb$IfTE$ & for an easy case structure
\end{tabular}

\medskip
These options can be used with \textbf{all} plot macros.

{\bfseries Using the option \verb+algebraic+ implies that all angles have to be used in the
radian unit! }

For the \verb+\parametricplot+ the two parts must be divided by the \verb+|+ character:

\begin{LTXexample}[width=2cm]
\begin{pspicture}(-0.5,-0.5)(0.5,0.5)
\parametricplot[algebraic,linecolor=red]{-3.14}{3.14}{cos(t)|sin(t)}
\end{pspicture}
\end{LTXexample}


\clearpage
\bigskip
%\begin{LTXexample}[pos=t]
\psset{lly=-0.5cm}
\psgraph(-10,-3)(10,2){\linewidth}{6cm}
  \psset{algebraic, plotpoints=101}
  \psplot[linecolor=yellow, linewidth=4\pslinewidth]{-10}{10}{2*sin(x)}%
  \psplot[linecolor=red, showpoints=true]{-10}{10}{2*sin(x)}
\endpsgraph
%\end{LTXexample}

\bigskip
\begin{lstlisting}
\psset{lly=-0.5cm}
\psgraph(-10,-3)(10,2){\linewidth}{6cm}
  \psset{algebraic,plotpoints=101}
  \psplot[linecolor=yellow, linewidth=4\pslinewidth]{-10}{10}{2*sin(x)}%
  \psplot[linecolor=red, showpoints=true]{-10}{10}{2*sin(x)}
\endpsgraph
\end{lstlisting}


\bigskip
%\begin{LTXexample}[pos=t]
\bgroup
\psset{lly=-0.5cm}
\psgraph(0,-5)(18,3){15cm}{5cm}
  \psset{algebraic,plotpoints=501}
  \psplot[linecolor=yellow, linewidth=4\pslinewidth]{0.01}{18}{ln(x)}%
  \psplot[linecolor=red]{0.01}{18}{ln(x)}
  \psplot[linecolor=yellow,linewidth=4\pslinewidth]{0}{18}{3*cos(x)*2.71^(-x/10)}
  \psplot[linecolor=blue,showpoints=true,plotpoints=51]{0}{18}{3*cos(x)*2.71^(-x/10)}
\endpsgraph
\egroup
%\end{LTXexample}


\bigskip
\begin{lstlisting}
\psset{lly=-0.5cm}
\psgraph(0,-5)(18,3){15cm}{5cm}
  \psset{algebraic,plotpoints=501}
  \psplot[linecolor=yellow, linewidth=4\pslinewidth]{0.01}{18}{ln(x)}%
  \psplot[linecolor=red]{0.01}{18}{ln(x)}
  \psplot[linecolor=yellow,linewidth=4\pslinewidth]{0}{18}{3*cos(x)*2.71^(-x/10)}
  \psplot[linecolor=blue,showpoints=true,plotpoints=51]{0}{18}{3*cos(x)*2.71^(-x/10)}
\endpsgraph
\end{lstlisting}



\clearpage
%--------------------------------------------------------------------------------------
\subsubsection{Using the \texttt{Sum} function}
%--------------------------------------------------------------------------------------

Syntax: \verb+Sum(<index name>,<start>,<step>,<end>,<function>)+

Let's plot the first development of cosine with polynomials:
$\displaystyle\sum_{n=0}^{+\infty}\frac{(-1)^nx^{2n}}{n!}$.

\begin{center}
\bgroup
\psset{algebraic, plotpoints=501, yunit=3}
\def\getColor#1{\ifcase#1 black\or red\or magenta\or yellow\or green\or Orange\or blue\or
  DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\fi}
\begin{pspicture}(-7,-1.5)(7,1.5)
  \psclip{\psframe(-7,-1.5)(7,1.5)}
    \psplot{-7}{7}{cos(x)}
    \multido{\n=1+1}{10}{%
      \psplot[linewidth=1pt,linecolor=\getColor{\n}]{-7}{7}{%
         Sum(ijk,0,1,\n,(-1)^ijk*x^(2*ijk)/fact(2*ijk))}}
   \endpsclip
  \psaxes(0,0)(-7,-1.5)(7,1.5)
\end{pspicture}
\egroup
\end{center}
\begin{lstlisting}
\psset{algebraic, plotpoints=501, yunit=3}
\def\getColor#1{\ifcase#1 black\or red\or magenta\or yellow\or green\or Orange\or blue\or
  DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\fi}
\begin{pspicture}(-7,-1.5)(7,1.5)
  \psclip{\psframe(-7,-1.5)(7,1.5)}
    \psplot{-7}{7}{cos(x)}
    \multido{\n=1+1}{10}{%
      \psplot[linewidth=1pt,linecolor=\getColor{\n}]{-7}{7}{%
         Sum(ijk,0,1,\n,(-1)^ijk*x^(2*ijk)/fact(2*ijk))}}
   \endpsclip
  \psaxes(0,0)(-7,-1.5)(7,1.5)
\end{pspicture}
\end{lstlisting}

\clearpage
%--------------------------------------------------------------------------------------
\subsubsection{Using the \texttt{IfTE} function}
%--------------------------------------------------------------------------------------
Syntax: \verb+IfTE(<condition>,<true part>,<false part>)+

Nesting of several \verb+IfTE+ are possible and seen in the following examples.
A classical example is a piece wise linear function.

\begin{center}
\begin{pspicture}(-7.5,-2.5)(7.5,6)\psgrid[subgriddiv=1,gridcolor=lightgray]
  \psset{algebraic=true, plotpoints=21,linewidth=2pt}
  \psplot[linecolor=blue]{-7.5}{7.5}{IfTE(x<-6,8+x,IfTE(x<0,-x/3,IfTE(x<3,2*x,9-x)))}
  \psplot[linecolor=red, plotpoints=101]{-7.5}{7.5}{%
      IfTE(2*x<-2^2*sqrt(9),7+x,IfTE(x<0,x^2/18-1,IfTE(x<3,2*x^2/3-1,8-x)))}%
\end{pspicture}
\end{center}


\begin{lstlisting}
\begin{pspicture}(-7.5,-2.5)(7.5,6)\psgrid[subgriddiv=1,gridcolor=lightgray]
  \psset{algebraic=true, plotpoints=21,linewidth=2pt}
  \psplot[linecolor=blue]{-7.5}{7.5}{IfTE(x<-6,8+x,IfTE(x<0,-x/3,IfTE(x<3,2*x,9-x)))}
  \psplot[linecolor=red, plotpoints=101]{-7.5}{7.5}{%
      IfTE(2*x<-2^2*sqrt(9),7+x,IfTE(x<0,x^2/18-1,IfTE(x<3,2*x^2/3-1,8-x)))}%
\end{pspicture}
\end{lstlisting}

When you program a piece-wise defined function you must take care that a 
plotting point must be put on each point where the description changes. Use \verb+showpoints=true+ to
see what's going on, when there is a problem. You are on the save side, when you choose a
big number for \verb+plotpoints+.

\clearpage


\begin{center}
\begin{pspicture}[showgrid=true](-8,-8)(8,8)
  \psset{plotpoints=1000,linewidth=1pt}
  \psplot[algebraic]{-8}{8}{ceiling(x)}
  \psplot[algebraic, linecolor=yellow]{-8}{8}{rand/(2^31-1)+x}
  \psplot[algebraic, linecolor=red]{-8}{8}{floor(x)}
  \psplot[algebraic, linecolor=blue]{-8}{8}{round(x)}
  \psplot[algebraic, linecolor=green]{-8}{8}{truncate(x)}
  \psplot[algebraic, linecolor=cyan]{-8}{8}{div(mul(4,x),7)}
  \psplot[algebraic, linecolor=gray]{-8}{8}{abs(x)+abs(x-3)-abs(5-5*x/7)}
  \psplot[algebraic, linecolor=gray]{-8}{8}{abs(3*cos(x)+1)}
  \psplot[algebraic, linecolor=magenta]{-8}{8}{floor(8*cos(x))}
\end{pspicture}
\end{center}

\begin{lstlisting}
\begin{pspicture}[showgrid=true](-8,-8)(8,8)
  \psset{plotpoints=1000,linewidth=1pt}
  \psplot[algebraic, linecolor=yellow]{-8}{8}{rand/(2^31-1)+x}
  \psplot[algebraic]{-8}{8}{ceiling(x)}
  \psplot[algebraic, linecolor=red]{-8}{8}{floor(x)}
  \psplot[algebraic, linecolor=blue]{-8}{8}{round(x)}
  \psplot[algebraic, linecolor=green]{-8}{8}{truncate(x)}
  \psplot[algebraic, linecolor=cyan]{-8}{8}{div(mul(4,x),7)}
  \psplot[algebraic, linecolor=gray]{-8}{8}{abs(x)+abs(x-3)-abs(5-5*x/7)}
  \psplot[algebraic, linecolor=gray]{-8}{8}{abs(3*cos(x)+1)}
  \psplot[algebraic, linecolor=magenta]{-8}{8}{floor(8*cos(x))}
\end{pspicture}
\end{lstlisting}




%--------------------------------------------------------------------------------------
\subsection{\texttt{comma}}
%--------------------------------------------------------------------------------------
Syntax:
\begin{lstlisting}[style=syntax]
comma=false|true
\end{lstlisting}
Setting this option to true gives labels with a comma as a decimal separator instead
of the dot. \verb|comma| and \verb|comma=true| is the same.

\resetOptions
\medskip
\begin{LTXexample}[width=5.5cm]
\begin{pspicture}(-0.5,-0.5)(5,5.5)
\psaxes[Dx=1.5,Dy=0.5,comma]{->}(5,5)
\psplot[linecolor=red,linewidth=3pt]{0}{4.5}%
   {x 180 mul 1.52 div cos 2 mul 2.5 add}
\psline[linestyle=dashed](0,2.5)(4.5,2.5)
\end{pspicture}
\end{LTXexample}

%--------------------------------------------------------------------------------------
\subsection{\texttt{xyAxes}, \texttt{xAxis} and \texttt{yAxis}}
%--------------------------------------------------------------------------------------
Syntax:
\begin{lstlisting}[style=syntax]
xyAxes=true|false
xAxis=true|false
yAxis=true|false
\end{lstlisting}

Sometimes there is only a need for one axis with ticks. In this case you can set one
of the following options to false. The \verb+xyAxes+ makes only sense, when you want
to set both, x and y to true with only one command again to the default, because with
\verb+xyAxes=false+ you get nothing with the \verb+psaxes+ macro.


\resetOptions%
\begin{LTXexample}
\begin{pspicture}(5,1)
\psaxes[yAxis=false,linecolor=blue]{->}(0,0.5)(5,0.5)
\end{pspicture}
\begin{pspicture}(1,5)
\psaxes[xAxis=false,linecolor=red]{->}(0.5,0)(0.5,5)
\end{pspicture}
\begin{pspicture}(1,5)
\psaxes[xAxis=false,linecolor=red]{->}(0.5,0)(0.5,5)
\end{pspicture}\hspace{2em}
\begin{pspicture}(1,5)
\psaxes[xAxis=false,linecolor=red,labelsep=-20pt]{->}(0.5,0)(0.5,5)
\end{pspicture}%
\begin{pspicture}(1,5)
\psaxes[xAxis=false,linecolor=red]{->}(0.5,0)(0.501,5)
\end{pspicture}%
\end{LTXexample}

As seen in the example, a single y axis gets the labels on the right side. This can be
changed in two ways, first with the option \verb+labelsep+ and second with a very
short and therefore invisible x-axis (right example). 

%--------------------------------------------------------------------------------------
\subsection{\texttt{xyDecimals}, \texttt{xDecimals} and \texttt{yDecimals}}
%--------------------------------------------------------------------------------------
Syntax:
\begin{lstlisting}[style=syntax]
xyDecimals=<number>
xDecimals=<any>
yDecimals=<any>
\end{lstlisting}
By default the labels of the axes get numbers with or without decimals, just depending to the
numbers. With these options \verb|??Decimals| it is possible to determine the decimals,
where the option \verb|xyDecimals| sets this identical for both axes.
The default setting \verb|{}| means, that you'll get the standard behaviour.


\begin{LTXexample}[width=6cm]
\begin{pspicture}(-1.5,-0.5)(5,3.75)
  \psaxes[xyDecimals=2]{->}(0,0)(4.5,3.5)
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}
\psset{xunit=10cm,yunit=0.01cm,labelFontSize=\footnotesize}
\begin{pspicture}(-0.3,-150)(1.5,550.0)
  \psaxes[Dx=0.25,Dy=100,ticksize=-4pt 0,comma=true,%
    xDecimals=3,yDecimals=1]{->}(0,0)(0,-100)(1.4,520)%
     [\textbf{Amp\`ere},-90][\textbf{Voltage},0]
\end{pspicture}
\end{LTXexample}

\resetOptions

%--------------------------------------------------------------------------------------
\subsection{\texttt{ticks}}
%--------------------------------------------------------------------------------------
Syntax:
\begin{lstlisting}[style=syntax]
ticks=all|x|y|none
\end{lstlisting}

This option is also already in the \verb+pst-plot+ package and only mentioned here for
some completness.

\begin{LTXexample}[width=3.5cm]
\psset{ticksize=6pt}
\begin{pspicture}(-1,-1)(2,2)
\psaxes[ticks=all,subticks=5]{->}(0,0)(-1,-1)(2,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(-1,-1)(2,2)
\psaxes[ticks=y,subticks=5]{->}(0,0)(-1,-1)(2,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(-1,-1)(2,2)
\psaxes[ticks=x,subticks=5]{->}(0,0)(2,2)(-1,-1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(-1,-1)(2,2)
\psaxes[ticks=none,subticks=5]{->}(0,0)(2,2)(-1,-1)
\end{pspicture}
\end{LTXexample}

Single ticks can be set with the two macros 
%
\begin{lstlisting}[style=syntax]
\psxTick[options](x value){label}
\psyTick[options](y value){label}
\end{lstlisting}


\begin{LTXexample}[width=.5\linewidth]
\begin{psgraph}[Dx=2,Dy=2](0,0)(-4,-2.2)(4,2.2){.5\textwidth}{!}
  \psxTick[linecolor=red](1.5){$x_0$}
  \psyTick[linecolor=blue](1.7){$y_0$}
\end{psgraph}
\end{LTXexample}

%--------------------------------------------------------------------------------------
\subsection{\texttt{labels}}
%--------------------------------------------------------------------------------------
Syntax:
\begin{lstlisting}[style=syntax]
labels=all|x|y|none
\end{lstlisting}

This option is also already in the \verb+pst-plot+ package and only mentioned here for
some completness.

\begin{LTXexample}[width=3.5cm]
\psset{ticksize=6pt}
\begin{pspicture}(-1,-1)(2,2)
\psaxes[labels=all,subticks=5]{->}(0,0)(-1,-1)(2,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(-1,-1)(2,2)
\psaxes[labels=y,subticks=5]{->}(0,0)(-1,-1)(2,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(-1,-1)(2,2)
\psaxes[labels=x,subticks=5]{->}(0,0)(2,2)(-1,-1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(-1,-1)(2,2)
\psaxes[labels=none,subticks=5]{->}(0,0)(2,2)(-1,-1)
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{\texttt{ticksize}, \texttt{xticksize}, \texttt{yticksize}}
%--------------------------------------------------------------------------------------

With this new option the recent \verb+tickstyle+ option of \verb+pst-plot+ is obsolete
and no more supported by \verb+pstricks-add+.

Syntax:
\begin{lstlisting}[style=syntax]
ticksize=value[unit]
ticksize=value[unit] value[unit]
xticksize=value[unit]
xticksize=value[unit] value[unit]
yticksize=value[unit]
yticksize=value[unit] value[unit]
\end{lstlisting}

\verb+ticksize+ sets both values. The first one is left/below and the optional second
one is right/above of the coordinate axis. The old setting \verb+tickstyle=bottom+ is
now easy to realize, e.g.: \verb+ticksize=-6pt 0+, or vice versa, if the coordinates
are set from positive to negative values.

\medskip
\begin{LTXexample}[width=6cm]
\psset{arrowscale=3}
\begin{pspicture}(-1.5,-1.5)(4,3.5)
  \psaxes[ticksize=0.5cm]{->}(0,0)(-1.5,-1.5)(4,3.5)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6cm]
\psset{arrowscale=3}
\begin{pspicture}(-1.5,-1.5)(4,3.5)
  \psaxes[xticksize=-10pt 0,yticksize=0 10pt]{->}(0,0)(-1.5,-1.5)(4,3.5)
\end{pspicture}
\end{LTXexample}

A grid is also possible by setting the values to the max/min coordinates.

\begin{LTXexample}[width=6cm]
\psset{arrowscale=3}
\begin{pspicture}(-.5,-.5)(5,4.5)
  \psaxes[ticklinestyle=dashed,ticksize=0 4cm]{->}(0,0)(-.5,-.5)(5,4.5)
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{\texttt{subticks}}
%--------------------------------------------------------------------------------------
Syntax:
\begin{lstlisting}[style=syntax]
subticks=<number>
\end{lstlisting}

By default subticks cannot have labels.

\begin{LTXexample}[width=3.5cm]
\psset{ticksize=6pt}
\begin{pspicture}(-1,-1)(2,2)
\psaxes[ticks=all,subticks=5]{->}(0,0)(-1,-1)(2,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(-1,-1)(2,2)
\psaxes[ticks=y,subticks=5]{->}(0,0)(-1,-1)(2,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(-1,-1)(2,2)
\psaxes[ticks=x,subticks=5]{->}(0,0)(2,2)(-1,-1)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\begin{pspicture}(-1,-1)(2,2)
\psaxes[ticks=none,subticks=5]{->}(0,0)(2,2)(-1,-1)
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{\texttt{subticksize}, \texttt{xsubticksize}, \texttt{ysubticksize}}
%--------------------------------------------------------------------------------------

Syntax:
\begin{lstlisting}[style=syntax]
subticksize=value
xsubticksize=value
ysubticksize=value
\end{lstlisting}

\verb+subticksize+ sets both values, which are relative to the ticksize length and 
can have any number. 1 sets it to the same length as the main ticks.

\begin{LTXexample}[preset=\centering,pos=t]
\psset{yunit=1.5cm,xunit=3cm}
\begin{pspicture}(-1.25,-4.75)(3.25,.75)
  \psaxes[xticksize=-4.5 0.5,ticklinestyle=dashed,subticks=5,xsubticksize=1,%
     ysubticksize=0.75,xsubticklinestyle=dotted,xsubtickwidth=1pt,
     subtickcolor=gray]{->}(0,0)(-1,-4)(3.25,0.5)
\end{pspicture}
\end{LTXexample}

\clearpage

%--------------------------------------------------------------------------------------
\subsection{\texttt{tickcolor}, \texttt{subtickcolor}}
%--------------------------------------------------------------------------------------
Syntax:
\begin{lstlisting}[style=syntax]
tickcolor=<color>
xtickcolor=<color>
ytickcolor=<color>
subtickcolor=<color>
xsubtickcolor=<color>
ysubtickcolor=<color>
\end{lstlisting}

\verb+tickcolor+ and \verb+subtickcolor+ set both for the x- and the y-Axis.

\begin{LTXexample}[preset=\centering,pos=t]
\begin{pspicture}(0,-0.75)(10,1)
\psaxes[labelsep=2pt,yAxis=false,labelFontSize=\footnotesize,%
  labelsep=-10pt,ticksize=0 10mm,subticks=10,subticksize=0.75,%
  tickcolor=red,subtickcolor=blue,tickwidth=1pt,%
  subtickwidth=0.5pt](10.01,0)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=5cm]
\begin{pspicture}(5,-0.75)(10,1)
\psaxes[labelsep=2pt,yAxis=false,labelFontSize=\footnotesize,%
  labelsep=5pt,ticksize=0 -10mm,subticks=10,subticksize=0.75,%
  tickcolor=red,subtickcolor=blue,tickwidth=1pt,%
  subtickwidth=0.5pt,Ox=5](5,0)(5,0)(10.01,0)
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{\texttt{ticklinestyle} and \texttt{subticklinestyle}}
%--------------------------------------------------------------------------------------
Syntax:
\begin{lstlisting}[style=syntax]
ticklinestyle=solid|dashed|dotted|none
xticklinestyle=solid|dashed|dotted|none
yticklinestyle=solid|dashed|dotted|none
subticklinestyle=solid|dashed|dotted|none
xsubticklinestyle=solid|dashed|dotted|none
ysubticklinestyle=solid|dashed|dotted|none
\end{lstlisting}

\verb+ticklinestyle+ and \verb+subticklinestyle+ set both values for the x and y axis. The
value \verb+none+ doesn't really makes sense, because it is the same to 
\verb+[sub]ticklines=0+

\begin{LTXexample}[preset=\centering,pos=t]
\psset{unit=4cm}
\pspicture(-0.15,-0.15)(2.5,1)
  \psaxes[axesstyle=frame,logLines=y,xticksize=0 1,xsubticksize=1,%
    ylogBase=10,tickcolor=red,subtickcolor=blue,tickwidth=1pt,%
    subticks=20,xsubticks=10,xticklinestyle=dashed,%
    xsubticklinestyle=dashed](2.5,1)
\endpspicture
\end{LTXexample}



%--------------------------------------------------------------------------------------
\subsection{\texttt{loglines}}
%--------------------------------------------------------------------------------------
Syntax:
\begin{lstlisting}[style=syntax]
loglines=all|x|y
\end{lstlisting}

\begin{LTXexample}[width=5.5cm]
\pspicture(0,-1)(5,5)
   \psaxes[subticks=5,axesstyle=frame,xylogBase=10,logLines=all](5,5)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[preset=\centering,pos=t]
\psset{unit=4cm}
\pspicture(-0.15,-0.15)(2.5,3)
  \psaxes[axesstyle=frame,logLines=y,xticksize=0 3,xsubticksize=1,%
    ylogBase=10,tickcolor=red,subtickcolor=blue,tickwidth=1pt,%
    subticks=20,xsubticks=10](2.5,3)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[preset=\centering,pos=t]
\psset{unit=4}
\pspicture(-0.5,-0.3)(3,1.2)
   \psaxes[axesstyle=frame,logLines=x,xlogBase=10,Dy=0.5,%
     tickcolor=red,subtickcolor=blue,tickwidth=1pt,ysubticks=5,xsubticks=10](3,1)
\endpspicture
\end{LTXexample}

%--------------------------------------------------------------------------------------
\subsection{\texttt{xylogBase}, \texttt{xlogBase} and \texttt{ylogBase}}
%--------------------------------------------------------------------------------------
There are additional options \verb|xylogBase | xlogBase | ylogBase| to get one or both axes with logarithm labels.
For an intervall of [$10^{-3} ... 10^2$] choose a \verb|pstricks| intervall of [-3,2]. \verb|pstricks| takes $0$ as the origin of this axes, which is wrong
if we want to have a logarithm axes. With the options \verb|Oy| and \verb|Ox| we can set
the origin to $-3$, so that the first label gets $10^{-3}$. If this is not done by the
user then \verb|pstricks-add| does it by default. An alternative is to set these
parameters to empty values \verb|Ox={},Oy={}|, in this case \verb|pstricks-add| does nothing.


%------------------------------------------------------------------------------------
\subsubsection{\texttt{xylogBase}}
%------------------------------------------------------------------------------------
This mode is in math also called double logarithm. It is a combination of the two forgoing modes and the function is now $y=\log x$ and is shown in the following example.

\medskip
\begin{LTXexample}[width=7cm]
\begin{pspicture}(-3.5,-3.5)(3.5,3.5)
  \psplot[linewidth=2pt,linecolor=red]{0.001}{3}{x log}
  \psaxes[xylogBase=10,Oy=-3,Ox=-3]{->}(-3,-3)(3.5,3.5)
  \uput[-90](3.5,-3){x}
  \uput[180](-3,3.5){y}
  \rput(2.5,1){$y=\log x$}
\end{pspicture}
\end{LTXexample}



%--------------------------------------------------------------------------------------------
\subsubsection{\texttt{ylogBase}}
%--------------------------------------------------------------------------------------------
The values for the \texttt{psaxes} y-coordinate are now the exponents to the base $10$ and for 
the right function to the base $e$: $10^{-3} \ldots 10^1$ which corresponds to the given 
y-intervall $-3\ldots 1.5$, where only integers as exponents are possible. These logarithm 
labels have no effect to the internal used units. To draw the logarithm function we have 
to use the math function
\[y=\log\{\log x\}\]
\[y=\ln\{\ln x\}\]
with an drawing intervall of $1.001\ldots 6$.

\medskip
\begin{LTXexample}[width=7cm]
\begin{pspicture}(-0.5,-3.5)(6.5,1.5)
  \psaxes[ylogBase=10,Oy=-3]{->}(0,-3)(6.5,1.5)
  \uput[-90](6.5,-3){x}
  \uput[0](0,1.4){y}
  \rput(5,1){$y=\log x$}
  \psplot[linewidth=2pt,%
  plotpoints=100,linecolor=red]{1.001}{6}{x log log} % log(log(x))
\end{pspicture}
\end{LTXexample}

\medskip
\begin{LTXexample}[width=7cm]
\begin{pspicture}(-0.5,-3.5)(6.5,1.5)
  \psplot[linewidth=2pt,plotpoints=100,linecolor=red]%
    {1.04}{6}{/ln {log 0.4343 div} def x ln ln} % log(x)
  \psaxes[ylogBase=e,Oy=-3]{->}(0,-3)(6.5,1.5)
  \uput[-90](6.5,-3){x}
  \uput[0](0,1.5){y}
  \rput(5,1){$y=\ln x$}
\end{pspicture}
\end{LTXexample}



\medskip
\begin{LTXexample}[width=7cm]
  \begin{pspicture}(-0.5,1.75)(6.5,4.5)
    \psaxes[ylogBase=10,Oy=2]{->}(0,2)(0,2)(6.5,4.5)
  \end{pspicture}
\end{LTXexample}



\medskip
\begin{LTXexample}[width=7cm]
  \begin{pspicture}(-0.5,-0.25)(6.5,4.5)
    \psplot{0}{6}{x x cos add log}                       % x   + cox(x)
    \psplot[linecolor=red]{0}{6}{x 3 exp x cos add log}  % x^3 + cos(x)
    \psplot[linecolor=cyan]{0}{6}{x 5 exp x cos add log} % x^5 + cos(x)
    \psaxes[ylogBase=10]{->}(6.5,4.5)
  \end{pspicture}
\end{LTXexample}



\medskip
\begin{LTXexample}[width=7cm]
\begin{pspicture}(-0.5,-1.25)(6.5,4.5)
  \psplot{0}{6}{x x cos add log}                       % x   + cox(x)
  \psplot[linecolor=red]{0}{6}{x 3 exp x cos add log}  % x^3 + cos(x)
  \psplot[linecolor=cyan]{0}{6}{x 5 exp x cos add log} % x^5 + cos(x)
  \psaxes[ylogBase=10]{->}(0,-1)(0,-1)(6.5,4.5)
\end{pspicture}
\end{LTXexample}



\medskip
\begin{LTXexample}[width=4cm]
\begin{pspicture}(2.5,1.75)(6.5,4.5)
  \psplot[linecolor=cyan]{3}{6}{x 5 exp x cos add log} % x^5 + cos(x)
  \psaxes[ylogBase=10,Ox=3,Oy=2]{->}(3,2)(3,2)(6.5,4.5)
\end{pspicture}
\end{LTXexample}





%--------------------------------------------------------------------------------------
\subsubsection{\texttt{xlogBase}}
%--------------------------------------------------------------------------------------
Now we have to use the easy math function $y=x$ because the x axis is still $\log x$.

\medskip
\begin{LTXexample}[width=7cm]
\begin{pspicture}(-3.5,-3.5)(3.5,3.5)
  \psplot[linewidth=2pt,linecolor=red]{-3}{3}{x} % log(x)
  \psplot[linewidth=2pt,linecolor=blue]{-1.3}{1.5}{x 0.4343 div} % ln(x)
  \psaxes[xlogBase=10,Oy=-3,Ox=-3]{->}(-3,-3)(3.5,3.5)
  \uput[-90](3.5,-3){x}
  \uput[180](-3,3.5){y}
  \rput(2.5,1){$y=\log x$}
  \rput[lb](0,-1){$y=\ln x$}
\end{pspicture}
\end{LTXexample}

\begin{center}
\psset{yunit=3cm,xunit=2cm}
\begin{pspicture}(-1.25,-1.25)(4.25,1.5)
  \uput[-90](4.25,-1){x}
  \uput[0](-1,1.25){y}
  \rput(0,1){$y=\sin x$}
  \psplot[linewidth=2pt,plotpoints=5000,linecolor=red]{-1}{3.5}{10 x exp sin }
  \psaxes[xlogBase=10,Oy=-1,Ox=-1]{->}(-1,-1)(4.25,1.25)
  \psline[linestyle=dashed](!0 1)(!90 log 1)(!90 log 0)
\end{pspicture}
\end{center}

\begin{lstlisting}
\psset{yunit=3cm,xunit=2cm}
\begin{pspicture}(-1.25,-1.25)(4.25,1.5)
  \uput[-90](4.25,-1){x}
  \uput[0](-1,1.25){y}
  \rput(0,1){$y=\sin x$}
  \psplot[linewidth=2pt,plotpoints=5000,linecolor=red]{-1}{3.5}{10 x exp sin }
  \psaxes[xlogBase=10,Ox=-1,Oy=-1]{->}(-1,-1)(4.25,1.25)
   \psline[linestyle=dashed](-1,0)(4,0)
   \psline[linestyle=dashed](!-1 1)(!90 log 1)(!90 log -1)
   \psline[linestyle=dashed](!90 log 1)(!180 log 1)(!180 log -1)
\end{pspicture}
\end{lstlisting}


\begin{LTXexample}[width=7cm]
\begin{pspicture}(-3.5,-2.5)(3.5,2.5)
  \psaxes[xlogBase=10]{->}(0,0)(-3.5,-2.5)(3.5,2.5)
  \psplot{-2.5}{2.5}{10 x exp log}
\end{pspicture}
\end{LTXexample}



\medskip
\begin{LTXexample}[width=7cm]
\begin{pspicture}(-3.5,-2.5)(3.5,2.5)
  \psaxes[xlogBase=10,Ox={},Oy={}]{->}(0,0)(-3.5,-2.5)(3.5,2.5)
  \psplot{-2.5}{2.5}{10 x exp log}
\end{pspicture}
\end{LTXexample}


%------------------------------------------------------------------------------------
\subsubsection{No logstyle (\texttt{xylogBase=\{\}})}
%------------------------------------------------------------------------------------
This is only a demonstration that the default option \verb|logBase={}| still works ... :-)

\medskip
\begin{LTXexample}[width=7cm]
\begin{pspicture}(-3.5,-0.5)(3.5,2.5)
  \psplot[linewidth=2pt,linecolor=red,xylogBase={}]{0.5}{3}{x log} % log(x)
  \psaxes{->}(0,0)(-3.5,0)(3.5,2.5)
  \uput[-90](3.5,0){x}
  \uput[180](0,2.5){y}
  \rput(2.5,1){$y=\log x$}
\end{pspicture}
\end{LTXexample}


\newpage
%--------------------------------------------------------------------------------------
\subsection{\texttt{subticks}, \texttt{tickwidth} and \texttt{subtickwidth}}
%--------------------------------------------------------------------------------------


\begin{center}
\psset{arrowscale=3}
 \psaxes[labelsep=2pt,yAxis=false,subticks=8]{->}(0,0)(-5,-1)(5,1)\\[1cm]
 \psaxes[yAxis=false,subticks=4,ticksize=-4pt 0]{->}(0,0)(5,1)(-5,-1)\\
 \psaxes[yAxis=false,subticks=4,ticksize=-10pt 0]{->}(0,0)(-5,-5)(5,5)\\[1cm]
 \psaxes[yAxis=false,subticks=10,ticksize=0 -10pt,labelsep=15pt]{->}(0,0)(-5,-5)(5,5)\\[1cm]
 \psaxes[yAxis=false,subticks=4,ticksize=0 10pt,labelsep=-15pt]{->}(0,0)(5,5)(-5,-5)\\[1cm]
 \psaxes[yAxis=false,subticks=4,ticksize=0 -10pt]{->}(0,0)(5,5)(-5,-5)\\[0.25cm]
 \psaxes[yAxis=false,subticks=0]{->}(0,0)(-5,-5)(5,5)\\[1cm]
 \psaxes[yAxis=false,subticks=0,tickcolor=red,linecolor=blue]{->}(0,0)(5,5)(-5,-5)\\
 \psaxes[yAxis=false,subticks=5,tickwidth=2pt,subtickwidth=1pt]{->}(0,0)(-5,-5)(5,5)\\[1cm]
 \psaxes[yAxis=false,subticks=0,tickcolor=red]{->}(0,0)(5,5)(-5,-5)
\end{center}
\begin{lstlisting}[xrightmargin=-1.75cm]
\psset{arrowscale=3}
\psaxes[labelsep=2pt,yAxis=false,subticks=8]{->}(0,0)(-5,-1)(5,1)\\[1cm]
\psaxes[yAxis=false,subticks=4,ticksize=-4pt 0]{->}(0,0)(5,1)(-5,-1)\\
\psaxes[yAxis=false,subticks=4,ticksize=-10pt 0]{->}(0,0)(-5,-5)(5,5)\\[1cm]
\psaxes[yAxis=false,subticks=10,ticksize=0 -10pt,labelsep=15pt]{->}(0,0)(-5,-5)(5,5)\\[1cm]
\psaxes[yAxis=false,subticks=4,ticksize=0 10pt,labelsep=-15pt]{->}(0,0)(5,5)(-5,-5)\\[1cm]
\psaxes[yAxis=false,subticks=4,ticksize=0 -10pt]{->}(0,0)(5,5)(-5,-5)\\[0.25cm]
\psaxes[yAxis=false,subticks=0]{->}(0,0)(-5,-5)(5,5)\\[1cm]
\psaxes[yAxis=false,subticks=0,tickcolor=red,linecolor=blue]{->}(0,0)(5,5)(-5,-5)\\
\psaxes[yAxis=false,subticks=5,tickwidth=2pt,subtickwidth=1pt]{->}(0,0)(-5,-5)(5,5)\\[1cm]
\psaxes[yAxis=false,subticks=0,tickcolor=red]{->}(0,0)(5,5)(-5,-5)
\end{lstlisting}
   
\clearpage
\vspace*{4cm}
\begin{center}
  \psset{arrowscale=3}
  \psaxes[xAxis=false,subticks=8]{->}(0,0)(-5,-5)(5,5)\hspace{2em}
  \psaxes[xAxis=false,subticks=4]{->}(0,0)(5,5)(-5,-5)\hspace{4em}
  \psaxes[xAxis=false,subticks=4,ticksize=0 4pt]{->}(0,0)(-5,-5)(5,5)\hspace{3em}
  \psaxes[xAxis=false,subticks=4,ticksize=-4pt 0]{->}(0,0)(-5,-5)(5,5)\hspace{1em}
  \psaxes[xAxis=false,subticks=4,ticksize=0 4pt]{->}(0,0)(5,5)(-5,-5)\hspace{2em}
  \psaxes[xAxis=false,subticks=4,ticksize=-4pt 0,linecolor=red]{->}(0,0)(5,5)(-5,-5)\hspace{4em}
  \psaxes[xAxis=false,subticks=0]{->}(0,0)(-5,-5)(5,5)\hspace{1em}
  \psaxes[xAxis=false,subticks=0,tickcolor=red,linecolor=blue]{->}(0,0)(5,5)(-5,-5)\hspace{4em}
  \psaxes[xAxis=false,subticks=5,tickwidth=2pt,subtickwidth=1pt]{->}(0,0)(-5,-5)(5,5)\hspace{2em}
  \psaxes[xAxis=false,subticks=5,tickcolor=red,tickwidth=2pt,%
      ticksize=10pt,subtickcolor=blue,subticksize=0.75]{->}(0,0)(5,5)(-5,-5)
\end{center}

\vspace*{5cm}
\begin{lstlisting}[xrightmargin=-1.75cm]
\psset{arrowscale=3}
\psaxes[xAxis=false,subticks=8]{->}(0,0)(-5,-5)(5,5)\hspace{2em}
\psaxes[xAxis=false,subticks=4]{->}(0,0)(5,5)(-5,-5)\hspace{4em}
\psaxes[xAxis=false,subticks=4,ticksize=0 4pt]{->}(0,0)(-5,-5)(5,5)\hspace{3em}
\psaxes[xAxis=false,subticks=4,ticksize=-4pt 0]{->}(0,0)(-5,-5)(5,5)\hspace{1em}
\psaxes[xAxis=false,subticks=4,ticksize=0 4pt]{->}(0,0)(5,5)(-5,-5)\hspace{2em}
\psaxes[xAxis=false,subticks=4,ticksize=-4pt 0,linecolor=red]{->}(0,0)(5,5)(-5,-5)\hspace{4em}
\psaxes[xAxis=false,subticks=0]{->}(0,0)(-5,-5)(5,5)\hspace{1em}
\psaxes[xAxis=false,subticks=0,tickcolor=red,linecolor=blue]{->}(0,0)(5,5)(-5,-5)\hspace{4em}
\psaxes[xAxis=false,subticks=5,tickwidth=2pt,subtickwidth=1pt]{->}(0,0)(-5,-5)(5,5)\hspace{2em}
\psaxes[xAxis=false,subticks=5,tickcolor=red,tickwidth=2pt,%
  ticksize=10pt,subtickcolor=blue,subticksize=0.75]{->}(0,0)(5,5)(-5,-5)
\end{lstlisting}
 
\begin{LTXexample}[width=5.5cm]
\pspicture(5,5.5)
\psaxes[subticks=4,ticksize=6pt,subticksize=0.5,%
   tickcolor=red,subtickcolor=blue]{->}(5.4,5)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[width=5.5cm]
\pspicture(5,5.5)
   \psaxes[subticks=5,ticksize=0 6pt,subticksize=0.5]{->}(5.4,5)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[width=5.5cm]
\pspicture(5,5.5)
   \psaxes[subticks=5,ticksize=-6pt 0,subticksize=0.5]{->}(5.4,5)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\pspicture(-3,-3)(3,3.5)
   \psaxes[subticks=5,ticksize=0 6pt,subticksize=0.5]{->}(0,0)(3,3)(-3,-3)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[width=6.5cm]
\pspicture(0,0.5)(-3,-3)
   \psaxes[subticks=5,ticksize=-6pt 0,subticksize=0.5,linecolor=red]{->}(-3,-3)
\endpspicture
\end{LTXexample}



\begin{LTXexample}[width=5.5cm]
\psset{axesstyle=frame}
\pspicture(5,5.5)
   \psaxes[subticks=4,tickcolor=red,subtickcolor=blue](5,5)
\endpspicture
\end{LTXexample}

\vspace{1cm}
\begin{LTXexample}[width=5.5cm]
\pspicture(5,5.5)
   \psaxes[subticks=5,subticksize=1,subtickcolor=lightgray](5,5)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[width=5.5cm]
\pspicture(5,5.5)
   \psaxes[subticks=2,subticksize=1,subtickcolor=lightgray](5,5)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\pspicture(3,4.5)
   \psaxes[subticks=5,ticksize=-7pt 0](3,4)
\endpspicture
\end{LTXexample}


\begin{LTXexample}[width=3.5cm]
\pspicture(0,1)(-3,-4)
   \psaxes[subticks=5](-3,-4)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\pspicture(3,4.5)
   \psaxes[axesstyle=axes,subticks=5](3,4)
\endpspicture
\end{LTXexample}

\begin{LTXexample}[width=3.5cm]
\pspicture(0,1)(-3,-4)
  \psaxes[axesstyle=axes,subticks=5,%
    ticksize=0 10pt,labelsep=13pt](-3,-4)
\endpspicture
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{\texttt{xlabelFactor} and \texttt{ylabelFactor}}
%--------------------------------------------------------------------------------------
When having big numbers as data records then it makes sense to write the values
as ${<number>\cdot 10^{<exp>}}$. These new options allow to define the additional part
of the value, but it must be set in math mode when using math operators!

\resetOptions
\begin{LTXexample}
\readdata{\data}{demo1.dat}
\pstScalePoints(1,0.000001){}{}% (x,y){additional x operator}{y op}
\psset{llx=-1cm,lly=-1cm}
\psgraph[ylabelFactor=\cdot 10^6,Dx=5,Dy=100](0,0)(25,750){8cm}{5cm} 
   \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
\endpsgraph
\pstScalePoints(1,1){}{}% reset
\end{LTXexample}

%--------------------------------------------------------------------------------------
\subsection{Plot style \texttt{bar} and option \texttt{barwidth}}
%--------------------------------------------------------------------------------------
This option allows to draw bars for the data records. The width of the bars
is controlled by the option \verb+barwidth+, which is set by default to
value of \verb+0.25cm+, which is the total width.

\def\barData{
0 0.03
1 0.11
2 0.28
3 0.84
4 6.70
5 8.55
6 8.77
7 11.09
8 7.18
9 6.20
10 5.78
11 4.19
12 2.37
13 2.26
14 1.68
15 1.03
16 1.37
17 1.34
18 0.92
19 0.67
20 0.87
21 1.20
22 1.98
23 3.99
24 5.08
25 5.17
26 5.78
27 4.44
28 0.11 
}

\begin{LTXexample}[preset=\centering,pos=t]
\psset{xunit=.44cm,yunit=.3cm}
\begin{pspicture}(-2,-3)(29,13)
  \psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,%
     ylabelFactor={\,\%}]{-}(29,12)
  \listplot[shadow=true,linecolor=blue,plotstyle=bar,barwidth=0.3cm,
     fillcolor=red,fillstyle=solid]{\barData}
  \rput{90}(-3,6.25){Amount}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[preset=\centering,pos=t]
\psset{xunit=.44cm,yunit=.3cm}
\begin{pspicture}(-2,-3)(29,13)
  \psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,%
     ylabelFactor={\,\%}]{-}(29,12)
  \listplot[linecolor=blue,plotstyle=bar,barwidth=0.3cm,
     fillcolor=red,fillstyle=crosshatch]{\barData}
  \rput{90}(-3,6.25){Amount}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[preset=\centering,pos=t]
\psset{xunit=.44cm,yunit=.3cm}
\begin{pspicture}(-2,-3)(29,13)
  \psaxes[axesstyle=axes,Ox=1466,Oy=0,Dx=4,Dy=2,%
     ylabelFactor={\,\%}]{-}(29,12)
  \listplot[linecolor=blue,plotstyle=bar,barwidth=0.3cm,
     fillcolor=red,fillstyle=vlines]{\barData}
  \listplot[showpoints=true]{\barData}
  \rput{90}(-3,6.25){Amount}
\end{pspicture}
\end{LTXexample}

%--------------------------------------------------------------------------------------
\subsection{\texttt{trigLabels} and \texttt{trigLabelBase} -- axis with trigonmetrical units}
%--------------------------------------------------------------------------------------
With the option \verb+trigLabels=true+ the labels on the x axis are trigonometrical ones.
The option \verb+trigLabelBase+ set the demoninator of fraction. The default value of
0 is the same as no fraction.
The following constants are are defined in the package:
\begin{lstlisting}[style=syntax]
\def§\ON§\psPiFour§\OFF§{12.566371}
\def§\ON§\psPiTwo§\OFF§{6.283185}
\def§\ON§\psPi§\OFF§{3.14159265}
\def§\ON§\psPiH§\OFF§{1.570796327}
\newdimen\pstRadUnit
\newdimen\pstRadUnitInv
§\ON§\pstRadUnit§\OFF§=1.047198cm % this is pi/3
§\ON§\pstRadUnitInv§\OFF§=0.95493cm % this is 3/pi
\end{lstlisting}



Because it is a bit complicating to set the right values, we show some more examples
here.

For \textbf{all} following examples in this section we did a 
global\\ \lstinline[frame=single]|\psset{trigLabels=true,labelFontSize=\small}|.



\psset{trigLabels,labelFontSize=\small}
Translating the decimal ticks to geometrical makes no real sense,
because every 1 xunit (1cm) is a tick and the last one at 6cm.

\begin{minipage}{0.4\fullWidth}
\begin{pspicture}[trigLabels=true](-0.5,-1.25)(6.5,1.25)%
  \pnode(5,0){A}%
  \psaxes{->}(0,0)(-0.5,-1.25)(\psPiTwo,1.25)%
\end{pspicture}
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)%
  \pnode(5,0){A}%
  \psaxes{->}(0,0)(-.5,-1.25)(\psPiTwo,1.25)
\end{pspicture}
\end{lstlisting}
\end{minipage}

\begin{minipage}{0.4\fullWidth}
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)%
  \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(\psPiTwo,1.25)
\end{pspicture}
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\begin{pspicture}(-0.5,-1.25)(10,1.25)%
  \psaxes[§\ON§trigLabelBase=3§\OFF§]{->}(0,0)(-0.5,-1.25)(\psPiTwo,1.25)
\end{pspicture}
\end{lstlisting}
\end{minipage}



Modifing the ticks to have the last one exactly at the end is possible
with a different dx value ($\frac{\pi}{3}\approx 1.047$):


\begin{minipage}{0.4\fullWidth}
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(\psPiTwo,0){C}%
  \psaxes[dx=\pstRadUnit]{->}(0,0)(-0.5,-1.25)(\psPiTwo,1.25)
\end{pspicture}%
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(\psPiTwo,0){C}%
  \psaxes[§\ON§dx=\pstRadUnit§\OFF§]{->}(0,0)(-0.5,-1.25)(\psPiTwo,1.25)
\end{pspicture}%
\end{lstlisting}
\end{minipage}


\begin{minipage}{0.4\fullWidth}
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(5,0){B}%
  \psaxes[dx=\pstRadUnit,trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(\psPiTwo,1.25)
\end{pspicture}%
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(5,0){B}%
  \psaxes[dx=\pstRadUnit,§\ON§trigLabelBase=3§\OFF§] {->}(0,0)(-0.5,-1.25)(\psPiTwo,1.25)
\end{pspicture}%
\end{lstlisting}
\end{minipage}

\ncline[linestyle=dashed,linewidth=0.4pt]{A}{B}

Set globaly everything in radiant unit. Now 6 units on the $x$-axis
are $6\pi$. Using \verb+trigLabelBase=3+ reduces this value to $2\pi$, a.s.o.

\bigskip
\begin{minipage}{0.4\fullWidth}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(6,0){D}%
  \psaxes{->}(0,0)(-0.5,-1.25)(6.5,1.25)%
\end{pspicture}%
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\psset{§\ON§xunit=\pstRadUnit§\OFF§}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)\pnode(6,0){D}%
  \psaxes{->}(0,0)(-0.5,-1.25)(6.5,1.25)%
\end{pspicture}%
\end{lstlisting}
\end{minipage}
\ncline[linestyle=dashed,linewidth=0.4pt]{C}{D}


\begin{minipage}{0.4\fullWidth}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
\end{pspicture}%
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\psset{§\ON§xunit=\pstRadUnit§\OFF§}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[§\ON§trigLabelBase=3§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
\end{pspicture}%
\end{lstlisting}
\end{minipage}



\begin{minipage}{0.4\fullWidth}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[trigLabelBase=4]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
\end{pspicture}%
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\psset{§\ON§xunit=\pstRadUnit§\OFF§}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[§\ON§trigLabelBase=4§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
\end{pspicture}%
\end{lstlisting}
\end{minipage}

\begin{minipage}{0.4\fullWidth}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[trigLabelBase=6]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
\end{pspicture}%
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\psset{§\ON§xunit=\pstRadUnit§\OFF§}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[§\ON§trigLabelBase=6§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
\end{pspicture}%
\end{lstlisting}
\end{minipage}



The best way seems to be setting the $x$-unit to \verb+\pstRadUnit+. Plotting a
function doesn't consider the value for \verb+trigLabelBase+, it has to be done by
the user. The first example sets the unit locally for the \verb+\psplot+
back to 1cm, which is needed, because we use this unit on PostScript side.

\begin{minipage}{0.4\fullWidth}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
  \psplot[xunit=1cm,linecolor=red,linewidth=1.5pt]{0}{\psPiTwo}{x RadtoDeg sin}
\end{pspicture}
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
  \psplot[§\ON§xunit=1cm§\OFF§,linecolor=red,linewidth=1.5pt]{0}{§\ON§\psPiTwo§\OFF§}{x RadtoDeg sin}
\end{pspicture}
\end{lstlisting}
\end{minipage}


\begin{minipage}{0.4\fullWidth}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
  \psplot[linecolor=red,linewidth=1.5pt]{0}{6}{x Pi 3 div mul RadtoDeg sin}
\end{pspicture}
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[trigLabelBase=3]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
  \psplot[linecolor=red,linewidth=1.5pt]{0}{6}{x §\ON§Pi 3 div mul §\OFF§RadtoDeg sin}
\end{pspicture}
\end{lstlisting}
\end{minipage}


\begin{minipage}{0.4\fullWidth}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[dx=1.5]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
  \psplot[xunit=.5cm,linecolor=red,linewidth=1.5pt]{0}{\psPiFour}{x RadtoDeg sin}
\end{pspicture}
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[§\ON§dx=1.5§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
  \psplot[§\ON§xunit=0.5cm§\OFF§,linecolor=red,linewidth=1.5pt]{0}{§\ON§\psPiFour§\OFF§}{x RadtoDeg sin}
\end{pspicture}
\end{lstlisting}
\end{minipage}


\begin{minipage}{0.4\fullWidth}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[dx=0.75,trigLabelBase=2]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
  \psplot[xunit=.5cm,linecolor=red,linewidth=1.5pt]{0}{\psPiFour}{x RadtoDeg sin}
\end{pspicture}
\end{minipage}%
\begin{minipage}{0.6\fullWidth}
\begin{lstlisting}
\psset{xunit=\pstRadUnit}%
\begin{pspicture}(-0.5,-1.25)(6.5,1.25)
  \psaxes[§\ON§dx=0.75§\OFF§,§\ON§trigLabelBase=2§\OFF§]{->}(0,0)(-0.5,-1.25)(6.5,1.25)
  \psplot[§\ON§xunit=0.5cm§\OFF§,linecolor=red,linewidth=1.5pt]{0}{\psPiFour}{x RadtoDeg sin}
\end{pspicture}
\end{lstlisting}
\end{minipage}


It is also possible to set the $x$ unit and $dx$ value to get the labels
right. But this needs some more understanding how it really works. 
A \verb+xunit=1.570796327+ sets the unit to $\pi/2$ and a  \verb+dx=0.666667+
then puts every $2/3$ of the unit a tick mark and a label. The length of
the $x$-axis is 6.4 units which is $6.4\cdot 1.570796327cm\approx 10cm$.
The function then is plotted from $0$ to $3\pi=9.424777961$. 




\begin{center}
\psset{unit=1cm}
\begin{pspicture}(-0.5,-1.25)(10,1.25)
  \psaxes[xunit=1.570796327,showorigin=false,trigLabelBase=3,dx=0.666667]{->}(0,0)(-0.5,-1.25)(6.4,1.25)
  \psplot[linecolor=red,linewidth=1.5pt]{0}{9.424777961}{%
	x RadtoDeg dup sin exch 1.1 mul cos add}
\end{pspicture}
\end{center}
\begin{lstlisting}
\begin{pspicture}(-0.5,-1.25)(10,1.25)
  \psaxes[§\ON§xunit=1.570796327§\OFF§,§\ON§trigLabelBase=3§\OFF§,§\ON§dx=0.666667§\OFF§]{->}(0,0)(-0.5,-1.25)(6.4,1.25)
  \psplot[linecolor=red,linewidth=1.5pt]{0}{§\ON§9.424777961§\OFF§}{%
	x RadtoDeg dup sin exch 1.1 mul cos add}
\end{pspicture}
\end{lstlisting}

\begin{center}
\psset{unit=1cm}
\begin{pspicture}(-0.5,-1.25)(10,1.25)
  \psaxes[xunit=\psPi,dx=0.25]{->}(0,0)(-0.25,-1.25)(3.2,1.25)
  \psplot[xunit=0.25,plotpoints=500,linecolor=red,linewidth=1.5pt]{0}{37.70}{%
	x RadtoDeg dup sin exch 1.1 mul cos add}
\end{pspicture}
\end{center}
\begin{lstlisting}
\psset{§\ON§unit=1cm§\OFF§}
  \psplot[§\ON§xunit=0.25§\OFF§,§\ON§plotpoints=500§\OFF§,linecolor=red,linewidth=1.5pt]{0}{37.70}{%
	x RadtoDeg dup sin exch 1.1 mul cos add}
\end{pspicture}
\end{lstlisting}


\begin{center}
\psset{unit=1cm}
\begin{pspicture}(-0.5,-2)(10,2)
  \psplot[xunit=0.0625,linecolor=red,linewidth=1.5pt,plotpoints=5000]{0}{150.80}{%
	x RadtoDeg dup sin exch 1.1 mul cos add}
  \psaxes[xunit=\psPi,dx=0.5,Dx=8,subticks=2]{->}(0,0)(-0.1,-2)(3.2,2)
\end{pspicture}
\end{center}
\begin{lstlisting}
\psset{§\ON§unit=1cm§\OFF§}
\begin{pspicture}(-0.5,-1.25)(10,1.25)
  \psplot[§\ON§xunit=0.0625§\OFF§,linecolor=red,linewidth=1.5pt,%
      §\ON§plotpoints=5000§\OFF§]{0}{150.80}%
	{x RadtoDeg dup sin exch 1.1 mul cos add}
  \psaxes[§\ON§xunit=\psPi§\OFF§,§\ON§dx=0.5§\OFF§,§\ON§Dx=8§\OFF§]{->}(0,0)(-0.25,-1.25)(3.2,1.25)
\end{pspicture}
\end{lstlisting}


\begin{center}
\psset{unit=1cm}
\begin{pspicture}(-7,-1.5)(7,1.5)
  \psaxes[trigLabels=true,xunit=\psPi]{->}(0,0)(-2.2,-1.5)(2.2,1.5)
  \psplot[linecolor=red,linewidth=1.5pt]{-7}{7}{x RadtoDeg sin}
\end{pspicture}
\end{center}
\begin{lstlisting}
\begin{pspicture}(-7,-1.5)(7,1.5)
  \psaxes[trigLabels=true,§\ON§xunit=\psPi§\OFF§]{->}(0,0)(-2.2,-1.5)(2.2,1.5)
  \psplot[linecolor=red,linewidth=1.5pt]{-7}{7}{x RadtoDeg sin}
\end{pspicture}
\end{lstlisting}


\begin{center}
\psset{unit=1cm}
\begin{pspicture}(-7,-1.5)(7,1.5)
  \psaxes[trigLabels=true,
	trigLabelBase=2,dx=\psPiH,xunit=\psPi]{->}(0,0)(-2.2,-1.5)(2.2,1.5)
  \psplot[linecolor=red,linewidth=1.5pt]{-7}{7}{x RadtoDeg sin}
\end{pspicture}
\end{center}
\begin{lstlisting}
\begin{pspicture}(-7,-1.5)(7,1.5)
  \psaxes[trigLabels=true,
	trigLabelBase=2,dx=\psPiH,xunit=\psPi]{->}(0,0)(-2.2,-1.5)(2.2,1.5)
  \psplot[linecolor=red,linewidth=1.5pt]{-7}{7}{x RadtoDeg sin}
\end{pspicture}
\end{lstlisting}


\psset{trigLabels=false}



%------------------------------------------------------------------------------------
\subsection{New options for \CMD{readdata}}
%------------------------------------------------------------------------------------


By default the macros \verb|\readdata| reads every
data record, which could be annoying when you have some text lines at top of your
data files or when there are more than 10000 records to read. 


\verb|pstricks-add| defines two additional keys \verb|ignoreLines| and \verb|nStep|, which allows
to ignore preceeding lines, e.g. \verb|ignoreLines=2|, or to read only a selected part of the data records,
e.g. \verb|nStep=10|, only every 10\textsuperscript{th} records is saved.

\begin{lstlisting}
\readdata[ignoreLines=2]{\dataA}{stressrawdata.dat}
\readdata[nStep=10]{\dataA}{stressrawdata.dat}
\end{lstlisting}

The default value for  \verb+ignoreLines+ is $0$ and for \verb+nStep+ is $1$.
the following data file has two text lines which shall be ignored by the \verb+\readdata+ macro:

\begin{LTXexample}[width=4cm]
\begin{filecontents*}{pstricks-add-data9.dat}
some nonsense in this line ���time forcex forcey
0 0.2
1 1
2 4
\end{filecontents*}
\readdata[ignoreLines=2]{\data}{pstricks-add-data9.dat}
\pspicture(2,4)
  \listplot[showpoints=true]{\data}
  \psaxes{->}(2,4)
\endpspicture
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{New options for \texttt{\textbackslash listplot}}
%--------------------------------------------------------------------------------------
By default the plot macros \verb|\dataplot|, \verb|\fileplot| and \verb|\listplot| plot every
data record. The package \verb|pst-plot-add| defines additional keys \verb|nStep, nStart, nEnd| and \verb|xStep, xStart, xEnd|, which allows
to plot only a selected part of the data records, e.g. \verb|nStep=10|. These "`n"' 
options mark the number of the record to be plot ($0,1,2,...$) and the "`x"' ones the x-values of the data records.


\begin{center}
\begin{tabular}{l|l}
Name & Default setting\\\hline
\verb|nStart| &  \verb|1|\\
\verb|nEnd|   &  \verb|{}|\\
\verb|nStep|  &  \verb|1|\\
\verb|xStart| &  \verb|{}|\\
\verb|xEnd|   &  \verb|{}|\\
\verb|yStart| &  \verb|{}|\\
\verb|yEnd|   &  \verb|{}|\\
\verb|xStep|  &  \verb|0|\\
\verb|plotNo|  &  \verb|1|\\
\verb|plotNoMax|  &  \verb|1|\\
\verb|ChangeOrder|  &  \verb|false|\\
(\verb+plotstyle+)& \verb+line+
\end{tabular}
\end{center}

These new options are only available
for the \verb|\listplot| macro, which is not a real limitation, because all data records can be read
from a file with the \verb|\readdata| macro (see example files or \cite{dtk02.2:jackson.voss:plot-funktionen}):
\begin{lstlisting}[style=syntax]
\readdata[nStep=10]{\data}{/home/voss/data/data1.dat}
\end{lstlisting}

The use \verb|nStep| and \verb|xStep| options make only real sense when also using the
option \verb|plotstyle=dots|. Otherwise the coordinates are connected by a line as usual. Also the \verb|xStep| option needs increasing x values.
Pay attention that \verb+nStep+ can be used for \verb+\readdata+ and for \verb+\listplot+. If used
in both macros than the effect is multiplied, e.g. \verb+\readdata+ with \verb+nStep=5+ and
\verb+\listplot+ with \verb+nStep=10+ means, that only every 50\textsuperscript{th} data records
is read and plotted.

When both, \verb|x/yStart/End| are defined then the values are also compared with
both values.


%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{nStep/xStep}}
%--------------------------------------------------------------------------------------

The datafile \verb|data.dat| contains $1000$ data records. The thin blue line is the plot
of all records with the plotstyle option \verb|curve|.

\begin{LTXexample}[preset=\centering,pos=t]
\readdata{\data}{data.dat}
\psset{xunit=0.125mm,yunit=0.0002mm}
\begin{pspicture}(-80,-30000)(1000,270000)
\psaxes[Dx=100,dx=100,Dy=50000,dy=50000](1000,250000)
\listplot[nStep=50,linewidth=3pt,linecolor=red,plotstyle=dots]{\data}
\listplot[linewidth=1pt,linecolor=blue]{\data}
\end{pspicture}
\end{LTXexample}


\clearpage

%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{nStart/xStart}}
%--------------------------------------------------------------------------------------

\begin{LTXexample}[preset=\centering,pos=t]
\readdata{\data}{data.dat}
\psset{xunit=0.125mm,yunit=0.0002mm}
\begin{pspicture}(-80,-30000)(1000,270000)
\psaxes[Dx=100,dx=100,Dy=50000,dy=50000](1000,250000)
\listplot[nStart=200,linewidth=3pt,linecolor=blue]{\data}
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{nEnd/xEnd}}
%--------------------------------------------------------------------------------------

\begin{LTXexample}[preset=\centering,pos=t]
\readdata{\data}{data.dat}
\psset{xunit=0.125mm,yunit=0.0002mm}
\begin{pspicture}(-80,-30000)(1000,310000)
\psaxes[axesstyle=frame,Dx=100,dx=100,Dy=50000,dy=50000](1000,300000)
\listplot[nEnd=800,linewidth=3pt,linecolor=blue]{\data}
\end{pspicture}
\end{LTXexample}


\clearpage

%--------------------------------------------------------------------------------------
\subsubsection{Example for all new options}
%--------------------------------------------------------------------------------------

\begin{LTXexample}[preset=\centering,pos=t]
\readdata{\data}{data.dat}
\psset{xunit=0.125mm,yunit=0.0002mm}
\begin{pspicture}(-80,-30000)(1000,310000)
\psaxes[axesstyle=frame,Dx=100,dx=100,Dy=50000,dy=50000](1000,300000)
\listplot[nStart=200, nEnd=800, nStep=50,linewidth=3pt,linecolor=blue,%
	plotstyle=dots]{\data}
\end{pspicture}
\end{LTXexample}



%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{xStart}}
%--------------------------------------------------------------------------------------

This example shows the use of the same plot with different units and different
\verb|xStart| value. The blue curve is the original plot of the data records.
To show the important part of the curve there is another one plotted with a
greater \verb|yunit| and a start value of \verb|xStart=0.35|. This makes it
possible to have a kind of a zoom to the original graphic.

\begin{center}
\psset{xunit=10cm, yunit=0.01cm}
\readdata{\data}{data3.dat}
\begin{pspicture}(-0.1,-100)(1.5,700.0)
  \psaxes[Dx=0.25,Dy=100,dy=100\psyunit,ticksize=-4pt 0,%
    labelFontSize={\footnotesize}]{->}(0,0)(0,-100)(1.4,520)
  \uput[0](1.4,0){\textsf{t [s]}}
  \rput(-0.125,200){\psrotateleft{\small flow [ml/s]}}
  \listplot[linewidth=2pt, linecolor=blue]{\data}
  \rput(0.4,300){
    \pscustom[yunit=0.04cm, linewidth=1pt]{%
      \listplot[xStart=0.355]{\data}
      \psline(1,-2.57)(1,0)(0.355,0)
      \fill[fillstyle=hlines,fillcolor=gray,hatchwidth=0.4pt,hatchsep=1.5pt,hatchcolor=red]%
      \psline[linewidth=0.5pt]{->}(0.7,0)(1.05,0)
    }%
  }
  \psline[linewidth=.01]{->}(0.75,300)(0.4,20)
  \psline[linewidth=.01]{->}(1,290)(1.1,440)
  \rput(1.1,470){\footnotesize leak volume}
  \psline[linewidth=.01]{->}(0.78,200)(1,100)
  \rput[l](1.02,100){\footnotesize closing volume}
\end{pspicture}
\end{center}


\begin{lstlisting}
\psset{xunit=10cm, yunit=0.01cm}
\readdata{\data}{data3.dat}
\begin{pspicture}(-0.1,-100)(1.5,700.0)
  \psaxes[Dx=0.25,Dy=100,dy=100\psyunit,ticksize=-4pt 0,%
    labelFontSize={\footnotesize}]{->}(0,0)(0,-100)(1.4,520)
  \uput[0](1.4,0){\textsf{t [s]}}
  \rput(-0.125,200){\psrotateleft{\small flow [ml/s]}}
  \listplot[linewidth=2pt, linecolor=blue]{\data}
  \rput(0.4,300){
    \pscustom[yunit=0.04cm, linewidth=1pt]{%
      \listplot[xStart=0.355]{\data}
      \psline(1,-2.57)(1,0)(0.355,0)
      \fill[fillstyle=hlines,fillcolor=gray,hatchwidth=0.4pt,hatchsep=1.5pt,hatchcolor=red]%
      \psline[linewidth=0.5pt]{->}(0.7,0)(1.05,0)
    }%
  }
  \psline[linewidth=.01]{->}(0.75,300)(0.4,20)
  \psline[linewidth=.01]{->}(1,290)(1.1,440)
  \rput(1.1,470){\footnotesize leak volume}
  \psline[linewidth=.01]{->}(0.78,200)(1,100)
  \rput[l](1.02,100){\footnotesize closing volume}
\end{pspicture}
\end{lstlisting}


\clearpage

\resetOptions
%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{yStart}/\texttt{yEnd}}
%--------------------------------------------------------------------------------------

\begin{LTXexample}[preset=\centering,pos=t]
\readdata{\data}{data.dat}
\psset{xunit=0.125mm,yunit=0.0002mm}
\begin{pspicture}(-80,-30000)(1000,310000)
  \psaxes[axesstyle=frame,Dx=100,dx=100,Dy=50000,dy=50000](1000,300000)
  \psset{linewidth=0.1pt, linestyle=dashed,linecolor=red}
  \psline(0,40000)(1000,40000)
  \psline(0,175000)(1000,175000)
  \listplot[yStart=40000, yEnd=175000,linewidth=3pt,linecolor=blue,plotstyle=dots]{\data}
\end{pspicture}
\end{LTXexample}



%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{plotNo/plotNoMax}}
%--------------------------------------------------------------------------------------
By default the plot macros expect \verb+x|y+ data records, but
when having data files with multiple values for y, like:
\begin{lstlisting}[style=syntax]
x y1 y2 y3 y4 ... yMax
x y1 y2 y3 y4 ... yMax
...
\end{lstlisting}

you can select the y value which should be plotted. The option \verb+plotNo+ marks the plotted
value (default $1$) and the option \verb+plotNoMax+ tells \verb+pst-plot+ how many $y$ values are
present. There are no real restrictions in the maximum number for \verb+plotNoMax+.

We have the following data file:
\begin{lstlisting}[style=syntax]
[% file data.dat
0    0    3.375    0.0625
10    5.375    7.1875    4.5
20    7.1875    8.375    6.25
30    5.75    7.75    6.6875
40    2.1875    5.75    5.9375
50    -1.9375    2.1875    4.3125
60    -5.125    -1.8125    0.875
70    -6.4375    -5.3125    -2.6875
80    -4.875    -7.1875    -4.875
90    0    -7.625    -5.625
100    5.5    -6.3125    -5.8125
110    6.8125    -2.75    -4.75
120    5.25    2.875    -0.75
]%
\end{lstlisting}

\noindent which holds data records for multiple plots (\verb+x y1 y2 y3+). This can be plotted
without any modification to the data file:

\begin{LTXexample}[preset=\centering,pos=t]
\readdata\Data{dataMul.dat}
\psset{xunit=0.1cm, yunit=0.5cm,lly=-0.5cm}
\begin{pspicture}(0,-7.5)(150,10)
\psaxes[Dx=10,Dy=2.5]{->}(0,0)(0,-7.5)(150,7.5)
\psset{linewidth=2pt,plotstyle=line}
\listplot[linecolor=green,plotNo=1,plotNoMax=3]{\Data}
\listplot[linecolor=red,plotNo=2,plotNoMax=3]{\Data}
\listplot[linecolor=blue,plotNo=3,plotNoMax=3]{\Data}
\end{pspicture}
\end{LTXexample}

\clearpage


%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{changeOrder}}
%--------------------------------------------------------------------------------------
It is only possible to fill the region between two listplots 
with \verb+\pscustom+ if one of both has the values in a reverse
order. Otherwise we do not get a closed path. With the option \verb+ChangeOrder+
the values are used in a reverse order:

\begin{LTXexample}[pos=t,preset=\centering]
\begin{filecontents*}{test.dat}
  0 3 8 
  2 4 7
  5 5 5.5
  7 3.5 5
  10 2 9
\end{filecontents*}
\psset{lly=-.5cm}
\begin{psgraph}[axesstyle=frame,ticklinestyle=dotted,ticksize=0 10](0,0)(10,10){4in}{2in}%
   \readdata{\data}{test.dat}%
   \pscustom[fillstyle=solid,fillcolor=gray]{%
     \listplot[plotNo=2,plotNoMax=2]{\data}%
     \listplot[plotNo=1,plotNoMax=2,ChangeOrder]{\data}} 
\end{psgraph}
\end{LTXexample}


\clearpage
%--------------------------------------------------------------------------------------
\subsubsection{Example for \texttt{plotstyle}}
%--------------------------------------------------------------------------------------
The \verb+plotstyle+ option is defined in the package \verb+pst-plot+, but its value
\verb+LSM+ (\textbf{L}east \textbf{S}quare \textbf{Method}) is only valid for the
\verb+pstricks-add+ package. Instead of plotting the data records as dots or a line,
the \verb+listplot+ macro calculates the values for a line $y=v\cdot x+u$ which fits
best all data records.

\bgroup
\centering
\begin{filecontents*}{LSM.dat}
0 1 1 3 2.8 4 3 2.9 2 5 4 4 5 5.5 6 8.2 8 7 
\end{filecontents*}
\psset{lly=-.5cm}
\readdata{\data}{LSM.dat}
\begin{psgraph}[arrows=->](0,0)(0,0)(8,8){.5\textwidth}{!}
  \listplot[plotstyle=dots]{\data}
  \listplot[plotstyle=LSM,linecolor=red]{\data}
\end{psgraph}
\egroup


\begin{lstlisting}
\begin{filecontents*}{LSM.dat}
0 1 1 3 2.8 4 3 2.9 2 5 4 4 5 5.5 6 8.2 8 7 
\end{filecontents*}
\psset{lly=-.5cm}
\readdata{\data}{LSM.dat}
\begin{psgraph}[arrows=->](0,0)(0,0)(8,8){.5\textwidth}{!}
  \listplot[plotstyle=dots]{\data}
  \listplot[§\ON§plotstyle§\OFF§=§\ON§LSM§\OFF§,linecolor=red]{\data}
\end{psgraph}
\end{lstlisting}


The macro looks for the lowest and biggest x-value and draws the line for this interval.
It is possible to pass another values to the macro by setting the \verb+xStart+ and/or
\verb+xEnd+ options. They are preset with an empty value \verb+{}+.

\bgroup
\centering
\begin{filecontents*}{LSM.dat}
0 1 1 3 2.8 4 3 2.9 2 5 4 4 5 5.5 6 8.2 8 7 
\end{filecontents*}
\readdata{\data}{LSM.dat}
\psset{lly=-1.75cm}
\begin{psgraph}[arrows=->](0,0)(0,0)(8,8){.5\textwidth}{!}
  \listplot[plotstyle=dots]{\data}
  \listplot[PstDebug=1,plotstyle=LSM,xStart=-0.5,xEnd=8.5,linecolor=red]{\data}
\end{psgraph}
\egroup

\begin{lstlisting}
\begin{filecontents*}{LSM.dat}
0 1 1 3 2.8 4 3 2.9 2 5 4 4 5 5.5 6 8.2 8 7 
\end{filecontents*}
\readdata{\data}{LSM.dat}
\psset{lly=-1.75cm}
\begin{psgraph}[arrows=->](0,0)(0,0)(8,8){.5\textwidth}{!}
  \listplot[plotstyle=dots]{\data}
  \listplot[§\ON§PstDebug§\OFF§=1,plotstyle=§\ON§LSM§\OFF§,§\ON§xStart§\OFF§=-0.5,§\ON§xEnd§\OFF§=8.5,linecolor=red]{\data}
\end{psgraph}
\end{lstlisting}


With \verb+PstDebug=1+ one gets the equation $y=v\cdot x+u$ printed, beginning at
the position (0|-50pt). This cannot be changed, because it is only for some kind
of debugging. Pay attention for the correct \verb+xStart+- and \verb+xEnd+-values,
when you use the \verb+\pstScalePoints+-Macro. In the following example we use an
x-interval from 0 to 3 to plot the values; first we substract 0.003 from all x-values
and then scale them with 10000. This is not taken into account for the \verb+xStart+- 
and \verb+xEnd+-values.


\bgroup
\centering
\begin{filecontents*}{LSM.dat}
0.003298697 1.397785583
0.003193358 1.615489564
0.003094538 2.044019006
0.003001651 2.259240127
\end{filecontents*}
\readdata{\data}{LSM.dat}
\pstScalePoints(10000,1){ 0.003 sub }{}
\psset{lly=-1.75cm}
\psgraph[arrows=->,Ox=0.0030,Dx=0.0001,dx=\psxunit](0,0)(3.2,3){10cm}{5cm}
  \listplot[showpoints=true,linewidth=1pt,linecolor=blue]{\data}
  \listplot[PstDebug=1,plotstyle=LSM,linewidth=0.1pt,linestyle=dashed,%
    xStart=-0.25,xEnd=3.3]{\data}
\endpsgraph
\egroup

\begin{lstlisting}
\begin{filecontents*}{LSM.dat}
0.003298697 1.397785583
0.003193358 1.615489564
0.003094538 2.044019006
0.003001651 2.259240127
\end{filecontents*}
\readdata{\data}{LSM.dat}
§\ON§\pstScalePoints§\OFF§(10000,1){ 0.003 sub }{}
\psset{lly=-1.75cm}
\psgraph[arrows=->,Ox=0.0030,Dx=0.0001,dx=\psxunit](0,0)(3.2,3){10cm}{5cm}
  \listplot[showpoints=true,linewidth=1pt,linecolor=blue]{\data}
  \listplot[PstDebug=1,plotstyle=§\ON§LSM§\OFF§,linewidth=0.1pt,linestyle=dashed,%
    xStart=-0.25,xEnd=3.3]{\data}
\endpsgraph
\end{lstlisting}


%--------------------------------------------------------------------------------------
\section{Polar plots}
%--------------------------------------------------------------------------------------

With the option \verb+polarplot=false|true+ it is possible to use \verb+\psplot+
in polar mode:
\begin{lstlisting}[style=syntax]
\psplot[polarplot=true,...]{<start angle>}{<end angle>}{<r(alpha)>}
\end{lstlisting}

The equation in PostScript code is interpreted as a function $r=f(\alpha)$, e.g. for the
circle with radius 1 as $r=\sqrt{\sin^2x+\cos^2x}$:

\begin{lstlisting}[style=syntax]
x sin dup mul x cos dup mul add sqrt 
\end{lstlisting}


\medskip
\begin{LTXexample}[width=6cm]
\resetOptions
\psset{plotpoints=200,unit=0.75}
\begin{pspicture}*(-5,-5)(3,3)
  \psaxes[labelsep=.75mm,arrowlength=1.75,ticksize=2pt,%
    labelFontSize=\footnotesize,%
    linewidth=0.17mm]{->}(0,0)(-4.99,-4.99)(3,3)
  \rput[Br](3,-.35){$x$}
  \rput[tr](-.15,3){$y$}
  \rput[Br](-.15,-.35){$0$}
  \psset{linewidth=.35mm,polarplot=true}
  \psplot[linecolor=red]{140}{310}{3 neg x sin mul x cos mul x sin 3 exp x cos 3 exp add div}
  \psplot[linecolor=cyan]{140}{310}{6 neg x sin mul x cos mul x sin 3 exp x cos 3 exp add div}
  \psplot[linecolor=blue]{140}{310}{9 neg x sin mul x cos mul x sin 3 exp x cos 3 exp add div}
\end{pspicture}
\end{LTXexample}



\medskip
\begin{LTXexample}[width=5cm]
\resetOptions
\psset{plotpoints=200,unit=1}
\begin{pspicture}(-2.5,-2.5)(2.5,2.5)% Ulrich Dirr
 \psaxes[labelsep=.75mm,arrowlength=1.75,%
    ticksize=2pt,linewidth=0.17mm]{->}(0,0)(-2.5,-2.5)(2.5,2.5)
  \rput[Br](2.5,-.35){$x$}
  \rput[tr](-.15,2.5){$y$}
  \rput[Br](-.15,-.35){$0$}
  \psset{linewidth=.35mm,plotstyle=curve,polarplot=true}
  \psplot[linecolor=red]{0}{360}{x cos 2 mul x sin mul}
  \psplot[linecolor=green]{0}{360}{x cos 3 mul x sin mul}
  \psplot[linecolor=blue]{0}{360}{x cos 4 mul x sin mul}
\end{pspicture}
\end{LTXexample}



\medskip
\begin{LTXexample}[width=8cm]
\psset{plotpoints=200,unit=0.5}
\begin{pspicture}(-8.5,-8.5)(9,9)% Ulrich Dirr 
\psaxes[Dx=2,dx=2,Dy=2,dy=2,labelsep=.75mm,%
  arrowlength=1.75,ticksize=2pt,linewidth=0.17mm]{->}(0,0)(-8.5,-8.5)(9,9)
\rput[Br](9,-.7){$x$}
\rput[tr](-.3,9){$y$}
\rput[Br](-.3,-.7){$0$}
%
\psset{linewidth=.35mm,plotstyle=curve,polarplot=true}
\psplot[linecolor=blue]{0}{720}{8 2.5 x mul sin mul}
\end{pspicture}
\end{LTXexample}


\resetOptions

%--------------------------------------------------------------------------------------
\section{\CMD{pstScalePoints}}
%--------------------------------------------------------------------------------------
The syntax is
\begin{lstlisting}[style=syntax]
\pstScalePoints(xScale,xScale){xPS}{yPS}
\end{lstlisting}

\verb+xScale,yScale+ are decimal values as scaling factors, the \verb+xPs+ and \verb+yPS+
are additional PostScript code to the x- and y-values of the data records. This macro
is only valid for the \CMD{listplot} macro! 

\resetOptions
\begin{LTXexample}[width=6cm]
\def\data{%
  0 0 1 3 2 4 3 1
  4 2 5 3 6 6 }
\begin{pspicture}(-0.5,-1)(6,6)
  \psaxes{->}(0,0)(6,6)
  \listplot[showpoints=true,%
    linecolor=red]{\data}
  \pstScalePoints(1,0.5){}{3 add}
  \listplot[showpoints=true,%
    linecolor=blue]{\data}
\end{pspicture}
\end{LTXexample}

\bigskip
\verb+\pstScalePoints(1,0.5){}{3 add}+ means that \textbf{first} the value $3$ is added
to the $y$ values and \textbf{second} this value is scaled with the factor $0.5$.
As seen for the blue line for $x=0$ we get $y(0)=(0+3)\cdot 0.5=1.5$.

Changes with \verb+\pstScalePoints+ are always global to all following \verb+\listplot+
macros. This is the reason why it is a good idea to reset the values at the end of the
\verb+pspicture+ environment.

\begin{lstlisting}[style=syntax]
\pstScalePoints(1,1){}{}
\end{lstlisting}


%--------------------------------------------------------------------------------------
\part{New commands and environments}
%--------------------------------------------------------------------------------------

%--------------------------------------------------------------------------------------
\section{\texttt{psgraph} environment}
%--------------------------------------------------------------------------------------
This new environment does the scaling, it expects as parameter the values (without units!) for the
coordinate system and the values of the physical width and height (with units!). The syntax is:

\begin{lstlisting}[style=syntax]
\psgraph[<axes options>]{<arrows>}%
    (xOrig,yOrig)(xMin,yMin)(xMax,yMax){xLength}{yLength}
...
\endpsgraph

\begin{psgraph}[<axes options>]{<arrows>}%
    (xOrig,yOrig)(xMin,yMin)(xMax,yMax){xLength}{yLength}
...
\end{psgraph}
\end{lstlisting}

where the options are valid \textbf{only} for the the \verb+\psaxes+ macro. The first
two arguments have the usual \verb+PSTricks+ behaviour.
\begin{itemize}
  \item if \verb+(xOrig,yOrig)+ is missing, it is substituted to  \verb+(xMin,xMax)+;
  \item if \verb+(xOrig,yOrig)+ \textbf{and} \verb+(xMin,yMin)+ are missing, they are both 
	substituted to \verb+(0,0)+.
\end{itemize}

The y-length maybe given as !, then the macro uses the same unit as for the x-axis.

%-----------------------------------------------------------------------------

\begin{center}
\readdata{\data}{demo1.dat}
\pstScalePoints(1,0.000001){}{}% (x,y){additional x operator}{y op}
\psset{llx=-1cm,lly=-1cm}
\begin{psgraph}[axesstyle=frame,xticksize=0 759,yticksize=0 25,%
    subticks=0,ylabelFactor=\cdot 10^6,
    Dx=5,dy=100\psyunit,Dy=100](0,0)(25,750){10cm}{6cm} % parameters
   \listplot[linecolor=red,linewidth=2pt,showpoints=true]{\data}
\end{psgraph}
\end{center}

\begin{lstlisting}
\readdata{\data}{demo1.dat}
\pstScalePoints(1,0.000001){}{}% (x,y){additional x operator}{y op}
\psset{llx=-1cm,lly=-1cm}
§\ON§\begin{psgraph}§\OFF§[axesstyle=frame,xticksize=0 759,yticksize=0 25,%
    subticks=0,ylabelFactor=\cdot 10^6,
    Dx=5,dy=100\psyunit,Dy=100](0,0)(25,750){10cm}{6cm} % parameters
   \listplot[linecolor=red,linewidth=2pt,showpoints=true]{\data}
§\ON§\end{psgraph}§\OFF§
\end{lstlisting}

%-----------------------------------------------------------------------------

In the following example, the y unit gets the same value as the one for the x-axis.
\begin{center}
\psset{llx=-1cm,lly=-0.5cm,ury=0.5cm}
\begin{psgraph}(0,0)(5,3){6cm}{!} % x-y-axis with same unit
   \psplot[linecolor=red,linewidth=1pt]{0}{5}{x dup mul 10 div}
\end{psgraph}
\end{center}

\begin{lstlisting}
\psset{llx=-1cm,lly=-0.5cm,ury=0.5cm}
\begin{psgraph}(0,0)(5,3){6cm}§\ON§{!}§\OFF§ % x-y-axis with same unit
   \psplot[linecolor=red,linewidth=1pt]{0}{5}{x dup mul 10 div}
\end{psgraph}
\end{lstlisting}

%-----------------------------------------------------------------------------

\begin{center}
\readdata{\data}{demo1.dat}
\psset{xAxisLabel=x-Axes,yAxisLabel=y-Axes,llx=-.5cm,ury=0.5cm,
   xAxisLabelPos={3cm,-1cm},yAxisLabelPos={-1.5cm,2.5cm}}
\pstScalePoints(1,0.00000001){}{}
\begin{psgraph}[axesstyle=frame,xticksize=0 7.5,yticksize=0 25,subticksize=1,
     ylabelFactor=\cdot 10^8,Dx=5,Dy=1,xsubticks=2](0,0)(25,7.5){5.5cm}{5cm}
  \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
\end{psgraph}
\end{center}

\begin{lstlisting}
\readdata{\data}{demo1.dat}
\psset{§\ON§xAxisLabel§\OFF§=x-Axes,§\ON§yAxisLabel§\OFF§=y-Axes,llx=-.5cm,ury=0.5cm,
   §\ON§xAxisLabelPos§\OFF§={3cm,-1cm},§\ON§yAxisLabelPos§\OFF§={-1.5cm,2.5cm}}
\pstScalePoints(1,0.00000001){}{}
\begin{psgraph}[axesstyle=frame,xticksize=0 7.5,yticksize=0 25,subticksize=1,
     §\ON§ylabelFactor§\OFF§=\cdot 10^8,Dx=5,Dy=1,xsubticks=2](0,0)(25,7.5){5.5cm}{5cm}
  \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
\end{psgraph}
\end{lstlisting}

%-----------------------------------------------------------------------------

\begin{LTXexample}[pos=t,preset=\centering]
\readdata{\data}{demo1.dat}
\psset{llx=-0.5cm,lly=-1cm}
\pstScalePoints(1,0.000001){}{}
\psgraph[arrows=->,Dx=5,dy=200\psyunit,Dy=200,%
    subticks=5,ticksize=-10pt 0,tickwidth=0.5pt,%
    subtickwidth=0.1pt](0,0)(25,750){5.5cm}{5cm}
\listplot[linecolor=red,linewidth=2pt,showpoints=true,]{\data}
\endpsgraph
\end{LTXexample}

%-----------------------------------------------------------------------------

\begin{center}
\readdata{\data}{demo1.dat}
\pstScalePoints(1,0.2){}{log}
\psset{lly=-0.75cm}
\psgraph[ylogBase=10,Dx=5,Dy=1,subticks=5](0,0)(25,2){12cm}{4cm}
  \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
\endpsgraph
\end{center}

\begin{lstlisting}
\readdata{\data}{demo1.dat}
\pstScalePoints(1,0.2){}{log}
\psset{lly=-0.75cm}
\psgraph[§\ON§ylogBase§\OFF§=10,Dx=5,Dy=1,subticks=5](0,0)(25,2){12cm}{4cm}
  \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
\endpsgraph
\end{lstlisting}

%-----------------------------------------------------------------------------

\begin{LTXexample}[pos=t,preset=\centering]
\readdata{\data}{demo0.dat}
\psset{lly=-0.75cm,ury=0.5cm}
\pstScalePoints(1,1){}{log}
\begin{psgraph}[arrows=->,Dx=0.5,ylogBase=10,Oy=-1,xsubticks=10,%
     ysubticks=2](0,-3)(3,1){12cm}{4cm}
  \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
\end{psgraph}
\end{LTXexample}


\begin{LTXexample}[pos=t,preset=\centering]
\psset{lly=-0.75cm,ury=0.5cm}
\readdata{\data}{demo0.dat}
\pstScalePoints(1,1){}{log}
\psgraph[arrows=->,Dx=0.5,ylogBase=10,Oy=-1,subticks=4](0,-3)(3,1){6cm}{3cm}
  \listplot[linecolor=red, linewidth=2pt, showpoints=true]{\data}
\endpsgraph
\end{LTXexample}


%-----------------------------------------------------------------------------
\begin{center}
\readdata{\data}{demo2.dat}%
\readdata{\dataII}{demo3.dat}%
\pstScalePoints(1,1){1989 sub}{}
\psset{llx=-0.5cm,lly=-1cm, xAxisLabel=Year,yAxisLabel=Whatever,%
     xAxisLabelPos={2in,-0.4in},yAxisLabelPos={-0.4in,1in}}
\psgraph[axesstyle=frame,Dx=2,Ox=1989,subticks=2](0,0)(12,6){4in}{2in}%
  \listplot[linecolor=red,linewidth=2pt]{\data}
  \listplot[linecolor=blue,linewidth=2pt]{\dataII}
  \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}
\endpsgraph
\end{center}

\begin{lstlisting}
\readdata{\data}{demo2.dat}%
\readdata{\dataII}{demo3.dat}%
\pstScalePoints(1,1){1989 sub}{}
\psset{llx=-0.5cm,lly=-1cm, §\ON§xAxisLabel§\OFF§=Year,§\ON§yAxisLabel§\OFF§=Whatever,%
     §\ON§xAxisLabelPos§\OFF§={2in,-0.4in},§\ON§yAxisLabelPos§\OFF§={-0.4in,1in}}
\psgraph[axesstyle=frame,Dx=2,Ox=1989,subticks=2](0,0)(12,6){4in}{2in}%
  \listplot[linecolor=red,linewidth=2pt]{\data}
  \listplot[linecolor=blue,linewidth=2pt]{\dataII}
  \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}
\endpsgraph
\end{lstlisting}
%-----------------------------------------------------------------------------

\begin{LTXexample}[pos=t,preset=\centering]
\readdata{\data}{demo2.dat}%
\readdata{\dataII}{demo3.dat}%
\psset{llx=-0.5cm,lly=-0.75cm}
\pstScalePoints(1,1){1989 sub}{2 sub}
\begin{psgraph}[axesstyle=frame,Dx=2,Ox=1989,Oy=2,subticks=2](0,0)(12,4){6in}{3in}%
  \listplot[linecolor=red,linewidth=2pt]{\data}
  \listplot[linecolor=blue,linewidth=2pt]{\dataII}
  \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}
\end{psgraph}
\end{LTXexample}

%\newpage
An example with ticks on every side of the frame:

\begin{center}
\def\data{0 0 1 1 2 4 3 9}
\psset{lly=-0.5cm}
\begin{psgraph}[axesstyle=frame,ticksize=0 4pt](0,0)(3.0,9.0){12cm}{5cm}
  \psaxes[axesstyle=frame,labels=none,ticksize=-4pt 0](3,9)(0,0)(3,9)
  \listplot[linecolor=red,linewidth=2pt]{\data}
\end{psgraph}
\end{center}

\begin{lstlisting}
\def\data{0 0 1 1 2 4 3 9}
\psset{lly=-0.5cm}
\begin{psgraph}[axesstyle=frame,ticksize=0 4pt](0,0)(3.0,9.0){12cm}{5cm}
  \psaxes[axesstyle=frame,labels=none,ticksize=-4pt 0](3,9)(0,0)(3,9)
  \listplot[linecolor=red,linewidth=2pt]{\data}
\end{psgraph}
\end{lstlisting}


%-------------------------------------------------------------------------------------------
\subsection{The new options}
%-------------------------------------------------------------------------------------------

\begin{center}
\begin{tabular}{>{\tt}l>{\tt}ll}
\textrm{name} & \textrm{default} & meaning\\\hline
xAxisLabel & x & label for the x-axis\\
yAxisLabel & y & label for the y-axis\\
xAxisLabelPos & \{\} & where to put the x-label\\
yAxisLabelPos & \{\} & where to put the y-label\\
llx & 0pt & trim for the lower left x\\
lly & 0pt & trim for the lower left y\\
urx & 0pt & trim for the upper right x\\
ury & 0pt & trim for the upper right y
\end{tabular}
\end{center}

There is one restriction in using the trim parameters, they must been set
\textbf{before} \verb+psgraph+ is called. They are senseless, when using
as parameters of \verb+psgraph+ itself.

\medskip
\resetOptions

\begin{center}
\readdata{\data}{demo2.dat}%
\readdata{\dataII}{demo3.dat}%
\psset{llx=-1cm,lly=-1.25cm,urx=0.5cm,ury=0.1in,xAxisLabel=Year,%
   yAxisLabel=Whatever,xAxisLabelPos={.4\linewidth,-0.4in},%
   yAxisLabelPos={-0.4in,2in}}
\pstScalePoints(1,1){1989 sub}{}
\psframebox[linestyle=dashed,boxsep=0pt]{%
\begin{psgraph}[axesstyle=frame,Ox=1989,subticks=2](0,0)(12,6){0.8\linewidth}{2.5in}%
  \listplot[linecolor=red,linewidth=2pt]{\data}%
  \listplot[linecolor=blue,linewidth=2pt]{\dataII}%
  \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}%
\end{psgraph}%
}
\end{center}


\begin{lstlisting}
\readdata{\data}{demo2.dat}%
\readdata{\dataII}{demo3.dat}%
\psset{llx=-1cm,lly=-1.25cm,urx=0.5cm,ury=0.1in,xAxisLabel=Year,%
   yAxisLabel=Whatever,xAxisLabelPos={.4\linewidth,-0.4in},%
   yAxisLabelPos={-0.4in,2in}}
\pstScalePoints(1,1){1989 sub}{}
\psframebox[linestyle=dashed,boxsep=0pt]{%
\begin{psgraph}[axesstyle=frame,Ox=1989,subticks=2](0,0)(12,6){0.8\linewidth}{2.5in}%
  \listplot[linecolor=red,linewidth=2pt]{\data}%
  \listplot[linecolor=blue,linewidth=2pt]{\dataII}%
  \listplot[linecolor=cyan,linewidth=2pt,yunit=0.5]{\dataII}%
\end{psgraph}%
}
\end{lstlisting}


\pstScalePoints(1,1){}{}% reset


%--------------------------------------------------------------------------------------
\subsection{Problems}
%--------------------------------------------------------------------------------------
Floating point operations in \TeX\ are a real mess, which causes a lot of problems
when there are very small oder very big units. With the options of \verb+\pst-plot+
it is possible to choose normal units (whatever this may be ...), but plotting
the data as usual.

\begin{LTXexample}[pos=t]
\begin{filecontents*}{test.dat}
3.2345 34.5
3.2364 65.4
3.2438 50.2
\end{filecontents*}

\psset{lly=-0.5cm,llx=-1cm}
\readdata{\data}{test.dat}
\pstScalePoints(1,1){3.23 sub 100 mul}{}
\begin{psgraph}[Ox=3.23,Dx=0.01,dx=\psxunit,Dy=10](0,0)(3,70){0.8\linewidth}{5cm}%
  \listplot[showpoints=true,plotstyle=curve]{\data}
\end{psgraph}
\end{LTXexample}

This example shows some important facts:
\begin{itemize}
\item \verb+3.23 sub 100 mul+: the x values are now $0.45; 0.64; 1.38$
\item \verb+Ox=3.23+: the origin of the x axis is set to $3.23$
\item \verb+Dx=0.01+: the increment of the labels
\item \verb+dx=\psxunit+: uses the calculated unit value to get every unit a label
\item \verb+Dy=10+: increase the y labels by 10
\end{itemize}

Using the internal \verb+\psxunit+ one can have dynamical x-units, depending to
the linewidth od the document.

\resetOptions

%--------------------------------------------------------------------------------------
\section{\CMD{psStep}}
%--------------------------------------------------------------------------------------
\verb+\psStep+ caclulates a step function for the upper or lower sum or the max/min
of the Riemann integral definition of a given function. The available option is

\verb+StepType=lower|upper|Riemann|infimum|supremum+ or alternative 
\verb+StepType=l|u|R|i|s+

with \verb+lower+ as the default setting. The syntax of the function is

\verb+\psStep[options](x1,x2){n}{function}+


(x1,x2) is the given Intervall for the step wise caculated function,
n is the number of the rectangles and \verb+function+ is the mathematical function
in postfix or algebraic notation (with \verb+algebraic=true+).

\begin{LTXexample}[pos=t,preset=\centering]
\begin{pspicture}(-0.5,-0.5)(10,3) 
 \psaxes[labelFontSize=\footnotesize]{->}(10,3)
 \psplot[plotpoints=100,linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)}
 \psStep[linecolor=magenta,StepType=upper,fillstyle=hlines](0,9){9}{x sqrt}
 \psStep[linecolor=blue,fillstyle=vlines](0,9){9}{x sqrt }
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[pos=t,preset=\centering]
\psset{plotpoints=200}
\begin{pspicture}(-0.5,-2.25)(10,3)  
  \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-2.25)(10,3)
 \psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*sin(x)}
 \psStep[algebraic,linecolor=magenta,StepType=upper](0,9){20}{sqrt(x)*sin(x)}
 \psStep[linecolor=blue,linestyle=dashed](0,9){20}{x sqrt x RadtoDeg sin mul}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[pos=t,preset=\centering]
\psset{yunit=1.25cm,plotpoints=200}
\begin{pspicture}(-0.5,-1.5)(10,1.5) 
 \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-1.5)(10,1.5)
 \psStep[algebraic,StepType=Riemann,fillstyle=solid,fillcolor=black!10](0,10){50}%
    {sqrt(x)*cos(x)*sin(x)}
 \psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*cos(x)*sin(x)}
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[pos=t,preset=\centering]
\psset{yunit=1.25cm,plotpoints=200}
\begin{pspicture}(-0.5,-1.5)(10,1.5) 
 \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-1.5)(10,1.5)
 \psStep[algebraic,StepType=infimum,fillstyle=solid,fillcolor=black!10](0,10){50}%
    {sqrt(x)*cos(x)*sin(x)}
 \psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*cos(x)*sin(x)}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[pos=t,preset=\centering]
\psset{yunit=1.25cm,plotpoints=200}
\begin{pspicture}(-0.5,-1.5)(10,1.5) 
 \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-1.5)(10,1.5)
 \psStep[algebraic,StepType=supremum,fillstyle=solid,fillcolor=black!10](0,10){50}%
    {sqrt(x)*cos(x)*sin(x)}
 \psplot[linewidth=1.5pt,algebraic]{0}{10}{sqrt(x)*cos(x)*sin(x)}
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[pos=t,preset=\centering]
\psset{unit=1.5cm,plotpoints=200}
\begin{pspicture}[plotpoints=200](-0.5,-3)(10,2.5) 
  \psStep[algebraic,fillstyle=solid,fillcolor=yellow](0.001,9.5){40}{2*sqrt(x)*cos(ln(x))*sin(x)}
  \psStep[algebraic,StepType=Riemann,fillstyle=solid,fillcolor=blue](0.001,9.5){40}{2*sqrt(x)*cos(ln(x))*sin(x)}
  \psaxes[labelFontSize=\footnotesize]{->}(0,0)(0,-2.75)(10,2.5)
  \psplot[algebraic,linecolor=white]{0.001}{9.75}{2*sqrt(x)*cos(ln(x))*sin(x)}
  \uput[90](6,1.2){$f(x)=2\cdot\sqrt{x}\cdot\cos{(\ln{x})}\cdot\sin{x}$}
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\section{\CMD{psplotTangent} and option \texttt{Tnormal}}
%--------------------------------------------------------------------------------------
There is an additional option, named \verb+Derive+ vor an alternative function (see
following example) to calculate the slope of the tangent. This will be in general the
first derivation, but can also be any other function. If this option is different to
to the default value  \verb+Derive=default+,
then this function is taken to calculate the slope. For the other cases, \verb+pstricks-add+
builds a secant with -0.00005<x<0.00005, calculates the slope and takes this for the
tangent. This maybe problematic in some cases of special functions or $x$ values, then it may be appropriate to use the
Derivate option.

The macro expects three parameters:

\begin{description}
\item[$x$]: the $x$ value of the function for which the tangent should be calculated
\item[$dx$]: the $dx$ to both sides of the $x$ value
\item[$f(x)$]: the function in infix (with option \verb+algebraic+) or the default 
postfix (PostScript) notation 
\end{description}

The following examples show the use of the algebraic option together with the Derive option.
Remember that using the \verb+algebraic+ option implies that the angles have to be in the
radian unit!

\begin{center}
\bgroup
\def\F{x RadtoDeg dup dup cos exch 2 mul cos add exch 3 mul cos add}
\def\Fp{x RadtoDeg dup dup sin exch 2 mul sin 2 mul add exch 3 mul sin 3 mul add neg}
\psset{plotpoints=1001,algebraic=false}
\begin{pspicture}(-7.5,-2.5)(7.5,4)%X\psgrid
  \psaxes{->}(0,0)(-7.5,-2)(7.5,3.5)
  \psplot[linewidth=3\pslinewidth]{-7}{7}{\F}
  \psset{linecolor=red, arrows=<->, arrowscale=2}
  \multido{\n=-7+1}{8}{\psplotTangent{\n}{1}{\F}}
  \psset{linecolor=magenta, arrows=<->, arrowscale=2}%
  \multido{\n=0+1}{8}{\psplotTangent[linecolor=blue, Derive=\Fp]{\n}{1}{\F}}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\def\F{x RadtoDeg dup dup cos exch 2 mul cos add exch 3 mul cos add}
\def\Fp{x RadtoDeg dup dup sin exch 2 mul sin 2 mul add exch 3 mul sin 3 mul add neg}
\psset{plotpoints=1001}
\begin{pspicture}(-7.5,-2.5)(7.5,4)%X\psgrid
  \psaxes{->}(0,0)(-7.5,-2)(7.5,3.5)
  \psplot[linewidth=3\pslinewidth]{-7}{7}{\F}
  \psset{linecolor=red, arrows=<->, arrowscale=2}
  \multido{\n=-7+1}{8}{\psplotTangent{\n}{1}{\F}}
  \psset{linecolor=magenta, arrows=<->, arrowscale=2}%
  \multido{\n=0+1}{8}{\psplotTangent[linecolor=blue, §\ON§Derive=\Fp§\OFF§]{\n}{1}{\F}}
\end{pspicture}
\end{lstlisting}


\begin{center}
\bgroup
\def\Falg{cos(x)+cos(2*x)+cos(3*x)}   \def\Fpalg{-sin(x)-2*sin(2*x)-3*sin(3*x)}
\begin{pspicture}(-7.5,-2.5)(7.5,4)%\psgrid
  \psaxes{->}(0,0)(-7.5,-2)(7.5,3.5)
  \psplot[linewidth=1.5pt,algebraic,plotpoints=500]{-7.5}{7.5}{\Falg}
  \multido{\n=-7+1}{8}{\psplotTangent[linecolor=red,arrows=<->,arrowscale=2,algebraic]{\n}{1}{\Falg}}
  \multido{\n=0+1}{8}{\psplotTangent[linecolor=magenta,%
     arrows=<->,arrowscale=2,algebraic,Derive={\Fpalg}]{\n}{1}{\Falg}}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\def\Falg{cos(x)+cos(2*x)+cos(3*x)}   \def\Fpalg{-sin(x)-2*sin(2*x)-3*sin(3*x)}
\begin{pspicture}(-7.5,-2.5)(7.5,4)%\psgrid
  \psaxes{->}(0,0)(-7.5,-2)(7.5,3.5)
  \psplot[linewidth=1.5pt,algebraic,plotpoints=500]{-7.5}{7.5}{\Falg}
  \multido{\n=-7+1}{8}{\psplotTangent[linecolor=red,arrows=<->,arrowscale=2,algebraic]{\n}{1}{\Falg}}
  \multido{\n=0+1}{8}{\psplotTangent[linecolor=magenta,%
     arrows=<->,arrowscale=2,algebraic,§\ON§Derive={\Fpalg}§\OFF§]{\n}{1}{\Falg}}
\end{pspicture}
\end{lstlisting}

The next example shows the use of \verb+Derive+ option to draw the perpendicular line of the
tangent.

\begin{LTXexample}[width=8cm,wide]
\begin{pspicture}(-0.5,-0.5)(7.25,7.25)
  \def\Func{10 x div}
  \psaxes[arrowscale=1.5]{->}(7,7)
  \psplot[linewidth=2pt,algebraic]{1.5}{5}{10/x}
  \psplotTangent[linewidth=.5\pslinewidth,linecolor=red,algebraic]{3}{2}{10/x}
  \psplotTangent[linewidth=.5\pslinewidth,linecolor=blue,algebraic,Derive=(x*x)/10]{3}{2}{10/x}
  \psline[linestyle=dashed](!0 /x 3 def \Func)(!3 /x 3 def \Func)(3,0)
\end{pspicture}
\end{LTXexample}

With setting the optional argument \texttt{Tnormal} one can plot the normal of
the tangent line. It always starts at the given point.

%\resetOptions
\begin{LTXexample}[width=8cm,wide]
\begin{pspicture}(-0.5,-0.5)(7.25,7.25)
  \def\Func{10 x div}
  \psaxes[arrowscale=1.5]{->}(7,7)
  \psplot[linewidth=2pt]{1.5}{5}{\Func}
  \psplotTangent[linewidth=1.5\pslinewidth,linecolor=red]{3}{2}{\Func}
  \psplotTangent[linewidth=1.5\pslinewidth,linecolor=blue,Tnormal]{3}{2}{\Func}
  \psline[linestyle=dashed](!0 /x 3 def \Func)(!3 /x 3 def \Func)(3,0)
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\subsection{A \texttt{polarplot} example}
%--------------------------------------------------------------------------------------

Let's work with the classical cardioid : $\rho=2(1+\cos(\theta))$
and $\displaystyle \frac{d\rho}{d\theta}=-2\sin(\theta)$. The Derive option always expects the
$\frac{d\rho}{d\theta}$ value and uses internally the equation for the derivation of implicit 
defined functions:

\[
\frac{dy}{dx}=\frac{\rho\prime\cdot\sin\theta + x}{\rho\prime\cdot\cos\theta - y}
\]
where $x=r\cdot\cos\theta$ and $y=r\cdot\sin\theta$


\begin{LTXexample}[width=6cm,wide]
\begin{pspicture}(-1,-3)(5,3)%\psgrid[subgridcolor=lightgray]
  \psaxes{->}(0,0)(-1,-3)(5,3)
  \psplot[polarplot,linewidth=3\pslinewidth,linecolor=blue,%
     plotpoints=500]{0}{360}{1 x cos add 2 mul}
\end{pspicture}
\end{LTXexample}

\psset{algebraic=false}
\begin{LTXexample}[width=6cm,wide]
\begin{pspicture}(-1,-3)(5,3)%\psgrid[subgridcolor=lightgray]
  \psaxes{->}(0,0)(-1,-3)(5,3)
  \psplot[polarplot,linewidth=3\pslinewidth,linecolor=blue,plotpoints=500]{0}{360}{1 x cos add 2 mul}
  \multido{\n=0+36}{10}{%
     \psplotTangent[polarplot,linecolor=red,arrows=<->]{\n}{1.5}{1 x cos add 2 mul} }
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=6cm,wide]
\begin{pspicture}(-1,-3)(5,3)%\psgrid[subgridcolor=lightgray]
  \psaxes{->}(0,0)(-1,-3)(5,3)
  \psplot[polarplot,linewidth=3\pslinewidth,linecolor=blue,algebraic,plotpoints=500]{0}{6.289}{2*(1+cos(x))}
  \multido{\r=0.000+0.314}{21}{%
     \psplotTangent[polarplot,Derive=-2*sin(x),algebraic,linecolor=red,arrows=<->]{\r}{1.5}{2*(1+cos(x))} }
\end{pspicture}
\end{LTXexample}



%--------------------------------------------------------------------------------------
\subsection{A \CMD{parametricplot} example}
%--------------------------------------------------------------------------------------

Let's work with a Lissajou curve : 
 $\displaystyle\left\{\begin{array}{l}x=3.5\cos(2t)\\y=3.5\sin(6t)\end{array}\right.$
whose derivative is :
 $\displaystyle\left\{\begin{array}{l}x=-7\sin(2t)\\y=21\cos(6t)\end{array}\right.$

The parameter must be the letter $t$ instead of $x$ and when using the \verb+algebraic+ option
divide the two equations by a | (see example).

\begin{LTXexample}[pos=t,wide]
\def\Lissa{t dup 2 RadtoDeg mul cos 3.5 mul exch 6 mul RadtoDeg sin 3.5 mul}%
\psset{yunit=0.6}
\begin{pspicture}(-4,-4)(4,6)
  \parametricplot[plotpoints=500,linewidth=3\pslinewidth]{0}{3.141592}{\Lissa}
  \multido{\r=0.000+0.314}{11}{%
    \psplotTangent[linecolor=red,arrows=<->]{\r}{1.5}{\Lissa} }
  \multido{\r=0.157+0.314}{11}{%
    \psplotTangent[linecolor=blue,arrows=<->]{\r}{1.5}{\Lissa} }
\end{pspicture}\hfill%
\def\LissaAlg{3.5*cos(2*t)|3.5*sin(6*t)}  \def\LissaAlgDer{-7*sin(2*t)|21*cos(6*t)}%
\begin{pspicture}(-4,-4)(4,6)
  \parametricplot[algebraic,plotpoints=500,linewidth=3\pslinewidth]{0}{3.141592}{\LissaAlg}
  \multido{\r=0.000+0.314}{11}{%
    \psplotTangent[algebraic,linecolor=red,arrows=<->]{\r}{1.5}{\LissaAlg} }
  \multido{\r=0.157+0.314}{11}{%
    \psplotTangent[algebraic,linecolor=blue,arrows=<->,%
       Derive=\LissaAlgDer]{\r}{1.5}{\LissaAlg} }
\end{pspicture}
\end{LTXexample}



\resetOptions

\section{Successive derivatives of a function}

The new PostScript function \verb$Derive$ has been added for plotting 
the succesive derivatives of a
function. It must be used wiht the \verb|algebaic| option. This function has two
arguments:

\begin{enumerate}
\item a positive integer with define the order of the derivative, obviously $0$ means the
  function itself!
\item a function of variable $x$ which can be any function using the common operators,
\end{enumerate}

Do not think that the derivative is approximated, the internal PostScript engine will
compute the real derivative using a formal derivative engine.

The following diagram contains the plot of the polynomial:

\[ f(x)=\sum_{i=0}^{14}\frac{(-1)^{i}x^{2i}}{i!}=1-\frac{x^2}{2}+\frac{x^4}{4!}-\frac{x^6}{6!}+\frac{x^8}{8!}-
          \frac{x^{10}}{10!}+\frac{x^{12}}{12!}-\frac{x^{14}}{14!}\]

and of its 15 first derivatives. It is the sequence definition of the cosine.


\begin{LTXexample}[pos=t,wide,preset=\centering]
\psset{unit=2}
\def\getColor#1{\ifcase#1 Tan\or RedOrange\or magenta\or yellow\or green\or Orange\or blue\or
  DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\or Goldenrod\or Mahogany\or
  OrangeRed\or CarnationPink\or RoyalPurple\or Lavender\fi}
\begin{pspicture}[showgrid=true](0,-1.2)(7,1.5)
  \psclip{\psframe[linestyle=none](0,-1.1)(7,1.1)}
  \multido{\in=0+1}{16}{%
     \psplot[linewidth=1pt,algebraic,linecolor=\getColor{\in}]{0}{7}
      {Derive(\in,1-x^2/2+x^4/24-x^6/720+x^8/40320-x^10/3628800+x^12/479001600-x^14/87178291200)}}
  \endpsclip
\end{pspicture}
\end{LTXexample}

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  \subsection{Other examples}


\begin{LTXexample}[width=3.5cm]
\begin{pspicture}[shift=-2.5,showgrid=true,linewidth=1pt](0,-2)(3,3)
  \psplot[algebraic]{.001}{3}{x*ln(x)}  % f(x)
  \psplot[algebraic,linecolor=red]{.05}{3}{Derive(1,x*ln(x))} % f'(x)=1+ln(x)
\end{pspicture}
\end{LTXexample}


\section{Variable step for plotting a curve}
\subsection{Theory}

As you know with the \verb$\psplot$ macro, the curve is plotted using a piece wise
linear curve. The step is given by the parameter \texttt{plotpoints}. For
each step between $x_i$ and $x_{i+1}$, the area defined between the curve and its
approximation (a segment) is majored by this formula :

\begin{minipage}[m]{.5\linewidth}
\[|\varepsilon|\le\frac{M_2(f)(x_{i+1}-x_i)^3}{12}\]

$M_2(f)$ is a majorant of the second derivative of $f$ in the interval $[x_i;x_{i+1}]$.
\end{minipage}
{\psset{unit=1cm, showpoints=false}
\begin{pspicture}[shift=-2,showgrid=true](0,-1)(6,3)
  \pscurve(0,0)(1,1)(3,2.2)(5,2)(6,1)\psline(1,1)(5,2)
  \psline(.5,0)(5.5,0)\psline(1,0)(1,1)\psline(5,0)(5,2)
  \rput[t](1,-.1){$x_n$}\rput[t](5,-.1){$x_{n+1}$}
  \psclip{\pscustom{\psecurve(0,0)(1,1)(3,2.2)(5,2)(6,1)\psline(5,2)}}
    \psframe[fillstyle=solid, fillcolor=gray](0,0)(5,5)
  \endpsclip
  \rput*(3,1.8){$\varepsilon$}
\end{pspicture}}



The parameter \verb$VarStep$ (\verb$false$ by default) activates the variable step
algorithm. It is set to a tolerance defines by the parameter \verb$VarStepEpsilon$
(\verb+default+ by default, accept real value). If this parameter is not set by the
user, then it is automatically computed using the default first step given by the
parameter \verb+plotpoints+. Then, for each step, $f''(x_n)$ and $f''(x_{n+1})$ are
computed and the smaller is used as $M_2(f)$, and then the step is approximated. This
means that the step is constant for a second order polynomials.

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \subsection{The cosine}

  Different value for the tolerance from $0.01$ to $0.000\,1$, a factor $10$ between
  each of them. In black, there is the classical \verb+psplot+ behavior, and in
  magenta the default variable step behavior.

\begin{center}
\bgroup
\psset{algebraic, VarStep=true, unit=2, showpoints=true, linecolor=red}
\begin{pspicture}(-0,-1)(3.14,2)\psgrid
  \psplot[VarStepEpsilon=.01]{0}{3.14}{cos(x)}
  \psplot[VarStepEpsilon=.001]{0}{3.14}{cos(x)+.15}
  \psplot[VarStepEpsilon=.0001]{0}{3.14}{cos(x)+.3}
  \psplot[linecolor=magenta]{0}{3.14}{cos(x)+.45}
  \psplot[VarStep=false, linewidth=2\pslinewidth, linecolor=black]{-0}{3.14}{cos(x)+.6}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{algebraic, VarStep=true, unit=2, showpoints=true, linecolor=red}
\begin{pspicture}[showgrid=true](-0,-1)(3.14,2)
  \psplot[VarStepEpsilon=.01]{0}{3.14}{cos(x)}
  \psplot[VarStepEpsilon=.001]{0}{3.14}{cos(x)+.15}
  \psplot[VarStepEpsilon=.0001]{0}{3.14}{cos(x)+.3}
  \psplot[linecolor=magenta]{0}{3.14}{cos(x)+.45}
  \psplot[VarStep=false,linewidth=1pt,linecolor=black]{-0}{3.14}{cos(x)+.6}
\end{pspicture}
\end{lstlisting}


\subsection{The neperian Logarithm}

A really classical example wich gives a bad beginning, the tolerance is set to $0.001$.

\begin{center}
\bgroup
\psset{algebraic, VarStep=true, linecolor=red, showpoints=true}
\begin{pspicture}[showgrid=true](0,-5)(16,4)
  \psplot[VarStep=false, linecolor=black]{.01}{16}{ln(x)+1}
  \psplot[linecolor=magenta]{.51}{16}{ln(x-1/2)+1/2}
  \psplot[VarStepEpsilon=.001]{1.01}{16}{ln(x-1)}
  \psplot[VarStepEpsilon=.01]{1.51}{16}{ln(x-1.5)-100/200}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{algebraic, VarStep=true, linecolor=red, showpoints=true}
\begin{pspicture}[showgrid=true](0,-5)(16,4)
  \psplot[VarStep=false, linecolor=black]{.01}{16}{ln(x)+1}
  \psplot[linecolor=magenta]{.51}{16}{ln(x-1/2)+1/2}
  \psplot[VarStepEpsilon=.001]{1.01}{16}{ln(x-1)}
  \psplot[VarStepEpsilon=.01]{1.51}{16}{ln(x-1.5)-100/200}
\end{pspicture}
\end{lstlisting}


\clearpage
\subsection{Sinus of the inverse of $x$}
Impossible to draw, but let's try!

\begin{center}
\bgroup
\psset{xunit=64,algebraic,VarStep,linecolor=red,showpoints=true,linewidth=1pt}
\begin{pspicture}[showgrid=true](0,-1)(.5,1)
  \psplot[VarStepEpsilon=.0001]{.01}{.25}{sin(1/x)}
\end{pspicture}\\
\begin{pspicture}[showgrid=true](0,-1)(.5,1)
  \psplot[VarStepEpsilon=.00001]{.01}{.25}{sin(1/x)}
\end{pspicture}\\
\begin{pspicture}[showgrid=true](0,-1)(.5,1)
  \psplot[VarStepEpsilon=.000001]{.01}{.25}{sin(1/x)}
\end{pspicture}\\
\begin{pspicture}[showgrid=true](0,-1)(.5,1)
  \psplot[VarStep=false, linecolor=black]{.01}{.25}{sin(1/x)}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{xunit=64,algebraic,VarStep,linecolor=red,showpoints=true,linewidth=1pt}
\begin{pspicture}[showgrid=true](0,-1)(.5,1)
  \psplot[VarStepEpsilon=.0001]{.01}{.25}{sin(1/x)}
\end{pspicture}\\
\begin{pspicture}[showgrid=true](0,-1)(.5,1)
  \psplot[VarStepEpsilon=.00001]{.01}{.25}{sin(1/x)}
\end{pspicture}\\
\begin{pspicture}[showgrid=true](0,-1)(.5,1)
  \psplot[VarStepEpsilon=.000001]{.01}{.25}{sin(1/x)}
\end{pspicture}\\
\begin{pspicture}[showgrid=true](0,-1)(.5,1)
  \psplot[VarStep=false, linecolor=black]{.01}{.25}{sin(1/x)}
\end{pspicture}
\end{lstlisting}





\subsection{A really complex function}

Just appreciate the difference between the normal behavior and the plotting with the
\texttt{varStep} option. The function is :

\[f(x)=x-\frac{x^2}{10}+\ln(x)+\cos(2x)+\sin(x^2)-1\]

\begin{center}
\bgroup
\psset{xunit=3, algebraic, VarStep, showpoints=true}
\begin{pspicture}[showgrid=true](0,-2)(5,6)
  \psplot[VarStepEpsilon=.0005, linecolor=red]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)}
  \psplot[linecolor=magenta]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)+.5}
  \psplot[VarStep=false]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)-1}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{xunit=3, algebraic, VarStep, showpoints=true}
\begin{pspicture}[showgrid=true](0,-2)(5,6)
  \psplot[VarStepEpsilon=.0005, linecolor=red]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)}
  \psplot[linecolor=magenta]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)+.5}
  \psplot[VarStep=false]{.1}{5}{x-x^2/10+ln(x)+cos(2*x)+sin(x^2)-1}
\end{pspicture}
\end{lstlisting}


\subsection{A hyperbola}

\begin{center}
\bgroup
\psset{algebraic, showpoints=true, unit=0.75}
\begin{pspicture}(-5,-4)(9,6)
  \psplot[linecolor=black]{-5}{1.8}{(x-1)/(x-2)}
  \psplot[VarStep=true, VarStepEpsilon=.001, linecolor=red]{2.2}{9}{(x-1)/(x-2)}
  \psaxes{->}(0,0)(-5,-4)(9,6)
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{algebraic, showpoints=true, unit=0.75}
\begin{pspicture}(-5,-4)(9,6)
  \psplot[linecolor=black]{-5}{1.8}{(x-1)/(x-2)}
  \psplot[VarStep=true, VarStepEpsilon=.001, linecolor=red]{2.2}{9}{(x-1)/(x-2)}
  \psaxes{->}(0,0)(-5,-4)(9,6)
\end{pspicture}
\end{lstlisting}





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Successive derivatives of a polynom}

\begin{center}
\bgroup
\psset{unit=2, algebraic=true, VarStep=true, showpoints=true, VarStepEpsilon=.001}
\def\getColor#1{\ifcase#1 Tan\or RedOrange\or magenta\or yellow\or green\or Orange\or blue\or
  DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\or Goldenrod\or Mahogany\or
  OrangeRed\or CarnationPink\or RoyalPurple\or Lavender\fi}
\begin{pspicture}[showgrid=true](0,-1.2)(7,1.5)
  \psclip{\psframe[linestyle=none](0,-1.1)(7,1.1)}
  \multido{\in=0+1}{16}{%
    \psplot[algebraic=true, linecolor=\getColor{\in}]{0.1}{7}
    {Derive(\in,Sum(i,0,1,7,(-1)^i*x^(2*i)/Fact(2*i)))}}
  \endpsclip
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{unit=2, algebraic=true, VarStep=true, showpoints=true, VarStepEpsilon=.001}
\def\getColor#1{\ifcase#1 Tan\or RedOrange\or magenta\or yellow\or green\or Orange\or blue\or
  DarkOrchid\or BrickRed\or Rhodamine\or OliveGreen\or Goldenrod\or Mahogany\or
  OrangeRed\or CarnationPink\or RoyalPurple\or Lavender\fi}
\begin{pspicture}[showgrid=true](0,-1.2)(7,1.5)
  \psclip{\psframe[linestyle=none](0,-1.1)(7,1.1)}
  \multido{\in=0+1}{16}{%
    \psplot[algebraic=true, linecolor=\getColor{\in}]{0.1}{7}
    {Derive(\in,Sum(i,0,1,7,(-1)^i*x^(2*i)/Fact(2*i)))}}
  \endpsclip
\end{pspicture}
\end{lstlisting}


\subsection{The variable step algorithm together with the \texttt{IfTE} primitive}

\begin{center}
\bgroup
\psset{unit=1.5, algebraic, VarStep, showpoints=true, VarStepEpsilon=.001}
\begin{pspicture}[showgrid=true](-7,-2)(2,4)
  \psplot{-7}{2}{IfTE(x<-5,-(x+5)^3/2,IfTE(x<0,0,x^2))}
  \psplot{-7}{2}{5*x/9+26/9}
  \psplot[linecolor=blue]{-7}{2}{(x+7)^30/9^30*4.5-1/2}
  \psplot[linecolor=red]{-6.9}{2}
      {IfTE(x<-6,ln(x+7),IfTE(x<-3,x+6,IfTE(x<0.1415926,sin(x+3)+3,3.1415926-x)))}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{unit=1.5, algebraic, VarStep, showpoints=true, VarStepEpsilon=.001}
\begin{pspicture}[showgrid=true](-7,-2)(2,4)
  \psplot{-7}{2}{IfTE(x<-5,-(x+5)^3/2,IfTE(x<0,0,x^2))}
  \psplot{-7}{2}{5*x/9+26/9}
  \psplot[linecolor=blue]{-7}{2}{(x+7)^30/9^30*4.5-1/2}
  \psplot[linecolor=red]{-6.9}{2}
      {IfTE(x<-6,ln(x+7),IfTE(x<-3,x+6,IfTE(x<0.1415926,sin(x+3)+3,3.1415926-x)))}
\end{pspicture}
\end{lstlisting}



\subsection{Using \CMD{parametricplot}}

\begin{center}
\bgroup
\psset{unit=2.5}
\begin{pspicture}[showgrid=true](-1,-1)(1,1)
\parametricplot[algebraic=true,linecolor=red,VarStep=true, showpoints=true,
                VarStepEpsilon=.0001]
                {-3.14}{3.14}{cos(3*t)|sin(2*t)}
\end{pspicture}
\begin{pspicture}[showgrid=true](-1,-1)(1,1)
\parametricplot[algebraic=true,linecolor=blue,VarStep=true, showpoints=false,
                VarStepEpsilon=.0001]
                {-3.14}{3.14}{cos(3*t)|sin(2*t)}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{unit=3}
\begin{pspicture}[showgrid=true](-1,-1)(1,1)
\parametricplot[algebraic=true,linecolor=red,VarStep=true, showpoints=true,
                VarStepEpsilon=.0001]
                {-3.14}{3.14}{cos(3*t)|sin(2*t)}
\end{pspicture}
\begin{pspicture}[showgrid=true](-1,-1)(1,1)
\parametricplot[algebraic=true,linecolor=blue,VarStep=true, showpoints=false,
                VarStepEpsilon=.0001]
                {-3.14}{3.14}{cos(3*t)|sin(2*t)}
\end{pspicture}
\end{lstlisting}


\begin{center}
\bgroup
\psset{unit=2.5}
\begin{pspicture}[showgrid=true](-1,-1)(1,1)
\parametricplot[algebraic=true,linecolor=red,VarStep=true, showpoints=true,
                VarStepEpsilon=.0001]
                {0}{47.115}{cos(5*t)|sin(3*t)}
\end{pspicture}
\begin{pspicture}[showgrid=true](-1,-1)(1,1)
\parametricplot[algebraic=true,linecolor=blue,VarStep=true, showpoints=false,
                VarStepEpsilon=.0001]
                {0}{47.115}{cos(5*t)|sin(3*t)}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{unit=2.5}
\begin{pspicture}[showgrid=true](-1,-1)(1,1)
\parametricplot[algebraic=true,linecolor=red,VarStep=true, showpoints=true,
                VarStepEpsilon=.0001]
                {0}{47.115}{cos(5*t)|sin(3*t)}
\end{pspicture}
\begin{pspicture}[showgrid=true](-1,-1)(1,1)
\parametricplot[algebraic=true,linecolor=blue,VarStep=true, showpoints=false,
                VarStepEpsilon=.0001]
                {0}{47.115}{cos(5*t)|sin(3*t)}
\end{pspicture}
\end{lstlisting}


\begin{center}
\bgroup
\psset{xunit=.5}
\begin{pspicture}[showgrid=true](0,0)(12.566,2)
\parametricplot[algebraic,linecolor=red,VarStep, showpoints=true,
        VarStepEpsilon=.01]{0}{12.566}{t+cos(-t-Pi/2)|1+sin(-t-Pi/2)}
\end{pspicture}
%
\begin{pspicture}[showgrid=true](0,0)(12.566,2)
\parametricplot[algebraic,linecolor=blue,VarStep, showpoints=false,
        VarStepEpsilon=.001]{0}{12.566}{t+cos(-t-Pi/2)|1+sin(-t-Pi/2)}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{xunit=.5}
\begin{pspicture}[showgrid=true](0,0)(12.566,2)
\parametricplot[algebraic,linecolor=red,VarStep, showpoints=true,
        VarStepEpsilon=.01]{0}{12.566}{t+cos(-t-Pi/2)|1+sin(-t-Pi/2)}
\end{pspicture}
%
\begin{pspicture}[showgrid=true](0,0)(12.566,2)
\parametricplot[algebraic,linecolor=blue,VarStep, showpoints=false,
        VarStepEpsilon=.001]{0}{12.566}{t+cos(-t-Pi/2)|1+sin(-t-Pi/2)}
\end{pspicture}
\end{lstlisting}


\resetOptions


\section{New math functions and their derivative}

\subsection{The inverse sin and its derivative}

\begin{center}
\bgroup
\psset{unit=1.5}
\begin{pspicture}[showgrid=true](-1,-2)(1,2)
  \psplot[linecolor=blue,algebraic]{-1}{1}{asin(x)}
\end{pspicture}
\hspace{1em}
\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
\begin{pspicture}[showgrid=true](-1,-2)(1,2)
  \psplot[linecolor=blue]{-.999}{.999}{asin(x)}
\end{pspicture}
\hspace{1em}
\begin{pspicture}[showgrid=true](-1,0)(1,4)
  \psplot[linecolor=blue]{-.97}{.97}{Derive(1,asin(x))}
\end{pspicture}
\hspace{1em}
\psset{algebraic, VarStep, VarStepEpsilon=.0001, showpoints=true}
\begin{pspicture}[showgrid=true](-1,0)(1,4)
  \psplot[linecolor=blue]{-.97}{.97}{Derive(1,asin(x))}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{unit=1.5}
\begin{pspicture}[showgrid=true](-1,-2)(1,2)
  \psplot[linecolor=blue,algebraic]{-1}{1}{asin(x)}
\end{pspicture}
\hspace{1em}
\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
\begin{pspicture}[showgrid=true](-1,-2)(1,2)
  \psplot[linecolor=blue]{-.999}{.999}{asin(x)}
\end{pspicture}
\hspace{1em}
\begin{pspicture}[showgrid=true](-1,0)(1,4)
  \psplot[linecolor=red]{-.97}{.97}{Derive(1,asin(x))}
\end{pspicture}
\hspace{1em}
\psset{algebraic, VarStep, VarStepEpsilon=.0001, showpoints=true}
\begin{pspicture}[showgrid=true](-1,0)(1,4)
  \psplot[linecolor=red]{-.97}{.97}{Derive(1,asin(x))}
\end{pspicture}
\end{lstlisting}


\subsection{The inverse cosine and its derivative}

\begin{center}
\bgroup
\psset{unit=1.5}
\begin{pspicture}[showgrid=true](-1,0)(1,3)
  \psplot[linecolor=blue,algebraic]{-1}{1}{acos(x)}
\end{pspicture}
\hspace{1em}
\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
\begin{pspicture}[showgrid=true](-1,0)(1,3)
  \psplot[linecolor=blue]{-.999}{.999}{acos(x)}
\end{pspicture}
\hspace{1em}
\begin{pspicture}[showgrid=true](-1,-4)(1,-1)
  \psplot[linecolor=blue]{-.97}{.97}{Derive(1,acos(x))}
\end{pspicture}
\hspace{1em}
\psset{algebraic, VarStep, VarStepEpsilon=.0001, showpoints=true}
\begin{pspicture}[showgrid=true](-1,-4)(1,-1)
  \psplot[linecolor=blue]{-.97}{.97}{Derive(1,acos(x))}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{unit=1.5}
\begin{pspicture}[showgrid=true](-1,0)(1,3)
  \psplot[linecolor=blue,algebraic]{-1}{1}{acos(x)}
\end{pspicture}
\hspace{1em}
\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
\begin{pspicture}[showgrid=true](-1,0)(1,3)
  \psplot[linecolor=blue]{-.999}{.999}{acos(x)}
\end{pspicture}
\hspace{1em}
\begin{pspicture}[showgrid=true](-1,-4)(1,-1)
  \psplot[linecolor=red]{-.97}{.97}{Derive(1,acos(x))}
\end{pspicture}
\hspace{1em}
\psset{algebraic, VarStep, VarStepEpsilon=.0001, showpoints=true}
\begin{pspicture}[showgrid=true](-1,-4)(1,-1)
  \psplot[linecolor=red]{-.97}{.97}{Derive(1,acos(x))}
\end{pspicture}
\end{lstlisting}



\subsection{The inverse tangente and its derivative}

\begin{center}
\bgroup
\begin{pspicture}[showgrid=true](-4,-2)(4,2)
\psset{algebraic=true}
  \psplot[linecolor=blue,linewidth=1pt]{-4}{4}{atg(x)}
  \psplot[linecolor=red,VarStep, VarStepEpsilon=.0001, showpoints=true]{-4}{4}{Derive(1,atg(x))}
\end{pspicture}
\hspace{1em}
\begin{pspicture}[showgrid=true](-4,-2)(4,2)
\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=blue]{-4}{4}{atg(x)}
  \psplot[linecolor=red]{-4}{4}{Derive(1,atg(x))}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\begin{pspicture}[showgrid=true](-4,-2)(4,2)
\psset{algebraic=true}
  \psplot[linecolor=blue,linewidth=1pt]{-4}{4}{atg(x)}
  \psplot[linecolor=red,VarStep, VarStepEpsilon=.0001, showpoints=true]{-4}{4}{Derive(1,atg(x))}
\end{pspicture}
\hspace{1em}
\begin{pspicture}[showgrid=true](-4,-2)(4,2)
\psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=blue]{-4}{4}{atg(x)}
  \psplot[linecolor=red]{-4}{4}{Derive(1,atg(x))}
\end{pspicture}
\end{lstlisting}

\subsection{Hyperbolique functions}

\begin{center}
\bgroup
\begin{pspicture}(-3,-4)(3,4)
\psset{algebraic=true}
  \psplot[linecolor=red,linewidth=1pt]{-2}{2}{sh(x)}
  \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{ch(x)}
  \psplot[linecolor=green,linewidth=1pt]{-3}{3}{th(x)}
  \psaxes{->}(0,0)(-3,-4)(3,4)
\end{pspicture}
\hspace{1em}
\begin{pspicture}(-3,-4)(3,4)
\psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=red,linewidth=1pt]{-2}{2}{sh(x)}
  \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{ch(x)}
  \psplot[linecolor=green,linewidth=1pt]{-3}{3}{th(x)}
  \psaxes{->}(0,0)(-3,-4)(3,4)
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\begin{pspicture}(-3,-4)(3,4)
\psset{algebraic=true}
  \psplot[linecolor=red,linewidth=1pt]{-2}{2}{sh(x)}
  \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{ch(x)}
  \psplot[linecolor=green,linewidth=1pt]{-3}{3}{th(x)}
  \psaxes{->}(0,0)(-3,-4)(3,4)
\end{pspicture}
\hspace{1em}
\begin{pspicture}(-3,-4)(3,4)
\psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=red,linewidth=1pt]{-2}{2}{sh(x)}
  \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{ch(x)}
  \psplot[linecolor=green,linewidth=1pt]{-3}{3}{th(x)}
  \psaxes{->}(0,0)(-3,-4)(3,4)
\end{pspicture}
\end{lstlisting}



\begin{center}
\bgroup
\begin{pspicture}(-3,-4)(3,4)
\psset{algebraic=true}
  \psplot[linecolor=red,linewidth=1pt]{-2}{2}{Derive(1,sh(x))}
  \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{Derive(1,ch(x))}
  \psplot[linecolor=green,linewidth=1pt]{-3}{3}{Derive(1,th(x))}
  \psaxes{->}(0,0)(-3,-4)(3,4)
\end{pspicture}
\hspace{1em}
\begin{pspicture}(-3,-4)(3,4)
\psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=red,linewidth=1pt]{-2}{2}{Derive(1,sh(x))}
  \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{Derive(1,ch(x))}
  \psplot[linecolor=green,linewidth=1pt]{-3}{3}{Derive(1,th(x))}
  \psaxes{->}(0,0)(-3,-4)(3,4)
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\begin{pspicture}(-3,-4)(3,4)
\psset{algebraic=true,linewidth=1pt}
  \psplot[linecolor=red,linewidth=1pt]{-2}{2}{Derive(1,sh(x))}
  \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{Derive(1,ch(x))}
  \psplot[linecolor=green,linewidth=1pt]{-3}{3}{Derive(1,th(x))}
  \psaxes{->}(0,0)(-3,-4)(3,4)
\end{pspicture}
\hspace{1em}
\begin{pspicture}(-3,-4)(3,4)
\psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=red,linewidth=1pt]{-2}{2}{Derive(1,sh(x))}
  \psplot[linecolor=blue,linewidth=1pt]{-2}{2}{Derive(1,ch(x))}
  \psplot[linecolor=green,linewidth=1pt]{-3}{3}{Derive(1,th(x))}
  \psaxes{->}(0,0)(-3,-4)(3,4)
\end{pspicture}
\end{lstlisting}



\begin{center}
\bgroup
\begin{pspicture}(-7,-3)(7,3)
\psset{algebraic=true}
  \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Argsh(x)}
  \psplot[linecolor=blue,linewidth=1pt]{1}{7}{Argch(x)}
  \psplot[linecolor=green,linewidth=1pt]{-.99}{.99}{Argth(x)}
  \psaxes{->}(0,0)(-7,-3)(7,3)
\end{pspicture}\\[\baselineskip]
\begin{pspicture}(-7,-3)(7,3)
  \psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Argsh(x)}
  \psplot[linecolor=blue,linewidth=1pt]{1.001}{7}{Argch(x)}
  \psplot[linecolor=green,linewidth=1pt]{-.99}{.99}{Argth(x)}
  \psaxes{->}(0,0)(-7,-3)(7,3)
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\begin{pspicture}(-7,-3)(7,3)
\psset{algebraic=true}
  \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Argsh(x)}
  \psplot[linecolor=blue,linewidth=1pt]{1}{7}{Argch(x)}
  \psplot[linecolor=green,linewidth=1pt]{-.99}{.99}{Argth(x)}
  \psaxes{->}(0,0)(-7,-3)(7,3)
\end{pspicture}\\[\baselineskip]
\begin{pspicture}(-7,-3)(7,3)
  \psset{algebraic, VarStep, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Argsh(x)}
  \psplot[linecolor=blue,linewidth=1pt]{1.001}{7}{Argch(x)}
  \psplot[linecolor=green,linewidth=1pt]{-.99}{.99}{Argth(x)}
  \psaxes{->}(0,0)(-7,-3)(7,3)
\end{pspicture}
\end{lstlisting}



\begin{center}
\bgroup
\begin{pspicture}(-7,-0.5)(7,6)
\psset{algebraic=true}
  \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Derive(1,Argsh(x))}
  \psplot[linecolor=blue,linewidth=1pt]{1.014}{7}{Derive(1,Argch(x))}
  \psplot[linecolor=green,linewidth=1pt]{-.9}{.9}{Derive(1,Argth(x))}
  \psaxes{->}(0,0)(-7,0)(7,6)
\end{pspicture}\\[\baselineskip]
\begin{pspicture}(-7,-0.5)(7,6)
\psset{algebraic=true}
  \psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Derive(1,Argsh(x))}
  \psplot[linecolor=blue,linewidth=1pt]{1.014}{7}{Derive(1,Argch(x))}
  \psplot[linecolor=green,linewidth=1pt]{-.9}{.9}{Derive(1,Argth(x))}
  \psaxes{->}(0,0)(-7,0)(7,6)
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\begin{pspicture}(-7,-0.5)(7,6)
\psset{algebraic=true}
  \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Derive(1,Argsh(x))}
  \psplot[linecolor=blue,linewidth=1pt]{1.014}{7}{Derive(1,Argch(x))}
  \psplot[linecolor=green,linewidth=1pt]{-.9}{.9}{Derive(1,Argth(x))}
  \psaxes{->}(0,0)(-7,0)(7,6)
\end{pspicture}\\[\baselineskip]
\begin{pspicture}(-7,-0.5)(7,6)
\psset{algebraic=true}
  \psset{algebraic=true, VarStep=true, VarStepEpsilon=.001, showpoints=true}
  \psplot[linecolor=red,linewidth=1pt]{-7}{7}{Derive(1,Argsh(x))}
  \psplot[linecolor=blue,linewidth=1pt]{1.014}{7}{Derive(1,Argch(x))}
  \psplot[linecolor=green,linewidth=1pt]{-.9}{.9}{Derive(1,Argth(x))}
  \psaxes{->}(0,0)(-7,0)(7,6)
\end{pspicture}
\end{lstlisting}

\clearpage
%--------------------------------------------------------------------------------------
\section[\CMD{psplotDiffEqn} -- solving diffential equations]{\CMD{psplotDiffEqn} -- solving diffential equations}
%--------------------------------------------------------------------------------------


 A differential euqation of first order is like

\begin{align} y^\prime=f(x,y,y^\prime) \end{align}


where $y$ is a function of  $x$. We define some vectors $Y=[y, y', \cdots , y^{(n-1)}]$ 
und $Y^\prime=[y^\prime, y^{\prime\prime}, \cdots , y^{n}]$, depending to the order $n$. 
The syntax of the macro is

\begin{lstlisting}[style=syntax]
\psplotDiffEqn[options]{x0}{x1}{y0}{f(x,y,y',...)}
\end{lstlisting}

\begin{itemize}\setlength\itemsep{0pt}\setlength\parsep{0pt}\setlength\parskip{0pt}
\item \verb+options+: the \verb+\psplotDiffEqn+ specific options and all other of PSTricks, which
make sense;
\item $x_0$: the start value;
\item $x_1$: the end value of the definition interval;
\item $y_0$: the initial values for $y(x_0)\ y'(x_0)\ \ldots$;
\item $f(x,y,y',...)$: the differential equation, depending to the number of initial values, e.g.:
    \verb+{0 1}+ for $y_0$ are two initial values, so that we have a differential equation of
    second order $f(x,y,y')$ and the macro leaves $y\ y'$ on the stack.
\end{itemize}

The new options are:


\begin{itemize}\setlength\itemsep{0pt}\setlength\parsep{0pt}\setlength\parskip{0pt}
\item \param{method}: integration method (\verb+euler+ for order 1 euler method, \verb+rk4+ for
  4\textsuperscript{th} order Runge-Kutta method);
\item \param{whichabs}: select the abscissa for plotting the graph, by default it is
  $x$, but you can specify a number which represent a position in the vector $y$;
\item \param{whichord}: same as precedent for the ordinate, by default $y(0)$;
\item \param{plotfuncx}: describe a ps function for the abscissa, parameter
  \param{whichabs} becomes useless;
\item \param{plotfuncy}: idem for ordoinate;
\item \param{buildvector}: boolean parameter for specifying the input-output of the
  $f$ description:
  \begin{description}
  \item[\texttt{true}] (default): $y$ is put on the stack element by element, $y'$
    must be given in the same way;
  \item[\texttt{false}]: $y$ is put on the stack as a vector, $y'$ must be returned
  in the same way;
  \end{description}

\item \param{algebraic}: algebraic description for $f$, \param{buildvector}
  parameter is useless when activating this option.
\end{itemize}



\subsection{Variable step for differential equations}

A new algorithm has been added for adjusting the step according to the variations of
the curve. The parameter \verb+method+ has a new possible value : \verb+varrkiv+ to
activate the \textsc{Runge-Kutta} method with variable step, then the parameter
\verb+varsteptol+ (real value; \verb+.01+ by default) can control the tolerance of
the algortihm.

\begin{center}
\bgroup
\def\Funct{neg}\def\FunctAlg{-y[0]}
\psset{xunit=1.5, yunit=8, showpoints=true}
\begin{pspicture}[showgrid=true](0,0)(10,1.2)
  \psplot[linewidth=6\pslinewidth, linecolor=green, showpoints=false]{0}{10}{2.71828182846 x neg exp}
  \psplotDiffEqn[linecolor=magenta, method=varrkiv, varsteptol=.1, plotpoints=2]{0}{10}{1}{\Funct}
  \rput(0,.0){\psplotDiffEqn[linecolor=blue, method=varrkiv, varsteptol=.01, plotpoints=2]{0}{10}{1}{\Funct}}
  \rput(0,.1){\psplotDiffEqn[linecolor=Orange, method=varrkiv, varsteptol=.001, plotpoints=2]{0}{10}{1}{\Funct}}
  \rput(0,.2){\psplotDiffEqn[linecolor=red, method=varrkiv, varsteptol=.0001, plotpoints=2]{0}{10}{1}{\Funct}}
  \psset{linewidth=4\pslinewidth,showpoints=false}
  \rput*(3.3,.9){\psline[linecolor=magenta](-.75cm,0)}
  \rput*[l](3.3,.9){\small RK ordre 4 : $\varepsilon<10^{-1}$}
  \rput*(3.3,.8){\psline[linecolor=blue](-.75cm,0)}
  \rput*[l](3.3,.8){\small RK ordre 4 : $\varepsilon<10^{-2}$}
  \rput*(3.3,.7){\psline[linecolor=Orange](-.75cm,0)}
  \rput*[l](3.3,.7){\small RK ordre 4 : $\varepsilon<10^{-3}$}
  \rput*(3.3,.6){\psline[linecolor=red](-.75cm,0)}
  \rput*[l](3.3,.6){\small RK ordre 4 : $\varepsilon<10^{-4}$}
  \rput*(3.3,.5){\psline[linecolor=green](-.75cm,0)}
  \rput*[l](3.3,.5){\small solution exacte}
\end{pspicture}
{\captionof{figure}{Equation $y'=-y$ with $y_0=1$.}\label{fig:minusexpvarstep}}
\egroup
\end{center}


\begin{lstlisting}[wide=true]
\def\Funct{neg}\def\FunctAlg{-y[0]}
\psset{xunit=1.5, yunit=8, showpoints=true}
\begin{pspicture}[showgrid=true](0,0)(10,1.2)
  \psplot[linewidth=6\pslinewidth, linecolor=green, showpoints=false]{0}{10}{2.71828182846 x neg exp}
  \psplotDiffEqn[linecolor=magenta, method=varrkiv, varsteptol=.1, plotpoints=2]{0}{10}{1}{\Funct}
  \rput(0,.0){\psplotDiffEqn[linecolor=blue, method=varrkiv, varsteptol=.01, plotpoints=2]{0}{10}{1}{\Funct}}
  \rput(0,.1){\psplotDiffEqn[linecolor=Orange, method=varrkiv, varsteptol=.001, plotpoints=2]{0}{10}{1}{\Funct}}
  \rput(0,.2){\psplotDiffEqn[linecolor=red, method=varrkiv, varsteptol=.0001, plotpoints=2]{0}{10}{1}{\Funct}}
  \psset{linewidth=4\pslinewidth,showpoints=false}
  \rput*(3.3,.9){\psline[linecolor=magenta](-.75cm,0)}
  \rput*[l](3.3,.9){\small RK ordre 4 : $\varepsilon<10^{-1}$}
  \rput*(3.3,.8){\psline[linecolor=blue](-.75cm,0)}
  \rput*[l](3.3,.8){\small RK ordre 4 : $\varepsilon<10^{-2}$}
  \rput*(3.3,.7){\psline[linecolor=Orange](-.75cm,0)}
  \rput*[l](3.3,.7){\small RK ordre 4 : $\varepsilon<10^{-3}$}
  \rput*(3.3,.6){\psline[linecolor=red](-.75cm,0)}
  \rput*[l](3.3,.6){\small RK ordre 4 : $\varepsilon<10^{-4}$}
  \rput*(3.3,.5){\psline[linecolor=green](-.75cm,0)}
  \rput*[l](3.3,.5){\small solution exacte}
\end{pspicture}
\end{lstlisting}



\begin{center}
\bgroup
\def\Funct{exch neg}
\psset{xunit=1.5, yunit=5, method=varrkiv, showpoints=true}%%
\def\quatrepi{12.5663706144}
\begin{pspicture}(0,-1)(10,1.3)
  \psaxes{->}(0,0)(0,-1)(10,1.3)
  \psplot[linewidth=4\pslinewidth, linecolor=green, algebraic=true]{0}{10}{cos(x)}
  \rput(0,.0){\psplotDiffEqn[linecolor=magenta, plotpoints=7, varsteptol=.1]{0}{10}{1 0}{\Funct}}
  \rput(0,.0){\psplotDiffEqn[linecolor=blue, plotpoints=201, varsteptol=.01]{0}{10}{1 0}{\Funct}}
  \rput(0,.1){\psplotDiffEqn[linewidth=2\pslinewidth, linecolor=red, varsteptol=.001]{0}{10}{1 0}{\Funct}}
  \rput(0,.2){\psplotDiffEqn[linecolor=black, varsteptol=.0001]{0}{10}{1 0}{\Funct}}
  \rput(0,.3){\psplotDiffEqn[linecolor=Orange, varsteptol=.00001]{0}{10}{1 0}{\Funct}}
  \psset{linewidth=4\pslinewidth,showpoints=false}
  \rput*(2.3,.9){\psline[linecolor=magenta](-.75cm,0)}
  \rput*[l](2.3,.9){\small $\varepsilon<10^{-1}$}
  \rput*(2.3,.8){\psline[linecolor=blue](-.75cm,0)}
  \rput*[l](2.3,.8){\small $\varepsilon<10^{-2}$}
  \rput*(2.3,.7){\psline[linecolor=red](-.75cm,0)}
  \rput*[l](2.3,.7){\small $\varepsilon<10^{-3}$}
  \rput*(2.3,.6){\psline[linecolor=black](-.75cm,0)}
  \rput*[l](2.3,.6){\small $\varepsilon<10^{-4}$}
  \rput*(2.3,.5){\psline[linecolor=Orange](-.75cm,0)}
  \rput*[l](2.3,.5){\small $\varepsilon<10^{-5}$}
  \rput*(2.3,.4){\psline[linecolor=green](-.75cm,0)}
  \rput*[l](2.3,.4){\small solution exacte}
\end{pspicture}
{\captionof{figure}{Equation $y''=-y$}\label{fig:trigfunc}}
\egroup
\end{center}

\begin{lstlisting}[wide=true]
\def\Funct{exch neg}
\psset{xunit=1.5, yunit=5, method=varrkiv, showpoints=true}%%
\def\quatrepi{12.5663706144}
\begin{pspicture}(0,-1)(10,1.3)
  \psaxes{->}(0,0)(0,-1)(10,1.3)
  \psplot[linewidth=4\pslinewidth, linecolor=green, algebraic=true]{0}{10}{cos(x)}
  \rput(0,.0){\psplotDiffEqn[linecolor=magenta, plotpoints=7, varsteptol=.1]{0}{10}{1 0}{\Funct}}
  \rput(0,.0){\psplotDiffEqn[linecolor=blue, plotpoints=201, varsteptol=.01]{0}{10}{1 0}{\Funct}}
  \rput(0,.1){\psplotDiffEqn[linewidth=2\pslinewidth, linecolor=red, varsteptol=.001]{0}{10}{1 0}{\Funct}}
  \rput(0,.2){\psplotDiffEqn[linecolor=black, varsteptol=.0001]{0}{10}{1 0}{\Funct}}
  \rput(0,.3){\psplotDiffEqn[linecolor=Orange, varsteptol=.00001]{0}{10}{1 0}{\Funct}}
  \psset{linewidth=4\pslinewidth,showpoints=false}
  \rput*(2.3,.9){\psline[linecolor=magenta](-.75cm,0)}
  \rput*[l](2.3,.9){\small $\varepsilon<10^{-1}$}
  \rput*(2.3,.8){\psline[linecolor=blue](-.75cm,0)}
  \rput*[l](2.3,.8){\small $\varepsilon<10^{-2}$}
  \rput*(2.3,.7){\psline[linecolor=red](-.75cm,0)}
  \rput*[l](2.3,.7){\small $\varepsilon<10^{-3}$}
  \rput*(2.3,.6){\psline[linecolor=black](-.75cm,0)}
  \rput*[l](2.3,.6){\small $\varepsilon<10^{-4}$}
  \rput*(2.3,.5){\psline[linecolor=Orange](-.75cm,0)}
  \rput*[l](2.3,.5){\small $\varepsilon<10^{-5}$}
  \rput*(2.3,.4){\psline[linecolor=green](-.75cm,0)}
  \rput*[l](2.3,.4){\small solution exacte}
\end{pspicture}
\end{lstlisting}




\begin{center}
\bgroup
\def\Funct{exch}
\psset{xunit=4, yunit=1, method=varrkiv, showpoints=true}%%
\def\quatrepi{12.5663706144}
\begin{pspicture}(0,-0.5)(3,11)
  \psaxes{->}(0,0)(3,11)
  \psplot[linewidth=4\pslinewidth, linecolor=green, algebraic=true]{0}{3}{ch(x)}
  \rput(0,.0){\psplotDiffEqn[linecolor=magenta, varsteptol=.1]{0}{3}{1 0}{\Funct}}
  \rput(0,.3){\psplotDiffEqn[linecolor=blue, varsteptol=.01]{0}{3}{1 0}{\Funct}}
  \rput(0,.6){\psplotDiffEqn[linecolor=red, varsteptol=.001]{0}{3}{1 0}{\Funct}}
  \rput(0,.9){\psplotDiffEqn[linecolor=black, varsteptol=.0001]{0}{3}{1 0}{\Funct}}
  \rput(0,1.2){\psplotDiffEqn[linecolor=Orange, varsteptol=.00001]{0}{3}{1 0}{\Funct}}
  \psset{linewidth=4\pslinewidth,showpoints=false}
  \rput*(2.3,.9){\psline[linecolor=magenta](-.75cm,0)}
  \rput*[l](2.3,.9){\small $\varepsilon<10^{-1}$}
  \rput*(2.3,.8){\psline[linecolor=blue](-.75cm,0)}
  \rput*[l](2.3,.8){\small $\varepsilon<10^{-2}$}
  \rput*(2.3,.7){\psline[linecolor=red](-.75cm,0)}
  \rput*[l](2.3,.7){\small $\varepsilon<10^{-3}$}
  \rput*(2.3,.6){\psline[linecolor=black](-.75cm,0)}
  \rput*[l](2.3,.6){\small $\varepsilon<10^{-4}$}
  \rput*(2.3,.5){\psline[linecolor=Orange](-.75cm,0)}
  \rput*[l](2.3,.5){\small $\varepsilon<10^{-5}$}
  \rput*(2.3,.4){\psline[linecolor=green](-.75cm,0)}
  \rput*[l](2.3,.4){\small solution exacte}
\end{pspicture}
\captionof{figure}{Equation $y''=y$}
\egroup
\end{center}

\begin{lstlisting}[wide=true]
\def\Funct{exch}
\psset{xunit=4, yunit=1, method=varrkiv, showpoints=true}%%
\def\quatrepi{12.5663706144}
\begin{pspicture}(0,-0.5)(3,11)
  \psaxes{->}(0,0)(3,11)
  \psplot[linewidth=4\pslinewidth, linecolor=green, algebraic=true]{0}{3}{ch(x)}
  \rput(0,.0){\psplotDiffEqn[linecolor=magenta, varsteptol=.1]{0}{3}{1 0}{\Funct}}
  \rput(0,.3){\psplotDiffEqn[linecolor=blue, varsteptol=.01]{0}{3}{1 0}{\Funct}}
  \rput(0,.6){\psplotDiffEqn[linecolor=red, varsteptol=.001]{0}{3}{1 0}{\Funct}}
  \rput(0,.9){\psplotDiffEqn[linecolor=black, varsteptol=.0001]{0}{3}{1 0}{\Funct}}
  \rput(0,1.2){\psplotDiffEqn[linecolor=Orange, varsteptol=.00001]{0}{3}{1 0}{\Funct}}
  \psset{linewidth=4\pslinewidth,showpoints=false}
  \rput*(2.3,.9){\psline[linecolor=magenta](-.75cm,0)}
  \rput*[l](2.3,.9){\small $\varepsilon<10^{-1}$}
  \rput*(2.3,.8){\psline[linecolor=blue](-.75cm,0)}
  \rput*[l](2.3,.8){\small $\varepsilon<10^{-2}$}
  \rput*(2.3,.7){\psline[linecolor=red](-.75cm,0)}
  \rput*[l](2.3,.7){\small $\varepsilon<10^{-3}$}
  \rput*(2.3,.6){\psline[linecolor=black](-.75cm,0)}
  \rput*[l](2.3,.6){\small $\varepsilon<10^{-4}$}
  \rput*(2.3,.5){\psline[linecolor=Orange](-.75cm,0)}
  \rput*[l](2.3,.5){\small $\varepsilon<10^{-5}$}
  \rput*(2.3,.4){\psline[linecolor=green](-.75cm,0)}
  \rput*[l](2.3,.4){\small solution exacte}
\end{pspicture}
\end{lstlisting}





\subsection{Equation of second order}

Here is the traditionnal simulation of two stars attracting each other according to
the classical gravitation law in $\displaystyle\frac{1}{r^2}$. In 2-Dimensions, the system to be
solved is composed of four second order differential equations. In order to be
described, each of them gives two first order equations, then we obtain a 8 sized vectorial
equation. In the following example the masses of the stars are 1 and 20.

\[
\left\{
\begin{array}[m]{l}
  x''_1=\displaystyle\frac{M_2}{r^2}\cos(\theta)\\
  y''_1=\displaystyle\frac{M_2}{r^2}\sin(\theta)\\
  x''_2=\displaystyle\frac{M_1}{r^2}\cos(\theta)\\
  y''_2=\displaystyle\frac{M_1}{r^2}\sin(\theta)\\
\end{array}
\right.
\mbox{ avec }
\left\{
\begin{array}[m]{l}
  r^2=(x_1-x_2)^2+(y_1-y_2)^2\\
  \cos(\theta)=\displaystyle\frac{(x_1-x_2)}{r}\\
  \sin(\theta)=\displaystyle\frac{(y_1-y_2)}{r}\\
\end{array}
\right.
\mbox{%
\begin{pspicture}[shift=-2](5,4)\psset{arrowscale=2}
  \psframe[linewidth=.75\pslinewidth](5,4)
  \pstGeonode[PosAngle={-90,90}](1,1){M_1}(4,3){M_2}
  \pstHomO[HomCoef=.33, PointSymbol=none]{M_1}{M_2}[F_1]
  \psline[arrows=->](M_1)(F_1)
  \pstHomO[HomCoef=.33, PointSymbol=none]{M_2}{M_1}[F_2]
  \psline[arrows=->, arrowscale=2](M_2)(F_2)
  \pstGeonode[PointSymbol=none, PointName=none](M_2|M_1){A}
  \psline[linewidth=.5\pslinewidth](M_1)(A)
  \pstMarkAngle{A}{M_1}{M_2}{$\theta$}
  \ncline[linewidth=.5\pslinewidth, offset=.5, arrows=<->]{M_1}{M_2}
  \ncput*{$r$}
\end{pspicture}}
\]

\begin{table}[!htbp]
  \centering\small
    \begin{tabular}{|l@{}>{\ttfamily}l@{}>{ \ttfamily \%\% }l|}
      \hline
      && x1 y1 x'1 y'1 x2 y2 x'2 y'2\\
      &/yp2 exch def /xp2 exch def /ay2 exch def /ax2 exch def&mise en variables\\
      &/yp1 exch def /xp1 exch def /ay1 exch def /ax1 exch def&mise en variables\\
      &/ro2 ax2 ax1 sub dup mul ay2 ay1 sub dup mul add def&calcul de r*r\\
      &xp1 yp1&\\
      &ax2 ax1 sub ro2 sqrt div ro2 div&calcul de x''1\\
      &ay2 ay1 sub ro2 sqrt div ro2 div&calcul de y''1\\
      &xp2 yp2&\\
      &3 index -20 mul&calcul de x''2=-20x''1\\
      &3 index -20 mul&calcul de y''2=-20y''1\\
      \hline
    \end{tabular}
    \caption{\PostScript source code for the gravitational interaction}\label{intgravcode}
\end{table}

\begin{table}[!htbp]
  \centering
    \small\newcommand{\POW}{\symbol{'136}}
    \begin{tabular}{|l@{}>{\ttfamily}l@{}>{ \ttfamily \%\% }l|}
      \hline
      &y[2]|&y'[0]\\
      &y[3]|&y'[1]\\
      &(y[4]-y[0])/((y[4]-y[0])\POW 2+(y[5]-y[1])\POW 2)\POW 1.5|&y'[2]=y''[0]\\
      &(y[5]-y[1])/((y[4]-y[0])\POW 2+(y[5]-y[1])\POW 2)\POW 1.5|&y'[3]=y''[1]\\
      &y[6]|&y'[4]\\
      &y[7]|&y'[5]\\
      &20*(y[0]-y[4])/((y[4]-y[0])\POW 2+(y[5]-y[1])\POW 2)\POW 1.5|&y'[6]=y''[4]\\
      &20*(y[1]-y[5])/((y[4]-y[0])\POW 2+(y[5]-y[1])\POW 2)\POW 1.5&y'[7]=y''[5]\\
      \hline
    \end{tabular}
    \caption{Algebraic description for the gravitational interaction}\label{intgravalgcode}
\end{table}

\newcommand\Grav{%
  /yp2 exch def /xp2 exch def /ay2 exch def /ax2 exch def
  /yp1 exch def /xp1 exch def /ay1 exch def /ax1 exch def
  /ro2 ax2 ax1 sub dup mul ay2 ay1 sub dup mul add def
  xp1 yp1
  ax2 ax1 sub ro2 sqrt div ro2 div
  ay2 ay1 sub ro2 sqrt div ro2 div
  xp2 yp2
  3 index -20 mul
  3 index -20 mul}
\newcommand\GravAlg{%
  y[2]|y[3]|%
  (y[4]-y[0])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5|%
  (y[5]-y[1])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5|%
  y[6]|y[7]|%
  20*(y[0]-y[4])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5|%
  20*(y[1]-y[5])/((y[4]-y[0])^2+(y[5]-y[1])^2)^1.5}
%%  0  1   2   3  4  5   6   7
%% x1 y1 x'1 y'1 x2 y2 x'2 y'2


\begin{LTXexample}[width=5cm,wide]
\def\InitCond{ 1  1  .1  0 -1 -1  -2   0}
\begin{pspicture}[shift=-2,showgrid=true](-3,-1.75)(2,1.5)
  \psplotDiffEqn[whichabs=0, whichord=1, linecolor=blue, method=rk4, plotpoints=100]{0}{3.95}{\InitCond}{\Grav}
  \psset{showpoints=true,whichabs=4, whichord=5}
  \psplotDiffEqn[linecolor=black, method=varrkiv, varsteptol=.0001, plotpoints=200]{0}{3.9}{\InitCond}{\Grav}
\end{pspicture}
\end{LTXexample}
\vspace{-2ex}
{\captionof{figure}{Gravitational interaction: fixed landmark, trajectory of the stars}\label{fig:InterGravRepFix}}



\bigskip
\begin{LTXexample}[width=5cm,wide]
\def\InitCond{ 1  1  .1  0 -1 -1  -2   0}
\begin{pspicture}[shift=-1.5,showgrid=true](-4,-1.75)(1,1)
  \psplotDiffEqn[linecolor=red, plotpoints=200,method=varrkiv, varsteptol=.0001, showpoints=true,
      plotfuncx=y dup 4 get exch 0 get sub,
      plotfuncy=dup 5 get exch 1 get sub ]{0}{3.9}{\InitCond}{\Grav}
\end{pspicture}
\end{LTXexample}
\vspace{-2ex}
{\captionof{figure}{Gravitational interaction : landmark defined by one star}\label{fig:IGnewrep}}


\begin{center}
\bgroup
\def\InitCond{ 1  1  .1   0 -1 -1  -2   0}
\psset{xunit=2}
\begin{pspicture}[showgrid=true](0,0)(8,9)
  \psset{showpoints=true}
  \psplotDiffEqn[linecolor=red, method=varrkiv, plotpoints=2, varsteptol=.0001,
      plotfuncy=dup 6 get dup mul exch 7 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
  \psplotDiffEqn[linecolor=blue, method=varrkiv, plotpoints=2, varsteptol=.0001,
      plotfuncy=dup 2 get dup mul exch 3 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
\end{pspicture}
\captionof{figure}{Gravitational interaction : vitessesspeed of the stars}
\egroup
\end{center}

\begin{lstlisting}
\psset{xunit=2}
\begin{pspicture}[showgrid=true](0,0)(8,9)
  \psset{showpoints=true}
  \psplotDiffEqn[linecolor=red, method=varrkiv, plotpoints=2, varsteptol=.0001,
      plotfuncy=dup 6 get dup mul exch 7 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
  \psplotDiffEqn[linecolor=blue, method=varrkiv, plotpoints=2, varsteptol=.0001,
      plotfuncy=dup 2 get dup mul exch 3 get dup mul add sqrt]{0}{8}{\InitCond}{\Grav}
\end{pspicture}
\end{lstlisting}

%--------------------------------------------------------------------------------------
\subsubsection{Simple equation of first order $y'=y$}
%--------------------------------------------------------------------------------------

For the initial value $y(0)=1$ we have the solution $y(x)=e^x$. $y$ is always
on the stack, so we have to do nothing. Using the \verb+algebraic+ option, we write it
as \verb$y[0]$. The following example shows different solutions depending to the number of plotpoints
with $y_0=1$:


\begin{center}
\bgroup
\psset{xunit=4, yunit=.4}
\begin{pspicture}(3,19)\psgrid[subgriddiv=1]
  \psplot[linewidth=6\pslinewidth, linecolor=green]{0}{3}{Euler x exp}
  \psplotDiffEqn[linecolor=magenta,plotpoints=16,algebraic=true]{0}{3}{1}{y[0]}
  \psplotDiffEqn[linecolor=blue,plotpoints=151]{0}{3}{1}{}
  \psplotDiffEqn[linecolor=red,method=rk4,plotpoints=15]{0}{3}{1}{}
  \psplotDiffEqn[linecolor=Orange,method=rk4,plotpoints=4]{0}{3}{1}{}
  \psset{linewidth=4\pslinewidth}
  \rput*(0.35,19){\psline[linecolor=magenta](-.75cm,0)}
  \rput*[l](0.35,19){\small Euler order 1 $h=0{,}2$}
  \rput*(0.35,17){\psline[linecolor=blue](-.75cm,0)}
  \rput*[l](0.35,17){\small Euler order 1 $h=0{,}02$}
  \rput*(0.35,15){\psline[linecolor=Orange](-.75cm,0)}
  \rput*[l](0.35,15){\small RK ordre 4 $h=1$}
  \rput*(0.35,13){\psline[linecolor=red](-.75cm,0)}
  \rput*[l](0.35,13){\small RK ordre 4 $h=0{,}2$}
  \rput*(0.35,11){\psline[linecolor=green](-.75cm,0)}
  \rput*[l](0.35,11){\small solution exacte}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{xunit=4, yunit=.4}
\begin{pspicture}(3,19)\psgrid[subgriddiv=1]
  \psplot[linewidth=6\pslinewidth, linecolor=green]{0}{3}{Euler x exp}
  \psplotDiffEqn[linecolor=magenta,plotpoints=16,algebraic=true]{0}{3}{1}{y[0]}
  \psplotDiffEqn[linecolor=blue,plotpoints=151]{0}{3}{1}{}
  \psplotDiffEqn[linecolor=red,method=rk4,plotpoints=15]{0}{3}{1}{}
  \psplotDiffEqn[linecolor=Orange,method=rk4,plotpoints=4]{0}{3}{1}{}
  \psset{linewidth=4\pslinewidth}
  \rput*(0.35,19){\psline[linecolor=magenta](-.75cm,0)}
  \rput*[l](0.35,19){\small Euler order 1 $h=0{,}2$}
  \rput*(0.35,17){\psline[linecolor=blue](-.75cm,0)}
  \rput*[l](0.35,17){\small Euler order 1 $h=0{,}02$}
  \rput*(0.35,15){\psline[linecolor=Orange](-.75cm,0)}
  \rput*[l](0.35,15){\small RK ordre 4 $h=1$}
  \rput*(0.35,13){\psline[linecolor=red](-.75cm,0)}
  \rput*[l](0.35,13){\small RK ordre 4 $h=0{,}2$}
  \rput*(0.35,11){\psline[linecolor=green](-.75cm,0)}
  \rput*[l](0.35,11){\small solution exacte}
\end{pspicture}
\end{lstlisting}

%--------------------------------------------------------------------------------------
\subsubsection{$y'=\displaystyle\frac{2-ty}{4-t^2}$}% $
%--------------------------------------------------------------------------------------

For the initial value $y(0)=1$ the exact solution is $y(x)=\displaystyle\frac{t+\sqrt{4-t^2}}{2}$.
The function $f$ described in PostScript code is like (y ist still on the stack):
\begin{lstlisting}[style=syntax]
x              %% y x
mul            %% x*y
2 exch sub     %% 2-x*y
4 x dup mul    %% 2-x*y 4 x^2
sub            %% 2-x*y 4-x^2
div            %% (2-x*y)/(4-x^2)
\end{lstlisting}
\noindent
The following example uses $y_0=1$.

\begin{lstlisting}[style=syntax]
\newcommand{\InitCond}{1}
\newcommand{\Func}{x mul 2 exch sub 4 x dup mul sub div}
\newcommand{\FuncAlg}{(2-x*y[0])/(4-x^2)}
\end{lstlisting}

\begin{center}
\bgroup
\psset{xunit=6.4, yunit=9.6, showpoints=false}
\begin{pspicture}(0,1)(2,1.5)  \psgrid[griddots=10](0,1)(2,1.5)
  { \psset{linewidth=4\pslinewidth,linecolor=lightgray}
  \psplot{0}{1.8}{x dup dup mul 4 exch sub sqrt add 2 div}
  \psplot{1.8}{2}{x dup dup mul 4 exch sub sqrt add 2 div} }
  \def\InitCond{1}
  \def\Func{x mul 2 exch sub 4 x dup mul sub div}
  \psplotDiffEqn[linecolor=magenta, plotpoints=20]{0}{1.9}{\InitCond}{\Func}
  \psplotDiffEqn[linecolor=blue, plotpoints=191]{0}{1.9}{\InitCond}{\Func}
  \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=11,%
     algebraic=true]{0}{1.9}{\InitCond}{(2-x*y[0])/(4-x^2)}
  \psplotDiffEqn[linecolor=Orange, method=rk4, plotpoints=21,%
     algebraic=true]{0}{1.9}{\InitCond}{(2-x*y[0])/(4-x^2)}
  \psset{linewidth=4\pslinewidth}\small
  \rput*(0,1.4){\psline[linecolor=magenta](-.75cm,0)}\rput*[l](0,1.4){Euler order 1 $h=0{,}1$}
  \rput*(0,1.35){\psline[linecolor=blue](-.75cm,0)}\rput*[l](0,1.35){Euler order 1 $h=0{,}01$}
  \rput*(0,1.3){\psline[linecolor=Orange](-.75cm,0)}\rput*[l](0,1.3){RK order 4 $h=0{,}19$}
  \rput*(0,1.25){\psline[linecolor=red](-.75cm,0)}\rput*[l](0,1.25){RK order 4 $h=0{,}095$}
  \rput*(0,1.2){\psline[linecolor=lightgray](-.75cm,0)}\rput*[l](0,1.2){exactly}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}[xrightmargin=-1cm,xleftmargin=-1cm]
\psset{xunit=6.4, yunit=9.6, showpoints=false}
\begin{pspicture}(0,1)(2,1.7)  \psgrid[subgriddiv=5]
  { \psset{linewidth=4\pslinewidth,linecolor=lightgray}
  \psplot{0}{1.8}{x dup dup mul 4 exch sub sqrt add 2 div}
  \psplot{1.8}{2}{x dup dup mul 4 exch sub sqrt add 2 div} }
  \def\InitCond{1}
  \def\Func{x mul 2 exch sub 4 x dup mul sub div}
  \psplotDiffEqn[linecolor=magenta, plotpoints=20]{0}{1.9}{\InitCond}{\Func}
  \psplotDiffEqn[linecolor=blue, plotpoints=191]{0}{1.9}{\InitCond}{\Func}
  \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=11,%
     algebraic=true]{0}{1.9}{\InitCond}{(2-x*y[0])/(4-x^2)}
  \psplotDiffEqn[linecolor=Orange, method=rk4, plotpoints=21,%
     algebraic=true]{0}{1.9}{\InitCond}{(2-x*y[0])/(4-x^2)}
  \psset{linewidth=4\pslinewidth}
  \rput*(0.3,1.6){\psline[linecolor=magenta](-.75cm,0)}\rput*[l](0.3,1.6){\small Euler order 1 $h=0{,}1$}
  \rput*(0.3,1.55){\psline[linecolor=blue](-.75cm,0)}\rput*[l](0.3,1.55){\small Euler order 1 $h=0{,}01$}
  \rput*(0.3,1.5){\psline[linecolor=Orange](-.75cm,0)}\rput*[l](0.3,1.5){\small RK order 4 $h=0{,}19$}
  \rput*(0.3,1.45){\psline[linecolor=red](-.75cm,0)}\rput*[l](0.3,1.45){\small RK order 4 $h=0{,}095$}
  \rput*(0.3,1.4){\psline[linecolor=lightgray](-.75cm,0)}\rput*[l](0.3,1.4){\small exactly}
\end{pspicture}
\end{lstlisting}


%--------------------------------------------------------------------------------------
\subsubsection{$y'=-2xy$}
%--------------------------------------------------------------------------------------

For $y(-1)=\frac{1}{e}$ we get $y(x)=e^{-x^2}$.

\begin{center}
\bgroup
\psset{unit=4}
\begin{pspicture}(-1,0)(3,1.1)\psgrid
  \psplot[linewidth=4\pslinewidth,linecolor=gray]{-1}{3}{Euler x dup mul neg exp}
  \psset{plotpoints=9}
  \psplotDiffEqn[linecolor=cyan]{-1}{3}{1 Euler div}{x -2 mul mul}
  \psplotDiffEqn[linecolor=yellow, method=rk4]{-1}{3}{1 Euler div}{x -2 mul mul}
  \psset{plotpoints=21}
  \psplotDiffEqn[linecolor=blue]{-1}{3}{1 Euler div}{x -2 mul mul}
  \psplotDiffEqn[linecolor=Orange, method=rk4]{-1}{3}{1 Euler div}{x -2 mul mul}
  \psset{linewidth=2\pslinewidth}
  \rput*(2,1){\psline[linecolor=Orange](-0.25,0)}
  \rput*[l](2,1){RK}
  \rput*(2,.9){\psline[linecolor=blue](-0.25,0)}
  \rput*[l](2,.9){\textsc{Euler}-1}
  \rput*(2,.8){\psline[linecolor=gray](-0.25,0)}
  \rput*[l](2,.8){solution}
\end{pspicture}
\egroup
\end{center}


\begin{lstlisting}
\psset{unit=4}
\begin{pspicture}(-1,0)(3,1.1)\psgrid
  \psplot[linewidth=4\pslinewidth,linecolor=gray]{-1}{3}{Euler x dup mul neg exp}
  \psset{plotpoints=9}
  \psplotDiffEqn[linecolor=cyan]{-1}{3}{1 Euler div}{x -2 mul mul}
  \psplotDiffEqn[linecolor=yellow, method=rk4]{-1}{3}{1 Euler div}{x -2 mul mul}
  \psset{plotpoints=21}
  \psplotDiffEqn[linecolor=blue]{-1}{3}{1 Euler div}{x -2 mul mul}
  \psplotDiffEqn[linecolor=Orange, method=rk4]{-1}{3}{1 Euler div}{x -2 mul mul}
  \psset{linewidth=2\pslinewidth}
  \rput*(2,1){\psline[linecolor=Orange](-0.25,0)}
  \rput*[l](2,1){RK}
  \rput*(2,.9){\psline[linecolor=blue](-0.25,0)}
  \rput*[l](2,.9){\textsc{Euler}-1}
  \rput*(2,.8){\psline[linecolor=gray](-0.25,0)}
  \rput*[l](2,.8){solution}
\end{pspicture}
\end{lstlisting}


%--------------------------------------------------------------------------------------
\subsubsection{Spirale of Cornu}
%--------------------------------------------------------------------------------------

The integrals of Fresnel :
\begin{align} x & =\int^t_0\cos\frac{\pi t^2}{2}\mathrm{d}t \\
 y & =\int^t_0\sin\frac{\pi t^2}{2}\mathrm{d}t \\
\intertext{with}
 \dot{x} &= \cos\frac{\pi t^2}{2} \\
 \dot{y} & =\sin\frac{\pi t^2}{2} 
 \end{align}

\begin{lstlisting}
\psset{unit=8}
\begin{pspicture}(1,1)\psgrid[subgriddiv=5]
  \psplotDiffEqn[whichabs=0,whichord=1,linecolor=red,method=rk4,algebraic,%
     plotpoints=500,showpoints=true]{0}{10}{0 0}{cos(Pi*x^2/2)|sin(Pi*x^2/2)}
\end{pspicture}
\end{lstlisting}


\begin{center}
\bgroup
\psset{unit=8}
\begin{pspicture}(1,1)\psgrid[subgriddiv=5]
  \psplotDiffEqn[whichabs=0,whichord=1,linecolor=red,method=rk4,algebraic,%
     plotpoints=500,showpoints=true]{0}{10}{0 0}{cos(Pi*x^2/2)|sin(Pi*x^2/2)}
\end{pspicture}
\egroup
\end{center}



%--------------------------------------------------------------------------------------
\subsubsection{Lotka-Volterra}
%--------------------------------------------------------------------------------------

The Lotka-Volterra model describes interactions between two species in an ecosystem, a predator and a prey. This represents our first multi-species model. Since we are considering two species, the model will involve two equations, one which describes how the prey population changes and the second which describes how the predator population changes.

For concreteness let us assume that the prey in our model are rabbits, and that the predators are foxes. If we let $R(t)$ and $F(t)$ represent the number of rabbits and foxes, respectively, that are alive at time t, then the Lotka-Volterra model is:

\begin{align}
\dot R &= a\cdot R - b\cdot R\cdot F\\
\dot F &= e\cdot b\cdot R\cdot F - c\cdot F
\end{align}

where the parameters are defined by:
\begin{description}
\item[a] is the natural growth rate of rabbits in the absence of predation,
\item[c] is the natural death rate of foxes in the absence of food (rabbits),
\item[b] is the death rate per encounter of rabbits due to predation,
\item[e] is the efficiency of turning predated rabbits into foxes. 
\end{description}

The Stella model representing the Lotka-Volterra model will be slightly more complex than the single species models we've dealt with before. The main difference is that our model will have two stocks (reservoirs), one for each species. Each species will have its own birth and death rates. In addition, the Lotka-Volterra model involves four parameters rather than two. All told, the Stella representation of the Lotka-Volterra model will use two stocks, four flows, four converters and many connectors.

\bgroup
\def\InitCond{ 0 10 10}%% xa ya xl
\def\Faiglelapin{\Vaigle*(y[2]-y[0])/sqrt(y[1]^2+(y[2]-y[0])^2)|%
                 -\Vaigle*y[1]/sqrt(y[1]^2+(y[2]-y[0])^2)|%
                 -\Vlapin}
\def\Vlapin{1}  \def\Vaigle{1.6}  
\psset{unit=.7,subgriddiv=0,gridcolor=lightgray,method=adams,algebraic,%
   plotpoints=20,showpoints=true}
\begin{pspicture}(-3,-8.25)(8,10)\psgrid[griddots=10]
 \psplotDiffEqn[plotfuncy=pop 0,whichabs=2,linecolor=red]{0}{10}{\InitCond}{\Faiglelapin}
 \psplotDiffEqn[whichabs=0,whichord=1,linecolor=black,method=rk4]{0}{10}{\InitCond}{\Faiglelapin}
  \psplotDiffEqn[whichabs=0,whichord=1,linecolor=blue]{0}{10}{\InitCond}{\Faiglelapin}
\end{pspicture}\hfill
\begin{pspicture}(0,-0.25)(10,14)\psgrid
 \psplotDiffEqn[plotfuncy=dup 1 get dup mul exch dup 0 get exch 2 get sub dup
    mul add sqrt,linecolor=red,method=rk4]{0}{10}{\InitCond}{\Faiglelapin}
 \psplotDiffEqn[plotfuncy=dup 1 get dup mul exch dup 0 get exch 2 get sub dup
    mul add sqrt,linecolor=blue]{0}{10}{\InitCond}{\Faiglelapin}
 \psplotDiffEqn[plotfuncy=pop Func aload pop pop dup mul exch dup mul add sqrt,
    linecolor=yellow]{0}{10}{\InitCond}{\Faiglelapin}
\end{pspicture}
\egroup
\begin{lstlisting}[label={fig:aiglelapin}]
\def\InitCond{ 0 10 10}%% xa ya xl
\def\Faiglelapin{\Vaigle*(y[2]-y[0])/sqrt(y[1]^2+(y[2]-y[0])^2)|%
                 -\Vaigle*y[1]/sqrt(y[1]^2+(y[2]-y[0])^2)|%
                 -\Vlapin}
\def\Vlapin{1}  \def\Vaigle{1.6}  
\psset{unit=.7,subgriddiv=0,gridcolor=lightgray,method=adams,algebraic,%
   plotpoints=20,showpoints=true}
\begin{pspicture}(-3,-8)(5,10)\psgrid[griddots=10]
 \psplotDiffEqn[plotfuncy=pop 0,whichabs=2,linecolor=red]{0}{10}{\InitCond}{\Faiglelapin}
 \psplotDiffEqn[whichabs=0,whichord=1,linecolor=black,method=rk4]{0}{10}{\InitCond}{\Faiglelapin}
  \psplotDiffEqn[whichabs=0,whichord=1,linecolor=blue]{0}{10}{\InitCond}{\Faiglelapin}
\end{pspicture}\hfill
\begin{pspicture}(10,12)\psgrid
 \psplotDiffEqn[plotfuncy=dup 1 get dup mul exch dup 0 get exch 2 get sub dup
    mul add sqrt,linecolor=red,method=rk4]{0}{10}{\InitCond}{\Faiglelapin}
 \psplotDiffEqn[plotfuncy=dup 1 get dup mul exch dup 0 get exch 2 get sub dup
    mul add sqrt,linecolor=blue]{0}{10}{\InitCond}{\Faiglelapin}
 \psplotDiffEqn[plotfuncy=pop Func aload pop pop dup mul exch dup mul add sqrt,
    linecolor=yellow]{0}{10}{\InitCond}{\Faiglelapin}
\end{pspicture}
\end{lstlisting}

%--------------------------------------------------------------------------------------
\subsubsection{$y''=y$}
%--------------------------------------------------------------------------------------

Beginning with the initial equation $\displaystyle y(x)=Ae^x+Be^{-x}$ we get the hyperbolic
trigonometrical functions.

\begin{center}
\bgroup
\def\Funct{exch}   \psset{xunit=5cm, yunit=0.75cm}
\begin{pspicture}(0,-0.25)(2,7)\psgrid[subgriddiv=1,griddots=10]
 \psplot[linewidth=4\pslinewidth, linecolor=green]{0}{2}{Euler x exp}  %%e^x
 \psplotDiffEqn[linecolor=magenta, plotpoints=11]{0}{2}{1 1}{\Funct}
 \psplotDiffEqn[linecolor=blue, plotpoints=101]{0}{2}{1 1}{\Funct}
 \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=11]{0}{2}{1 1}{\Funct}
 \psplot[linewidth=4\pslinewidth, linecolor=green]{0}{2}{Euler dup x exp  %%ch(x)
    exch x neg exp add 2 div}
 \psplotDiffEqn[linecolor=magenta, plotpoints=11]{0}{2}{1 0}{\Funct}
 \psplotDiffEqn[linecolor=blue, plotpoints=101]{0}{2}{1 0}{\Funct}
 \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=11]{0}{2}{1 0}{\Funct}
 \psplot[linewidth=4\pslinewidth, linecolor=green]{0}{2}{Euler dup x exp    
     exch x neg exp sub 2 div}  %%sh(x)
 \psplotDiffEqn[linecolor=magenta, plotpoints=11]{0}{2}{0 1}{\Funct}
 \psplotDiffEqn[linecolor=blue, plotpoints=101]{0}{2}{0 1}{\Funct}
 \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=11]{0}{2}{0 1}{\Funct}
 \rput*(1.3,.9){\psline[linecolor=magenta](-.75cm,0)}\rput*[l](1.3,.9){\small\textsc{Euler} ordre 1 $h=1$}
 \rput*(1.3,.8){\psline[linecolor=blue](-.75cm,0)}\rput*[l](1.3,.8){\small\textsc{Euler} ordre 1 $h=0{,}1$}
 \rput*(1.3,.7){\psline[linecolor=red](-.75cm,0)}\rput*[l](1.3,.7){\small RK ordre 4 $h=1$}
 \rput*(1.3,.6){\psline[linecolor=green](-.75cm,0)}\rput*[l](1.3,.6){\small solution exacte}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}[label={fig:minusexp}]
\def\Funct{exch}   \psset{xunit=5cm, yunit=0.75cm}
\begin{pspicture}(0,-0.25)(2,7)\psgrid[subgriddiv=1,griddots=10]
 \psplot[linewidth=4\pslinewidth, linecolor=green]{0}{2}{Euler x exp}  %%e^x
 \psplotDiffEqn[linecolor=magenta, plotpoints=11]{0}{2}{1 1}{\Funct}
 \psplotDiffEqn[linecolor=blue, plotpoints=101]{0}{2}{1 1}{\Funct}
 \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=11]{0}{2}{1 1}{\Funct}
 \psplot[linewidth=4\pslinewidth, linecolor=green]{0}{2}{Euler dup x exp  %%ch(x)
    exch x neg exp add 2 div}
 \psplotDiffEqn[linecolor=magenta, plotpoints=11]{0}{2}{1 0}{\Funct}
 \psplotDiffEqn[linecolor=blue, plotpoints=101]{0}{2}{1 0}{\Funct}
 \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=11]{0}{2}{1 0}{\Funct}
 \psplot[linewidth=4\pslinewidth, linecolor=green]{0}{2}{Euler dup x exp    
     exch x neg exp sub 2 div}  %%sh(x)
 \psplotDiffEqn[linecolor=magenta, plotpoints=11]{0}{2}{0 1}{\Funct}
 \psplotDiffEqn[linecolor=blue, plotpoints=101]{0}{2}{0 1}{\Funct}
 \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=11]{0}{2}{0 1}{\Funct}
 \rput*(1.3,.9){\psline[linecolor=magenta](-.75cm,0)}\rput*[l](1.3,.9){\small\textsc{Euler} ordre 1 $h=1$}
 \rput*(1.3,.8){\psline[linecolor=blue](-.75cm,0)}\rput*[l](1.3,.8){\small\textsc{Euler} ordre 1 $h=0{,}1$}
 \rput*(1.3,.7){\psline[linecolor=red](-.75cm,0)}\rput*[l](1.3,.7){\small RK ordre 4 $h=1$}
 \rput*(1.3,.6){\psline[linecolor=green](-.75cm,0)}\rput*[l](1.3,.6){\small solution exacte}
\end{pspicture}
\end{lstlisting}

%--------------------------------------------------------------------------------------
\subsubsection{$y''=-y$}
%--------------------------------------------------------------------------------------
\begin{center}
\bgroup
\def\Funct{exch neg}
\psset{xunit=1, yunit=4}
\def\quatrepi{12.5663706144}%%4pi=12.5663706144
\begin{pspicture}(0,-1.25)(\quatrepi,1.25)\psgrid[subgriddiv=1,griddots=10]
 \psplot[linewidth=4\pslinewidth,linecolor=green]{0}{\quatrepi}{x RadtoDeg cos}%%cos(x)
 \psplotDiffEqn[linecolor=blue, plotpoints=201]{0}{3.1415926}{1 0}{\Funct}
 \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=31]{0}{\quatrepi}{1 0}{\Funct}
 \psplot[linewidth=4\pslinewidth,linecolor=green]{0}{\quatrepi}{x RadtoDeg sin}  %%sin(x)
 \psplotDiffEqn[linecolor=blue,plotpoints=201]{0}{3.1415926}{0 1}{\Funct}
 \psplotDiffEqn[linecolor=red,method=rk4, plotpoints=31]{0}{\quatrepi}{0 1}{\Funct}
 \rput*(3.3,.9){\psline[linecolor=magenta](-.75cm,0)}\rput*[l](3.3,.9){\small Euler order 1 $h=1$}
 \rput*(3.3,.8){\psline[linecolor=blue](-.75cm,0)}\rput*[l](3.3,.8){\small Euler order 1 $h=0{,}1$}
 \rput*(3.3,.7){\psline[linecolor=red](-.75cm,0)}\rput*[l](3.3,.7){\small RK ordre 4 $h=1$}
 \rput*(3.3,.6){\psline[linecolor=green](-.75cm,0)}\rput*[l](3.3,.6){\small solution exacte}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}[label={fig:minusexp2}]
\def\Funct{exch neg}
\psset{xunit=1, yunit=4}
\def\quatrepi{12.5663706144}%%4pi=12.5663706144
\begin{pspicture}(0,-1.25)(\quatrepi,1.25)\psgrid[subgriddiv=1,griddots=10]
 \psplot[linewidth=4\pslinewidth,linecolor=green]{0}{\quatrepi}{x RadtoDeg cos}%%cos(x)
 \psplotDiffEqn[linecolor=blue, plotpoints=201]{0}{3.1415926}{1 0}{\Funct}
 \psplotDiffEqn[linecolor=red, method=rk4, plotpoints=31]{0}{\quatrepi}{1 0}{\Funct}
 \psplot[linewidth=4\pslinewidth,linecolor=green]{0}{\quatrepi}{x RadtoDeg sin}  %%sin(x)
 \psplotDiffEqn[linecolor=blue,plotpoints=201]{0}{3.1415926}{0 1}{\Funct}
 \psplotDiffEqn[linecolor=red,method=rk4, plotpoints=31]{0}{\quatrepi}{0 1}{\Funct}
 \rput*(3.3,.9){\psline[linecolor=magenta](-.75cm,0)}\rput*[l](3.3,.9){\small Euler order 1 $h=1$}
 \rput*(3.3,.8){\psline[linecolor=blue](-.75cm,0)}\rput*[l](3.3,.8){\small Euler order 1 $h=0{,}1$}
 \rput*(3.3,.7){\psline[linecolor=red](-.75cm,0)}\rput*[l](3.3,.7){\small RK ordre 4 $h=1$}
 \rput*(3.3,.6){\psline[linecolor=green](-.75cm,0)}\rput*[l](3.3,.6){\small solution exacte}
\end{pspicture}
\end{lstlisting}

%--------------------------------------------------------------------------------------
\subsubsection{The mechanical pendulum: $y''=-\frac{g}{l}\sin(y)$}% $
%--------------------------------------------------------------------------------------

Pour des faibles oscillations $\sin(y)\simeq y$:

\[ y(x)=y_0\cos\left(\sqrt{\frac{g}{l}}x\right) \]

The function $f$ is writen in PostScript code:

\begin{lstlisting}[style=syntax]
exch RadtoDeg sin -9.8 mul %% y' -gsin(y)
\end{lstlisting}

\begin{center}
\bgroup
\def\Func{y[1]|-9.8*sin(y[0])}
\psset{yunit=2,xunit=4,algebraic=true,linewidth=1.5pt}
\begin{pspicture}(0,-2.25)(3,2.25)\psgrid[subgriddiv=2,griddots=10]
  \psplot[linewidth=3\pslinewidth, linecolor=Orange]{0}{3}{.1*cos(sqrt(9.8)*x)}
  \psset{method=rk4,plotpoints=50,linecolor=blue}
  \psplotDiffEqn{0}{3}{.1 0}{\Func}
  \psplot[linewidth=3\pslinewidth,linecolor=Orange]{0}{3}{.25*cos(sqrt(9.8)*x)}
  \psplotDiffEqn{0}{3}{.25 0}{\Func}
  \psplotDiffEqn{0}{3}{.5 0}{\Func}
  \psplotDiffEqn{0}{3}{1 0}{\Func}
  \psplotDiffEqn[plotpoints=100]{0}{3}{Pi 2 div 0}{\Func}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}[label=fig:second]
\def\Func{y[1]|-9.8*sin(y[0])}
\psset{yunit=2,xunit=4,algebraic=true,linewidth=1.5pt}
\begin{pspicture}(0,-2.25)(3,2.25)\psgrid[subgriddiv=2,griddots=10]
  \psplot[linewidth=3\pslinewidth, linecolor=Orange]{0}{3}{.1*cos(sqrt(9.8)*x)}
  \psset{method=rk4,plotpoints=50,linecolor=blue}
  \psplotDiffEqn{0}{3}{.1 0}{\Func}
  \psplot[linewidth=3\pslinewidth,linecolor=Orange]{0}{3}{.25*cos(sqrt(9.8)*x)}
  \psplotDiffEqn{0}{3}{.25 0}{\Func}
  \psplotDiffEqn{0}{3}{.5 0}{\Func}
  \psplotDiffEqn{0}{3}{1 0}{\Func}
  \psplotDiffEqn[plotpoints=100]{0}{3}{Pi 2 div 0}{\Func}
\end{pspicture}
\end{lstlisting}

%--------------------------------------------------------------------------------------
\subsubsection{$y''=-\frac{y'}{4}-2y$}% $
%--------------------------------------------------------------------------------------

Pour $y_0=5$ et $y'_0=0$ la solution est :

\[ 
5e^{-\frac{x}{8}}\left(\cos\left(\omega x\right)+\frac{\sin(\omega x)}{8\omega}\right)
\mbox{ avec } \omega=\frac{\sqrt{127}}{8}
\]

\iffalse
La fonction $f$ est d�rite par le code PostScript suivant :

\begin{lstlisting}[style=syntax]
dup             %% y y' y'
3 1 roll        %% y' y y'
-4 div          %% y' y y'/-4
exch            %% y' y'/-4 y
2 mul           %% y' y'/-4 2y
sub             %% y' y'/-4-2y
\end{lstlisting}

\fi
\begin{center}
\bgroup
\psset{xunit=.6,yunit=0.8,plotpoints=500}
\begin{pspicture}(0,-4.25)(26,5.25)
  \psgrid[subgriddiv=0,gridcolor=lightgray,linewidth=1.5pt]
  \psplot[plotpoints=200,linewidth=4\pslinewidth,linecolor=gray]{0}{26}{%
     Euler x -8 div exp x 127 sqrt 8 div mul RadtoDeg dup cos 5 mul exch sin 127 sqrt div 5 mul add mul}
  \psplotDiffEqn[linecolor=red,linewidth=5\pslinewidth]{0}{26}{5 0}
     {dup 3 1 roll -4 div exch 2 mul sub}
  \psplotDiffEqn[linecolor=black,algebraic]{0}{26}{5 0} {y[1]|-y[1]/4-2*y[0]}
  \psset{method=rk4, plotpoints=50}
  \psplotDiffEqn[linecolor=blue,linewidth=5\pslinewidth]{0}{26}{5 0}{%
      dup 3 1 roll -4 div exch 2 mul sub}
  \psplotDiffEqn[linecolor=black,algebraic=true]{0}{26}{5 0}{y[1]|-y[1]/4-2*y[0]}
\end{pspicture}
\egroup
\end{center}

\begin{lstlisting}
\psset{xunit=.6,yunit=0.8,plotpoints=500}
\begin{pspicture}(0,-4.25)(26,5.25)
  \psgrid[subgriddiv=0,gridcolor=lightgray,linewidth=1.5pt]
  \psplot[plotpoints=200,linewidth=4\pslinewidth,linecolor=gray]{0}{26}{%
     Euler x -8 div exp x 127 sqrt 8 div mul RadtoDeg dup cos 5 mul exch sin 127 sqrt div 5 mul add mul}
  \psplotDiffEqn[linecolor=red,linewidth=5\pslinewidth]{0}{26}{5 0}
     {dup 3 1 roll -4 div exch 2 mul sub}
  \psplotDiffEqn[linecolor=black,algebraic]{0}{26}{5 0} {y[1]|-y[1]/4-2*y[0]}
  \psset{method=rk4, plotpoints=50}
  \psplotDiffEqn[linecolor=blue,linewidth=5\pslinewidth]{0}{26}{5 0}{%
      dup 3 1 roll -4 div exch 2 mul sub}
  \psplotDiffEqn[linecolor=black,algebraic=true]{0}{26}{5 0}{y[1]|-y[1]/4-2*y[0]}
\end{pspicture}
\end{lstlisting}

\iffalse

\newpage
%--------------------------------------------------------------------------------------
\subsubsection{Gravitation: two stars and more}
%--------------------------------------------------------------------------------------

\iffalse 
L'exemple le plus complexe dans l'�riture de $f$, mais aussi dans l'�uilibrage de
la simulation\footnote{n'h�itez pas �modifier des param�res, ajouter des astres,
  et vous verrez que le syst�e solaire est miraculeux : il est stable !}. $f$ est
g��ique : elle peut traiter un nombre d'astres quelconques chacun ayant sa propre
masse. Dans cette section on va en faire interagir quatre. Cela donne pour le moteur
d'affichage un syst�e de 16 �uations du premier ordre �r�oudre, et le r�ultat
est remarquable.

\fi
                x1 y1 x'1 y'1 x2 y2 x'2 y'2 x3 y3 x'3    y'3  x4   y4  x'4  y'4
  \def\InitCond{ 1  1   0   0 -1 -1  -2   2  3  3 2.86 -2.86 5.5 -3.5 -2.1 -2.1}
  \def\tMAX{10}
  \newcommand{\MunMdeux}{40}
  \newcommand{\MdeuxMtrois}{40}
  \psset{unit=1, showpoints=false, plotpoints=400}%%plotpoints=375}
  \newcommand{\Test}{
    %% masses des astres
    /Weigth [ 40 1 1 2 ] def
    /NbAstor Weigth length def
    /ABVect { 3 -1 roll exch sub 3 1 roll sub exch } def
    %% calculs des distances entre masses
    1 1 NbAstor 1 sub {
      dup /i exch def 1 add 1 NbAstor {
        /j exch def
        y i 1 sub 4 mul get y j 1 sub 4 mul get sub dup mul
        y i 1 sub 4 mul 1 add get y j 1 sub 4 mul 1 add get sub dup mul add
        } for
      } for
    NbAstor dup 1 sub mul 2 div cvi array astore /ro2 exch def
    %% calculs des forces
    1 1 NbAstor {
      /i exch def
      y i 1 sub 4 mul 4 getinterval aload pop 4 2 roll
      /xf 0 def /yf 0 def
      1 1 NbAstor {
        dup i eq
        { pop }
        { /j exch def
        2 copy y j 1 sub 4 mul 2 getinterval aload pop ABVect
        Weigth j 1 sub get
        ro2 i j 2 copy lt { exch } if dup
        dup 1 sub dup NbAstor mul 3 1 roll mul 2 div sub 3 1 roll sub add 1 sub
        cvi get dup sqrt mul div exch 1 index mul 3 1 roll mul exch
        yf add /yf exch def xf add /xf exch def } ifelse
        } for pop pop xf neg yf neg 
      } for
      NbAstor 4 mul array astore
    }

\begin{LTXexample}[pos=t,preset=\centering]
\begin{pspicture}(-9,-6.25)(6,6)
 \psgrid[subgriddiv=0,gridcolor=lightgray](-9,-6)(6,6)
 \psset{buildvector=true,method=rk4,linewidth=1.5pt}
 \psplotDiffEqn[whichabs=0,whichord=1,linecolor=blue]{0}{\tMAX}{\InitCond}{\Test}
 \psplotDiffEqn[whichabs=4,whichord=5,linecolor=red]{0}{\tMAX}{\InitCond}{\Test}
 \psplotDiffEqn[whichabs=4,whichord=5,linecolor=Orange,method=adams]{0}{\tMAX}{\InitCond}{\Test}
 \psplotDiffEqn[whichabs=8,whichord=9,linecolor=magenta]{0}{\tMAX}{\InitCond}{\Test}
 \psplotDiffEqn[whichabs=12,whichord=13,linecolor=green]{0}{\tMAX}{\InitCond}{\Test}
 \psplotDiffEqn[whichabs=12,whichord=13,linecolor=yellow,method=adams]{0}{\tMAX}{\InitCond}{\Test}
\end{pspicture}
\end{LTXexample}


\begin{LTXexample}[pos=t,preset=\centering]
\begin{pspicture}(-10,-7.25)(5,5)
  \psgrid[subgriddiv=0,gridcolor=lightgray](-10,-7)(5,5)
  \psset{buildvector=true,method=rk4,linewidth=1.5pt}
  \psplotDiffEqn[linecolor=red,plotfuncx=y dup 4 get exch 0 get sub ,
     plotfuncy=dup 5 get exch 1 get sub ]{0}{\tMAX}{\InitCond}{\Test}
  \psplotDiffEqn[linecolor=magenta,plotfuncx=y dup 8 get exch 0 get sub ,
     plotfuncy=dup 9 get exch 1 get sub ]{0}{\tMAX}{\InitCond}{\Test}
  \psplotDiffEqn[linecolor=green,plotfuncx=y dup 12 get exch 0 get sub ,
     plotfuncy=dup 13 get exch 1 get sub ]{0}{\tMAX}{\InitCond}{\Test}
\end{pspicture}
\end{LTXexample}

\fi


%--------------------------------------------------------------------------------------
\section{\CMD{psMatrixPlot}}
%--------------------------------------------------------------------------------------
\begin{filecontents}{matrix.dat}
/dotmatrix [ %
0  1  1  0  0  0  0  1	1  1
0  1  1	 0  1  1  1  0	1  0
1  0  1	 1  0  0  0  1	1  0
0  0  1	 0  0  0  0  0	1  1
1  1  1	 1  1  0  1  0	0  1
0  0  1	 1  0  1  0  1	1  1
1  0  0	 0  1  1  0  0	0  1
0  0  0	 1  1  1  0  1	1  0
1  1  0	 0  0  0  1  0	0  1
1  0  1	 0  0  1  1  1	0  0
] def 
\end{filecontents}


This macro allows to visualize a matrix. The datafile must be defined as a PostScript matrix
named \verb+/dotmatrix+:
\begin{lstlisting}[style=syntax]
/dotmatrix [ %  <------------ important line
0  1  1  0  0  0  0  1  1  1
0  1  1	 0  1  1  1  0  1  0
1  0  1	 1  0  0  0  1  1  0
0  0  1	 0  0  0  0  0  1  1
1  1  1	 1  1  0  1  0  0  1
0  0  1	 1  0  1  0  1  1  1
1  0  0	 0  1  1  0  0  0  1
0  0  0	 1  1  1  0  1  1  0
1  1  0	 0  0  0  1  0  0  1
1  0  1  0  0  1  1  1  0  0
] def        %  <------------ important line
\end{lstlisting}

Important is only the value 0, in this case there happens nothing and for all other
cases a dot is printed. The syntax of the macro is:
\begin{lstlisting}[style=syntax]
  \psMatrixPlot[options]{rows}{columns}{data file}
\end{lstlisting}

The matrix is scanned line by line from the the first one to the last. In general it
looks vice versa than the above listed matrix, the first row $0\,1\,1\,0\,0\,0\,0\,1\,1\,1$
is the first plotted line ($y=1$). With the option \verb+ChangeOrder=true+ it looks exactly like
the above view.

\bgroup
\begin{center}
%\begin{LTXexample}[pos=t,preset=\centering]
\begin{pspicture}(-0.5,-0.75)(11,11)
  \psaxes{->}(11,11)
  \psMatrixPlot[dotsize=1.1cm,dotstyle=square*,linecolor=magenta]%
    {10}{10}{matrix.dat}
  \psMatrixPlot[dotsize=.5cm,dotstyle=o,ChangeOrder]{10}{10}{matrix.dat}
\end{pspicture}
%\end{LTXexample}

\begin{lstlisting}
\begin{pspicture}(-0.5,-0.75)(11,11)
  \psaxes{->}(11,11)
  \psMatrixPlot[dotsize=1.1cm,dotstyle=square*,linecolor=magenta]%
    {10}{10}{matrix.dat}
  \psMatrixPlot[dotsize=.5cm,dotstyle=o,ChangeOrder]{10}{10}{matrix.dat}
\end{pspicture}
\end{lstlisting}

\begin{LTXexample}[pos=t,preset=\centering]
\begin{pspicture}(-0.5,-0.75)(11,11)
  \psaxes{->}(11,11)
  \psMatrixPlot[dotscale=3,dotstyle=*,linecolor=blue]{10}{8}{matrix.dat}
\end{pspicture}
\end{LTXexample}
\end{center}
\egroup

%--------------------------------------------------------------------------------------
\section{\CMD{psforeach}}
%--------------------------------------------------------------------------------------

The macro \CMD{psforeach} allows a loop with an individuell increment.

\begin{lstlisting}[style=syntax]
\psforeach{variable}{value list}{action}
\end{lstlisting}

\begin{LTXexample}
\begin{pspicture}[showgrid=true](5,5)
  \psforeach{\nA}{0, 1, 1.5, 3, 5}{%
    \psdot[dotscale=3](\nA,\nA)}
\end{pspicture}
\end{LTXexample}


%--------------------------------------------------------------------------------------
\section{\CMD{resetOptions}}
%--------------------------------------------------------------------------------------

Sometimes it is difficult to know what options, which are changed inside a long document,
are different to the default one. With this
macro all options depending to \verb+pst-plot+ can be reset. This depends to all
options of the packages \verb+pstricks+, \verb+pst-plot+ and \verb+pst-node+.


\appendix


%--------------------------------------------------------------------------------------
\section{PostScript}
%--------------------------------------------------------------------------------------

PostScript uses the stack system and the LIFO system, "'Last In, First Out"`.

\newlength{\Li}\settowidth{\Li}{Function}
\begin{table}[htbp]
  \begin{center}{\ttfamily
    \begin{tabular}{|l|r@{ $\rightarrow$ }l|}\hline
    \multirow{2}{\Li}{\normalfont Function}&\multicolumn{2}{c|}{\normalfont Meaning}\\
    &\normalfont on stack before & \normalfont after\\\hline\hline
    add&$x\quad y$&$x+y$\\\hline
    sub&$x\quad y$&$x-y$\\\hline
    mul&$x\quad y$&$x\times y$\\\hline
    div&$x\quad y$&$x\div y$\\\hline
    sqrt&$x$&$\sqrt{x}$\\\hline
    abs&$x$&$|x|$\\\hline
    neg&$x$&$-x$\\\hline
    cos&$x$&$\cos(x)$ ($x$ in degrees)\\\hline
    sin&$x$&$\sin(x)$ ($x$  in degrees)\\\hline
    tan&$x$&$\tan(x)$ ($x$  in degrees)\\\hline
    atan&$y\quad x$&$\angle{(\vec{Ox};\vec{OM})}$ (in degrees of $M(x,y)$)\\\hline
    ln&$x$&$\ln(x)$\\\hline
    log&$x$&$\log(x)$\\\hline
    array&$n$&\normalfont$v$ (of dimension $n$)\\\hline
    aload&$v$&$x_1\quad x_2\quad \cdots\quad x_n\quad v$\\\hline
    astore&$x_1\quad x_2\quad \cdots\quad x_n\quad v$&$v$\\\hline
    pop&$x$&\\\hline
    dup&$x\quad x$&\\\hline
    roll&$x_1\quad x_2\quad \cdots\quad x_n\quad n p$&\\\hline
  \end{tabular}}
    \caption{Some primitive PostScript macros}\label{tab:primpost}
  \end{center}
\end{table}


\clearpage
\section{List of all optional arguments for \texttt{pstricks-add}}

\xkvview{family=pstricks-add,columns={key,type,default}}


%--------------------------------------------------------------------------------------
\section{Credits}
%--------------------------------------------------------------------------------------
{Hendri Adriaens | } 
{Martin Chicoine | }
{Ulrich Dirr | } 
{Christophe Fourey | }
{Hubert G\"a\ss lein |}
{Denis Girou | } 
{Peter Hutnick | } 
{Christophe Jorssen | } 
{Uwe Kern | } 
{Manuel Luque | } 
{Jens-Uwe Morawski |}
{Tobias N\"ahring |}
{Rolf Niepraschk |}
{Alan Ristow |}
{Arnaud Schmittbuhl |}
{Timothy Van Zandt}



\nocite{*}
\bgroup
\RaggedRight
\bibliographystyle{plain}
\bibliography{pstricks-add-doc}
\egroup

%--------------------------------------------------------------------------------------
\section{Change log}
%--------------------------------------------------------------------------------------

See file Changes

%\clearpage
%\section{The code}

%\lstinputlisting{pstricks-add.tex}


\end{document}