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
|
%%
%% This is file `pst-optic.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pst-optic.tex'
%%
%% Manuel Luque <Mluque5130@aol.com> (France)
%% Herbert Voss <voss@perce.de> (Germany)
%%
%% February 16, 2003
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%% `pst-optic' is a PSTricks package to define lenses and mirrors
%%
\csname PSTopticLoaded\endcsname
\let\PSTopticLoaded\endinput
% Requires PSTricks, pst-node, pstcol, pst-plot, pst-3d, multido packages
\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi
\ifx\PSTplotLoaded\endinput\else\input pst-plot.tex\fi % parametric-plot
\ifx\PSTthreeDLoaded\endinput\else\input pst-3d.tex\fi % symplan
\ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
%
\def\fileversion{0.92}
\def\filedate{2004/11/09}
\message{`PST-Optic' v\fileversion, \filedate\space (Manuel Luque and Herbert Voss)}
%
% DPC interface to the `keyval' package (until keyval based version of PSTricks)
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
\pst@addfams{pst-optic}
\SpecialCoor
%
%%%%%%%%%%%%%%%%%% Macrolist %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% \def\Arrows[#1](#2)(#3)
%% \def\psOutLine[#1](#2)(#3)#4
%% \def\psBeforeLine[#1](#2)(#3)#4
%% \def\ABinterCD(#1)(#2)(#3)(#4)#5
%% \def\Parallel[#1](#2)(#3)(#4)#5
%% \def\arrowLine[#1](#2)(#3)#4
%% \def\nodeBetween(#1)(#2)#3
%% \def\rotateNode(#1)#2
%% \def\rotateTriangle(#1)(#2)(#3)#4
%% \def\rotateFrame(#1)(#2)(#3)(#4)#5
%% \def\lensSPH[#1]
%% \def\lensSPHRay[#1](#2)(#3)#4#5#6
%% \def\ABinterSPHLens(#1)(#2)(#3)#4
%% \def\lens[#1]
%% \def\pslensDVG
%% \def\pslensDVG@i#1#2
%% \def\pslensDVG@ii
%% \def\pslensCVG
%% \def\pslensCVG@ii
%% \def\lensCVG
%% \def\lensDVG
%% \def\Transform
%% \def\rayInterLens(#1)(#2)#3#4
%% \def\mirrorCVGRay[#1](#2)(#3)#4
%% \def\mirrorCVG[#1]
%% \def\mirrorDVG[#1]
%% \def\mirrorDVGRay[#1](#2)(#3)#4
%% \def\beamLight[#1]
%% \def\mirrorTwo
%% \def\telescope[#1]
%% \def\planMirrorRay(#1)(#2)(#3)#4
%% \def\symPlan(#1)(#2)
%% \def\refractionRay[#1](#2)(#3)(#4)(#5)#6#7#8
%% \def\reflectionRay[#1](#2)(#3)#4
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% ---------------- the if's -----------------
%
\newif\ifPst@lensTwo% is a second lens present?
\define@key[psset]{pst-optic}{lensTwo}[false]{\@nameuse{Pst@lensTwo#1}%
}
\newif\ifPst@lensGlass% draw a _real_ lens?
\define@key[psset]{pst-optic}{lensGlass}[true]{\@nameuse{Pst@lensGlass#1}%
}
\newif\ifPst@drawing% draw the nodes and rays?
\define@key[psset]{pst-optic}{drawing}[true]{\@nameuse{Pst@drawing#1}%
}
\newif\ifPst@rightRay% a ray on the right side?
\define@key[psset]{pst-optic}{rightRay}[false]{\@nameuse{Pst@rightRay#1}%
}
%
\psset{lensGlass=false}
\psset{drawing=true}
%
% ------- the global definitions for the pspicture frame ------
%
\define@key[psset]{pst-optic}{xLeft}{\edef\psk@optic@xLeft{#1}}
\define@key[psset]{pst-optic}{xRight}{\edef\psk@optic@xRight{#1}}
\define@key[psset]{pst-optic}{yBottom}{\edef\psk@optic@yBottom{#1}}
\define@key[psset]{pst-optic}{yTop}{\edef\psk@optic@yTop{#1}}
\psset{xLeft=-7.5,xRight=7.5,yBottom=-3.0,yTop=3.0}
%
% ---------------- the lenses -----------------
%
\define@key[psset]{pst-optic}{lensType}{% CVG|DVG
\edef\psk@optic@lensType{#1}%
}
\define@key[psset]{pst-optic}{lensColor}{%
\edef\psk@optic@lensColor{#1}%
}
\define@key[psset]{pst-optic}{lensWidth}{% the thichness of the lens
\edef\psk@optic@lensWidth{#1}%
}
\define@key[psset]{pst-optic}{lensDepth}{%
\edef\psk@optic@lensDepth{#1}%
}
\define@key[psset]{pst-optic}{lensHeight}{% the TOTAL height of the lens
\edef\psk@optic@lensHeight{#1}%
}
\define@key[psset]{pst-optic}{lensScale}{% more or less obsolete
\edef\psk@optic@lensScale{#1}%
}
\define@key[psset]{pst-optic}{lensArrowSize}{% for the AB,... Arrows
\edef\psk@optic@lensArrowSize{#1}%
}
\define@key[psset]{pst-optic}{lensArrowInset}{%
\edef\psk@optic@lensArrowInset{#1}%
}
\psset{lensType=CVG}
\def\Type{CVG}
\psset{lensColor=lightgray}
\psset{lensWidth=0.5}
\psset{lensDepth=1}
\psset{lensHeight=5}
\psset{lensScale=1}
\psset{lensArrowSize=0.2}
\psset{lensArrowInset=0.5}
%
% ---------------- the mirrors -----------------
%
\define@key[psset]{pst-optic}{mirrorType}{% PLAN|PARAbolic|SPHerical
\edef\psk@optic@mirrorType{#1}%
}
\define@key[psset]{pst-optic}{mirrorDepth}{%
\edef\psk@optic@mirrorDepth{#1}%
}
\define@key[psset]{pst-optic}{mirrorHeight}{% it's the TOTAL height
\edef\psk@optic@mirrorHeight{#1}%
}
\define@key[psset]{pst-optic}{mirrorWidth}{%
\edef\psk@optic@mirrorWidth{#1}%
}
\define@key[psset]{pst-optic}{mirrorColor}{%
\edef\psk@optic@mirrorColor{#1}%
}
\define@key[psset]{pst-optic}{mirrorFocus}{%
\edef\psk@optic@mirrorFocus{#1}%
}
\define@key[psset]{pst-optic}{posMirrorTwo}{% a sencond mirror? (telescope)
\edef\psk@optic@posMirrorTwo{#1}%
}
\define@key[psset]{pst-optic}{mirrorTwoAngle}{% the angle for the 2. plan mirror (telescope)
\edef\psk@optic@mirrorTwoAngle{#1}%
}
\psset{mirrorType=CVG}% possible CVG|DVG
\def\mirrorType{CVG}
\psset{mirrorDepth=1}
\psset{mirrorHeight=5}
\psset{mirrorWidth=0.25}
\psset{mirrorFocus=8}% only for LensTwo option
\psset{mirrorTwoAngle=45}
\psset{posMirrorTwo=6}
\psset{mirrorColor=lightgray}
%
% -------------- the refrectionnumbers -------------
%
\define@key[psset]{pst-optic}{refractA}{%
\edef\psk@optic@refractA{#1}%
}
\define@key[psset]{pst-optic}{refractB}{%
\edef\psk@optic@refractB{#1}%
}
\psset{refractA=1}
\psset{refractB=1.41}
%
% -------------- the length and node definitions -------------
%
\define@key[psset]{pst-optic}{XO}{% the X-offset
\edef\psk@optic@XO{#1}%
}
\define@key[psset]{pst-optic}{YO}{% the y-offset
\edef\psk@optic@YO{#1}%
}
\define@key[psset]{pst-optic}{posStart}{% where the arrows start
\edef\psk@optic@posStart{#1}%
}
\define@key[psset]{pst-optic}{length}{% the length of the before|outlines
\edef\psk@optic@length{#1}%
}
\define@key[psset]{pst-optic}{focus}{% for lenses/mirrors with a fixed focus
\edef\psk@optic@focus{#1}%
}
\define@key[psset]{pst-optic}{AB}{% the length of the object arrow
\edef\psk@optic@AB{#1}%
}
\define@key[psset]{pst-optic}{OA}{% the xcoordinate of the object arrow
\edef\psk@optic@OA{#1}%
}
\define@key[psset]{pst-optic}{arrowOffset}{% offset for \arrowLine
\edef\psk@optic@arrowOffset{#1}%
}
%
\psset{XO=0,YO=0}
\psset{OA=-3}
\psset{posStart=0,length=2}
\psset{focus=2}
\psset{AB=1}
\psset{arrowOffset=0}
%
\define@key[psset]{pst-optic}{nameA}{% start of the object arrow
\edef\psk@optic@nameA{#1}%
}
\define@key[psset]{pst-optic}{spotA}{% where to draw the label
\edef\psk@optic@spotA{#1}%
}
\define@key[psset]{pst-optic}{nameB}{%
\edef\psk@optic@nameB{#1}%
}
\define@key[psset]{pst-optic}{spotB}{%
\edef\psk@optic@spotB{#1}%
}
\define@key[psset]{pst-optic}{nameF}{%
\edef\psk@optic@nameF{#1}%
}
\define@key[psset]{pst-optic}{spotF}{%
\edef\psk@optic@spotF{#1}%
}
\define@key[psset]{pst-optic}{nameO}{%
\edef\psk@optic@nameO{#1}%
}
\define@key[psset]{pst-optic}{spotO}{%
\edef\psk@optic@spotO{#1}%
}
\define@key[psset]{pst-optic}{nameAi}{%
\edef\psk@optic@nameAi{#1}%
}
\define@key[psset]{pst-optic}{spotAi}{%
\edef\psk@optic@spotAi{#1}%
}
\define@key[psset]{pst-optic}{nameBi}{%
\edef\psk@optic@nameBi{#1}%
}
\define@key[psset]{pst-optic}{spotBi}{%
\edef\psk@optic@spotBi{#1}%
}
\define@key[psset]{pst-optic}{nameFi}{%
\edef\psk@optic@nameFi{#1}%
}
\define@key[psset]{pst-optic}{spotFi}{%
\edef\psk@optic@spotFi{#1}%
}
%
\psset{nameA=A}
\psset{spotA=270}
\psset{nameB=B}
\psset{spotB=90}
\psset{nameF=F}
\psset{spotF=270}
\psset{nameO=O}
\psset{spotO=225}
\psset{nameAi=A'}
\psset{spotAi=90}
\psset{nameBi=B'}
\psset{spotBi=270}
\psset{nameFi=F'}
\psset{spotFi=270}
%
% -------------------- colors/fillstyles -------------------
%
\definecolor{BleuVerre}{cmyk}{0.2,0,0,0}
\definecolor{JauneVert}{rgb}{0.7,1,0}
\newpsstyle{rayuresJaunes}{%
fillstyle=hlines,hatchsep=2\pslinewidth,hatchcolor=JauneVert%
}
\define@key[psset]{pst-optic}{rayColor}{%
\edef\psk@optic@rayColor{#1}%
}
\psset{rayColor=red}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Utility stuff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% posStart=Starting point
% length= Arrow length.
\def\Arrows{\@ifnextchar[{\pst@Arrows}{\pst@Arrows[]}}
\def\pst@Arrows[#1](#2)(#3){{%
\psset{#1}%
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pnode(!%
/StartArrow \psk@optic@posStart\space def
/LengthArrow \psk@optic@length\space def
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
/denominateur XB XA sub def
/numerateur YB YA sub def
/angleDirectionAB numerateur denominateur Atan def
/XD StartArrow angleDirectionAB cos mul XA add def
/YD StartArrow angleDirectionAB sin mul YA add def
/XF XD LengthArrow angleDirectionAB cos mul add def
/YF YD LengthArrow angleDirectionAB sin mul add def
XD YD ){ArrowStart}
\pnode(! XF YF){ArrowEnd}
\psset{arrows=->}
\psline[#1](ArrowStart)(ArrowEnd)%
}}
%
% draw a line (===) outside: #2-----#3=======#4
%
\def\psOutLine{\@ifnextchar[{\pst@ToDrawOut}{\pst@ToDrawOut[]}}
\def\pst@ToDrawOut[#1](#2)(#3)#4{{%
\psset{#1}%
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pnode(!%
/LengthArrow \psk@optic@length\space def
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
/denominateur XB XA sub def
/numerateur YB YA sub def
/angleDirectionAB numerateur denominateur Atan def
/Xend XB LengthArrow angleDirectionAB cos mul add def
/Yend YB LengthArrow angleDirectionAB sin mul add def
Xend Yend){#4}
\psline[#1](#3)(#4)
}}
%
% draw a line (===) before: #4========#2-----#3
%
\def\psBeforeLine{\@ifnextchar[{\pst@BeforeLine}{\pst@BeforeLine[]}}
\def\pst@BeforeLine[#1](#2)(#3)#4{{%
\psset{#1}%
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pnode(!%
/LengthArrow \psk@optic@length\space def
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
/denominateur XB XA sub def
/numerateur YB YA sub def
/angleDirectionAB numerateur denominateur Atan def
/Xstart XA LengthArrow angleDirectionAB cos mul sub def
/Ystart YA LengthArrow angleDirectionAB sin mul sub def
Xstart Ystart){#4}
\psline[#1](#4)(#2)%
}}
%
% intersection de deux droites
% 2 juillet 2001/ rewritten 2003-01-27 Herbert
%
\def\ABinterCD(#1)(#2)(#3)(#4)#5{%
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\pst@getcoor{#3}\pst@tempc
\pst@getcoor{#4}\pst@tempd
\pnode(!%
/YA \pst@tempa exch pop \pst@number\psyunit div def
/XA \pst@tempa pop \pst@number\psxunit div def
/YB \pst@tempb exch pop \pst@number\psyunit div def
/XB \pst@tempb pop \pst@number\psxunit div def
/YC \pst@tempc exch pop \pst@number\psyunit div def
/XC \pst@tempc pop \pst@number\psxunit div def
/YD \pst@tempd exch pop \pst@number\psyunit div def
/XD \pst@tempd pop \pst@number\psxunit div def
/dY1 YB YA sub def
/dX1 XB XA sub def
/dY2 YD YC sub def
/dX2 XD XC sub def
dX1 abs 0.01 lt {
/m2 dY2 dX2 div def
XA dup XC sub m2 mul YC add
}{
dX2 abs 0.01 lt {
/m1 dY1 dX1 div def
XC dup XA sub m1 mul YA add
}{%
/m1 dY1 dX1 div def
/m2 dY2 dX2 div def
m1 XA mul m2 XC mul sub YA sub YC add m1 m2 sub div dup
XA sub m1 mul YA add
} ifelse
} ifelse ){#5}
}
%
% draw a parallel line
% #2---------#3
% #4----------#5(new)
\def\Parallel{\@ifnextchar[{\pst@Parallel}{\pst@Parallel[]}}
\def\pst@Parallel[#1](#2)(#3)(#4)#5{{%
\psset{#1}%
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pst@getcoor{#4}\pst@tempc
\pnode(!%
/LengthArrow \psk@optic@length\space def
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /YB exch \pst@number\psyunit div def
/XB exch \pst@number\psxunit div def
\pst@tempc /YC exch \pst@number\psyunit div def
/XC exch \pst@number\psxunit div def
/denominateur XB XA sub def
/numerateur YB YA sub def
/angleDirectionAB numerateur denominateur Atan def
/XstartParallel XC LengthArrow angleDirectionAB cos mul add def
/YstartParallel YC LengthArrow angleDirectionAB sin mul add def
XstartParallel YstartParallel){#5}
\psline[#1](#4)(#5)
}}
%
% arrowLine[options](A)(B){n}
% #2---->---->---->---->----#3 #4-arrows inside
\def\arrowLine{\@ifnextchar[{\pst@arrowLine}{\pst@arrowLine[]}}
\def\pst@arrowLine[#1](#2)(#3)#4{{%
\psset{arrowsize=4pt,arrows=->}% the defaults
\psset{#1}%
\def\pst@optic@n{#4}
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pnode(!%
/YA \pst@tempa exch pop \pst@number\psyunit div def
/XA \pst@tempa pop \pst@number\psxunit div def
/YB \pst@tempb exch pop \pst@number\psyunit div def
/XB \pst@tempb pop \pst@number\psxunit div def
/dY YB YA sub \pst@optic@n\space 1 add div def
/dX XB XA sub \pst@optic@n\space 1 add div def
/Alpha dY dX atan def
/dYOffset \psk@optic@arrowOffset\space Alpha sin mul def
/dXOffset \psk@optic@arrowOffset\space Alpha cos mul def
XA YA ){tempArrowC}
\multido{\i=1+1}{#4}{%
\pnode(!%
XA dX \i\space mul add dXOffset add
YA dY \i\space mul add dYOffset add){tempArrowB}
\psline(tempArrowC)(tempArrowB)
\pnode(tempArrowB){tempArrowC}
}
\psline[arrows=-](tempArrowB)(#3)
}}
%
% #1------#3------#2
\def\nodeBetween(#1)(#2)#3{% Herbert 2003/01/05
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\pnode(!%
/XA \pst@tempa pop \pst@number\psxunit div def
/YA \pst@tempa exch pop \pst@number\psyunit div def
/XB \pst@tempb pop \pst@number\psxunit div def
/YB \pst@tempb exch pop \pst@number\psyunit div def
XB XA add 2 div YB YA add 2 div){#3}
}
%
% rotateNode(A)
% (A) the node
% #2 the angle
% Herbert Voss <voss@perce.de> 2003-01-26
\def\rotateNode{\pst@rotateNode}
\def\pst@rotateNode(#1)#2{{%
\pst@getcoor{#1}\pst@tempa
\def\pst@optic@angle{#2} % the rotating angle
\pnode(!%
/YA \pst@tempa exch pop \pst@number\psyunit div def
/XA \pst@tempa pop \pst@number\psxunit div def
YA 0 eq XA 0 eq and {0 0}{
/r XA dup mul YA dup mul add sqrt def
/AlphaOld YA XA atan def
/AlphaNew AlphaOld \pst@optic@angle\space add def
r AlphaNew cos mul r AlphaNew sin mul
} ifelse ){temp}
\pnode(temp){#1}
}}
%
\def\rotateTriangle{\pst@rotateTriangle}
\def\pst@rotateTriangle(#1)(#2)(#3)#4{{%
\rotateNode(#1){#4}
\rotateNode(#2){#4}
\rotateNode(#3){#4}
}}
%
\def\rotateFrame{\pst@rotateFrame}
\def\pst@rotateFrame(#1)(#2)(#3)(#4)#5{{%
\rotateNode(#1){#5}
\rotateNode(#2){#5}
\rotateNode(#3){#5}
\rotateNode(#4){#5}
}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% L E N S E S %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% A spherical lens is drawn only with a spherical bow
%
\def\lensSPH{\@ifnextchar[{\pst@lensSPH}{\pst@lensSPH[]}}
\def\pst@lensSPH[#1]{{%
\psset{lensType=CVG,OA=-7,%
lensHeight=6,%
lensWidth=1.5,%
refractB=2}
\psset{#1}
\begin{pspicture*}(\psk@optic@xLeft ,\psk@optic@yBottom )
(\psk@optic@xRight ,\psk@optic@yTop)
\pnode(! \psk@optic@xLeft\space 0){xLeft}
\pnode(! \psk@optic@xRight\space 0){xRight}
\pstVerb{%
/Height \psk@optic@lensHeight\space 2.0 div def
/Depth \psk@optic@lensDepth\space def
/Width \psk@optic@lensWidth\space def
/Width2 Width 2.0 div def
}
\ifx\psk@optic@lensType\Type% CVG ?
\pnode(!%
/radius Width2 dup mul Height dup mul add Width2 div 2 div def
/XM Width2 radius sub def
/YM 0 def
XM YM){Center}
\else% DVG ?
\pnode(!%
/radius Depth dup mul Height dup mul add Depth div 2.0 div def
/XM Width2 radius add neg def
/YM 0 def
XM YM){Center}
\fi
% and vice versa
\pnode(! XM neg 0){Center'}
\pnode(!%
/AB \psk@optic@AB\space def
/OA \psk@optic@OA\space def
/XO \psk@optic@XO\space def
/YO \psk@optic@YO\space def
OA XO add YO){A}
\pnode(! OA XO add AB YO add){B}
\pnode(! XO YO){O}
\pnode(! XO AB YO add){I}
\begingroup% for the fill option
\psset{fillstyle=solid,%
fillcolor=\psk@optic@lensColor,%
linecolor=\psk@optic@lensColor%
}
\rput(! XO YO){%
\ifx\psk@optic@lensType\Type% CVG
\pscustom{%
\parametricplot{\psk@optic@lensHeight}{-\psk@optic@lensHeight}{%
/arg t radius 2.0 mul div def
arg 1 arg dup mul sub sqrt atan
cos 1 sub radius mul neg Width2 sub
t 2.0 div
}
\parametricplot{-\psk@optic@lensHeight}{\psk@optic@lensHeight}{%
/arg t radius 2.0 mul div def
arg 1 arg dup mul sub sqrt atan
cos 1 sub radius mul neg Width2 sub neg
t 2.0 div
}
\fill
}%
\else
\pscustom{%
% (d+w/2,h/2)->(d-w,h/2)
\psline(! Depth Width2 add Height)(! Depth Width2 add neg Height)
% (-d-w/2,h/2)->(-d-w/2,-h/2)
\parametricplot{\psk@optic@lensHeight}{-\psk@optic@lensHeight}{%
/arg t 2.0 div radius div def
arg 1 arg dup mul sub sqrt atan cos 1 sub radius mul Width2 sub
t 2.0 div
}
% (-d-w/2,-h/2)(d+w/2,-h/2)
\psline(! Depth Width2 add neg Height neg)(! Depth Width2 add Height neg)
% (d+w/2,-h/2)->(d+w/2,h/2)
\parametricplot{-\psk@optic@lensHeight}{\psk@optic@lensHeight}{%
/arg t 2.0 div radius div def
1 arg 1 arg dup mul sub sqrt atan cos sub radius mul Width2 add
t 2.0 div
}
\fill
}
\fi%
}%
\endgroup
\ifPst@drawing
% optical axes
\psline[linewidth=0.5pt](xLeft)(xRight)
\psset{dotstyle=|}
\psdots(Center')
\uput[-90](Center'){Center'}
\psdots(Center)
\uput[-90](Center){Center}
\psset{linecolor=\psk@optic@rayColor}
\psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B)
\ifx\psk@optic@lensType\Type
% the parallel ray
\lensSPHRay[lensType=CVG]%
(B)(I){\psk@optic@refractA}{\psk@optic@refractB}{PSPH}
\ABinterCD(PSPH')(PSPH'')(O)(xRight){F'}
\pst@getcoor{F'}\pst@tempf
\pnode(!%
/XF \pst@tempf pop \pst@number\psxunit div neg def
/YF \pst@tempf exch pop \pst@number\psyunit div def
XF YF){F}
\psline(B)(PSPH)(PSPH')(F')
\psOutLine[length=5](PSPH')(F'){PEnd}
% the center ray
\lensSPHRay[lensType=CVG]%
(B)(O){\psk@optic@refractA}{\psk@optic@refractB}{OSPH}
\ABinterCD(PSPH')(PSPH'')(OSPH')(OSPH''){B'}
\pnode(B'|0,0){A'}
\psOutLine[length=5](OSPH')(OSPH''){OEnd}
\psline(B)(OSPH)(OSPH')(OEnd)
% the focus ray
\lensSPHRay[lensType=CVG]%
(B)(F){\psk@optic@refractA}{\psk@optic@refractB}{FSPH}
\psOutLine[length=10](FSPH')(FSPH''){FEnd}
\psline(B)(FSPH)(FSPH')(FEnd)
\else % the DVG part
% the parallel ray
\lensSPHRay[lensType=DVG]%
(B)(I){\psk@optic@refractA}{\psk@optic@refractB}{PSPH}
\ABinterCD(PSPH')(PSPH'')(O)(xRight){F}
\pst@getcoor{F}\pst@tempf
\pnode(!%
/XF \pst@tempf pop \pst@number\psxunit div def
/YF \pst@tempf exch pop \pst@number\psyunit div def
XF neg YF){F'}
\psOutLine[linestyle=dashed,length=5](F)(PSPH'){PEnd'}
\psOutLine[linestyle=dashed,length=5](PEnd')(PSPH'){PEnd}
\psline(B)(PSPH)(PSPH')
% the center ray
\lensSPHRay[lensType=DVG]%
(B)(O){\psk@optic@refractA}{\psk@optic@refractB}{OSPH}
\ABinterCD(PSPH')(PSPH'')(OSPH')(OSPH''){B'}
\pnode(B'|0,0){A'}
\psOutLine(PSPH')(B'){PEnd}
\psline(B)(OSPH)(OSPH')
\psOutLine[linestyle=dashed,length=5](OSPH)(OSPH'){OEnd}
% the focus ray
\lensSPHRay[lensType=DVG]%
(B)(F'){\psk@optic@refractA}{\psk@optic@refractB}{FSPH}
\psline(B)(FSPH)(FSPH')(FSPH'')
\psOutLine[length=5](FSPH')(FSPH''){FEnd}
\psOutLine[linestyle=dashed,length=5](FSPH'')(FSPH'){FEnd'}
\psline[linestyle=dashed](FSPH')(F')
\fi
\psdots(F')
\uput[\psk@optic@spotFi](F'){$\mathrm{\psk@optic@nameFi}$}
\uput[\psk@optic@spotF](F){$\mathrm{\psk@optic@nameF}$}
\psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A')(B')
\uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$}
\uput[\psk@optic@spotB](B){$\mathrm{\psk@optic@nameB}$}
\uput[\psk@optic@spotAi](A'){$\mathrm{\psk@optic@nameAi}$}
\uput[\psk@optic@spotBi](B'){$\mathrm{\psk@optic@nameBi}$}
\uput[\psk@optic@spotO](O){$\mathrm{\psk@optic@nameO}$}
\fi% ifdrawing
\end{pspicture*}
}}
%
% Herbert Voss 2003/02/02
% [#1] : lensType=CVG/DVG
% (#2)(#3): the ray coordinates
% #4 #5: the refraction numbers IN and OUT
% #6: the intersection point
%
\def\lensSPHRay{\@ifnextchar[{\pst@lensSPHRay}{\pst@lensSPHRay[]}}
\def\pst@lensSPHRay[#1](#2)(#3)#4#5#6{{%
\psset{#1}
\ifx\psk@optic@lensType\Type% CVG
\ifPst@rightRay
\ABinterSPHLens(#2)(#3)(Center){#6}
\else
\ABinterSPHLens(#2)(#3)(Center'){#6}
\fi
\else
\ABinterSPHLens(#2)(#3)(Center){#6}
\fi
% \psline(! Y mT sub X 1 sub neg)(! Y mT add X 1 add neg)
\refractionRay(#2)(#6)(! Y mT sub X 1 sub neg)(! Y mT add X 1 add neg){#4}{#5}{tempSPHRay}
\ifx\psk@optic@lensType\Type% CVG
\ifPst@rightRay
\ABinterSPHLens(#6)(tempSPHRay')(Center'){#6'}
\else
\ABinterSPHLens(#6)(tempSPHRay')(Center){#6'}
\fi
\else
\ABinterSPHLens(#6)(tempSPHRay')(Center'){#6'}
\fi
% \psline(! Y mT sub X 1 sub neg)(! Y mT add X 1 add neg)
\refractionRay(#6)(#6')(! Y mT sub X 1 sub neg)%
(! Y mT add X 1 add neg){#5}{#4}{tempSPHRay}
\pnode(tempSPHRay'){#6''}
}}
%
% Intersection Point of ray and sperical lense
% 2003-02-03 Herbert
% (#1)(#2): the ray coordinates
% (#3): The center of the sperical
% #4: the intersection point
%
\def\ABinterSPHLens(#1)(#2)(#3)#4{%
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\pst@getcoor{#3}\pst@tempm
% calculate the intersection point. we change the coordinates
\ifx\psk@optic@lensType\Type% CVG
\pnode(!%
/YA \pst@tempa pop \pst@number\psxunit div def
/XA \pst@tempa exch pop \pst@number\psyunit div neg def
/YB \pst@tempb pop \pst@number\psxunit div def
/XB \pst@tempb exch pop \pst@number\psyunit div neg def
/YM \pst@tempm pop \pst@number\psxunit div def
/XM \pst@tempm exch pop \pst@number\psyunit div neg def
% /radius YM abs Width2 add def
/dX XB XA sub def
dX abs 0.01 lt {
% a horizontal line
/Y YM radius dup mul XA dup mul sub sqrt YM 0 gt {sub}{add}ifelse def
/YSecond YM radius dup mul XA dup mul sub sqrt YM 0 gt {add}{sub}ifelse def
/X XA def
/XSecond XA def
/mT XA radius dup mul XA dup mul sub sqrt div YM 0 lt {neg}if def
Y X neg
}{
/dY YB YA sub def
/m dY dX div def
/m21 m dup mul 1 add def
/klammer YM m XA mul add YA sub def
/p2neg klammer m mul m21 div def
/q klammer dup mul radius dup mul sub m21 div def
/root p2neg dup mul q sub sqrt def
/X p2neg root YM m mul 0 gt {sub}{add}ifelse def
/XSecond p2neg root YM m mul 0 gt {add}{sub}ifelse def
/Y m X XA sub mul YA add def
/YSecond m XSecond XA sub mul YA add def
/mT X radius dup mul X dup mul sub sqrt div YM 0 lt {neg}if def
Y X neg
} ifelse){#4}
\else% DVG
\pnode(!%
/YA \pst@tempa pop \pst@number\psxunit div def
/XA \pst@tempa exch pop \pst@number\psyunit div neg def
/YB \pst@tempb pop \pst@number\psxunit div def
/XB \pst@tempb exch pop \pst@number\psyunit div neg def
/YM \pst@tempm pop \pst@number\psxunit div def
/XM \pst@tempm exch pop \pst@number\psyunit div neg def
% /radius YM abs Width2 add def
/dX XB XA sub def
dX abs 0.01 lt {
% a horizontal line
/Y YM radius dup mul XA dup mul sub sqrt YM 0 gt {sub}{add}ifelse def
/YSecond YM radius dup mul XA dup mul sub sqrt YM 0 gt {add}{sub}ifelse def
/X XA def
/mT XA radius dup mul XA dup mul sub sqrt div YM 0 lt {neg}if def
/XSecond XA def
Y X neg
}{
/dY YB YA sub def
/m dY dX div def
/m21 m dup mul 1 add def
/klammer YM m XA mul add YA sub def
/p2neg klammer m mul m21 div def
/q klammer dup mul radius dup mul sub m21 div def
/root p2neg dup mul q sub sqrt def
/X p2neg root YM m mul 0 gt {sub}{add}ifelse def
/XSecond p2neg root YM m mul 0 gt {add}{sub}ifelse def
/Y m X XA sub mul YA add def
/YSecond m XSecond XA sub mul YA add def
/mT X radius dup mul X dup mul sub sqrt div YM 0 lt {neg}if def
Y X neg
} ifelse){#4}
\fi
\pnode(! YSecond XSecond neg){#4'}
%\arrowLine[linecolor=blue,arrows=->](#4)(#4'){2}
}
%
%fin 26 juin 2001
%Lentille convergente : CVG
%(#2) est l'abscisse du centre optique
\def\lens{\@ifnextchar[{\pst@lens}{\pst@lens[]}}
\def\pst@lens[#1]{{%
\psset{xLeft=-7.5,xRight=7.5,yBottom=-3,yTop=3}%
\psset{#1}%
\pst@killglue
%
% trace les rayons
% calcule la position de l'image
\begin{pspicture*}(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop)
\pnode(! \psk@optic@xLeft\space 0){xLeft}
\pnode(! \psk@optic@xRight\space 0){xRight}
\ifPst@lensTwo
\pnode(!%
/OF' \psk@optic@focus\space def
%/AB \psk@optic@AB\space def
/AB A'1B'1 def
%/OA \psk@optic@OA\space def
/XO \psk@optic@XO\space def
/YO \psk@optic@YO\space def
/OA XO neg XO1 add O1A1' add def
/TesT OA OF' add def
TesT 0 eq {/OA OF' neg 0.001 add def} if
/OA' OA OF' mul OA OF' add div def
/Gamma OA' OA div def
/A'B' Gamma AB mul def
OA' XO add YO){A'}
\pnode(! OA XO add YO){A}
\pnode(! OA XO add AB YO add){B}
\pnode(! OF' XO add YO){F'}
\pnode(! OF' neg XO add YO){F}
\pnode(! OA' XO add A'B' YO add){B'}
\pnode(! XO YO){O}
\pnode(! XO AB YO add){I}
\pnode(! XO A'B' YO add){I'}
\pnode(! \psk@optic@xRight\space A'B' YO add){I1}
\pnode(! \psk@optic@xRight\space neg A'B' YO add){I2}
\else
\pnode(!%
/OF' \psk@optic@focus\space def
/AB \psk@optic@AB\space def
/OA \psk@optic@OA\space def
/XO \psk@optic@XO\space def
/YO \psk@optic@YO\space def
/TesT OA OF' add def
TesT 0 eq {/OA OF' neg 0.001 add def} if
/OA' OA OF' mul OA OF' add div def
/Gamma OA' OA div def
/A'B' Gamma AB mul def
OA' XO add YO){A'}
\pnode(! OA XO add YO){A}
\pnode(! OA XO add AB YO add){B}
\pnode(! OF' XO add YO){F'}
\pnode(! OF' neg XO add YO){F}
\pnode(! OA' XO add A'B' YO add){B'}
\pnode(! XO YO){O}
\pnode(! XO AB YO add){I}
\pnode(! XO A'B' YO add){I'}
\pnode(! \psk@optic@xRight\space A'B' YO add){I1}
\pnode(! \psk@optic@xRight\space neg A'B' YO add){I2}
\fi
\begingroup
\ifPst@lensGlass
\rput(! XO YO){\ifx\psk@optic@lensType\Type\lensCVG\else\lensDVG\fi}%
\else
\ifx\psk@optic@lensType\Type
\psset{arrows=<->}
\else
\psset{arrows=>-<}
\fi
\psline[linecolor=\psk@optic@lensColor,
linewidth=\psk@optic@lensWidth,arrowsize=\psk@optic@lensArrowSize,
arrowinset=\psk@optic@lensArrowInset]%
(! XO -0.5 \psk@optic@lensHeight\space mul
\psk@optic@lensScale\space mul YO add)%
(! XO 0.5 \psk@optic@lensHeight\space mul
\psk@optic@lensScale\space mul YO add)
\fi
\endgroup%
\ifPst@drawing
% axe optique
\psline(! \psk@optic@xLeft\space YO)(! \psk@optic@xRight\space YO)
\ifx\psk@optic@lensType\Type
% Position des foyers
\psdots[dotstyle=|](F')
\uput[\psk@optic@spotFi](F'){$\mathrm{\psk@optic@nameFi}$}
\psdots[dotstyle=|](F)
\uput[\psk@optic@spotF](F){$\mathrm{\psk@optic@nameF}$}
%dessin de l'objet
\psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B)
% dessin de l'image
\psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A')(B')
%dessin des rayons
\psset{linecolor=\psk@optic@rayColor}
\pcline(B)(B')
\Arrows[length=16,arrows=-](B)(O)
\Arrows(B)(I)
\psline(B)(I)
\Arrows[length=10,posStart=0,arrows=-](I)(F')
\Arrows[posStart=1,arrows=->](I)(F')
\Arrows[arrows=->>](B)(I')
\psline(B)(I')(B')
\Arrows[length=10,arrows=-](I')(B')
\Arrows[length=2,posStart=0.5,arrows=->>](I')(B')
%\uput[-45](I'){I'}
%\uput[45](I){I}
\uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$}
\uput[\psk@optic@spotB](B){$\mathrm{\psk@optic@nameB}$}
\uput[\psk@optic@spotAi](A'){$\mathrm{\psk@optic@nameAi}$}
\uput[\psk@optic@spotBi](B'){$\mathrm{\psk@optic@nameBi}$}
\uput[\psk@optic@spotO](O){$\mathrm{\psk@optic@nameO}$}
\else
%dessin de l'objet
\psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B)
% dessin de l'image
\psline[linewidth=1.5\pslinewidth,arrowinset=0,linestyle=dashed]{->}(A')(B')
%dessin des rayons
\psset{linecolor=\psk@optic@rayColor}
\Arrows[length=16,arrows=-](B)(O)
\Arrows(B)(I)
\psline(B)(I)
\psOutLine[arrows=->,length=1](B')(I){END1}
\psOutLine[length=5](B')(I){END2}
\psline[linestyle=dashed](F')(I)
\Arrows[arrows=->>](B)(I')
\psline(B)(I')
\psOutLine[arrows=->>,length=2](B')(I'){END3}
\psOutLine[length=10](B')(I'){END4}
\psline[linestyle=dashed](B')(I')
%\uput[45](I'){I'}
%\uput[45](I){I}
\uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$}
\uput[\psk@optic@spotB](B){$\mathrm{\psk@optic@nameB}$}
\uput[\psk@optic@spotAi](A'){$\mathrm{\psk@optic@nameAi}$}
\uput[\psk@optic@spotBi](B'){$\mathrm{\psk@optic@nameBi}$}
\uput[\psk@optic@spotO](O){$\mathrm{\psk@optic@nameO}$}
\fi
\fi
\end{pspicture*}
}\ignorespaces}
%
% 25 december 2002 Herbert <voss@perce.de>
% make the lenses dynamical to width _and_ height
% \pslens calculates the radius and the angles from the given values
% of lensWidth and lensHeight and draws the lens with it's origin (0,0)
%
\def\pslensDVG{\pst@object{pslensDVG}}
\def\pslensDVG@i#1#2{%
\begin@OpenObj
\pssetlength\pst@dima{#1}%
\pssetlength\pst@dimb{#2}%
\addto@pscode{\pslensDVG@ii}%
\end@OpenObj%
}
\def\pslensDVG@ii{%
/w \pst@number\pst@dima def% lensWidth
/wHalbe w 2 div def% half of the width
/h \pst@number\pst@dimb 2 div def% the half of the height
/Radius wHalbe 2 div dup mul h dup mul add wHalbe div def
/x Radius wHalbe 2 div add def
/y 0 def
/angleA h x wHalbe sub atan neg def
/angleB angleA neg def
wHalbe h moveto
x y Radius 180 angleA add 180 angleB add arc
x neg y Radius angleA angleB arc
wHalbe h lineto
}
%
\def\pslensCVG{\pst@object{pslensCVG}}
\def\pslensCVG@i#1#2{%
\begin@OpenObj
\pssetlength\pst@dima{#1}%
\pssetlength\pst@dimb{#2}%
\addto@pscode{\pslensCVG@ii}%
\end@OpenObj%
}
%
\def\pslensCVG@ii{%
/w \pst@number\pst@dima def% lensWidth
/wHalbe w 2 div def% half of the width
/h \pst@number\pst@dimb 2 div def% the half of the height
/Radius wHalbe dup mul h dup mul add w div def
/x Radius wHalbe sub def
/y 0 def
/angleA h x atan neg def
/angleB angleA neg def
0 h moveto
x y Radius 180 angleA add 180 angleB add arc
x neg y Radius angleA angleB arc
}
%
%22 juin 2001 / 25 december 2002
%Choisir la forme et la taille de la lentille
%Le dessin de la lentille
%
\def\lensCVG{%
\scalebox{\psk@optic@lensScale}{%
\pscustom[linewidth=0.75\pslinewidth]{%
\pslensCVG{\psk@optic@lensWidth}{\psk@optic@lensHeight}
\fill[fillstyle=solid,fillcolor=BleuVerre]
}%
}%
}
%
\def\lensDVG{%
\scalebox{\psk@optic@lensScale}{%
\pscustom[linewidth=0.75\pslinewidth]{%
\pslensDVG{\psk@optic@lensWidth}{\psk@optic@lensHeight}
\fill[fillstyle=solid,fillcolor=BleuVerre]%
}%
}%
}
%Sauvegarde des points pour le cas d'un
%système à deux lentilles (26 juin 2001)
\def\Transform{%
\pnode(A){A1}
\pnode(B){B1}
\pnode(A'){A'1}
\pnode(B'){B'1}
\pnode(O){O1}
\pnode(F){F1}
\pnode(F'){F'1}
\pnode(I){I11}
\pnode(I'){I'1}
\pnode(!%
/XO1 XO def
/YO1 YO def
/O1A1' OA' def
/A'1B'1 A'B' def
XO1 YO1){factice}
}
%
%intersection d'un rayon avec une lentille
\def\rayInterLens(#1)(#2)#3#4{{%
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\pnode(!%
/LengthArrow \psk@optic@length\space def
\pst@tempa /YE1 exch \pst@number\psyunit div def
/XE1 exch \pst@number\psxunit div def
\pst@tempb /YB1 exch \pst@number\psyunit div def
/XB1 exch \pst@number\psxunit div def
/XO2 #3 def
/YO2 YB1 YE1 sub
XB1 XE1 sub div
XO2 XE1 sub
mul
YE1 add
def
XO2 YO2){#4}
}}
%
%eye du philatéliste
\def\eye{%
\psarc[linewidth=2pt](0,2.5){2.5}{215}{270}%
\psarc[linewidth=2pt](0,-2.5){2.5}{90}{140}%
\psarc(-2.5,0){1}{-30}{30}%
\psarc(0,0){1.75}{160}{200}
\psclip{%
\pscircle[linestyle=none](0,0){1.75}}
\pscircle[fillstyle=solid,fillcolor=lightgray](-2.5,0){0.9}
\endpsclip%
}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% M I R R O R S %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
\def\mirrorCVGRay{\@ifnextchar[{% Herbert 2003/01/05
\pst@mirrorCVGRay}{\pst@mirrorCVGRay[]}}
\def\pst@mirrorCVGRay[#1](#2)(#3)#4{{%
\psset{#1}%
%
\ifx\psk@optic@mirrorType\mirrorType% PARA
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pnode(!%
\psk@optic@mirrorHeight\space dup mul 16 div
\psk@optic@mirrorDepth\space div XO add YO){Focus}
\pnode(!%
/Xmax \psk@optic@mirrorHeight\space 2 div def
/Ymax \psk@optic@mirrorDepth\space def
/A 2 \psk@optic@mirrorHeight\space div dup mul Ymax mul def
/XA \pst@tempa exch pop \pst@number\psyunit div neg def
/YA \pst@tempa pop \pst@number\psxunit div def
/XB \pst@tempb exch pop \pst@number\psyunit div neg def
/YB \pst@tempb pop \pst@number\psxunit div def
XB XA sub abs 0.01 lt {A XA dup mul mul XA neg}{
/m YB YA sub XB XA sub div def
/m2a m A div 2 div def
/Root m2a dup mul m XA mul YA sub A div sub sqrt def
/Xp m2a Root add XA sub def
/Xn m2a Root sub XA sub def
/YSp m Xp mul YA add def
/XSp Xp XA add neg def
/YSn m Xn mul YA add def
/XSn Xn XA add neg def
YA 0 eq {0 0}{XB XA lt {YSn XSn}{YSp XSp} ifelse} ifelse} ifelse) {#4}
\pst@getcoor{#2}\pst@tempc% the starting point
\pst@getcoor{#4}\pst@tempa% the point on the mirror
\pnode(!%
/XA \pst@tempa exch pop \pst@number\psyunit div neg def
/YA \pst@tempa pop \pst@number\psxunit div def
/XC \pst@tempc exch pop \pst@number\psyunit div neg def
/YC \pst@tempc pop \pst@number\psxunit div def
% Mittelpunktsstrahl?
XA abs 0.01 lt YA abs 0.01 lt and {%
/NoMoreReflection true def
YC XC
}{%
/DY YA YC sub def
/DX XA XC sub def
% Steigung der Tangente im Punkt (XA|YA) y'=2ax
/mRay A XA mul 2 mul def
% zugehoeriger Steigungswinkel alpha=arctan y'
/Alpha mRay 2 div 0.5 atan def
% das dazugehoerige Lot
/AlphaPerp 1.0 neg mRay atan def
% Winkel des einfallenden Strahls
/Beta DY DX atan def
% Winkel des ausfallenden Strahls
/BetaStrich AlphaPerp 2 mul Beta sub def
% senkrechte Steigung? cos BetaStrich = 0
BetaStrich cos abs 0.1 lt {%
/NoMoreReflection true def
Ymax 2 mul XA neg
}{%
% Steigung
/m BetaStrich sin BetaStrich cos div def
% Steigung, ab der kein Schnittpunkt mehr stattfindet
/mMax 2 A mul Xmax mul def
m abs mMax gt {
% no more second reflection
/NoMoreReflection true def
Ymax 2 mul dup YA sub m div XA add neg
}{
% moegliche 2. Reflektion
/NoMoreReflection false def
% pq Formel anwenden
/m2a m A div 2 div def
/Root m2a dup mul m XA mul YA sub A div sub sqrt def
/X1 m2a Root add def
/X2 m2a Root sub def
% be sure, that we get the right point
/X XA X1 sub abs 0.01 gt {X1}{X2} ifelse def
/Y A X dup mul mul def
Y X neg
} ifelse
} ifelse
} ifelse){#4'}
%{\psset{linecolor=cyan}
%\qdisk(#4'){3pt}}
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#4'}\pst@tempb
\pst@getcoor{#4}\pst@tempc
\pnode(!%
/XB \pst@tempb exch pop \pst@number\psyunit div neg def
/YB \pst@tempb pop \pst@number\psxunit div def
NoMoreReflection
{YB XB neg}{%
/XC \pst@tempc exch pop \pst@number\psyunit div neg def
/YC \pst@tempc pop \pst@number\psxunit div def
/XAtemp \pst@tempa exch pop \pst@number\psyunit div neg def
/YAtemp \pst@tempa pop \pst@number\psxunit div def
/m1 2 A mul XB mul def
/Alpha2 m1 abs 0.01 lt {90}{1 neg m1 atan} ifelse def
/Beta XB XC sub abs 0.01 gt
{YC YB sub XC XB sub atan}
{90} ifelse def
/Gamma Alpha2 Beta sub def
/Delta Alpha2 Gamma add def
Delta cos abs 0.01 gt {%
/mDelta Delta sin Delta cos div def
/X YAtemp YB sub mDelta div XB add neg def}{%
/X XB neg def} ifelse
m1 abs 0.01 lt {YAtemp XAtemp}{YAtemp X} ifelse
} ifelse ){#4''}
\else
%--------------- A Spherical Mirror -----------------
\ABinterSPHLens(#2)(#3)(Center){tempRef0}
\pst@getcoor{tempRef0}\pst@tempa
\pst@getcoor{tempRef0'}\pst@tempb
\pnode(!%
\pst@tempa /Y1 exch \pst@number\psyunit div def
/X1 exch \pst@number\psxunit div def
\pst@tempb /Y2 exch \pst@number\psyunit div def
/X2 exch \pst@number\psxunit div def
X1 X2 lt {X1 Y1}{X2 Y2}ifelse ){#4}
\reflectionRay[#1](#2)(#4){tempRef1}
% we try if we have another intermediate point
\ABinterSPHLens(#4)(tempRef1)(Center){tempRef2}
\pst@getcoor{#4}\pst@tempa
\pst@getcoor{tempRef2}\pst@tempb
\pst@getcoor{tempRef2'}\pst@tempc
\pnode(!%
\pst@tempa /YP exch \pst@number\psyunit div def
/XP exch \pst@number\psxunit div def
\pst@tempb /Y1 exch \pst@number\psyunit div def
/X1 exch \pst@number\psxunit div def
\pst@tempc /Y2 exch \pst@number\psyunit div def
/X2 exch \pst@number\psxunit div def
XP X1 sub abs 0.01 gt {X1 Y1}{X2 Y2}ifelse
){#4'}
\reflectionRay[#1](tempRef1)(#4'){#4''}
\psset{mirrorType=CVG}% restore
\fi
\ifPst@drawing
\psline[#1](#2)(#4)
\psline[#1](#4)(#4')
\psline[#1](#4')(#4'')
\fi
}}
%
%
\def\mirrorCVG{\@ifnextchar[{% Herbert Voss 2003/01/05
\pst@mirrorCVG}{\pst@mirrorCVG[]}}
\def\pst@mirrorCVG[#1]{{%
\psset{%
mirrorType=CVG,%
AB=1.25,OA=4.5,%
XO=0,YO=0,xLeft=-5,xRight=5,yBottom=-3,yTop=3,%
mirrorHeight=5,mirrorDepth=1,mirrorWidth=0.2}
\psset{#1}
\begin{pspicture}(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop)
\pnode(! \psk@optic@xLeft\space 0){xLeft}
\pnode(! \psk@optic@xRight\space 0){xRight}
\pstVerb{%
/Height \psk@optic@mirrorHeight\space 2.0 div def
/Depth \psk@optic@mirrorDepth\space def
/Width \psk@optic@mirrorWidth\space def
}
\pnode(!%
/AB \psk@optic@AB\space def
/OA \psk@optic@OA\space def
/XO \psk@optic@XO\space def
/YO \psk@optic@YO\space def
OA XO add YO){A}
\pnode(! OA XO add AB YO add){B}
\pnode(! XO YO){O}
\ifx\psk@optic@mirrorType\mirrorType
\pnode(!%
\psk@optic@mirrorHeight\space dup mul 16 div
\psk@optic@mirrorDepth\space div XO add YO){Focus}
\else
\pnode(!%
/radius \psk@optic@mirrorHeight\space dup mul 4 div
\psk@optic@mirrorDepth\space dup mul add
2 div \psk@optic@mirrorDepth\space div def
radius XO add YO){Center}
\pnode(! radius 2 div XO add YO){Focus}
\fi
\pscustom[fillstyle=solid,%
fillcolor=\psk@optic@mirrorColor,%
linecolor=\psk@optic@mirrorColor]{%
% (d,h/2)->(d-w,h/2)
\psline(!%
\psk@optic@mirrorDepth\space \psk@optic@mirrorHeight\space 2 div)(!%
\psk@optic@mirrorDepth\space \psk@optic@mirrorWidth\space sub
\psk@optic@mirrorHeight\space 2 div)
% (-w/2,h/2)->(-w/2,-h/2)
\ifx\psk@optic@mirrorType\mirrorType
\parametricplot{\psk@optic@mirrorHeight}{-\psk@optic@mirrorHeight}{%
2 \psk@optic@mirrorHeight\space div dup mul \psk@optic@mirrorDepth\space mul
t 2 exp 4 div mul \psk@optic@mirrorWidth\space sub t 2 div
}
\else
\parametricplot{\psk@optic@mirrorHeight}{-\psk@optic@mirrorHeight}{%
/radD radius \psk@optic@mirrorWidth\space add def
radius \psk@optic@mirrorWidth\space sub radD dup mul t 2 div dup mul sub sqrt sub
t 2 div
}
\fi
% (d-w,-h/2)(d,-h/2)
\psline(!%
\psk@optic@mirrorDepth\space \psk@optic@mirrorWidth\space sub
\psk@optic@mirrorHeight\space 2 div neg)(!%
\psk@optic@mirrorDepth\space \psk@optic@mirrorHeight\space 2 div neg)
% (w/2,-h/2)->(w/2,h/2)
\ifx\psk@optic@mirrorType\mirrorType
\parametricplot{-\psk@optic@mirrorHeight}{\psk@optic@mirrorHeight}{%
2 \psk@optic@mirrorHeight\space div dup mul \psk@optic@mirrorDepth\space mul
t 2 exp 4 div mul t 2 div
}
\else
\parametricplot{-\psk@optic@mirrorHeight}{\psk@optic@mirrorHeight}{%
radius dup dup mul t 2 div dup mul sub sqrt sub
t 2 div
}
\fi
\fill
}
\ifPst@drawing
\psline[linewidth=0.5pt,linecolor=black](O)(xRight)
\ifx\psk@optic@mirrorType\mirrorType
\else
\qdisk(Center){1.5pt}\uput{0.2}[-90](Center){Center}
\fi
\qdisk(Focus){2pt}\uput[0](Focus){F}
\psline[linewidth=3\pslinewidth]{->}(A)(B)
\psset{%
linewidth=\pslinewidth,%
linecolor=\psk@optic@rayColor,%
arrows=>}
\uput[0](A){A}
\uput[0](B){B}
\pnode(! 1 \psk@optic@AB\space){Dummy}
\mirrorCVGRay[mirrorType=\psk@optic@mirrorType,drawing=false](B)(Dummy){PR}
\psOutLine[length=\psk@optic@OA](PR)(PR'){PR''}
\nodeBetween(B)(PR){Dummy}
\psline(B)(Dummy)
\psline(Dummy)(PR)
\nodeBetween(PR)(PR''){Dummy}
\psline(PR)(Dummy)
\psline(Dummy)(PR'')
%
\mirrorCVGRay[mirrorType=\psk@optic@mirrorType,drawing=false](B)(! 0 0){MR}
\psOutLine[length=\psk@optic@OA](MR)(MR'){MR''}
\nodeBetween(B)(MR){Dummy}
\psline(B)(Dummy)
\psline(Dummy)(MR)
\nodeBetween(MR)(MR'){Dummy}
\psline(MR)(Dummy)
\psline(Dummy)(MR')
%
\mirrorCVGRay[mirrorType=\psk@optic@mirrorType,drawing=false](B)(Focus){FR}
\psOutLine[length=\psk@optic@OA](FR)(FR'){FR''}
\nodeBetween(B)(FR){Dummy}
\psline(B)(Dummy)
\psline(Dummy)(FR)
\nodeBetween(FR)(FR'){Dummy}
\psline(FR)(Dummy)
\psline(Dummy)(FR')
%
\ABinterCD(PR)(PR')(FR)(FR'){B'}
\pnode( B'|0,0 ){A'}
\psline[linecolor=black,linewidth=3\pslinewidth,arrows=->](A')(B')
\uput[45](A'){A'}
\uput[-45](B'){B'}
\fi
\end{pspicture}
}}
%
%
\def\mirrorDVG{\@ifnextchar[{% Herbert Voss 2003/01/05
\pst@mirrorDVG}{\pst@mirrorDVG[]}}
\def\pst@mirrorDVG[#1]{{%
\psset{% the defaults
AB=1.25,OA=4,XO=0,YO=0,%
xLeft=-5,xRight=5,yBottom=-3,yTop=3,%
mirrorHeight=5,mirrorDepth=1,mirrorWidth=0.2}
\psset{#1}%
\pstVerb{%
/Height \psk@optic@mirrorHeight\space 2 div def
/Depth \psk@optic@mirrorDepth\space def
/Width \psk@optic@mirrorWidth\space def
}
\begin{pspicture}(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop)
\pnode(! \psk@optic@xLeft\space 0){xLeft}
\pnode(! \psk@optic@xRight\space 0){xRight}
\pnode(!%
/AB \psk@optic@AB\space def
/OA \psk@optic@OA\space def
/XO \psk@optic@XO\space def
/YO \psk@optic@YO\space def
OA XO add YO){A}
\pnode(! OA XO add AB YO add){B}
\pnode(! XO YO){O}
\ifx\psk@optic@mirrorType\mirrorType
\pnode(! Height dup mul 4 div Depth div XO add YO){Focus}
\else
\pnode(!%
/radius Height dup mul Depth dup mul add 2 div Depth div def
radius neg XO add YO){Center}
\pnode(! radius 2 div XO add YO){Focus}
\fi
\pscustom[fillstyle=solid,%
fillcolor=\psk@optic@mirrorColor,%
linecolor=\psk@optic@mirrorColor]{%
% (d,h/2)->(d-w,h/2)
\psline(! Depth neg Height)(! Depth Width add neg Height)
% (-w/2,h/2)->(-w/2,-h/2)
\ifx\psk@optic@mirrorType\mirrorType
\parametricplot{\psk@optic@mirrorHeight}{-\psk@optic@mirrorHeight}{%
Depth Height dup mul div t 2 exp 4 div mul neg
t 2 div
}
\else
\parametricplot{\psk@optic@mirrorHeight}{-\psk@optic@mirrorHeight}{%
radius dup mul t 2 div dup mul sub sqrt radius sub
t 2 div
}
\fi
% (d-w,-h/2)(d,-h/2)
\psline(! Depth Width add neg Height neg)(! Depth neg Height neg)%
% (w/2,-h/2)->(w/2,h/2)
\ifx\psk@optic@mirrorType\mirrorType
\parametricplot{-\psk@optic@mirrorHeight}{\psk@optic@mirrorHeight}{%
Depth Height dup mul div t 2 exp 4 div mul neg Width sub
t 2 div
}
\else
\parametricplot{-\psk@optic@mirrorHeight}{\psk@optic@mirrorHeight}{%
radius Width sub dup mul t 2 div dup mul sub sqrt radius sub
t 2 div
}
\fi
\fill
}
\ifPst@drawing
\psline[linecolor=black,linewidth=0.5pt](xLeft)(xRight)
\qdisk(Center){2pt}\uput[-90](Center){C}
\qdisk(Focus){2pt}\uput{0.25}[-90](Focus){F}
\psline[linewidth=3\pslinewidth,arrowinset=0]{->}(A)(B)
\psset{%
linewidth=1.5\pslinewidth,%
linecolor=\psk@optic@rayColor,%
arrows=->%
}
\uput{0.15}[0](A){A}
\uput{0.15}[0](B){B}
%
\mirrorDVGRay[%
mirrorType=\psk@optic@mirrorType,%
drawing=false](B)(! 0 \psk@optic@AB){PR}
\qdisk(PR){1.5pt}\uput{0.2}[180](PR){PR}
\qdisk(PR'){1.5pt}\uput{0.2}[0](PR'){PR'}
\nodeBetween(B)(PR){PDummy}
\psline(B)(PDummy)
\psline(PDummy)(PR)
\psline[arrows=-, linestyle=dotted](Focus)(PR)
\psOutLine[arrows=-,linestyle=dotted](P)(Focus){PBegin}
\psline(PR)(PR')
%
\mirrorDVGRay[%
mirrorType=\psk@optic@mirrorType,%
drawing=false](B)(! 0 0){MR}
\qdisk(MR){1.5pt}\uput{0.2}[180](MR){MR}
\qdisk(MR'){1.5pt}\uput{0.2}[0](MR'){MR'}
\nodeBetween(B)(! 0 0){MDummy}
\psline(B)(MDummy)
\psline(MDummy)(! 0 0)
\psline(MR)(MR')
%
\mirrorDVGRay[%
mirrorType=\psk@optic@mirrorType,%
drawing=false](B)(Focus){FR}
\qdisk(FR){1.5pt}\uput{0.2}[180](FR){FR}
\qdisk(FR'){1.5pt}\uput{0.2}[0](FR'){FR'}
\nodeBetween(B)(FR){Dummy}
\psline(B)(Dummy)
\psline(Dummy)(FR)
\psline(FR)(FR')
\psline[arrows=-,linestyle=dotted](Focus)(FR)
\psOutLine[arrows=-, linestyle=dotted](FR)(Focus){PBegin}
\fi
\end{pspicture}
}}
%
\def\mirrorDVGRay{\@ifnextchar[{% Herbert Voss 2003/01/05
\pst@mirrorDVGRay}{\pst@mirrorDVGRay[]}}
\def\pst@mirrorDVGRay[#1](#2)(#3)#4{{%
\psset{#1}%
\pnode(!%
\psk@optic@mirrorHeight\space dup mul 16 div
\psk@optic@mirrorDepth\space div neg 0){Focus}
\ifx\psk@optic@mirrorType\mirrorType
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pnode(!%
/A 2 \psk@optic@mirrorHeight\space div dup mul \psk@optic@mirrorDepth\space mul neg def
/XA \pst@tempa exch pop \pst@number\psyunit div neg def
/YA \pst@tempa pop \pst@number\psxunit div def
/XB \pst@tempb exch pop \pst@number\psyunit div neg def
/YB \pst@tempb pop \pst@number\psxunit div def
XB abs 0.001 lt YB abs 0.001 lt and
{ 0 0 }{
XB XA sub abs 0.01 lt
{A XA dup mul mul XA neg}{
/Xmax \psk@optic@mirrorHeight\space 2 div def
/m YB YA sub XB XA sub div def
/m2a m A div 2 div def
/Root m2a dup mul m XA mul YA sub A div sub sqrt def
/X1 m2a Root add def
/X2 m2a Root sub def
/X XB X1 sub abs XB X2 sub abs lt
{X1}{X2} ifelse def
/Y A X dup mul mul def
X abs Xmax lt
{Y X neg}
{A Xmax dup mul mul Xmax neg} ifelse
} ifelse
} ifelse){#4}
% #4 is the point on the mirror
\pst@getcoor{#2}\pst@tempc% the starting point
\pst@getcoor{#4}\pst@tempa% the point on the mirror
\pst@getcoor{Focus}\pst@tempf% the point on the mirror
\pnode(!
/XA \pst@tempa exch pop \pst@number\psyunit div neg def
/YA \pst@tempa pop \pst@number\psxunit div def
/XC \pst@tempc exch pop \pst@number\psyunit div neg def
/YC \pst@tempc pop \pst@number\psxunit div def
XA abs 0.001 lt YA abs 0.001 lt and
{YC XC}{
/YF \pst@tempf pop \pst@number\psxunit div def
/DY YA YC sub def
/DX XA XC sub def
/Alpha A XA mul 0.5 atan def
/Delta 180 DY DX atan sub Alpha 2 mul add def
Delta round cvi 90 mod 0 eq {YC XA neg}{
/m DX abs 0.01 lt
{YA YF sub XA div}
{Delta sin Delta cos div} ifelse def
/X \psk@optic@length\space Delta cos mul neg XA add def
/Y \psk@optic@length\space Delta sin mul neg YA add def
Y X neg
} ifelse
} ifelse){#4'}% second point on the mirror
\else
%--------------- A Spherical Mirror -----------------
\ABinterSPHLens(#2)(#3)(Center){tempRef0}
\pst@getcoor{tempRef0}\pst@tempa
\pst@getcoor{tempRef0'}\pst@tempb
\pnode(!%
\pst@tempa /Y1 exch \pst@number\psyunit div def
/X1 exch \pst@number\psxunit div def
\pst@tempb /Y2 exch \pst@number\psyunit div def
/X2 exch \pst@number\psxunit div def
X1 X2 gt {X1 Y1}{X2 Y2}ifelse ){#4}
\reflectionRay[mirrorType=SPH](#2)(#4){tempRef1}
\pnode(tempRef1){#4'}
\fi
\ifPst@drawing
\psline[#1](#2)(#4)(#4')
\fi
}}
%
% HEadlight Herbert <voss@perce.de> 2003/01/23
%
\def\beamLight{\@ifnextchar[{\pst@beamLight}{\pst@beamLight[]}}
\def\pst@beamLight[#1]{{%
\psset{xLeft=-5,xRight=5,yBottom=-5,yTop=5,%
drawing=false}% the defaults
\psset{#1}%
\begin{pspicture*}(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop)
\rput(0,0){%
\mirrorCVG[#1]%
}
\psline[linewidth=0.1cm]%
(!\psk@optic@mirrorDepth\space \psk@optic@mirrorHeight\space 2 div neg)%
(!\psk@optic@mirrorDepth\space \psk@optic@mirrorHeight\space 2 div)
\psset{linewidth=0.75mm,fillstyle=solid}
\psline(-1.1,1)(0.2,1)
\psline(-1.1,-1)(0.2,-1)
\pscurve(0.2,0.75)(1.6,1.5)(3,1)(3.5,0)(3,-1)(1.6,-1.5)(0.2,-0.75)
\psframe(-1.1,-0.85)(0.2,0.85)
\psframe(0.2,-0.3)(0.5,0.3)
\psline(-1.1,-0.85)(-1.4,-0.6)(-1.4,0.6)(-1.1,0.85)
\psline(0,0)(2.9,0)(2.9,0.5)(0.9,0.5)(0.9,0)%
\psline(3.0,0)(3.0,-0.3)(2.5,-0.3)(2.2,0.15)(2,-0.15)%
(1.8,0.15)(1.6,-0.15)(1.4,0.15)(1.2,-0.15)(1,0.15)%
\psline[linecolor=black,linewidth=0.5pt,linestyle=dashed](-1.75,0)(10,0)
\end{pspicture*}
}}
%
%
%Telescope
%2 juillet 2001
%
\def\mirrorTwo{%
\psframe[linestyle=none,%
fillstyle=vlines,%
hatchwidth=0.5\pslinewidth,%
hatchsep=3\pslinewidth](-1,0)(1,0.2)
\psline[linewidth=1.5\pslinewidth](-1,0)(1,0)%
}
%
\def\telescope{\@ifnextchar[{\pst@telescope}{\pst@telescope[]}}
\def\pst@telescope[#1]{{%
\psset{xLeft=-0.5,xRight=11,yBottom=-6,yTop=2}% the default
\psset{#1}%
\pstVerb{%
/mirrorFocus \psk@optic@mirrorFocus\space def
/Coeff mirrorFocus 4 mul def
/mirrorTwoAngle \psk@optic@mirrorTwoAngle\space def
/posMirrorTwo \psk@optic@posMirrorTwo\space def
}%
%
\begin{pspicture}*(\psk@optic@xLeft,\psk@optic@yBottom)(\psk@optic@xRight,\psk@optic@yTop)
\rput(0,0){%
\mirrorCVG[%
mirrorHeight=4,%
mirrorWidth=0.25,%
mirrorDepth=0.25,%
drawing=false]%
}
\pnode(! \psk@optic@xLeft\space 0){xLeft}
\pnode(! \psk@optic@xRight\space 0){xRight}
\psline[linewidth=0.5\pslinewidth](11,0)
\pnode(! 1.5 dup mul Coeff div 1.5){P1}
\pnode(! 1.5 dup mul Coeff div 1.5 neg){P2}
\pnode(! mirrorFocus 0){mirrorFocusNode}
\pnode(! posMirrorTwo 1 mirrorTwoAngle cos mul sub
1 mirrorTwoAngle sin mul){UpMirror2}
\pnode(! posMirrorTwo 1 mirrorTwoAngle cos mul add
1 mirrorTwoAngle sin mul neg){DownMirror2}
\ABinterCD(P1)(mirrorFocusNode)(UpMirror2)(DownMirror2){Inter1}
\ABinterCD(P2)(mirrorFocusNode)(UpMirror2)(DownMirror2){Inter2}
\pnode(!%
\psk@optic@posMirrorTwo\space posMirrorTwo mirrorFocus sub){ocularFocusNode}
{%
\psset{linecolor=red}
\Arrows[arrows=->,arrowsize=0.2](11,1.5)(P1)
\Arrows[arrows=->,arrowsize=0.2](P1)(Inter1)
%
\Arrows[arrows=->>,arrowsize=0.2](11,-1.5)(P2)
\Arrows[arrows=->>,arrowsize=0.2](P2)(Inter2)
\psline[linestyle=dashed](Inter2)(mirrorFocusNode)
\pnode(! 5 \psk@optic@posMirrorTwo\space 2 sub neg){ocularLeft}
\pnode(! 7 \psk@optic@posMirrorTwo\space 2 sub neg){ocularRight}
\ABinterCD(Inter1)(ocularFocusNode)(ocularLeft)(ocularRight){FO1}
\ABinterCD(Inter2)(ocularFocusNode)(ocularLeft)(ocularRight){FO2}
\Arrows[arrows=->>,arrowsize=0.2,length=1](Inter2)(FO2)
\psline(11,-1.5)(P2)(Inter2)(FO2)
\Arrows[arrows=->,arrowsize=0.2](Inter1)(ocularFocusNode)
\psline[linestyle=dashed](Inter1)(mirrorFocusNode)
\psline(11,1.5)(P1)(Inter1)(FO1)
}
\rput{-\psk@optic@mirrorTwoAngle}(\psk@optic@posMirrorTwo,0){\mirrorTwo}
\uput[90](mirrorFocusNode){$\mathrm{F_1}$}
\uput[180](ocularFocusNode){$\mathrm{F_2}$}
\rput{90}(!%
\psk@optic@posMirrorTwo\space
\psk@optic@posMirrorTwo\space 2 sub neg){%
\scalebox{0.5 0.4}{\lens[lensWidth=0.4,lensGlass=true,drawing=false]}}
\pnode(0,2){Aux1}
\pnode(0,-2){Aux2}
\Parallel[length=1](Aux1)(Aux2)(FO1){Eye1}
\Parallel[length=1](Aux1)(Aux2)(FO2){Eye2}
{%
\psset{linecolor=red,arrowsize=0.2,length=0.7}
\psline[linecolor=red](FO1)(Eye1)
\psline[linecolor=red](FO2)(Eye2)
\Arrows[arrows=->](FO1)(Eye1)
\Arrows[arrows=->>](FO2)(Eye2)%
}
\rput{-90}(!%
\psk@optic@posMirrorTwo\space
\psk@optic@posMirrorTwo\space neg){\scalebox{0.6}{\eye}}
\end{pspicture}
}}
%
%Images et réflexions sur un miroir plan
%(#1) coordonnées du point objet (XA,YA)
%(#2) coordonnées d'une extrémité du miroir (X1,Y1)
%(#3) coordonnées de l'autre extrémité du miroir (X2,Y2)
%{#4} nom de l'image A'
%
\def\planMirrorRay(#1)(#2)(#3)#4{{%
\pst@getcoor{#1}\pst@tempa
\pst@getcoor{#2}\pst@tempb
\pst@getcoor{#3}\pst@tempc
\pnode(!%
\pst@tempa /YA exch \pst@number\psyunit div def
/XA exch \pst@number\psxunit div def
\pst@tempb /Y1 exch \pst@number\psyunit div def
/X1 exch \pst@number\psxunit div def
\pst@tempc /Y2 exch \pst@number\psyunit div def
/X2 exch \pst@number\psxunit div def
/Dx X2 X1 sub def
/Dy Y2 Y1 sub def
/xH XA Dx Dx mul mul
X1 Dy Dy mul mul
add
YA Y1 sub Dx Dy mul mul
add
Dx Dx mul Dy Dy mul add
div
def
/yH YA Dy Dy mul mul
Y1 Dx Dx mul mul
add
XA X1 sub Dx Dy mul mul
add
Dx dup mul Dy dup mul add
div
def
/xA' 2 xH mul XA sub def
/yA' 2 yH mul YA sub def
/D12 Dx Dx mul Dy Dy mul add sqrt def
xA' yA' moveto
xH yH rlineto
xA' yA'){#4}
}}
%
% 2002/12/27
%
\def\symPlan(#1)(#2){\pst@killglue\pst@makebox{\symPlan@(#1)(#2)}}%
\def\symPlan@(#1)(#2){{%
\pst@getcoor{#1}\pst@tempa%
\pst@getcoor{#2}\pst@tempb%
\leavevmode
\hbox{%
\pnode(!%
\pst@tempa /Y1 exch def
/X1 exch def
\pst@tempb /Y2 exch def
/X2 exch def
/DX X2 X1 sub def
/DY Y2 Y1 sub def
/D12 DX dup mul DY dup mul add def
/ax 2 DX dup mul mul D12 div 1 sub def
/by 2 DX DY mul mul D12 div def
/cx by def
/dy 2 DY dup mul mul D12 div 1 sub def
/tx X1 DY dup mul mul
Y1 DX DY mul mul sub
2 mul
D12 div
def
/ty Y1 DX dup mul mul
X1 DX DY mul mul sub
2 mul
D12 div
def
X1 Y1){Factice}%
\pst@Verb{%
{ [ax by cx dy tx ty] concat
} \tx@TMChange}%
\box\pst@hbox
\pst@Verb{\tx@TMRestore}}%
}}
%
% refractionRay[options](A)(B)(C)(D){rNoA}{rNoB}{E}
% (A)(B) the ray nodes
% (C)(D) the nodes of the other material
% {rNoA}{rNoB} the refraction numbers
% {E} the intermediate node of the ray and the material
% {E'} the end node of the ray
%
% Herbert Voss <voss@perce.de> 2003-01-26
%
\def\refractionRay{\@ifnextchar[{\pst@refractionRay}{\pst@refractionRay[]}}
\def\pst@refractionRay[#1](#2)(#3)(#4)(#5)#6#7#8{{%
\psset{#1}
\pst@getcoor{#2}\pst@tempa
\pst@getcoor{#3}\pst@tempb
\pst@getcoor{#4}\pst@tempc
\pst@getcoor{#5}\pst@tempd
\ABinterCD(#2)(#3)(#4)(#5){#8}
%\psset{linecolor=black}
%\qdisk(#8){2pt}
% #8 is the point on the material
\pst@getcoor{#8}\pst@tempp
\def\pst@optic@cIn{#6} % refraction number 1
\def\pst@optic@cOut{#7} % refraction number 2
\pnode(!%
/YA \pst@tempa exch pop \pst@number\psyunit div def
/XA \pst@tempa pop \pst@number\psxunit div def
/YB \pst@tempb exch pop \pst@number\psyunit div def
/XB \pst@tempb pop \pst@number\psxunit div def
/YC \pst@tempc exch pop \pst@number\psyunit div def
/XC \pst@tempc pop \pst@number\psxunit div def
/YD \pst@tempd exch pop \pst@number\psyunit div def
/XD \pst@tempd pop \pst@number\psxunit div def
/YP \pst@tempp exch pop \pst@number\psyunit div def
/XP \pst@tempp pop \pst@number\psxunit div def
/dY1 YP YA sub def
/dX1 XP XA sub def
/dY2 YD YC sub def
/dX2 XD XC sub def
% the gradient of the material (if negativ then it must be the nominator)
/Gamma dY2 dX2 mul 0 lt {dY2 abs neg dX2 abs}{dY2 dX2} ifelse atan def
% the perpendicular line is: 90°-Gamma
/GammaStrich 90 Gamma sub def
% the angle of the incoming ray
/AlphaStrich dY1 dX1 atan def
% the same relative to the material
/Alpha 90 AlphaStrich sub Gamma add def
% the angle of the outgoing ray relative to the material
% the law of Snell: sin(Alpha)/sin(Beta) = n2/n1
% sin(Beta)>1 is a total reflection instead of a refraction
/sinBeta \pst@optic@cIn\space \pst@optic@cOut\space div Alpha sin mul def
sinBeta abs 1 le{
/Root 1 sinBeta dup mul sub sqrt def
/Beta sinBeta Root atan def
}{
/Beta 180 Alpha sub def
} ifelse
% the same absolute
/BetaStrich 90 Gamma sub Beta add def
% Determine the intermediate point
XP BetaStrich cos sub
YP BetaStrich sin add ){#8'}
%\qdisk(#8){5pt}
}}
%
% Herbert Voss <voss@perce.de> 2003-02-10
%
% reflectionRay[options](A)(B){C}
% options: the type of
% (A)(B) the ray nodes
% {C} the intermediate node of the ray and the material
% {C'} the end node of the reflected ray
%
\def\reflectionRay{\@ifnextchar[{\pst@reflectionRay}{\pst@reflectionRay[]}}
\def\pst@reflectionRay[#1](#2)(#3)#4{{%
\psset{#1}
\pst@getcoor{#2}\pst@tempa% the starting point
\pst@getcoor{#3}\pst@tempp% the point on the mirror
\pst@getcoor{Center}\pst@tempc% the center/focus of the mirror
\ifx\psk@optic@mirrorType\mirrorType% Parabolic
\else% Spherical
\pnode(!%
/XA \pst@tempa exch pop \pst@number\psyunit div neg def
/YA \pst@tempa pop \pst@number\psxunit div def
/XC \pst@tempc exch pop \pst@number\psyunit div neg def
/YC \pst@tempc pop \pst@number\psxunit div def
/XP \pst@tempp exch pop \pst@number\psyunit div neg def
/YP \pst@tempp pop \pst@number\psxunit div def
/dY1 YA YP sub def
/dX1 XA XP sub def
/signum YP 0 lt {-1}{1}ifelse def
% the gradient of the point. radius must be defined
/root radius dup mul XP dup mul sub sqrt def
/Gamma XP signum mul root atan 180 sub def
% the angle of the incoming ray
/AlphaStrich dY1 dX1 atan 180 sub def
% the same relative to the material
/Alpha 90 AlphaStrich sub Gamma add def
% the angle of the outgoing ray absolute
% /BetaStrich Alpha 2 mul AlphaStrich sub def
/BetaStrich Gamma Alpha add 90 sub def
% Determine the intermediate point
YP BetaStrich sin add XP BetaStrich cos add neg){#4}
\fi
}}
%
\catcode`\@=\PstAtCode\relax
%
%% END: pst-optic.tex
\endinput
|