diff options
Diffstat (limited to 'graphics/metapost')
141 files changed, 15916 insertions, 25 deletions
diff --git a/graphics/metapost/contrib/macros/mp-geom2d/LICENSE b/graphics/metapost/contrib/macros/mp-geom2d/LICENSE new file mode 100644 index 0000000000..130ede1e51 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/LICENSE @@ -0,0 +1,11 @@ + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3c +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of LaTeX +version 2005/12/01 or later. + +This work has the LPPL maintenance status “maintained”. + diff --git a/graphics/metapost/contrib/macros/mp-geom2d/README.md b/graphics/metapost/contrib/macros/mp-geom2d/README.md new file mode 100644 index 0000000000..60f6690be8 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/README.md @@ -0,0 +1,73 @@ +# MP-GEOM2D + +Flat geometry with MetaPost. + + +![Geometry illustration](illustration.jpg) + + +## Purpose + +mp-geom2d was written with the aim of providing MetaPost macros for creating +a geometry figure that closely matches an imperative description: + +- Let A be the point with coordinates (2,3). +- Let B be the point with coordinates (4,5). +- Draw the line (A, B). +- ... + +## Documentation + +The documentation, in French, is in the form of a PDF file: + +* [mp-geom2d-doc.pdf](doc/mp-geom2d-doc.pdf) + +## CTAN + +* https://ctan.org/pkg/mp-geom2d + +## Contact + +- Jean-Michel Sarlat, `jm.sarlat(at)gmail.com` +- Maxime Chupin, `notezik(at)gmail.com` + +## License + +LATEX Project Public License 1.3c. + +# mp-geom2d (français) + +De la géométrie plane avec MetaPost. + + +![Illustration de géométrie](illustration.jpg) + + +## Objectif + +mp-geom2d a été écrit avec le but de proposer des macros MetaPost permettant de réaliser +une figure de géométrie en collant d’assez près à une description impérative : + +- Soit A le point de coordonnées (2,3). +- Soit B le point de coordonnées (4,5). +- Trace la droite (A, B). +- ... + +## Documentation + +La documentation, en français, est sous forme d’un fichier PDF : + +* [mp-geom2d-doc.pdf](doc/mp-geom2d-doc.pdf) + +## CTAN + +* https://ctan.org/pkg/mp-geom2d + +## Contact + +- Jean-Michel Sarlat, `jm.sarlat(at)gmail.com` +- Maxime Chupin, `notezik(at)gmail.com` + +## Licence + +LATEX Project Public License 1.3c.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/K001-1.dat b/graphics/metapost/contrib/macros/mp-geom2d/doc/K001-1.dat new file mode 100644 index 0000000000..82bb5f73b3 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/K001-1.dat @@ -0,0 +1,441 @@ +-9.50332 39.03779 +-8.90985 36.92109 +-8.35830 34.94184 +-7.84242 33.07748 +-7.35647 31.30663 +-6.89478 29.60762 +-6.45128 27.95615 +-6.01847 26.32078 +-5.58493 24.65153 +-5.12641 22.83954 +-4.53013 20.37356 +-4.21630 18.99730 +-3.82624 17.15868 +-3.60655 16.02255 +-3.48053 15.31960 +-3.39084 14.78786 +-3.32137 14.35307 +-3.26497 13.98196 +-3.21775 13.65636 +-3.17735 13.36511 +-3.14222 13.10083 +-3.11127 12.85833 +-3.08371 12.63385 +-3.05896 12.42451 +-3.03656 12.22812 +-3.01615 12.04292 +-2.99745 11.86749 +-2.98023 11.70069 +-2.96428 11.54154 +-2.94946 11.38925 +-2.93563 11.24313 +-2.92266 11.10259 +-2.91047 10.96713 +-2.89896 10.83630 +-2.88807 10.70973 +-2.87772 10.58707 +-2.86785 10.46803 +-2.85843 10.35233 +-2.84940 10.23975 +-2.84071 10.13006 +-2.83235 10.02307 +-2.82426 9.91862 +-2.81643 9.81654 +-2.80883 9.71668 +-2.80143 9.61893 +-2.79421 9.52315 +-2.78715 9.42923 +-2.78023 9.33709 +-2.77343 9.24662 +-2.76675 9.15773 +-2.76016 9.07035 +-2.75365 8.98441 +-2.74721 8.89983 +-2.74083 8.81655 +-2.73449 8.73451 +-2.72820 8.65365 +-2.72193 8.57393 +-2.71568 8.49529 +-2.70944 8.41770 +-2.70321 8.34109 +-2.69697 8.26545 +-2.69072 8.19072 +-2.68446 8.11687 +-2.67818 8.04387 +-2.67186 7.97168 +-2.66552 7.90029 +-2.65914 7.82964 +-2.65272 7.75973 +-2.64625 7.69053 +-2.63973 7.62200 +-2.63316 7.55413 +-2.62653 7.48689 +-2.61983 7.42027 +-2.61308 7.35425 +-2.60625 7.28880 +-2.59935 7.22390 +-2.59238 7.15955 +-2.58533 7.09572 +-2.57821 7.03240 +-2.57100 6.96957 +-2.56370 6.90722 +-2.55632 6.84533 +-2.54885 6.78390 +-2.54129 6.72290 +-2.53363 6.66233 +-2.52588 6.60218 +-2.51803 6.54243 +-2.51009 6.48308 +-2.50204 6.42410 +-2.49389 6.36550 +-2.48564 6.30727 +-2.47728 6.24939 +-2.46881 6.19185 +-2.46024 6.13466 +-2.45155 6.07779 +-2.44276 6.02124 +-2.43385 5.96501 +-2.42483 5.90908 +-2.41569 5.85345 +-2.40644 5.79812 +-2.39707 5.74307 +-2.38758 5.68830 +-2.37797 5.63381 +-2.36823 5.57958 +-2.35838 5.52561 +-2.34841 5.47190 +-2.33831 5.41844 +-2.32808 5.36523 +-2.31773 5.31226 +-2.30726 5.25952 +-2.29665 5.20701 +-2.28592 5.15473 +-2.27506 5.10268 +-2.26406 5.05084 +-2.25294 4.99921 +-2.24168 4.94779 +-2.23030 4.89658 +-2.21877 4.84557 +-2.20712 4.79475 +-2.19532 4.74413 +-2.18340 4.69370 +-2.17133 4.64346 +-2.15913 4.59340 +-2.14679 4.54352 +-2.13431 4.49382 +-2.12169 4.44430 +-2.10893 4.39494 +-2.09603 4.34575 +-2.08299 4.29673 +-2.06981 4.24786 +-2.05648 4.19916 +-2.04301 4.15062 +-2.02939 4.10223 +-2.01563 4.05398 +-2.00172 4.00589 +-1.98766 3.95795 +-1.97346 3.91015 +-1.95911 3.86249 +-1.94461 3.81497 +-1.92996 3.76758 +-1.91516 3.72033 +-1.90020 3.67322 +-1.88510 3.62623 +-1.86984 3.57937 +-1.85443 3.53263 +-1.83887 3.48602 +-1.82315 3.43954 +-1.80727 3.39317 +-1.79124 3.34691 +-1.77505 3.30078 +-1.75870 3.25475 +-1.74219 3.20884 +-1.72552 3.16304 +-1.70869 3.11735 +-1.69170 3.07176 +-1.67455 3.02627 +-1.65723 2.98089 +-1.63975 2.93560 +-1.62210 2.89042 +-1.60429 2.84533 +-1.58631 2.80033 +-1.56816 2.75543 +-1.54984 2.71061 +-1.53135 2.66589 +-1.51269 2.62125 +-1.49386 2.57670 +-1.47485 2.53222 +-1.45567 2.48783 +-1.43631 2.44352 +-1.41677 2.39929 +-1.39705 2.35513 +-1.37716 2.31104 +-1.35708 2.26703 +-1.33682 2.22308 +-1.31637 2.17920 +-1.29574 2.13538 +-1.27492 2.09163 +-1.25392 2.04794 +-1.23272 2.00430 +-1.21133 1.96072 +-1.18974 1.91720 +-1.16796 1.87372 +-1.14598 1.83030 +-1.12380 1.78692 +-1.10142 1.74359 +-1.07884 1.70029 +-1.05605 1.65704 +-1.03305 1.61382 +-1.00984 1.57063 +-0.98641 1.52748 +-0.96277 1.48435 +-0.93892 1.44125 +-0.91484 1.39816 +-0.89054 1.35510 +-0.86601 1.31205 +-0.84125 1.26901 +-0.81625 1.22598 +-0.79102 1.18295 +-0.76556 1.13992 +-0.73984 1.09688 +-0.71388 1.05384 +-0.68767 1.01078 +-0.66120 0.96771 +-0.63447 0.92461 +-0.60747 0.88149 +-0.58020 0.83833 +-0.55266 0.79513 +-0.52484 0.75189 +-0.49673 0.70859 +-0.46833 0.66524 +-0.43962 0.62183 +-0.41062 0.57834 +-0.38130 0.53477 +-0.35165 0.49112 +-0.32168 0.44737 +-0.29137 0.40351 +-0.26072 0.35954 +-0.22971 0.31545 +-0.19833 0.27122 +-0.16657 0.22684 +-0.13443 0.18230 +-0.10188 0.13758 +-0.06892 0.09268 +-0.03553 0.04758 +-0.00169 0.00225 +0.03262 -0.04332 +0.06740 -0.08914 +0.10268 -0.13524 +0.13849 -0.18165 +0.17485 -0.22838 +0.21178 -0.27548 +0.24930 -0.32295 +0.28747 -0.37085 +0.32629 -0.41921 +0.36583 -0.46806 +0.40611 -0.51747 +0.44718 -0.56746 +0.48910 -0.61812 +0.53194 -0.66949 +0.57575 -0.72166 +0.62061 -0.77472 +0.66663 -0.82875 +0.71390 -0.88389 +0.76254 -0.94027 +0.81271 -0.99805 +0.86459 -1.05742 +0.91838 -1.11864 +0.97436 -1.18200 +1.03287 -1.24788 +1.09435 -1.31679 +1.15939 -1.38939 +1.22880 -1.46660 +1.30380 -1.54981 +1.38626 -1.64115 +1.47945 -1.74439 +1.59010 -1.86727 +1.73787 -2.03254 +2.00722 -2.34049 +2.21922 -2.59293 +2.36996 -2.78029 +2.47176 -2.91150 +2.55344 -3.01993 +2.62335 -3.11523 +2.68533 -3.20180 +2.74151 -3.28210 +2.79322 -3.35762 +2.84135 -3.42941 +2.88655 -3.49818 +2.92929 -3.56448 +2.96993 -3.62870 +3.00876 -3.69119 +3.04601 -3.75218 +3.08186 -3.81190 +3.11648 -3.87052 +3.14999 -3.92820 +3.18250 -3.98504 +3.21411 -4.04117 +3.24490 -4.09668 +3.27495 -4.15165 +3.30431 -4.20615 +3.33306 -4.26025 +3.36122 -4.31400 +3.38887 -4.36747 +3.41602 -4.42069 +3.44272 -4.47371 +3.46901 -4.52658 +3.49491 -4.57931 +3.52046 -4.63197 +3.54567 -4.68456 +3.57058 -4.73713 +3.59521 -4.78969 +3.61956 -4.84229 +3.64368 -4.89493 +3.66757 -4.94765 +3.69125 -5.00047 +3.71473 -5.05340 +3.73804 -5.10648 +3.76118 -5.15971 +3.78417 -5.21312 +3.80702 -5.26673 +3.82975 -5.32056 +3.85236 -5.37461 +3.87487 -5.42891 +3.89729 -5.48348 +3.91963 -5.53833 +3.94189 -5.59348 +3.96409 -5.64894 +3.98624 -5.70473 +4.00834 -5.76087 +4.03041 -5.81737 +4.05245 -5.87424 +4.07447 -5.93150 +4.09647 -5.98917 +4.11848 -6.04727 +4.14049 -6.10579 +4.16251 -6.16477 +4.18455 -6.22422 +4.20662 -6.28415 +4.22872 -6.34458 +4.25086 -6.40553 +4.27305 -6.46700 +4.29529 -6.52902 +4.31760 -6.59160 +4.33997 -6.65476 +4.36242 -6.71851 +4.38496 -6.78287 +4.40758 -6.84787 +4.43030 -6.91351 +4.45312 -6.97981 +4.47605 -7.04680 +4.49910 -7.11448 +4.52227 -7.18289 +4.54558 -7.25203 +4.56902 -7.32193 +4.59261 -7.39261 +4.61635 -7.46409 +4.64025 -7.53638 +4.66431 -7.60951 +4.68856 -7.68351 +4.71298 -7.75839 +4.73759 -7.83418 +4.76241 -7.91090 +4.78742 -7.98857 +4.81266 -8.06722 +4.83811 -8.14688 +4.86380 -8.22757 +4.88972 -8.30932 +4.91590 -8.39215 +4.94233 -8.47610 +4.96903 -8.56119 +4.99601 -8.64746 +5.02327 -8.73493 +5.05083 -8.82364 +5.07869 -8.91362 +5.10687 -9.00491 +5.13538 -9.09753 +5.16423 -9.19153 +5.19343 -9.28695 +5.22300 -9.38382 +5.25294 -9.48219 +5.28326 -9.58209 +5.31399 -9.68357 +5.34513 -9.78667 +5.37669 -9.89145 +5.40870 -9.99794 +5.44117 -10.10619 +5.47410 -10.21627 +5.50753 -10.32822 +5.54146 -10.44209 +5.57591 -10.55795 +5.61090 -10.67586 +5.64645 -10.79587 +5.68257 -10.91805 +5.71929 -11.04247 +5.75663 -11.16920 +5.79460 -11.29831 +5.83324 -11.42988 +5.87255 -11.56398 +5.91258 -11.70070 +5.95333 -11.84013 +5.99485 -11.98234 +6.03715 -12.12745 +6.08027 -12.27554 +6.12422 -12.42671 +6.16906 -12.58108 +6.21480 -12.73875 +6.26148 -12.89984 +6.30914 -13.06448 +6.35782 -13.23279 +6.40754 -13.40490 +6.45836 -13.58097 +6.51032 -13.76112 +6.56346 -13.94553 +6.61783 -14.13435 +6.67349 -14.32776 +6.73047 -14.52594 +6.78884 -14.72907 +6.84866 -14.93737 +6.90998 -15.15103 +6.97288 -15.37029 +7.03742 -15.59538 +7.10367 -15.82656 +7.17172 -16.06408 +7.24163 -16.30823 +7.31351 -16.55930 +7.38743 -16.81761 +7.46350 -17.08349 +7.54182 -17.35731 +7.62250 -17.63943 +7.70566 -17.93027 +7.79142 -18.23024 +7.87991 -18.53982 +7.97129 -18.85948 +8.06569 -19.18976 +8.16328 -19.53122 +8.26424 -19.88445 +8.36875 -20.25011 +8.47703 -20.62888 +8.58927 -21.02152 +8.70572 -21.42883 +8.82664 -21.85169 +8.95229 -22.29102 +9.08296 -22.74786 +9.21899 -23.22330 +9.36072 -23.71854 +9.50853 -24.23490 +9.66284 -24.77379 +9.82409 -25.33678 +9.99278 -25.92556 +10.16946 -26.54200 +10.35472 -27.18816 +10.54923 -27.86631 +10.75371 -28.57894 +10.96897 -29.32883 +11.19590 -30.11906 +11.43550 -30.95305 +11.68889 -31.83463 +11.95732 -32.76810 +12.24220 -33.75829 +12.54510 -34.81064 +12.86784 -35.93132 diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/K001-2.dat b/graphics/metapost/contrib/macros/mp-geom2d/doc/K001-2.dat new file mode 100644 index 0000000000..a9fb9ed80b --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/K001-2.dat @@ -0,0 +1,1208 @@ +6.76428 -0.94750 +6.97936 -0.97051 +7.14459 -0.97893 +7.26220 -0.98025 +7.36013 -0.97848 +7.44648 -0.97481 +7.52497 -0.96978 +7.59767 -0.96371 +7.66587 -0.95678 +7.73043 -0.94915 +7.79199 -0.94089 +7.85100 -0.93209 +7.90781 -0.92280 +7.96270 -0.91306 +8.01589 -0.90292 +8.06755 -0.89241 +8.11785 -0.88154 +8.16690 -0.87034 +8.21481 -0.85884 +8.26168 -0.84704 +8.30759 -0.83496 +8.35260 -0.82261 +8.39677 -0.81001 +8.44016 -0.79716 +8.48281 -0.78407 +8.52478 -0.77076 +8.56609 -0.75723 +8.60678 -0.74348 +8.64688 -0.72952 +8.68642 -0.71537 +8.72543 -0.70101 +8.76393 -0.68647 +8.80194 -0.67173 +8.83948 -0.65682 +8.87657 -0.64173 +8.91323 -0.62646 +8.94946 -0.61102 +8.98529 -0.59542 +9.02073 -0.57965 +9.05580 -0.56372 +9.09049 -0.54763 +9.12483 -0.53138 +9.15883 -0.51498 +9.19249 -0.49844 +9.22582 -0.48174 +9.25883 -0.46490 +9.29154 -0.44791 +9.32394 -0.43078 +9.35604 -0.41352 +9.38785 -0.39611 +9.41938 -0.37857 +9.45064 -0.36090 +9.48162 -0.34309 +9.51233 -0.32515 +9.54278 -0.30709 +9.57298 -0.28889 +9.60292 -0.27058 +9.63262 -0.25213 +9.66207 -0.23357 +9.69128 -0.21488 +9.72026 -0.19607 +9.74900 -0.17715 +9.77752 -0.15811 +9.80581 -0.13895 +9.83387 -0.11967 +9.86172 -0.10029 +9.88935 -0.08079 +9.91676 -0.06118 +9.94397 -0.04146 +9.97096 -0.02163 +9.99775 -0.00169 +10.02433 0.01835 +10.05071 0.03850 +10.07689 0.05876 +10.10287 0.07912 +10.12865 0.09958 +10.15424 0.12014 +10.17964 0.14080 +10.20484 0.16157 +10.22986 0.18243 +10.25469 0.20339 +10.27933 0.22444 +10.30379 0.24560 +10.32806 0.26684 +10.35215 0.28819 +10.37607 0.30962 +10.39980 0.33115 +10.42335 0.35277 +10.44673 0.37448 +10.46993 0.39628 +10.49295 0.41817 +10.51580 0.44014 +10.53848 0.46221 +10.56098 0.48436 +10.58332 0.50660 +10.60548 0.52892 +10.62748 0.55133 +10.64931 0.57382 +10.67097 0.59639 +10.69246 0.61905 +10.71379 0.64178 +10.73495 0.66460 +10.75594 0.68750 +10.77678 0.71047 +10.79745 0.73353 +10.81796 0.75666 +10.83830 0.77987 +10.85849 0.80315 +10.87851 0.82651 +10.89837 0.84995 +10.91808 0.87346 +10.93762 0.89704 +10.95701 0.92069 +10.97624 0.94442 +10.99531 0.96822 +11.01422 0.99209 +11.03298 1.01603 +11.05158 1.04003 +11.07002 1.06411 +11.08831 1.08825 +11.10644 1.11247 +11.12442 1.13674 +11.14225 1.16109 +11.15992 1.18549 +11.17744 1.20997 +11.19480 1.23450 +11.21201 1.25910 +11.22907 1.28377 +11.24598 1.30849 +11.26274 1.33328 +11.27934 1.35812 +11.29579 1.38303 +11.31209 1.40799 +11.32824 1.43302 +11.34424 1.45810 +11.36009 1.48324 +11.37579 1.50843 +11.39134 1.53368 +11.40674 1.55899 +11.42199 1.58435 +11.43709 1.60977 +11.45204 1.63523 +11.46685 1.66076 +11.48150 1.68633 +11.49601 1.71196 +11.51037 1.73763 +11.52458 1.76336 +11.53864 1.78914 +11.55256 1.81496 +11.56633 1.84084 +11.57995 1.86676 +11.59342 1.89273 +11.60675 1.91874 +11.61993 1.94480 +11.63296 1.97091 +11.64585 1.99706 +11.65859 2.02326 +11.67118 2.04950 +11.68363 2.07578 +11.69593 2.10211 +11.70809 2.12847 +11.72010 2.15488 +11.73196 2.18133 +11.74368 2.20781 +11.75526 2.23434 +11.76669 2.26091 +11.77797 2.28751 +11.78911 2.31415 +11.80010 2.34083 +11.81095 2.36754 +11.82166 2.39429 +11.83222 2.42107 +11.84263 2.44789 +11.85290 2.47474 +11.86303 2.50163 +11.87301 2.52855 +11.88285 2.55550 +11.89255 2.58248 +11.90210 2.60949 +11.91151 2.63653 +11.92077 2.66360 +11.92989 2.69070 +11.93887 2.71783 +11.94770 2.74499 +11.95639 2.77217 +11.96494 2.79938 +11.97334 2.82661 +11.98160 2.85387 +11.98972 2.88116 +11.99769 2.90847 +12.00552 2.93580 +12.01321 2.96316 +12.02076 2.99054 +12.02816 3.01794 +12.03542 3.04536 +12.04254 3.07280 +12.04952 3.10026 +12.05635 3.12774 +12.06304 3.15524 +12.06959 3.18276 +12.07600 3.21029 +12.08226 3.23784 +12.08839 3.26541 +12.09437 3.29299 +12.10021 3.32059 +12.10590 3.34821 +12.11146 3.37583 +12.11688 3.40347 +12.12215 3.43113 +12.12728 3.45879 +12.13227 3.48647 +12.13712 3.51416 +12.14183 3.54185 +12.14640 3.56956 +12.15082 3.59728 +12.15511 3.62500 +12.15925 3.65274 +12.16326 3.68048 +12.16712 3.70822 +12.17084 3.73598 +12.17442 3.76374 +12.17786 3.79150 +12.18117 3.81927 +12.18433 3.84704 +12.18735 3.87482 +12.19023 3.90259 +12.19297 3.93037 +12.19557 3.95816 +12.19803 3.98594 +12.20035 4.01372 +12.20253 4.04150 +12.20457 4.06928 +12.20648 4.09706 +12.20824 4.12484 +12.20986 4.15261 +12.21135 4.18038 +12.21269 4.20815 +12.21390 4.23591 +12.21496 4.26367 +12.21589 4.29142 +12.21668 4.31917 +12.21733 4.34691 +12.21785 4.37464 +12.21822 4.40236 +12.21845 4.43007 +12.21855 4.45778 +12.21851 4.48547 +12.21833 4.51316 +12.21801 4.54083 +12.21756 4.56849 +12.21697 4.59614 +12.21624 4.62378 +12.21537 4.65140 +12.21436 4.67901 +12.21322 4.70661 +12.21194 4.73419 +12.21052 4.76175 +12.20897 4.78930 +12.20728 4.81683 +12.20545 4.84434 +12.20349 4.87184 +12.20139 4.89931 +12.19915 4.92677 +12.19677 4.95421 +12.19426 4.98162 +12.19162 5.00902 +12.18884 5.03639 +12.18592 5.06374 +12.18287 5.09107 +12.17968 5.11837 +12.17635 5.14565 +12.17289 5.17291 +12.16930 5.20014 +12.16557 5.22735 +12.16170 5.25452 +12.15771 5.28168 +12.15357 5.30880 +12.14930 5.33590 +12.14490 5.36296 +12.14036 5.39000 +12.13569 5.41701 +12.13089 5.44398 +12.12595 5.47093 +12.12087 5.49784 +12.11567 5.52473 +12.11033 5.55157 +12.10486 5.57839 +12.09925 5.60517 +12.09351 5.63192 +12.08764 5.65863 +12.08164 5.68530 +12.07550 5.71194 +12.06923 5.73855 +12.06283 5.76511 +12.05630 5.79164 +12.04963 5.81812 +12.04283 5.84457 +12.03591 5.87098 +12.02885 5.89735 +12.02166 5.92367 +12.01433 5.94996 +12.00688 5.97620 +11.99930 6.00240 +11.99159 6.02856 +11.98374 6.05467 +11.97577 6.08074 +11.96766 6.10676 +11.95943 6.13273 +11.95107 6.15866 +11.94257 6.18455 +11.93395 6.21038 +11.92520 6.23617 +11.91632 6.26191 +11.90731 6.28760 +11.89817 6.31323 +11.88891 6.33882 +11.87951 6.36436 +11.86999 6.38984 +11.86034 6.41528 +11.85057 6.44066 +11.84066 6.46599 +11.83063 6.49126 +11.82047 6.51648 +11.81019 6.54164 +11.79977 6.56675 +11.78923 6.59180 +11.77857 6.61679 +11.76778 6.64173 +11.75686 6.66660 +11.74582 6.69142 +11.73465 6.71618 +11.72336 6.74088 +11.71194 6.76552 +11.70040 6.79010 +11.68873 6.81462 +11.67694 6.83907 +11.66503 6.86346 +11.65299 6.88779 +11.64083 6.91205 +11.62854 6.93625 +11.61613 6.96038 +11.60360 6.98445 +11.59094 7.00845 +11.57816 7.03239 +11.56526 7.05626 +11.55224 7.08005 +11.53910 7.10378 +11.52583 7.12744 +11.51244 7.15104 +11.49894 7.17456 +11.48531 7.19800 +11.47156 7.22138 +11.45769 7.24469 +11.44370 7.26792 +11.42958 7.29108 +11.41535 7.31416 +11.40100 7.33717 +11.38653 7.36011 +11.37195 7.38296 +11.35724 7.40575 +11.34241 7.42845 +11.32747 7.45108 +11.31241 7.47363 +11.29723 7.49610 +11.28193 7.51849 +11.26651 7.54080 +11.25098 7.56303 +11.23533 7.58518 +11.21957 7.60725 +11.20369 7.62923 +11.18769 7.65113 +11.17157 7.67295 +11.15534 7.69469 +11.13900 7.71633 +11.12254 7.73790 +11.10597 7.75938 +11.08928 7.78077 +11.07247 7.80207 +11.05556 7.82329 +11.03853 7.84441 +11.02138 7.86545 +11.00412 7.88640 +10.98675 7.90726 +10.96927 7.92803 +10.95168 7.94870 +10.93397 7.96929 +10.91615 7.98978 +10.89822 8.01018 +10.88018 8.03048 +10.86202 8.05069 +10.84376 8.07081 +10.82538 8.09082 +10.80690 8.11075 +10.78831 8.13057 +10.76960 8.15030 +10.75079 8.16993 +10.73186 8.18946 +10.71283 8.20889 +10.69369 8.22822 +10.67444 8.24745 +10.65509 8.26658 +10.63562 8.28561 +10.61605 8.30453 +10.59637 8.32335 +10.57659 8.34207 +10.55670 8.36068 +10.53670 8.37919 +10.51659 8.39759 +10.49638 8.41589 +10.47607 8.43408 +10.45565 8.45216 +10.43512 8.47013 +10.41449 8.48799 +10.39376 8.50575 +10.37292 8.52339 +10.35198 8.54092 +10.33093 8.55834 +10.30979 8.57565 +10.28853 8.59285 +10.26718 8.60993 +10.24572 8.62689 +10.22417 8.64375 +10.20251 8.66048 +10.18074 8.67710 +10.15888 8.69361 +10.13692 8.70999 +10.11485 8.72626 +10.09269 8.74241 +10.07043 8.75844 +10.04806 8.77435 +10.02560 8.79013 +10.00304 8.80580 +9.98038 8.82134 +9.95762 8.83676 +9.93476 8.85206 +9.91180 8.86723 +9.88875 8.88227 +9.86560 8.89719 +9.84235 8.91199 +9.81900 8.92665 +9.79556 8.94119 +9.77202 8.95560 +9.74839 8.96988 +9.72466 8.98402 +9.70083 8.99804 +9.67691 9.01192 +9.65290 9.02568 +9.62879 9.03929 +9.60458 9.05278 +9.58028 9.06613 +9.55589 9.07934 +9.53141 9.09241 +9.50683 9.10535 +9.48215 9.11815 +9.45739 9.13081 +9.43253 9.14333 +9.40758 9.15571 +9.38254 9.16795 +9.35741 9.18005 +9.33218 9.19200 +9.30686 9.20381 +9.28146 9.21547 +9.25596 9.22699 +9.23037 9.23836 +9.20469 9.24959 +9.17892 9.26066 +9.15306 9.27159 +9.12712 9.28236 +9.10108 9.29299 +9.07495 9.30346 +9.04874 9.31378 +9.02243 9.32394 +8.99604 9.33395 +8.96956 9.34380 +8.94299 9.35350 +8.91633 9.36304 +8.88959 9.37242 +8.86276 9.38164 +8.83584 9.39069 +8.80883 9.39959 +8.78174 9.40832 +8.75456 9.41689 +8.72729 9.42529 +8.69994 9.43353 +8.67250 9.44160 +8.64498 9.44950 +8.61737 9.45723 +8.58967 9.46478 +8.56189 9.47217 +8.53402 9.47938 +8.50607 9.48642 +8.47803 9.49328 +8.44991 9.49997 +8.42170 9.50647 +8.39341 9.51280 +8.36503 9.51894 +8.33657 9.52490 +8.30802 9.53068 +8.27939 9.53627 +8.25067 9.54168 +8.22187 9.54690 +8.19298 9.55192 +8.16401 9.55676 +8.13496 9.56140 +8.10582 9.56585 +8.07659 9.57010 +8.04728 9.57416 +8.01789 9.57801 +7.98841 9.58167 +7.95884 9.58512 +7.92920 9.58836 +7.89946 9.59140 +7.86964 9.59423 +7.83974 9.59686 +7.80975 9.59926 +7.77967 9.60146 +7.74951 9.60344 +7.71926 9.60520 +7.68892 9.60674 +7.65850 9.60805 +7.62799 9.60914 +7.59740 9.61001 +7.56671 9.61064 +7.53594 9.61104 +7.50508 9.61121 +7.47413 9.61114 +7.44309 9.61083 +7.41196 9.61027 +7.38074 9.60947 +7.34943 9.60843 +7.31802 9.60713 +7.28653 9.60557 +7.25494 9.60376 +7.22326 9.60169 +7.19148 9.59935 +7.15960 9.59674 +7.12763 9.59386 +7.09557 9.59071 +7.06340 9.58728 +7.03113 9.58356 +6.99877 9.57955 +6.96630 9.57526 +6.93373 9.57066 +6.90105 9.56577 +6.86827 9.56057 +6.83538 9.55506 +6.80238 9.54923 +6.76926 9.54308 +6.73604 9.53660 +6.70270 9.52979 +6.66924 9.52264 +6.63567 9.51514 +6.60197 9.50729 +6.56815 9.49908 +6.53420 9.49050 +6.50012 9.48155 +6.46591 9.47221 +6.43156 9.46248 +6.39708 9.45235 +6.36244 9.44181 +6.32767 9.43084 +6.29274 9.41944 +6.25765 9.40761 +6.22240 9.39531 +6.18699 9.38255 +6.15141 9.36931 +6.11565 9.35557 +6.07970 9.34132 +6.04356 9.32654 +6.00722 9.31122 +5.97068 9.29533 +5.93392 9.27886 +5.89694 9.26179 +5.85972 9.24408 +5.82225 9.22573 +5.78452 9.20669 +5.74652 9.18694 +5.70822 9.16645 +5.66963 9.14518 +5.63071 9.12309 +5.59144 9.10015 +5.55181 9.07629 +5.51178 9.05147 +5.47133 9.02564 +5.43043 8.99871 +5.38904 8.97063 +5.34711 8.94130 +5.30460 8.91063 +5.26145 8.87850 +5.21760 8.84478 +5.17296 8.80932 +5.12744 8.77194 +5.08093 8.73241 +5.03329 8.69047 +4.98434 8.64578 +4.93386 8.59790 +4.88154 8.54628 +4.82698 8.49015 +4.76961 8.42843 +4.70857 8.35952 +4.64243 8.28078 +4.56857 8.18739 +4.48095 8.06825 +4.35469 7.87798 +4.24481 7.69069 +4.12202 7.45061 +4.04236 7.27224 +3.99228 7.14844 +3.95432 7.04733 +3.92342 6.95961 +3.89728 6.88103 +3.87460 6.80919 +3.85459 6.74262 +3.83671 6.68030 +3.82057 6.62151 +3.80591 6.56571 +3.79249 6.51251 +3.78015 6.46157 +3.76875 6.41263 +3.75819 6.36548 +3.74837 6.31994 +3.73922 6.27587 +3.73067 6.23313 +3.72266 6.19162 +3.71515 6.15124 +3.70810 6.11191 +3.70147 6.07355 +3.69522 6.03610 +3.68933 5.99951 +3.68378 5.96371 +3.67854 5.92867 +3.67358 5.89433 +3.66890 5.86067 +3.66447 5.82765 +3.66027 5.79523 +3.65631 5.76339 +3.65255 5.73209 +3.64900 5.70132 +3.64563 5.67105 +3.64245 5.64126 +3.63943 5.61193 +3.63658 5.58304 +3.63388 5.55458 +3.63133 5.52652 +3.62892 5.49885 +3.62664 5.47157 +3.62449 5.44464 +3.62246 5.41807 +3.62055 5.39184 +3.61875 5.36594 +3.61705 5.34036 +3.61546 5.31508 +3.61397 5.29011 +3.61257 5.26542 +3.61127 5.24101 +3.61005 5.21688 +3.60891 5.19302 +3.60786 5.16941 +3.60688 5.14605 +3.60598 5.12293 +3.60516 5.10006 +3.60440 5.07741 +3.60371 5.05499 +3.60309 5.03279 +3.60253 5.01081 +3.60203 4.98903 +3.60159 4.96746 +3.60121 4.94609 +3.60088 4.92491 +3.60061 4.90392 +3.60039 4.88312 +3.60022 4.86250 +3.60010 4.84206 +3.60003 4.82179 +3.60000 4.80169 +3.60002 4.78176 +3.60008 4.76199 +3.60019 4.74238 +3.60033 4.72293 +3.60052 4.70363 +3.60074 4.68449 +3.60100 4.66549 +3.60130 4.64663 +3.60164 4.62792 +3.60201 4.60934 +3.60241 4.59091 +3.60285 4.57260 +3.60332 4.55443 +3.60382 4.53639 +3.60435 4.51848 +3.60492 4.50069 +3.60551 4.48302 +3.60613 4.46547 +3.60677 4.44805 +3.60745 4.43074 +3.60815 4.41354 +3.60888 4.39646 +3.60963 4.37948 +3.61041 4.36262 +3.61121 4.34586 +3.61203 4.32921 +3.61288 4.31266 +3.61375 4.29622 +3.61464 4.27987 +3.61556 4.26363 +3.61649 4.24748 +3.61745 4.23143 +3.61843 4.21547 +3.61942 4.19961 +3.62044 4.18384 +3.62147 4.16816 +3.62253 4.15256 +3.62360 4.13706 +3.62469 4.12164 +3.62579 4.10631 +3.62692 4.09106 +3.62806 4.07590 +3.62922 4.06082 +3.63039 4.04582 +3.63158 4.03089 +3.63278 4.01605 +3.63400 4.00129 +3.63524 3.98660 +3.63649 3.97198 +3.63775 3.95744 +3.63903 3.94298 +3.64033 3.92858 +3.64163 3.91426 +3.64295 3.90001 +3.64429 3.88583 +3.64563 3.87172 +3.64699 3.85767 +3.64836 3.84370 +3.64975 3.82979 +3.65115 3.81594 +3.65255 3.80216 +3.65397 3.78844 +3.65541 3.77479 +3.65685 3.76120 +3.65830 3.74767 +3.65977 3.73420 +3.66125 3.72079 +3.66273 3.70744 +3.66423 3.69415 +3.66574 3.68092 +3.66726 3.66774 +3.66879 3.65463 +3.67033 3.64156 +3.67188 3.62856 +3.67343 3.61560 +3.67500 3.60270 +3.67658 3.58986 +3.67817 3.57707 +3.67976 3.56433 +3.68137 3.55164 +3.68298 3.53900 +3.68461 3.52641 +3.68624 3.51388 +3.68788 3.50139 +3.68953 3.48895 +3.69118 3.47656 +3.69285 3.46422 +3.69452 3.45192 +3.69620 3.43967 +3.69789 3.42747 +3.69959 3.41532 +3.70130 3.40320 +3.70301 3.39114 +3.70473 3.37912 +3.70646 3.36714 +3.70820 3.35520 +3.70994 3.34331 +3.71169 3.33146 +3.71345 3.31965 +3.71522 3.30789 +3.71699 3.29616 +3.71877 3.28448 +3.72056 3.27283 +3.72235 3.26123 +3.72415 3.24966 +3.72596 3.23814 +3.72778 3.22665 +3.72960 3.21520 +3.73142 3.20379 +3.73326 3.19242 +3.73510 3.18108 +3.73695 3.16978 +3.73880 3.15852 +3.74066 3.14729 +3.74253 3.13610 +3.74440 3.12494 +3.74628 3.11382 +3.74817 3.10274 +3.75006 3.09168 +3.75196 3.08067 +3.75386 3.06968 +3.75577 3.05873 +3.75769 3.04781 +3.75961 3.03692 +3.76154 3.02607 +3.76347 3.01525 +3.76541 3.00446 +3.76736 2.99370 +3.76931 2.98297 +3.77127 2.97227 +3.77323 2.96160 +3.77520 2.95097 +3.77718 2.94036 +3.77916 2.92978 +3.78115 2.91923 +3.78314 2.90871 +3.78514 2.89822 +3.78714 2.88776 +3.78915 2.87733 +3.79116 2.86692 +3.79318 2.85654 +3.79521 2.84619 +3.79724 2.83586 +3.79928 2.82557 +3.80132 2.81529 +3.80337 2.80505 +3.80542 2.79483 +3.80748 2.78464 +3.80954 2.77447 +3.81161 2.76433 +3.81369 2.75421 +3.81577 2.74412 +3.81786 2.73405 +3.81995 2.72401 +3.82204 2.71399 +3.82415 2.70399 +3.82625 2.69402 +3.82837 2.68407 +3.83049 2.67414 +3.83261 2.66424 +3.83474 2.65436 +3.83687 2.64451 +3.83901 2.63467 +3.84116 2.62486 +3.84331 2.61507 +3.84547 2.60530 +3.84763 2.59555 +3.84979 2.58582 +3.85197 2.57612 +3.85414 2.56643 +3.85633 2.55677 +3.85852 2.54713 +3.86071 2.53750 +3.86291 2.52790 +3.86511 2.51832 +3.86732 2.50875 +3.86954 2.49921 +3.87176 2.48968 +3.87399 2.48018 +3.87622 2.47069 +3.87846 2.46122 +3.88070 2.45177 +3.88295 2.44234 +3.88520 2.43293 +3.88746 2.42353 +3.88973 2.41415 +3.89200 2.40479 +3.89427 2.39545 +3.89656 2.38613 +3.89884 2.37682 +3.90114 2.36753 +3.90343 2.35825 +3.90574 2.34900 +3.90805 2.33975 +3.91036 2.33053 +3.91268 2.32132 +3.91501 2.31213 +3.91734 2.30295 +3.91968 2.29379 +3.92203 2.28464 +3.92438 2.27551 +3.92673 2.26640 +3.92909 2.25729 +3.93146 2.24821 +3.93383 2.23914 +3.93621 2.23008 +3.93860 2.22104 +3.94099 2.21201 +3.94339 2.20299 +3.94579 2.19399 +3.94820 2.18501 +3.95061 2.17603 +3.95303 2.16707 +3.95546 2.15813 +3.95790 2.14919 +3.96033 2.14027 +3.96278 2.13137 +3.96523 2.12247 +3.96769 2.11359 +3.97016 2.10472 +3.97263 2.09586 +3.97510 2.08702 +3.97759 2.07818 +3.98008 2.06936 +3.98257 2.06055 +3.98508 2.05175 +3.98759 2.04297 +3.99010 2.03419 +3.99263 2.02543 +3.99515 2.01667 +3.99769 2.00793 +4.00023 1.99920 +4.00278 1.99048 +4.00534 1.98177 +4.00790 1.97307 +4.01047 1.96438 +4.01305 1.95570 +4.01563 1.94703 +4.01822 1.93837 +4.02082 1.92972 +4.02343 1.92108 +4.02604 1.91245 +4.02866 1.90382 +4.03128 1.89521 +4.03392 1.88661 +4.03656 1.87801 +4.03921 1.86943 +4.04186 1.86085 +4.04453 1.85228 +4.04720 1.84372 +4.04987 1.83517 +4.05256 1.82663 +4.05525 1.81809 +4.05795 1.80956 +4.06066 1.80104 +4.06338 1.79253 +4.06610 1.78403 +4.06884 1.77553 +4.07158 1.76704 +4.07433 1.75856 +4.07708 1.75008 +4.07985 1.74162 +4.08262 1.73315 +4.08540 1.72470 +4.08819 1.71625 +4.09099 1.70781 +4.09379 1.69938 +4.09661 1.69095 +4.09943 1.68252 +4.10226 1.67411 +4.10511 1.66570 +4.10795 1.65729 +4.11081 1.64889 +4.11368 1.64050 +4.11656 1.63211 +4.11944 1.62373 +4.12233 1.61535 +4.12524 1.60698 +4.12815 1.59861 +4.13107 1.59025 +4.13400 1.58189 +4.13694 1.57354 +4.13989 1.56519 +4.14285 1.55685 +4.14582 1.54851 +4.14880 1.54017 +4.15179 1.53184 +4.15479 1.52351 +4.15780 1.51519 +4.16082 1.50687 +4.16385 1.49856 +4.16689 1.49024 +4.16994 1.48193 +4.17300 1.47363 +4.17607 1.46533 +4.17915 1.45703 +4.18224 1.44873 +4.18534 1.44043 +4.18846 1.43214 +4.19158 1.42386 +4.19472 1.41557 +4.19786 1.40729 +4.20102 1.39900 +4.20419 1.39072 +4.20737 1.38245 +4.21056 1.37417 +4.21377 1.36590 +4.21698 1.35763 +4.22021 1.34936 +4.22345 1.34109 +4.22670 1.33282 +4.22997 1.32455 +4.23324 1.31629 +4.23653 1.30803 +4.23983 1.29976 +4.24314 1.29150 +4.24647 1.28324 +4.24981 1.27498 +4.25316 1.26672 +4.25653 1.25846 +4.25991 1.25020 +4.26330 1.24194 +4.26670 1.23368 +4.27012 1.22542 +4.27355 1.21715 +4.27700 1.20889 +4.28046 1.20063 +4.28393 1.19237 +4.28742 1.18411 +4.29093 1.17584 +4.29444 1.16758 +4.29798 1.15931 +4.30152 1.15104 +4.30509 1.14278 +4.30866 1.13451 +4.31225 1.12623 +4.31586 1.11796 +4.31949 1.10969 +4.32313 1.10141 +4.32678 1.09313 +4.33045 1.08485 +4.33414 1.07656 +4.33784 1.06828 +4.34156 1.05999 +4.34530 1.05170 +4.34905 1.04340 +4.35282 1.03510 +4.35661 1.02680 +4.36042 1.01850 +4.36424 1.01019 +4.36808 1.00188 +4.37194 0.99357 +4.37582 0.98525 +4.37972 0.97693 +4.38363 0.96860 +4.38756 0.96027 +4.39151 0.95193 +4.39549 0.94360 +4.39948 0.93525 +4.40349 0.92690 +4.40752 0.91855 +4.41157 0.91019 +4.41564 0.90183 +4.41973 0.89346 +4.42384 0.88508 +4.42798 0.87670 +4.43213 0.86832 +4.43631 0.85993 +4.44050 0.85153 +4.44472 0.84313 +4.44896 0.83472 +4.45323 0.82630 +4.45752 0.81788 +4.46183 0.80945 +4.46616 0.80101 +4.47052 0.79257 +4.47490 0.78412 +4.47930 0.77566 +4.48373 0.76719 +4.48819 0.75872 +4.49267 0.75024 +4.49717 0.74175 +4.50171 0.73325 +4.50626 0.72474 +4.51085 0.71623 +4.51546 0.70770 +4.52009 0.69917 +4.52476 0.69063 +4.52945 0.68208 +4.53417 0.67352 +4.53892 0.66495 +4.54370 0.65637 +4.54851 0.64778 +4.55334 0.63918 +4.55821 0.63057 +4.56311 0.62195 +4.56804 0.61332 +4.57300 0.60467 +4.57799 0.59602 +4.58302 0.58735 +4.58807 0.57868 +4.59316 0.56999 +4.59828 0.56129 +4.60344 0.55258 +4.60863 0.54385 +4.61386 0.53512 +4.61912 0.52637 +4.62442 0.51760 +4.62976 0.50883 +4.63513 0.50004 +4.64054 0.49123 +4.64599 0.48242 +4.65148 0.47358 +4.65700 0.46474 +4.66257 0.45588 +4.66818 0.44700 +4.67383 0.43811 +4.67952 0.42921 +4.68525 0.42028 +4.69103 0.41135 +4.69685 0.40239 +4.70271 0.39342 +4.70862 0.38444 +4.71458 0.37543 +4.72058 0.36641 +4.72664 0.35737 +4.73274 0.34831 +4.73889 0.33924 +4.74509 0.33014 +4.75134 0.32103 +4.75764 0.31190 +4.76399 0.30275 +4.77040 0.29358 +4.77687 0.28439 +4.78339 0.27518 +4.78996 0.26594 +4.79660 0.25669 +4.80329 0.24742 +4.81005 0.23812 +4.81686 0.22880 +4.82374 0.21946 +4.83068 0.21009 +4.83768 0.20071 +4.84475 0.19129 +4.85189 0.18186 +4.85910 0.17240 +4.86637 0.16291 +4.87372 0.15340 +4.88114 0.14386 +4.88863 0.13430 +4.89621 0.12470 +4.90385 0.11509 +4.91158 0.10544 +4.91939 0.09576 +4.92728 0.08606 +4.93526 0.07633 +4.94332 0.06656 +4.95147 0.05677 +4.95971 0.04694 +4.96804 0.03708 +4.97647 0.02719 +4.98500 0.01727 +4.99362 0.00731 +5.00235 -0.00268 +5.01118 -0.01271 +5.02012 -0.02277 +5.02916 -0.03287 +5.03832 -0.04301 +5.04760 -0.05318 +5.05699 -0.06340 +5.06650 -0.07365 +5.07614 -0.08395 +5.08591 -0.09428 +5.09581 -0.10466 +5.10584 -0.11508 +5.11602 -0.12555 +5.12634 -0.13606 +5.13680 -0.14662 +5.14742 -0.15723 +5.15820 -0.16789 +5.16914 -0.17859 +5.18024 -0.18935 +5.19152 -0.20016 +5.20298 -0.21102 +5.21462 -0.22194 +5.22645 -0.23292 +5.23848 -0.24395 +5.25071 -0.25505 +5.26316 -0.26620 +5.27582 -0.27742 +5.28872 -0.28871 +5.30185 -0.30006 +5.31523 -0.31149 +5.32886 -0.32298 +5.34276 -0.33455 +5.35694 -0.34620 +5.37141 -0.35792 +5.38619 -0.36973 +5.40128 -0.38162 +5.41670 -0.39360 +5.43248 -0.40567 +5.44862 -0.41783 +5.46514 -0.43009 +5.48207 -0.44246 +5.49943 -0.45493 +5.51724 -0.46752 +5.53553 -0.48022 +5.55433 -0.49305 +5.57367 -0.50600 +5.59359 -0.51909 +5.61412 -0.53232 +5.63530 -0.54570 +5.65720 -0.55925 +5.67986 -0.57296 +5.70334 -0.58685 +5.72773 -0.60094 +5.75309 -0.61524 +5.77952 -0.62976 +5.80714 -0.64452 +5.83607 -0.65955 +5.86648 -0.67488 +5.89854 -0.69052 +5.93249 -0.70652 +5.96862 -0.72294 +6.00730 -0.73982 +6.04901 -0.75724 +6.09440 -0.77530 +6.14442 -0.79416 +6.20046 -0.81401 +6.26480 -0.83521 +6.34164 -0.85836 +6.44070 -0.88489 +6.60174 -0.92047 diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/axessimilitude-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/axessimilitude-1.pdf Binary files differnew file mode 100644 index 0000000000..02861f899f --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/axessimilitude-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/axessimilitude.1 b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/axessimilitude.1 new file mode 100644 index 0000000000..5429141f81 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/axessimilitude.1 @@ -0,0 +1,350 @@ +%!PS +%%BoundingBox: -185 -185 351 130 +%%HiResBoundingBox: -184.75018 -184.75018 350.57535 129.47513 +%%Creator: MetaPost 2.10 +%%CreationDate: 2024.10.13:1449 +%%Pages: 1 +%*Font: cmr10 9.96263 9.96265 41:80000000189839 +%*Font: cmr7 6.97385 6.97385 31:e +%*Font: cmmi10 9.96265 9.96265 43:a2 +%%BeginProlog +%%EndProlog +%%Page: 1 1 +gsave newpath -184.25018 -184.25018 moveto +-184.25018 128.97513 lineto +350.07535 128.97513 lineto +350.07535 -184.25018 lineto + closepath clip + 0.6552 0.7448 0.84001 setrgbcolor +newpath 313.28333 0.00839 moveto +-184.24129 -71.80072 lineto +-184.24452 -71.8012 -184.25018 -71.81084 -184.25018 -71.80405 curveto +-184.25018 71.80447 lineto +-184.25018 71.81917 -184.236 71.79997 -184.22711 71.79869 curveto +313.25258 -0.00392 lineto +313.27377 -0.00697 313.3094 0.01216 313.28333 0.00839 curveto closepath fill + 0.5148 0.5852 0.66 setrgbcolor +newpath 27.63303 24.44064 moveto +3.69157 0.0059 lineto +3.6894 0.00371 3.66844 0.01772 3.67947 0.00645 curveto +27.64157 -24.45049 lineto +27.64903 -24.4581 27.63753 -24.44553 27.63753 -24.44109 curveto +27.63753 24.44263 lineto +27.63753 24.44481 27.63507 24.44273 27.63303 24.44064 curveto closepath fill +newpath -27.63326 -31.96431 moveto +3.68849 0.00275 lineto +3.69342 0.00778 3.68306 0.00278 3.68193 0.00394 curveto +-27.63858 31.97127 lineto +-27.63937 31.97208 -27.63753 31.97284 -27.63753 31.97162 curveto +-27.63753 -31.97179 lineto +-27.63753 -31.97998 -27.63583 -31.96693 -27.63326 -31.96431 curveto closepath fill + 1 1 1 setrgbcolor 0 0.99626 dtransform truncate idtransform setlinewidth pop + [] 0 setdash 1 setlinejoin 10 setmiterlimit +newpath -18.42502 0 moveto +-18.42502 14.6605 -24.24976 28.71881 -34.61551 39.08456 curveto +-44.98126 49.45032 -59.03957 55.27505 -73.70007 55.27505 curveto +-88.36058 55.27505 -102.41888 49.45032 -112.78464 39.08456 curveto +-123.15039 28.71881 -128.97513 14.6605 -128.97513 0 curveto +-128.97513 -14.6605 -123.15039 -28.71881 -112.78464 -39.08456 curveto +-102.41888 -49.45032 -88.36058 -55.27505 -73.70007 -55.27505 curveto +-59.03957 -55.27505 -44.98126 -49.45032 -34.61551 -39.08456 curveto +-24.24976 -28.71881 -18.42502 -14.6605 -18.42502 0 curveto closepath +gsave fill grestore stroke +newpath 92.12509 0 moveto +92.12509 9.77367 88.24194 19.14587 81.33144 26.05638 curveto +74.42093 32.96689 65.04872 36.85004 55.27505 36.85004 curveto +45.50139 36.85004 36.12918 32.96689 29.21867 26.05638 curveto +22.30817 19.14587 18.42502 9.77367 18.42502 0 curveto +18.42502 -9.77367 22.30817 -19.14587 29.21867 -26.05638 curveto +36.12918 -32.96689 45.50139 -36.85004 55.27505 -36.85004 curveto +65.04872 -36.85004 74.42093 -32.96689 81.33144 -26.05638 curveto +88.24194 -19.14587 92.12509 -9.77367 92.12509 0 curveto closepath +gsave fill grestore stroke +newpath 18.42502 -73.70007 moveto +18.42502 -68.81323 16.48344 -64.12714 13.02818 -60.67189 curveto +9.57294 -57.21663 4.88684 -55.27505 0 -55.27505 curveto +-4.88684 -55.27505 -9.57294 -57.21663 -13.02818 -60.67189 curveto +-16.48344 -64.12714 -18.42502 -68.81323 -18.42502 -73.70007 curveto +-18.42502 -78.58691 -16.48344 -83.27301 -13.02818 -86.72826 curveto +-9.57294 -90.18352 -4.88684 -92.12509 0 -92.12509 curveto +4.88684 -92.12509 9.57294 -90.18352 13.02818 -86.72826 curveto +16.48344 -83.27301 18.42502 -78.58691 18.42502 -73.70007 curveto closepath +gsave fill grestore stroke + 0.468 0.532 0.6 setrgbcolor +newpath -18.42502 0 moveto +-18.42502 14.6605 -24.24976 28.71881 -34.61551 39.08456 curveto +-44.98126 49.45032 -59.03957 55.27505 -73.70007 55.27505 curveto +-88.36058 55.27505 -102.41888 49.45032 -112.78464 39.08456 curveto +-123.15039 28.71881 -128.97513 14.6605 -128.97513 0 curveto +-128.97513 -14.6605 -123.15039 -28.71881 -112.78464 -39.08456 curveto +-102.41888 -49.45032 -88.36058 -55.27505 -73.70007 -55.27505 curveto +-59.03957 -55.27505 -44.98126 -49.45032 -34.61551 -39.08456 curveto +-24.24976 -28.71881 -18.42502 -14.6605 -18.42502 0 curveto closepath stroke +newpath 92.12509 0 moveto +92.12509 9.77367 88.24194 19.14587 81.33144 26.05638 curveto +74.42093 32.96689 65.04872 36.85004 55.27505 36.85004 curveto +45.50139 36.85004 36.12918 32.96689 29.21867 26.05638 curveto +22.30817 19.14587 18.42502 9.77367 18.42502 0 curveto +18.42502 -9.77367 22.30817 -19.14587 29.21867 -26.05638 curveto +36.12918 -32.96689 45.50139 -36.85004 55.27505 -36.85004 curveto +65.04872 -36.85004 74.42093 -32.96689 81.33144 -26.05638 curveto +88.24194 -19.14587 92.12509 -9.77367 92.12509 0 curveto closepath stroke +newpath 18.42502 -73.70007 moveto +18.42502 -68.81323 16.48344 -64.12714 13.02818 -60.67189 curveto +9.57294 -57.21663 4.88684 -55.27505 0 -55.27505 curveto +-4.88684 -55.27505 -9.57294 -57.21663 -13.02818 -60.67189 curveto +-16.48344 -64.12714 -18.42502 -68.81323 -18.42502 -73.70007 curveto +-18.42502 -78.58691 -16.48344 -83.27301 -13.02818 -86.72826 curveto +-9.57294 -90.18352 -4.88684 -92.12509 0 -92.12509 curveto +4.88684 -92.12509 9.57294 -90.18352 13.02818 -86.72826 curveto +16.48344 -83.27301 18.42502 -78.58691 18.42502 -73.70007 curveto closepath stroke + 0 0 0 setrgbcolor 0 0.5 dtransform truncate idtransform setlinewidth pop + 1 setlinecap +newpath 1216.05121 0 moveto +-1234.47623 0 lineto stroke +newpath 552.75055 663.30066 moveto +-497.4755 -737.00073 lineto stroke +newpath 663.30066 -737.00073 moveto +-737.00073 663.30066 lineto stroke + 0 0 0.545 setrgbcolor [3 3 ] 0 setdash +newpath -3371.77554 -1473.99866 moveto +3629.72607 1326.59879 lineto stroke + 0.545 0 0 setrgbcolor +newpath 313.22531 0 moveto +-18.42502 -55.27505 lineto stroke +newpath 3.68579 0 moveto +36.85004 -110.55011 lineto stroke +newpath 3.68579 0 moveto +-55.27478 -147.39987 lineto stroke + 1 1 0 setrgbcolor +newpath -72.20007 0 moveto +-72.20007 0.39784 -72.35814 0.77934 -72.63943 1.06064 curveto +-72.92073 1.34193 -73.30223 1.5 -73.70007 1.5 curveto +-74.09792 1.5 -74.47942 1.34193 -74.76071 1.06064 curveto +-75.042 0.77934 -75.20007 0.39784 -75.20007 0 curveto +-75.20007 -0.39784 -75.042 -0.77934 -74.76071 -1.06064 curveto +-74.47942 -1.34193 -74.09792 -1.5 -73.70007 -1.5 curveto +-73.30223 -1.5 -72.92073 -1.34193 -72.63943 -1.06064 curveto +-72.35814 -0.77934 -72.20007 -0.39784 -72.20007 0 curveto closepath fill + 0 0 0 setrgbcolor [] 0 setdash +newpath -72.20007 0 moveto +-72.20007 0.39784 -72.35814 0.77934 -72.63943 1.06064 curveto +-72.92073 1.34193 -73.30223 1.5 -73.70007 1.5 curveto +-74.09792 1.5 -74.47942 1.34193 -74.76071 1.06064 curveto +-75.042 0.77934 -75.20007 0.39784 -75.20007 0 curveto +-75.20007 -0.39784 -75.042 -0.77934 -74.76071 -1.06064 curveto +-74.47942 -1.34193 -74.09792 -1.5 -73.70007 -1.5 curveto +-73.30223 -1.5 -72.92073 -1.34193 -72.63943 -1.06064 curveto +-72.35814 -0.77934 -72.20007 -0.39784 -72.20007 0 curveto closepath stroke + 1 1 0 setrgbcolor +newpath 56.77505 0 moveto +56.77505 0.39784 56.61699 0.77934 56.3357 1.06064 curveto +56.0544 1.34193 55.6729 1.5 55.27505 1.5 curveto +54.87721 1.5 54.49571 1.34193 54.21442 1.06064 curveto +53.93312 0.77934 53.77505 0.39784 53.77505 0 curveto +53.77505 -0.39784 53.93312 -0.77934 54.21442 -1.06064 curveto +54.49571 -1.34193 54.87721 -1.5 55.27505 -1.5 curveto +55.6729 -1.5 56.0544 -1.34193 56.3357 -1.06064 curveto +56.61699 -0.77934 56.77505 -0.39784 56.77505 0 curveto closepath fill + 0 0 0 setrgbcolor +newpath 56.77505 0 moveto +56.77505 0.39784 56.61699 0.77934 56.3357 1.06064 curveto +56.0544 1.34193 55.6729 1.5 55.27505 1.5 curveto +54.87721 1.5 54.49571 1.34193 54.21442 1.06064 curveto +53.93312 0.77934 53.77505 0.39784 53.77505 0 curveto +53.77505 -0.39784 53.93312 -0.77934 54.21442 -1.06064 curveto +54.49571 -1.34193 54.87721 -1.5 55.27505 -1.5 curveto +55.6729 -1.5 56.0544 -1.34193 56.3357 -1.06064 curveto +56.61699 -0.77934 56.77505 -0.39784 56.77505 0 curveto closepath stroke + 1 1 0 setrgbcolor +newpath 1.5 -73.70007 moveto +1.5 -73.30223 1.34193 -72.92073 1.06064 -72.63943 curveto +0.77934 -72.35814 0.39784 -72.20007 0 -72.20007 curveto +-0.39784 -72.20007 -0.77934 -72.35814 -1.06064 -72.63943 curveto +-1.34193 -72.92073 -1.5 -73.30223 -1.5 -73.70007 curveto +-1.5 -74.09792 -1.34193 -74.47942 -1.06064 -74.76071 curveto +-0.77934 -75.042 -0.39784 -75.20007 0 -75.20007 curveto +0.39784 -75.20007 0.77934 -75.042 1.06064 -74.76071 curveto +1.34193 -74.47942 1.5 -74.09792 1.5 -73.70007 curveto closepath fill + 0 0 0 setrgbcolor +newpath 1.5 -73.70007 moveto +1.5 -73.30223 1.34193 -72.92073 1.06064 -72.63943 curveto +0.77934 -72.35814 0.39784 -72.20007 0 -72.20007 curveto +-0.39784 -72.20007 -0.77934 -72.35814 -1.06064 -72.63943 curveto +-1.34193 -72.92073 -1.5 -73.30223 -1.5 -73.70007 curveto +-1.5 -74.09792 -1.34193 -74.47942 -1.06064 -74.76071 curveto +-0.77934 -75.042 -0.39784 -75.20007 0 -75.20007 curveto +0.39784 -75.20007 0.77934 -75.042 1.06064 -74.76071 curveto +1.34193 -74.47942 1.5 -74.09792 1.5 -73.70007 curveto closepath stroke + 0 0 0.545 setrgbcolor +newpath 314.72531 0 moveto +314.72531 0.39784 314.56725 0.77934 314.28595 1.06064 curveto +314.00465 1.34193 313.62315 1.5 313.22531 1.5 curveto +312.82747 1.5 312.44597 1.34193 312.16467 1.06064 curveto +311.88338 0.77934 311.72531 0.39784 311.72531 0 curveto +311.72531 -0.39784 311.88338 -0.77934 312.16467 -1.06064 curveto +312.44597 -1.34193 312.82747 -1.5 313.22531 -1.5 curveto +313.62315 -1.5 314.00465 -1.34193 314.28595 -1.06064 curveto +314.56725 -0.77934 314.72531 -0.39784 314.72531 0 curveto closepath fill + 0 0 0 setrgbcolor +newpath 314.72531 0 moveto +314.72531 0.39784 314.56725 0.77934 314.28595 1.06064 curveto +314.00465 1.34193 313.62315 1.5 313.22531 1.5 curveto +312.82747 1.5 312.44597 1.34193 312.16467 1.06064 curveto +311.88338 0.77934 311.72531 0.39784 311.72531 0 curveto +311.72531 -0.39784 311.88338 -0.77934 312.16467 -1.06064 curveto +312.44597 -1.34193 312.82747 -1.5 313.22531 -1.5 curveto +313.62315 -1.5 314.00465 -1.34193 314.28595 -1.06064 curveto +314.56725 -0.77934 314.72531 -0.39784 314.72531 0 curveto closepath stroke + 0 0 0.545 setrgbcolor +newpath 38.35004 -110.55011 moveto +38.35004 -110.15227 38.19197 -109.77077 37.91068 -109.48947 curveto +37.62938 -109.20818 37.24788 -109.05011 36.85004 -109.05011 curveto +36.4522 -109.05011 36.0707 -109.20818 35.7894 -109.48947 curveto +35.5081 -109.77077 35.35004 -110.15227 35.35004 -110.55011 curveto +35.35004 -110.94795 35.5081 -111.32945 35.7894 -111.61075 curveto +36.0707 -111.89204 36.4522 -112.05011 36.85004 -112.05011 curveto +37.24788 -112.05011 37.62938 -111.89204 37.91068 -111.61075 curveto +38.19197 -111.32945 38.35004 -110.94795 38.35004 -110.55011 curveto closepath fill + 0 0 0 setrgbcolor +newpath 38.35004 -110.55011 moveto +38.35004 -110.15227 38.19197 -109.77077 37.91068 -109.48947 curveto +37.62938 -109.20818 37.24788 -109.05011 36.85004 -109.05011 curveto +36.4522 -109.05011 36.0707 -109.20818 35.7894 -109.48947 curveto +35.5081 -109.77077 35.35004 -110.15227 35.35004 -110.55011 curveto +35.35004 -110.94795 35.5081 -111.32945 35.7894 -111.61075 curveto +36.0707 -111.89204 36.4522 -112.05011 36.85004 -112.05011 curveto +37.24788 -112.05011 37.62938 -111.89204 37.91068 -111.61075 curveto +38.19197 -111.32945 38.35004 -110.94795 38.35004 -110.55011 curveto closepath stroke + 0 0 0.545 setrgbcolor +newpath -53.77478 -147.39987 moveto +-53.77478 -147.00203 -53.93285 -146.62053 -54.21414 -146.33923 curveto +-54.49544 -146.05794 -54.87694 -145.89987 -55.27478 -145.89987 curveto +-55.67262 -145.89987 -56.05412 -146.05794 -56.33542 -146.33923 curveto +-56.61671 -146.62053 -56.77478 -147.00203 -56.77478 -147.39987 curveto +-56.77478 -147.79771 -56.61671 -148.17921 -56.33542 -148.46051 curveto +-56.05412 -148.7418 -55.67262 -148.89987 -55.27478 -148.89987 curveto +-54.87694 -148.89987 -54.49544 -148.7418 -54.21414 -148.46051 curveto +-53.93285 -148.17921 -53.77478 -147.79771 -53.77478 -147.39987 curveto closepath fill + 0 0 0 setrgbcolor +newpath -53.77478 -147.39987 moveto +-53.77478 -147.00203 -53.93285 -146.62053 -54.21414 -146.33923 curveto +-54.49544 -146.05794 -54.87694 -145.89987 -55.27478 -145.89987 curveto +-55.67262 -145.89987 -56.05412 -146.05794 -56.33542 -146.33923 curveto +-56.61671 -146.62053 -56.77478 -147.00203 -56.77478 -147.39987 curveto +-56.77478 -147.79771 -56.61671 -148.17921 -56.33542 -148.46051 curveto +-56.05412 -148.7418 -55.67262 -148.89987 -55.27478 -148.89987 curveto +-54.87694 -148.89987 -54.49544 -148.7418 -54.21414 -148.46051 curveto +-53.93285 -148.17921 -53.77478 -147.79771 -53.77478 -147.39987 curveto closepath stroke + 0.545 0 0 setrgbcolor +newpath 5.18579 0 moveto +5.18579 0.39784 5.02773 0.77934 4.74643 1.06064 curveto +4.46513 1.34193 4.08363 1.5 3.68579 1.5 curveto +3.28795 1.5 2.90645 1.34193 2.62515 1.06064 curveto +2.34386 0.77934 2.18579 0.39784 2.18579 0 curveto +2.18579 -0.39784 2.34386 -0.77934 2.62515 -1.06064 curveto +2.90645 -1.34193 3.28795 -1.5 3.68579 -1.5 curveto +4.08363 -1.5 4.46513 -1.34193 4.74643 -1.06064 curveto +5.02773 -0.77934 5.18579 -0.39784 5.18579 0 curveto closepath fill + 0 0 0 setrgbcolor +newpath 5.18579 0 moveto +5.18579 0.39784 5.02773 0.77934 4.74643 1.06064 curveto +4.46513 1.34193 4.08363 1.5 3.68579 1.5 curveto +3.28795 1.5 2.90645 1.34193 2.62515 1.06064 curveto +2.34386 0.77934 2.18579 0.39784 2.18579 0 curveto +2.18579 -0.39784 2.34386 -0.77934 2.62515 -1.06064 curveto +2.90645 -1.34193 3.28795 -1.5 3.68579 -1.5 curveto +4.08363 -1.5 4.46513 -1.34193 4.74643 -1.06064 curveto +5.02773 -0.77934 5.18579 -0.39784 5.18579 0 curveto closepath stroke + 0.545 0 0 setrgbcolor +newpath -16.92502 -55.27505 moveto +-16.92502 -54.87721 -17.08308 -54.49571 -17.36438 -54.21442 curveto +-17.64568 -53.93312 -18.02718 -53.77505 -18.42502 -53.77505 curveto +-18.82286 -53.77505 -19.20436 -53.93312 -19.48566 -54.21442 curveto +-19.76695 -54.49571 -19.92502 -54.87721 -19.92502 -55.27505 curveto +-19.92502 -55.6729 -19.76695 -56.0544 -19.48566 -56.3357 curveto +-19.20436 -56.61699 -18.82286 -56.77505 -18.42502 -56.77505 curveto +-18.02718 -56.77505 -17.64568 -56.61699 -17.36438 -56.3357 curveto +-17.08308 -56.0544 -16.92502 -55.6729 -16.92502 -55.27505 curveto closepath fill + 0 0 0 setrgbcolor +newpath -16.92502 -55.27505 moveto +-16.92502 -54.87721 -17.08308 -54.49571 -17.36438 -54.21442 curveto +-17.64568 -53.93312 -18.02718 -53.77505 -18.42502 -53.77505 curveto +-18.82286 -53.77505 -19.20436 -53.93312 -19.48566 -54.21442 curveto +-19.76695 -54.49571 -19.92502 -54.87721 -19.92502 -55.27505 curveto +-19.92502 -55.6729 -19.76695 -56.0544 -19.48566 -56.3357 curveto +-19.20436 -56.61699 -18.82286 -56.77505 -18.42502 -56.77505 curveto +-18.02718 -56.77505 -17.64568 -56.61699 -17.36438 -56.3357 curveto +-17.08308 -56.0544 -16.92502 -55.6729 -16.92502 -55.27505 curveto closepath stroke + 0.545 0 0 setrgbcolor +newpath 19.92474 -49.13376 moveto +19.92474 -48.73592 19.76668 -48.35442 19.48538 -48.07312 curveto +19.20409 -47.79182 18.82259 -47.63376 18.42474 -47.63376 curveto +18.0269 -47.63376 17.6454 -47.79182 17.3641 -48.07312 curveto +17.08281 -48.35442 16.92474 -48.73592 16.92474 -49.13376 curveto +16.92474 -49.5316 17.08281 -49.9131 17.3641 -50.1944 curveto +17.6454 -50.4757 18.0269 -50.63376 18.42474 -50.63376 curveto +18.82259 -50.63376 19.20409 -50.4757 19.48538 -50.1944 curveto +19.76668 -49.9131 19.92474 -49.5316 19.92474 -49.13376 curveto closepath fill + 0 0 0 setrgbcolor +newpath 19.92474 -49.13376 moveto +19.92474 -48.73592 19.76668 -48.35442 19.48538 -48.07312 curveto +19.20409 -47.79182 18.82259 -47.63376 18.42474 -47.63376 curveto +18.0269 -47.63376 17.6454 -47.79182 17.3641 -48.07312 curveto +17.08281 -48.35442 16.92474 -48.73592 16.92474 -49.13376 curveto +16.92474 -49.5316 17.08281 -49.9131 17.3641 -50.1944 curveto +17.6454 -50.4757 18.0269 -50.63376 18.42474 -50.63376 curveto +18.82259 -50.63376 19.20409 -50.4757 19.48538 -50.1944 curveto +19.76668 -49.9131 19.92474 -49.5316 19.92474 -49.13376 curveto closepath stroke +305.3278 7.49442 moveto +(E) cmmi10 9.96265 fshow +312.6822 6.00002 moveto +(12) cmr7 6.97385 fshow +28.95253 -123.35791 moveto +(E) cmmi10 9.96265 fshow +36.30693 -124.85231 moveto +(31) cmr7 6.97385 fshow +-63.17229 -160.20767 moveto +(E) cmmi10 9.96265 fshow +-55.81789 -161.70207 moveto +(23) cmr7 6.97385 fshow +-2.72421 7.49442 moveto +(I) cmmi10 9.96265 fshow +1.65518 6.00002 moveto +(12) cmr7 6.97385 fshow +-35.445 -66.28284 moveto +(I) cmmi10 9.96265 fshow +-31.06561 -67.77724 moveto +(31) cmr7 6.97385 fshow +22.62473 -60.14154 moveto +(I) cmmi10 9.96265 fshow +27.00412 -61.63594 moveto +(23) cmr7 6.97385 fshow +-79.49503 7.49442 moveto +(C) cmmi10 9.96265 fshow +-72.37453 6.00002 moveto +(1) cmr7 6.97385 fshow +49.4801 7.49442 moveto +(C) cmmi10 9.96265 fshow +56.6006 6.00002 moveto +(2) cmr7 6.97385 fshow +-5.79495 -86.50787 moveto +(C) cmmi10 9.96265 fshow +1.32555 -88.00227 moveto +(3) cmr7 6.97385 fshow +gsave [0.92719 0.3746 -0.3746 0.92719 128.9754 -70.6998 ] concat 0 0 moveto +(Axe) cmr10 9.96263 fshow grestore +gsave [0.92719 0.3746 -0.3746 0.92719 147.96304 -63.02837 ] concat 0 0 moveto +(de) cmr10 9.96263 fshow grestore +gsave [0.92719 0.3746 -0.3746 0.92719 160.2793 -58.05234 ] concat 0 0 moveto +(similitude) cmr10 9.96263 fshow grestore +grestore + 1 1 1 setrgbcolor 0 1 dtransform truncate idtransform setlinewidth pop + [] 0 setdash 1 setlinejoin 10 setmiterlimit +newpath -184.25018 -184.25018 moveto +-184.25018 128.97513 lineto +350.07535 128.97513 lineto +350.07535 -184.25018 lineto + closepath stroke +showpage +%%EOF diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/axessimilitude.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/axessimilitude.mp new file mode 100644 index 0000000000..fd4a0f4755 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/axessimilitude.mp @@ -0,0 +1,98 @@ +input geom2d; +%%% depuis Drawing with Metapost de Toby Thurston +labeloffset := 6; +gddTaillePoint := 3; +gddCouleurPoint := Yellow; +gddU:=0.65cm; +beginfig(1); + C1 = Cercle((-4,0),3); + C2 = Cercle((3,0),2); + C3 = Cercle((0,-4),1); + + T1 = TangenteCommuneExterieure(C1,C2); + T2 = TangenteCommuneExterieure(C2,C1); + T3 = TangenteCommuneInterieure(C1,C2); + T4 = TangenteCommuneInterieure(C2,C1); + + T5 = TangenteCommuneExterieure(C2,C3); + T6 = TangenteCommuneExterieure(C3,C2); + T7 = TangenteCommuneInterieure(C2,C3); + T8 = TangenteCommuneInterieure(C3,C2); + + T9 = TangenteCommuneExterieure(C1,C3); + T10 = TangenteCommuneExterieure(C3,C1); + T11 = TangenteCommuneInterieure(C1,C3); + T12 = TangenteCommuneInterieure(C3,C1); + + E12 = IntersectionDroites(T1,T2); + E23 = IntersectionDroites(T5,T6); + E31 = IntersectionDroites(T9,T10); + I12 = IntersectionDroites(T3,T4); + I23 = IntersectionDroites(T7,T8); + I31 = IntersectionDroites(T11,T12); + + path t[]; + t1 :=(gddTraceObjet T1) gddEnPlace; + t2 := (gddTraceObjet T2) gddEnPlace; + t3 := (-10*gddU,-10*gddU)--(-10gddU,10*gddU); + fill buildcycle(t1, t3,reverse t2) withcolor 1.4*LightSlateGrey; + + t4 :=(gddTraceObjet T3) gddEnPlace; + t5 := (gddTraceObjet T4) gddEnPlace; + t6 := (1.5*gddU,-10*gddU)--(1.5*gddU,10*gddU); + fill buildcycle(t4, t5,reverse t6) withcolor 1.1*LightSlateGrey; + + t7 :=(gddTraceObjet T3) gddEnPlace; + t8 := (gddTraceObjet T4) gddEnPlace; + t9 := (-1.5*gddU,-10*gddU)--(-1.5*gddU,10*gddU); + fill buildcycle(t7, t8,reverse t9) withcolor 1.1*LightSlateGrey; + + drawoptions(withpen pencircle scaled 1pt withcolor LightSlateGrey); + colorie C1 withcolor white; + colorie C2 withcolor white; + colorie C3 withcolor white; + trace C1; trace C2; trace C3; + + drawoptions(); + trace Droite(Centre(C1),Centre(C2)); + trace Droite(Centre(C3),Centre(C2)); + trace Droite(Centre(C1),Centre(C3)); + + D_E = Droite(E12,E23); + trace D_E dashed evenly withcolor DarkBlue; + + E_I = Segment(E12,I31); + trace E_I dashed evenly withcolor DarkRed; + I_E1 = Segment(I12,E31); + trace I_E1 dashed evenly withcolor DarkRed; + I_E2 = Segment(I12,E23); + trace I_E2 dashed evenly withcolor DarkRed; + + + drawoptions(); + pointe Centre(C1); + pointe Centre(C2); + pointe Centre(C3); + gddCouleurPoint := DarkBlue; + pointe E12; pointe E31; pointe E23; + gddCouleurPoint := DarkRed; + pointe I12; pointe I31; pointe I23; + + label.top(btex $E_{12}$ etex,PointTOPair(E12) gddEnPlace); + label.bot(btex $E_{31}$ etex,PointTOPair(E31) gddEnPlace); + label.bot(btex $E_{23}$ etex,PointTOPair(E23) gddEnPlace); + + label.top(btex $I_{12}$ etex,PointTOPair(I12) gddEnPlace); + label.llft(btex $I_{31}$ etex,PointTOPair(I31) gddEnPlace); + label.lrt(btex $I_{23}$ etex,PointTOPair(I23) gddEnPlace); + + + label.top(btex $C_{1}$ etex,PointTOPair(Centre(C1)) gddEnPlace); + label.top(btex $C_{2}$ etex,PointTOPair(Centre(C2)) gddEnPlace); + label.bot(btex $C_{3}$ etex,PointTOPair(Centre(C3)) gddEnPlace); + + draw textext("Axe de similitude") rotated (22) shifted (0.5[Pt(E23),Pt(E12)] + gddEnPlace +(0,3)); + Fenetre(-10,-10,19,7); +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles1-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles1-1.pdf Binary files differnew file mode 100644 index 0000000000..b32e7b092c --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles1-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles1-1.png b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles1-1.png Binary files differnew file mode 100644 index 0000000000..5288505bf3 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles1-1.png diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles1.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles1.mp new file mode 100644 index 0000000000..c7f1c99699 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles1.mp @@ -0,0 +1,37 @@ +input geom2d; + +labeloffset := 6; + +gddTaillePoint := 3; +gddCouleurPoint := Yellow; + +beginfig(1); + + Repere(9,9,4,5,0.8,0.8); + Axes; + Debut; + Graduations; + Unites(1); + + C1 = Cercle((1,1),3); + C2 = Cercle((-1,-2),1); + + P1 = IntersectionCercles(C1,C2); + P2 = IntersectionCercles(C2,C1); + + drawoptions(withcolor LightSlateGrey); + trace C1; + trace C2; + + drawoptions(); + pointe Point(1,1); + pointe Point(-1,-2); + pointe P1; + pointe P2; + label.urt(textext("\(P_1\)"),PtR(P1)); + label.top(textext("\(P_2\)"),PtR(P2)); + + Fin; + +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles2-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles2-1.pdf Binary files differnew file mode 100644 index 0000000000..d39a73d14f --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles2-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles2-1.png b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles2-1.png Binary files differnew file mode 100644 index 0000000000..c32660dfd6 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles2-1.png diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles2.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles2.mp new file mode 100644 index 0000000000..9020be7c20 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles2.mp @@ -0,0 +1,34 @@ +input geom2d; + +labeloffset := 6; +gddTaillePoint := 2; +gddCouleurPoint := Yellow; + +beginfig(1); + Repere(9,9,4,5,0.8,0.8); + Axes; + Debut; + Axes; + Graduations; Unites(1); + + C1 = Cercle((1,1),3); + C2 = Cercle((-1,-2),1); + + T1 = TangenteCommuneExterieure(C1,C2); + T2 = TangenteCommuneExterieure(C2,C1); + + drawoptions(withcolor LightSlateGrey); + trace C1; + trace C2; + + drawoptions(withcolor Olive); + trace T1; + trace T2; + + drawoptions(); + pointe Point(1,1); + pointe Point(-1,-2); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3-001.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3-001.pdf Binary files differnew file mode 100644 index 0000000000..5f16f972ac --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3-001.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3-1.pdf Binary files differnew file mode 100644 index 0000000000..9e9d57dacb --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3-2.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3-2.pdf Binary files differnew file mode 100644 index 0000000000..c3f83f5ae6 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3-2.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3.001 b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3.001 new file mode 100644 index 0000000000..29a5d6af67 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3.001 @@ -0,0 +1,76 @@ +%!PS +%%BoundingBox: -1033 -2116 849 2051 +%%HiResBoundingBox: -1032.62207 -2115.02084 848.11754 2050.78284 +%%Creator: MetaPost 2.02 +%%CreationDate: 2023.11.19:1336 +%%Pages: 1 +%%BeginProlog +%%EndProlog +%%Page: 1 1 + 0.468 0.532 0.6 setrgbcolor 0 0.5 dtransform truncate idtransform setlinewidth pop + [] 0 setdash 1 setlinejoin 10 setmiterlimit +newpath 113.3858 28.34645 moveto +113.3858 50.90129 104.42459 72.52965 88.47713 88.47713 curveto +72.52965 104.42459 50.90129 113.3858 28.34645 113.3858 curveto +5.79161 113.3858 -15.83675 104.42459 -31.78423 88.47713 curveto +-47.73169 72.52965 -56.6929 50.90129 -56.6929 28.34645 curveto +-56.6929 5.79161 -47.73169 -15.83675 -31.78423 -31.78423 curveto +-15.83675 -47.73169 5.79161 -56.6929 28.34645 -56.6929 curveto +50.90129 -56.6929 72.52965 -47.73169 88.47713 -31.78423 curveto +104.42459 -15.83675 113.3858 5.79161 113.3858 28.34645 curveto closepath stroke +newpath -56.6929 -85.03935 moveto +-56.6929 -77.52107 -59.67998 -70.31161 -64.99579 -64.99579 curveto +-70.31161 -59.67998 -77.52107 -56.6929 -85.03935 -56.6929 curveto +-92.55763 -56.6929 -99.76709 -59.67998 -105.08292 -64.99579 curveto +-110.39873 -70.31161 -113.3858 -77.52107 -113.3858 -85.03935 curveto +-113.3858 -92.55763 -110.39873 -99.76709 -105.08292 -105.08292 curveto +-99.76709 -110.39873 -92.55763 -113.3858 -85.03935 -113.3858 curveto +-77.52107 -113.3858 -70.31161 -110.39873 -64.99579 -105.08292 curveto +-59.67998 -99.76709 -56.6929 -92.55763 -56.6929 -85.03935 curveto closepath stroke + 0.5 0.5 0 setrgbcolor 1 setlinecap +newpath 847.86754 2050.53284 moveto +-1032.37207 -2114.77084 lineto stroke +newpath 589.01413 188.14299 moveto +-799.40399 -438.61998 lineto stroke + 1 1 0 setrgbcolor +newpath 29.34645 28.34645 moveto +29.34645 28.61168 29.24107 28.86601 29.05354 29.05354 curveto +28.86601 29.24107 28.61168 29.34645 28.34645 29.34645 curveto +28.08122 29.34645 27.82689 29.24107 27.63936 29.05354 curveto +27.45183 28.86601 27.34645 28.61168 27.34645 28.34645 curveto +27.34645 28.08122 27.45183 27.82689 27.63936 27.63936 curveto +27.82689 27.45183 28.08122 27.34645 28.34645 27.34645 curveto +28.61168 27.34645 28.86601 27.45183 29.05354 27.63936 curveto +29.24107 27.82689 29.34645 28.08122 29.34645 28.34645 curveto closepath fill + 0 0 0 setrgbcolor +newpath 29.34645 28.34645 moveto +29.34645 28.61168 29.24107 28.86601 29.05354 29.05354 curveto +28.86601 29.24107 28.61168 29.34645 28.34645 29.34645 curveto +28.08122 29.34645 27.82689 29.24107 27.63936 29.05354 curveto +27.45183 28.86601 27.34645 28.61168 27.34645 28.34645 curveto +27.34645 28.08122 27.45183 27.82689 27.63936 27.63936 curveto +27.82689 27.45183 28.08122 27.34645 28.34645 27.34645 curveto +28.61168 27.34645 28.86601 27.45183 29.05354 27.63936 curveto +29.24107 27.82689 29.34645 28.08122 29.34645 28.34645 curveto closepath stroke + 1 1 0 setrgbcolor +newpath -84.03935 -85.03935 moveto +-84.03935 -84.77412 -84.14473 -84.51979 -84.33226 -84.33226 curveto +-84.51979 -84.14473 -84.77412 -84.03935 -85.03935 -84.03935 curveto +-85.30458 -84.03935 -85.55891 -84.14473 -85.74644 -84.33226 curveto +-85.93398 -84.51979 -86.03935 -84.77412 -86.03935 -85.03935 curveto +-86.03935 -85.30458 -85.93398 -85.55891 -85.74644 -85.74644 curveto +-85.55891 -85.93398 -85.30458 -86.03935 -85.03935 -86.03935 curveto +-84.77412 -86.03935 -84.51979 -85.93398 -84.33226 -85.74644 curveto +-84.14473 -85.55891 -84.03935 -85.30458 -84.03935 -85.03935 curveto closepath fill + 0 0 0 setrgbcolor +newpath -84.03935 -85.03935 moveto +-84.03935 -84.77412 -84.14473 -84.51979 -84.33226 -84.33226 curveto +-84.51979 -84.14473 -84.77412 -84.03935 -85.03935 -84.03935 curveto +-85.30458 -84.03935 -85.55891 -84.14473 -85.74644 -84.33226 curveto +-85.93398 -84.51979 -86.03935 -84.77412 -86.03935 -85.03935 curveto +-86.03935 -85.30458 -85.93398 -85.55891 -85.74644 -85.74644 curveto +-85.55891 -85.93398 -85.30458 -86.03935 -85.03935 -86.03935 curveto +-84.77412 -86.03935 -84.51979 -85.93398 -84.33226 -85.74644 curveto +-84.14473 -85.55891 -84.03935 -85.30458 -84.03935 -85.03935 curveto closepath stroke +showpage +%%EOF diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3.mp new file mode 100644 index 0000000000..aff09b49ea --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/cercles3.mp @@ -0,0 +1,58 @@ +input geom2d; + +labeloffset := 6; + +gddTaillePoint := 2; +gddCouleurPoint := Yellow; + + + +beginfig(1); + + + C1 = Cercle((1,1),3); + C2 = Cercle((-3,-3),1); + + T1 = TangenteCommuneExterieure(C1,C2); + T2 = TangenteCommuneExterieure(C2,C1); + T3 = TangenteCommuneInterieure(C1,C2); + T4 = TangenteCommuneInterieure(C2,C1); + + + drawoptions(withcolor LightSlateGrey); + trace C1; + trace C2; + + drawoptions(withcolor Olive); + trace T1; + trace T2; + + + drawoptions(withcolor DarkRed); + trace T3; + trace T4; + + drawoptions(); + pointe Centre(C1); + pointe Centre(C2); + + a = angle((0,-1)); + show a; + +endfig; + +beginfig(2); + + A = Point(0,0); + B = Point(2,1); + C = Point(1,3); + + K = CercleTroisPoints(A,B,C); + + trace K; + pointe A; + pointe B; + pointe C; +endfig; + +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/inter-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/inter-1.pdf Binary files differnew file mode 100644 index 0000000000..e56765abe6 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/inter-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/inter.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/inter.mp new file mode 100644 index 0000000000..4fd719ca0c --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cercles/inter.mp @@ -0,0 +1,22 @@ +input geom2d; + +beginfig(1); +gddPointeType:="croix"; +A = Point(1,1); +pointe A avecCrayon(1,green); +B = Point(4,4); + +CA = CercleD(A,1); +trace CA; +CB = CercleD(B,2); +trace CB; +%C = IntersectionCercles(CA,CA); +%trace C; +D = Point(2,3); +E = Point(4,-1); +DE = Droite(D,E); +trace DE; +%C = IntersectionDroiteCercle(DE,CA,1); +%pointe C; +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-1.pdf Binary files differnew file mode 100644 index 0000000000..41fa9854bd --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-2.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-2.pdf Binary files differnew file mode 100644 index 0000000000..377acbfc82 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-2.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-3.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-3.pdf Binary files differnew file mode 100644 index 0000000000..4dca328210 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-3.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-4.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-4.pdf Binary files differnew file mode 100644 index 0000000000..9f4c93c43f --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse-4.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse.mp new file mode 100644 index 0000000000..b95e3d82d2 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/ellipse.mp @@ -0,0 +1,105 @@ +input geom2d; + +beginfig(1); + C = Point(3,2); + A = Point(5,1); + B = Point(3.5,3) ; + E = Ellipse(C,A,B); + F = EllipseF(C,A,2.5); + D = Centre(F); + pointe D; + trace E; + trace F; + pointe C; + pointe A; + pointe B; +endfig; + + + +beginfig(2); + F1 = Point(3,1); + F2 = Point(1.5,0.5); + E := EllipseF(F1,F2,1.2); + trace E; + + bboxmargin := 1cm; + path cadre; cadre = bbox currentpicture; + + pair M; + M = point 3.5 of (gddTraceObjet(E)) ; + M' = PointImp(M); + + d:=Longueur(M',F1)+Longueur(M',F2); + show d; % Pour vérifier que l'on obtient bien 2a + + trace Segment(F1,M'); + trace Segment(F2,M'); + D := TangenteEllipse(E,M); + trace D; + + gddTaillePoint := 1.5; + gddCouleurPoint := Yellow; + pointe M'; + gddCouleurPoint := Gainsboro; + pointe F1; + pointe F2; + + setbounds currentpicture to cadre; +endfig; + + +beginfig(3); + F1 := Point(3,1); + F2 := Point(1.5,0.5); + E := EllipseF(F1,F2,1.2); + trace E; + + bboxmargin := 5cm; + path cadre; cadre = bbox currentpicture; + numeric M; + P = Point(1,-1); + C1 = CercleCP(P,F1); + trace C1; + C2 = Cercle(F2,2*DemiGrandAxe(E)); + trace C2; + T1 = IntersectionCercles(C1,C2); + T2 = IntersectionCercles(C2,C1); + if(Longueur(F1,T1)<Longueur(F1,T2)): + U = T1; + else: + U = T2; + fi + DU = Segment(F2,U); + pair Ip; + Ip := (gddTraceObjet(DU)) intersectionpoint (gddTraceObjet(E)); + M = PointImp(Ip); + trace DU; + marque.urt "M"; + marque.urt "P"; + marque.urt "F1"; + marque.urt "F2"; + marque.urt "T1"; + marque.urt "T2"; + + setbounds currentpicture to cadre; +endfig; +beginfig(4); + F1 := Point(3,1); + F2 := Point(1.5,0.5); + E := EllipseF(F1,F2,1.2); + trace E; + P := Point(4,1); + bboxmargin := 5cm; + path cadre; cadre = bbox currentpicture; + T1 := TangenteExterieureEllipse(E,P,1); + trace T1; + T2 := TangenteExterieureEllipse(E,P,2); + trace T2; + marque.urt "P"; + pointe gddB[T1]; + + pointe gddB[T2]; + setbounds currentpicture to cadre; +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/hyper-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/hyper-1.pdf Binary files differnew file mode 100644 index 0000000000..7bd2bd78e6 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/hyper-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/hyper.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/hyper.mp new file mode 100644 index 0000000000..f01557feb6 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/coniques/hyper.mp @@ -0,0 +1,41 @@ +input geom2d; + +beginfig(1); + A = Point(0,0); + B = Point(3,2); + AB = Droite(A,B); + F_1 = Point(-1,1); + Hyper = HyperboleFD(F_1,AB,1.5); + O = Centre(Hyper); + F_2 = Foyer(Hyper,2); + Axe = Droite(F_1,F_2); + S_1 = Sommet(Hyper,1); + S_2 = Sommet(Hyper,2); + + trace Axe dashed evenly; + C = CerclePrincipale(Hyper) ; + trace C avecCrayon(0.5,LightSlateGray) dashed evenly; + A_1 = AsymptoteHyperbole(Hyper,1); + A_2 = AsymptoteHyperbole(Hyper,2); + trace A_1 dashed evenly; + trace A_2 dashed evenly; + + D_1 = Directrice(Hyper,1); + D_2 = Directrice(Hyper,2); + + trace D_1 avecCrayon(1.1,CornflowerBlue); + trace D_2 avecCrayon(1.1,CornflowerBlue); + trace DemiHyperbole(Hyper,1) avecCrayon(1.5,Crimson); + trace DemiHyperbole(Hyper,2) avecCrayon(1.5,Crimson); + + marque.lft "O"; + marque.lft "S_1"; + marque.lft "S_2"; + marque.lft "F_1"; + marque.lft "F_2"; + label.lft(textext("\(\mathcal{C}\)"),Pt(PointDe(C,0.6)) gddEnPlace) withcolor LightSlateGray; + label.top(textext("\(\mathcal{D}_1\)"),Pt(PointDe(D_1,0.47)) gddEnPlace) withcolor CornflowerBlue; + label.top(textext("\(\mathcal{D}_2\)"),Pt(PointDe(D_2,0.46)) gddEnPlace) withcolor CornflowerBlue; + Fenetre(-4,-7,4,4); +endfig; +end. diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/construction/ogiveentiers-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/construction/ogiveentiers-1.pdf Binary files differnew file mode 100644 index 0000000000..91f4a16e7d --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/construction/ogiveentiers-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/construction/ogiveentiers.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/construction/ogiveentiers.mp new file mode 100644 index 0000000000..b02c8e0bce --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/construction/ogiveentiers.mp @@ -0,0 +1,126 @@ +input geom2d; + +beginfig(1); + % les points de base pour l'ogive + O = Point(0,0); + A = Point(-3,0); + A2 = Point(-4,0); + B = Point(3,0); + B2 = Point(4,0); + % la droite de base de l'ogive + AB = Droite(A,B); + % on se prend une droite quelconque + Ct = Point(0.8,-2); % point quelconque + AC = Droite(A,Ct); % droite quelconque + % on prend trois longueures égales sur la droite + longueurTier := 1.4; + C1 = ReportSurDroite(A,AC,longueurTier); + C2 = ReportSurDroite(C1,AC,longueurTier); + C3 = ReportSurDroite(C2,AC,longueurTier); + % on définit la droite qui passe par B et le dernier point + BC = Droite(B,C3); + % on construit une droite perpendiculaire à BC + D = Point(-4,0); + perpD = DroitePerpendiculaire(BC,D); + DD = IntersectionDroites(perpD,BC); + % on projette C2 et C1 sar la droite AB pour diviser [AB] en 3 parties + % égales + perpC2 = DroitePerpendiculaire(perpD,C2); + perpC1 = DroitePerpendiculaire(perpD,C1); + D1 = IntersectionDroites(AB,perpC1); + D2 = IntersectionDroites(AB,perpC2); + % on construit l'enveloppe de l'ogive + C_DA = CercleCP(D2,A); + C_DB = CercleCP(D1,B); + C_DA2 = CercleCP(D2,A2); + C_DB2 = CercleCP(D1,B2); + % on construit le point P pour la projection finale + C_AB = CercleCP(A,B); + C_BA = CercleCP(B,A); + P = IntersectionCercles(C_BA,C_AB); + % on prend 5 longueures égales sur la droite quelconque du début + longueurCinq :=0.8; + F1 = ReportSurDroite(A,AC,longueurCinq); + F2 = ReportSurDroite(F1,AC,longueurCinq); + F3 = ReportSurDroite(F2,AC,longueurCinq); + F4 = ReportSurDroite(F3,AC,longueurCinq); + F5 = ReportSurDroite(F4,AC,longueurCinq); + % on projette les points sur AB pour diviser [AB] en 5 parties égale + BF5 = Droite(B,F5); + perpF5 = DroitePerpendiculaire(BF5,A2); + CC = IntersectionDroites(BF5,perpF5); + perpF4 = DroitePerpendiculaire(perpF5,F4); + perpF3 = DroitePerpendiculaire(perpF5,F3); + perpF2 = DroitePerpendiculaire(perpF5,F2); + perpF1 = DroitePerpendiculaire(perpF5,F1); + G1 = IntersectionDroites(AB,perpF1); + G2 = IntersectionDroites(AB,perpF2); + G3 = IntersectionDroites(AB,perpF3); + G4 = IntersectionDroites(AB,perpF4); + % on projette les Gi sur l'ogive avec le point P + PG1 = Droite(P,G1); + PG2 = Droite(P,G2); + PG3 = Droite(P,G3); + PG4 = Droite(P,G4); + I1 = IntersectionDroiteCercle(PG1,C_DA,1); + I2 = IntersectionDroiteCercle(PG2,C_DA,2); + I3 = IntersectionDroiteCercle(PG3,C_DB,2); + I4 = IntersectionDroiteCercle(PG4,C_DB,2); + % à partir des 2 points issus de la division en 3 de [AB] + % on trace les séparations des pierres qui constituent l'ogive + Dvoute1 = Droite(D2,I1); + Dvoute2 = Droite(D2,I2); + Dvoute3 = Droite(D1,I3); + Dvoute4 = Droite(D1,I4); + + % les tracés + drawoptions(withcolor 1.3*Grey); + trace perpC2; trace perpC1; + trace AB; + trace AC; + trace BC; + trace perpD; + trace SigneOrtho(B,DD,A2,0.2); + + drawoptions(withcolor Bisque); + trace BF5; + trace perpF5;trace perpF4;trace perpF3;trace perpF2;trace perpF1; + trace SigneOrtho(B,CC,A2,0.2); + + drawoptions(withcolor SteelBlue withpen pencircle scaled 0.85pt); + trace gddTraceArcDeCercle(C_DA,Pi/2,Pi); + trace gddTraceArcDeCercle(C_DA2,Pi/2,Pi); + trace gddTraceArcDeCercle(C_DB2,0,Pi/2); + trace gddTraceArcDeCercle(C_DB,0,Pi/2); + + drawoptions(); + trace gddTraceArcDeCercle(C_AB,0,-Pi/2) dashed evenly; + trace gddTraceArcDeCercle(C_BA,Pi,3Pi/2) dashed evenly; + + drawoptions(withcolor DarkSalmon); + trace PG1; trace PG2; trace PG3; trace PG4; + + drawoptions(withcolor SteelBlue withpen pencircle scaled 0.85pt); + trace Dvoute1; trace Dvoute2; trace Dvoute3; trace Dvoute4; + drawoptions(); + + gddCouleurPoint := DarkRed; + pointe O; + pointe A; + pointe B; pointe D; + pointe B2; + + gddCouleurPoint := Bisque; + pointe F1; pointe F2; pointe F3; pointe F4; pointe F5; + pointe G1; pointe G2;pointe G3;pointe G4; + gddCouleurPoint := 1.3*Grey; + pointe DD; + pointe C1; pointe C2; pointe C3; + pointe D1; pointe D2; + + gddCouleurPoint := DarkSalmon; + pointe P; + pointe I1; pointe I2; pointe I3; pointe I4; + Fenetre(-5,-7,5,5); +endfig; +end. diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp01-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp01-1.pdf Binary files differnew file mode 100644 index 0000000000..f3e9c46b9f --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp01-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp01.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp01.mp new file mode 100644 index 0000000000..615e1cca93 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp01.mp @@ -0,0 +1,38 @@ +input geom2d; + + +labeloffset := 6; +gddU:=1.2cm; + +vardef f(expr t) = 2*cos(t)*cos(t)*cos(t) enddef; +vardef g(expr t) = 2*sin(t)*sin(t)*sin(t) enddef; + + +beginfig(1); + Repere(8,8,4,4,1.8,1.8); + Axes; + Debut; + Graduations; Unites(1); + drawoptions(withpen pencircle scaled 0.5 withcolor LightSlateGrey); + trace ((-2,-2)--(-2,2)--(2,2)--(2,-2)--cycle); + + nb = 80; + pas = 2*Pi/nb; + for i=0 upto nb: trace (0,2*sin(i*pas))--(2*cos(i*pas),0); endfor; + + fleche Segment((2,0),(1.2,0)) avecCrayon(1,RoyalBlue); + fleche Segment((-2,0),(-1.2,0)) avecCrayon(1,RoyalBlue); + fleche Segment((0,2),(0,1.2)) avecCrayon(1,RoyalBlue); + fleche Segment((0,-2),(0,-1.2)) avecCrayon(1,RoyalBlue); + + trace Courbe(f,g,0,2*Pi,500) avecCrayon(1.5,DarkOrange); + + pointe Point(0,0); + pointe Point(2,0); + pointe Point(0,2); + pointe Point(0,-2); + pointe Point(-2,0); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp02-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp02-1.pdf Binary files differnew file mode 100644 index 0000000000..456b3d7eb2 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp02-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp02.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp02.mp new file mode 100644 index 0000000000..6e0162b6d9 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp02.mp @@ -0,0 +1,35 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef f(expr t) = sin(2*t+Pi/3) enddef; +vardef g(expr t) = sin(3*t) enddef; + +beginfig(1); + Repere(8,8,4,4,3,3); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + trace ((-1,-1)--(-1,1)--(1,1)--(1,-1)--cycle); + trace ((-1,-1)--(1,1)); + trace (1,-1)--(-1,1); + trace Cercle(origine,1); + trace ((-1,0.5)--(1,0.5)); + trace ((-1,-0.5)--(1,-0.5)); + trace ((0.5,-1)--(0.5,1)); + trace ((-0.5,-1)--(-0.5,1)); + trace ((-1,sqrt(3)/2)--(1,sqrt(3)/2)); + trace ((-1,-sqrt(3)/2)--(1,-sqrt(3)/2)); + trace ((sqrt(3)/2,-1)--(sqrt(3)/2,1)); + trace ((-sqrt(3)/2,-1)--(-sqrt(3)/2,1)); + + trace Courbe(f,g,0,2*Pi,500) avecCrayon(1.5,Orchid); + + pointe Point(0,0); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp03-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp03-1.pdf Binary files differnew file mode 100644 index 0000000000..a40bc09ec5 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp03-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp03.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp03.mp new file mode 100644 index 0000000000..f96fdfed5c --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp03.mp @@ -0,0 +1,21 @@ +input geom2d; + +labeloffset := 6; +gddU:=1cm; + +vardef f(expr t) = t*t enddef; +vardef g(expr t) = t*t*t enddef; + +beginfig(1); + + Repere(8,12,2,6,1,1); + Axes; + Debut; + Graduations; Unites(1); + fleche Segment((0,0),(2,0)) avecCrayon(1,Crimson); + trace Courbe(f,g,-3,3,300) avecCrayon(1.5,DarkTurquoise); + pointe Point(0,0); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp04-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp04-1.pdf Binary files differnew file mode 100644 index 0000000000..53791974cd --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp04-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp04.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp04.mp new file mode 100644 index 0000000000..d179e05f05 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp04.mp @@ -0,0 +1,37 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef f(expr t) = t*t+2/t enddef; +vardef g(expr t) = t+1/t enddef; +vardef fp(expr t) = t*t enddef; +vardef gp(expr t) = t enddef; + +beginfig(1); + + Repere(12,10,5,4,0.7,0.7); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + trace Droite(Point(-4,-2),Point(4,2)); + trace (3,0)--(3,2)--(0,2) dashed evenly; + trace (-1,0)--(-1,-2)--(0,-2) dashed evenly; + trace Courbe(fp,gp,-4,4,500); + + fleche Segment((3,2),(5,8/3)) avecCrayon(1,DeepPink); + fleche Segment((-1,-2),(-2.8,-2)) avecCrayon(1,DeepPink); + fleche Segment((-1,-2),(0.8,-2)) avecCrayon(1,DeepPink); + + trace Courbe(f,g,-5,-0.1,100) avecCrayon(1.5,DarkCyan); + trace Courbe(f,g,0.1,5,100) avecCrayon(1.5,DarkCyan); + + pointe Point(0,0); + pointe Point(3,2); + pointe Point(-1,-2); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp05-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp05-1.pdf Binary files differnew file mode 100644 index 0000000000..d44adddc0d --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp05-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp05.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp05.mp new file mode 100644 index 0000000000..902fff5db3 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp05.mp @@ -0,0 +1,37 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef f(expr t) = t*t-2*t enddef; +vardef g(expr t) = t*t + 1/(t*t) enddef; +vardef fp(expr t) = 2*t+t*t enddef; +vardef gp(expr t) = t*t enddef; + +beginfig(1); + + Repere(8,10,2,1,1,1); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + trace (3,0)--(3,2)--(-1,2)--(-1,0) dashed evenly; + trace (1,0)--(1,6)--(0,6) dashed evenly; + trace Courbe(fp,gp,-5,5,500); + + fleche Segment((-1,2),(-1,2)+(0.5,2)) avecCrayon(1,Crimson); + fleche Segment((3,2),(4,2)) avecCrayon(1,Crimson); + fleche Segment((3,2),(2,2)) avecCrayon(1,Crimson); + + trace Courbe(f,g,-10,-0.05,300) avecCrayon(1.5,DarkGoldenrod); + trace Courbe(f,g,0.05,10,300) avecCrayon(1.5,DarkGoldenrod); + + pointe Point(0,0); + pointe Point(-1,2); + pointe Point(3,2); + pointe Point(1,6); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp06-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp06-1.pdf Binary files differnew file mode 100644 index 0000000000..ac66491dcf --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp06-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp06.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp06.mp new file mode 100644 index 0000000000..9c0b170d2c --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp06.mp @@ -0,0 +1,31 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef f(expr t) = 1/t + 1/(t+1) enddef; +vardef g(expr t) = 1/t + 1/(1+2*t+t**2) enddef; +vardef p(expr x) = x*(x+2)+2 enddef; + +beginfig(1); + + Repere(10,10,5,5,1,1); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + trace Droite(origine,Point(1,1)); + trace Representation(p,-3,1,20); + + trace Courbe(f,g,-20,-1.1,300) avecCrayon(1.5,Teal); + trace Courbe(f,g,-0.9,-0.1,300) avecCrayon(1.5,Teal); + trace Courbe(f,g,0.1,20,300) avecCrayon(1.5,Teal); + + pointe Point(0,0); + pointe Point(-1,0); + pointe Point(-0.526,-0.140); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp07-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp07-1.pdf Binary files differnew file mode 100644 index 0000000000..8d20576d7e --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp07-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp07.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp07.mp new file mode 100644 index 0000000000..7b595e0ea9 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp07.mp @@ -0,0 +1,26 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef f(expr t) = t/sqrt(1+t*t) enddef; +vardef g(expr t) = t*(1+f(t)) enddef; +vardef h(expr t) = -t*(1+f(t)) enddef; + +beginfig(1); + + Repere(6,10,3,5,2,2); + Axes; + Debut; + Graduations; Unites(1); + + trace Droite((1,-2),(1,2)) withcolor MidnightBlue; + + trace (-1,0)..Courbe(f,g,-18,18,200) avecCrayon(1.5,DarkSalmon); + trace (-1,0)..Courbe(f,h,-18,18,200) avecCrayon(1.5,DarkSalmon); + + pointe Point(0,0); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp08-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp08-1.pdf Binary files differnew file mode 100644 index 0000000000..182205040d --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp08-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp08.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp08.mp new file mode 100644 index 0000000000..6a2f749580 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/courbes/cp08.mp @@ -0,0 +1,38 @@ +input geom2d; + +labeloffset := 6; +gddU:=1cm; + +vardef f(expr t) = 2*sin(t) enddef; +vardef g(expr t) = 2*cos(t)*cos(t)/(2-cos(t)) enddef; +vardef h(expr t) = -t*(1+f(t)) enddef; + +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + +path bicorne; +bicorne = Courbe(f,g,-Pi,Pi,200)--cycle; + +beginfig(1); + + Repere(9,6,4.5,1,2,2); + Axes; + Debut; + Axes; + Graduations; Unites(1); + + colorieAvecTransparence(bicorne,CadetBlue,0.2); + + traceDoubleVecteur((0,2),(0.5,0)) avecCrayon(1,Crimson); + traceDoubleVecteur((0,2/3),(0.5,0)) avecCrayon(1,Crimson); + fleche Segment((2,0),(1.6,0.4)) avecCrayon(1,Crimson); + fleche Segment((-2,0),(-1.6,0.4)) avecCrayon(1,Crimson); + + trace bicorne avecCrayon(1.5,CadetBlue); + + pointe Point(0,0); + pointe Point(2,0); + pointe Point(-2,0); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001-1.dat b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001-1.dat new file mode 100644 index 0000000000..82bb5f73b3 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001-1.dat @@ -0,0 +1,441 @@ +-9.50332 39.03779 +-8.90985 36.92109 +-8.35830 34.94184 +-7.84242 33.07748 +-7.35647 31.30663 +-6.89478 29.60762 +-6.45128 27.95615 +-6.01847 26.32078 +-5.58493 24.65153 +-5.12641 22.83954 +-4.53013 20.37356 +-4.21630 18.99730 +-3.82624 17.15868 +-3.60655 16.02255 +-3.48053 15.31960 +-3.39084 14.78786 +-3.32137 14.35307 +-3.26497 13.98196 +-3.21775 13.65636 +-3.17735 13.36511 +-3.14222 13.10083 +-3.11127 12.85833 +-3.08371 12.63385 +-3.05896 12.42451 +-3.03656 12.22812 +-3.01615 12.04292 +-2.99745 11.86749 +-2.98023 11.70069 +-2.96428 11.54154 +-2.94946 11.38925 +-2.93563 11.24313 +-2.92266 11.10259 +-2.91047 10.96713 +-2.89896 10.83630 +-2.88807 10.70973 +-2.87772 10.58707 +-2.86785 10.46803 +-2.85843 10.35233 +-2.84940 10.23975 +-2.84071 10.13006 +-2.83235 10.02307 +-2.82426 9.91862 +-2.81643 9.81654 +-2.80883 9.71668 +-2.80143 9.61893 +-2.79421 9.52315 +-2.78715 9.42923 +-2.78023 9.33709 +-2.77343 9.24662 +-2.76675 9.15773 +-2.76016 9.07035 +-2.75365 8.98441 +-2.74721 8.89983 +-2.74083 8.81655 +-2.73449 8.73451 +-2.72820 8.65365 +-2.72193 8.57393 +-2.71568 8.49529 +-2.70944 8.41770 +-2.70321 8.34109 +-2.69697 8.26545 +-2.69072 8.19072 +-2.68446 8.11687 +-2.67818 8.04387 +-2.67186 7.97168 +-2.66552 7.90029 +-2.65914 7.82964 +-2.65272 7.75973 +-2.64625 7.69053 +-2.63973 7.62200 +-2.63316 7.55413 +-2.62653 7.48689 +-2.61983 7.42027 +-2.61308 7.35425 +-2.60625 7.28880 +-2.59935 7.22390 +-2.59238 7.15955 +-2.58533 7.09572 +-2.57821 7.03240 +-2.57100 6.96957 +-2.56370 6.90722 +-2.55632 6.84533 +-2.54885 6.78390 +-2.54129 6.72290 +-2.53363 6.66233 +-2.52588 6.60218 +-2.51803 6.54243 +-2.51009 6.48308 +-2.50204 6.42410 +-2.49389 6.36550 +-2.48564 6.30727 +-2.47728 6.24939 +-2.46881 6.19185 +-2.46024 6.13466 +-2.45155 6.07779 +-2.44276 6.02124 +-2.43385 5.96501 +-2.42483 5.90908 +-2.41569 5.85345 +-2.40644 5.79812 +-2.39707 5.74307 +-2.38758 5.68830 +-2.37797 5.63381 +-2.36823 5.57958 +-2.35838 5.52561 +-2.34841 5.47190 +-2.33831 5.41844 +-2.32808 5.36523 +-2.31773 5.31226 +-2.30726 5.25952 +-2.29665 5.20701 +-2.28592 5.15473 +-2.27506 5.10268 +-2.26406 5.05084 +-2.25294 4.99921 +-2.24168 4.94779 +-2.23030 4.89658 +-2.21877 4.84557 +-2.20712 4.79475 +-2.19532 4.74413 +-2.18340 4.69370 +-2.17133 4.64346 +-2.15913 4.59340 +-2.14679 4.54352 +-2.13431 4.49382 +-2.12169 4.44430 +-2.10893 4.39494 +-2.09603 4.34575 +-2.08299 4.29673 +-2.06981 4.24786 +-2.05648 4.19916 +-2.04301 4.15062 +-2.02939 4.10223 +-2.01563 4.05398 +-2.00172 4.00589 +-1.98766 3.95795 +-1.97346 3.91015 +-1.95911 3.86249 +-1.94461 3.81497 +-1.92996 3.76758 +-1.91516 3.72033 +-1.90020 3.67322 +-1.88510 3.62623 +-1.86984 3.57937 +-1.85443 3.53263 +-1.83887 3.48602 +-1.82315 3.43954 +-1.80727 3.39317 +-1.79124 3.34691 +-1.77505 3.30078 +-1.75870 3.25475 +-1.74219 3.20884 +-1.72552 3.16304 +-1.70869 3.11735 +-1.69170 3.07176 +-1.67455 3.02627 +-1.65723 2.98089 +-1.63975 2.93560 +-1.62210 2.89042 +-1.60429 2.84533 +-1.58631 2.80033 +-1.56816 2.75543 +-1.54984 2.71061 +-1.53135 2.66589 +-1.51269 2.62125 +-1.49386 2.57670 +-1.47485 2.53222 +-1.45567 2.48783 +-1.43631 2.44352 +-1.41677 2.39929 +-1.39705 2.35513 +-1.37716 2.31104 +-1.35708 2.26703 +-1.33682 2.22308 +-1.31637 2.17920 +-1.29574 2.13538 +-1.27492 2.09163 +-1.25392 2.04794 +-1.23272 2.00430 +-1.21133 1.96072 +-1.18974 1.91720 +-1.16796 1.87372 +-1.14598 1.83030 +-1.12380 1.78692 +-1.10142 1.74359 +-1.07884 1.70029 +-1.05605 1.65704 +-1.03305 1.61382 +-1.00984 1.57063 +-0.98641 1.52748 +-0.96277 1.48435 +-0.93892 1.44125 +-0.91484 1.39816 +-0.89054 1.35510 +-0.86601 1.31205 +-0.84125 1.26901 +-0.81625 1.22598 +-0.79102 1.18295 +-0.76556 1.13992 +-0.73984 1.09688 +-0.71388 1.05384 +-0.68767 1.01078 +-0.66120 0.96771 +-0.63447 0.92461 +-0.60747 0.88149 +-0.58020 0.83833 +-0.55266 0.79513 +-0.52484 0.75189 +-0.49673 0.70859 +-0.46833 0.66524 +-0.43962 0.62183 +-0.41062 0.57834 +-0.38130 0.53477 +-0.35165 0.49112 +-0.32168 0.44737 +-0.29137 0.40351 +-0.26072 0.35954 +-0.22971 0.31545 +-0.19833 0.27122 +-0.16657 0.22684 +-0.13443 0.18230 +-0.10188 0.13758 +-0.06892 0.09268 +-0.03553 0.04758 +-0.00169 0.00225 +0.03262 -0.04332 +0.06740 -0.08914 +0.10268 -0.13524 +0.13849 -0.18165 +0.17485 -0.22838 +0.21178 -0.27548 +0.24930 -0.32295 +0.28747 -0.37085 +0.32629 -0.41921 +0.36583 -0.46806 +0.40611 -0.51747 +0.44718 -0.56746 +0.48910 -0.61812 +0.53194 -0.66949 +0.57575 -0.72166 +0.62061 -0.77472 +0.66663 -0.82875 +0.71390 -0.88389 +0.76254 -0.94027 +0.81271 -0.99805 +0.86459 -1.05742 +0.91838 -1.11864 +0.97436 -1.18200 +1.03287 -1.24788 +1.09435 -1.31679 +1.15939 -1.38939 +1.22880 -1.46660 +1.30380 -1.54981 +1.38626 -1.64115 +1.47945 -1.74439 +1.59010 -1.86727 +1.73787 -2.03254 +2.00722 -2.34049 +2.21922 -2.59293 +2.36996 -2.78029 +2.47176 -2.91150 +2.55344 -3.01993 +2.62335 -3.11523 +2.68533 -3.20180 +2.74151 -3.28210 +2.79322 -3.35762 +2.84135 -3.42941 +2.88655 -3.49818 +2.92929 -3.56448 +2.96993 -3.62870 +3.00876 -3.69119 +3.04601 -3.75218 +3.08186 -3.81190 +3.11648 -3.87052 +3.14999 -3.92820 +3.18250 -3.98504 +3.21411 -4.04117 +3.24490 -4.09668 +3.27495 -4.15165 +3.30431 -4.20615 +3.33306 -4.26025 +3.36122 -4.31400 +3.38887 -4.36747 +3.41602 -4.42069 +3.44272 -4.47371 +3.46901 -4.52658 +3.49491 -4.57931 +3.52046 -4.63197 +3.54567 -4.68456 +3.57058 -4.73713 +3.59521 -4.78969 +3.61956 -4.84229 +3.64368 -4.89493 +3.66757 -4.94765 +3.69125 -5.00047 +3.71473 -5.05340 +3.73804 -5.10648 +3.76118 -5.15971 +3.78417 -5.21312 +3.80702 -5.26673 +3.82975 -5.32056 +3.85236 -5.37461 +3.87487 -5.42891 +3.89729 -5.48348 +3.91963 -5.53833 +3.94189 -5.59348 +3.96409 -5.64894 +3.98624 -5.70473 +4.00834 -5.76087 +4.03041 -5.81737 +4.05245 -5.87424 +4.07447 -5.93150 +4.09647 -5.98917 +4.11848 -6.04727 +4.14049 -6.10579 +4.16251 -6.16477 +4.18455 -6.22422 +4.20662 -6.28415 +4.22872 -6.34458 +4.25086 -6.40553 +4.27305 -6.46700 +4.29529 -6.52902 +4.31760 -6.59160 +4.33997 -6.65476 +4.36242 -6.71851 +4.38496 -6.78287 +4.40758 -6.84787 +4.43030 -6.91351 +4.45312 -6.97981 +4.47605 -7.04680 +4.49910 -7.11448 +4.52227 -7.18289 +4.54558 -7.25203 +4.56902 -7.32193 +4.59261 -7.39261 +4.61635 -7.46409 +4.64025 -7.53638 +4.66431 -7.60951 +4.68856 -7.68351 +4.71298 -7.75839 +4.73759 -7.83418 +4.76241 -7.91090 +4.78742 -7.98857 +4.81266 -8.06722 +4.83811 -8.14688 +4.86380 -8.22757 +4.88972 -8.30932 +4.91590 -8.39215 +4.94233 -8.47610 +4.96903 -8.56119 +4.99601 -8.64746 +5.02327 -8.73493 +5.05083 -8.82364 +5.07869 -8.91362 +5.10687 -9.00491 +5.13538 -9.09753 +5.16423 -9.19153 +5.19343 -9.28695 +5.22300 -9.38382 +5.25294 -9.48219 +5.28326 -9.58209 +5.31399 -9.68357 +5.34513 -9.78667 +5.37669 -9.89145 +5.40870 -9.99794 +5.44117 -10.10619 +5.47410 -10.21627 +5.50753 -10.32822 +5.54146 -10.44209 +5.57591 -10.55795 +5.61090 -10.67586 +5.64645 -10.79587 +5.68257 -10.91805 +5.71929 -11.04247 +5.75663 -11.16920 +5.79460 -11.29831 +5.83324 -11.42988 +5.87255 -11.56398 +5.91258 -11.70070 +5.95333 -11.84013 +5.99485 -11.98234 +6.03715 -12.12745 +6.08027 -12.27554 +6.12422 -12.42671 +6.16906 -12.58108 +6.21480 -12.73875 +6.26148 -12.89984 +6.30914 -13.06448 +6.35782 -13.23279 +6.40754 -13.40490 +6.45836 -13.58097 +6.51032 -13.76112 +6.56346 -13.94553 +6.61783 -14.13435 +6.67349 -14.32776 +6.73047 -14.52594 +6.78884 -14.72907 +6.84866 -14.93737 +6.90998 -15.15103 +6.97288 -15.37029 +7.03742 -15.59538 +7.10367 -15.82656 +7.17172 -16.06408 +7.24163 -16.30823 +7.31351 -16.55930 +7.38743 -16.81761 +7.46350 -17.08349 +7.54182 -17.35731 +7.62250 -17.63943 +7.70566 -17.93027 +7.79142 -18.23024 +7.87991 -18.53982 +7.97129 -18.85948 +8.06569 -19.18976 +8.16328 -19.53122 +8.26424 -19.88445 +8.36875 -20.25011 +8.47703 -20.62888 +8.58927 -21.02152 +8.70572 -21.42883 +8.82664 -21.85169 +8.95229 -22.29102 +9.08296 -22.74786 +9.21899 -23.22330 +9.36072 -23.71854 +9.50853 -24.23490 +9.66284 -24.77379 +9.82409 -25.33678 +9.99278 -25.92556 +10.16946 -26.54200 +10.35472 -27.18816 +10.54923 -27.86631 +10.75371 -28.57894 +10.96897 -29.32883 +11.19590 -30.11906 +11.43550 -30.95305 +11.68889 -31.83463 +11.95732 -32.76810 +12.24220 -33.75829 +12.54510 -34.81064 +12.86784 -35.93132 diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001-1.pdf Binary files differnew file mode 100644 index 0000000000..6f500479b5 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001-2.dat b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001-2.dat new file mode 100644 index 0000000000..a9fb9ed80b --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001-2.dat @@ -0,0 +1,1208 @@ +6.76428 -0.94750 +6.97936 -0.97051 +7.14459 -0.97893 +7.26220 -0.98025 +7.36013 -0.97848 +7.44648 -0.97481 +7.52497 -0.96978 +7.59767 -0.96371 +7.66587 -0.95678 +7.73043 -0.94915 +7.79199 -0.94089 +7.85100 -0.93209 +7.90781 -0.92280 +7.96270 -0.91306 +8.01589 -0.90292 +8.06755 -0.89241 +8.11785 -0.88154 +8.16690 -0.87034 +8.21481 -0.85884 +8.26168 -0.84704 +8.30759 -0.83496 +8.35260 -0.82261 +8.39677 -0.81001 +8.44016 -0.79716 +8.48281 -0.78407 +8.52478 -0.77076 +8.56609 -0.75723 +8.60678 -0.74348 +8.64688 -0.72952 +8.68642 -0.71537 +8.72543 -0.70101 +8.76393 -0.68647 +8.80194 -0.67173 +8.83948 -0.65682 +8.87657 -0.64173 +8.91323 -0.62646 +8.94946 -0.61102 +8.98529 -0.59542 +9.02073 -0.57965 +9.05580 -0.56372 +9.09049 -0.54763 +9.12483 -0.53138 +9.15883 -0.51498 +9.19249 -0.49844 +9.22582 -0.48174 +9.25883 -0.46490 +9.29154 -0.44791 +9.32394 -0.43078 +9.35604 -0.41352 +9.38785 -0.39611 +9.41938 -0.37857 +9.45064 -0.36090 +9.48162 -0.34309 +9.51233 -0.32515 +9.54278 -0.30709 +9.57298 -0.28889 +9.60292 -0.27058 +9.63262 -0.25213 +9.66207 -0.23357 +9.69128 -0.21488 +9.72026 -0.19607 +9.74900 -0.17715 +9.77752 -0.15811 +9.80581 -0.13895 +9.83387 -0.11967 +9.86172 -0.10029 +9.88935 -0.08079 +9.91676 -0.06118 +9.94397 -0.04146 +9.97096 -0.02163 +9.99775 -0.00169 +10.02433 0.01835 +10.05071 0.03850 +10.07689 0.05876 +10.10287 0.07912 +10.12865 0.09958 +10.15424 0.12014 +10.17964 0.14080 +10.20484 0.16157 +10.22986 0.18243 +10.25469 0.20339 +10.27933 0.22444 +10.30379 0.24560 +10.32806 0.26684 +10.35215 0.28819 +10.37607 0.30962 +10.39980 0.33115 +10.42335 0.35277 +10.44673 0.37448 +10.46993 0.39628 +10.49295 0.41817 +10.51580 0.44014 +10.53848 0.46221 +10.56098 0.48436 +10.58332 0.50660 +10.60548 0.52892 +10.62748 0.55133 +10.64931 0.57382 +10.67097 0.59639 +10.69246 0.61905 +10.71379 0.64178 +10.73495 0.66460 +10.75594 0.68750 +10.77678 0.71047 +10.79745 0.73353 +10.81796 0.75666 +10.83830 0.77987 +10.85849 0.80315 +10.87851 0.82651 +10.89837 0.84995 +10.91808 0.87346 +10.93762 0.89704 +10.95701 0.92069 +10.97624 0.94442 +10.99531 0.96822 +11.01422 0.99209 +11.03298 1.01603 +11.05158 1.04003 +11.07002 1.06411 +11.08831 1.08825 +11.10644 1.11247 +11.12442 1.13674 +11.14225 1.16109 +11.15992 1.18549 +11.17744 1.20997 +11.19480 1.23450 +11.21201 1.25910 +11.22907 1.28377 +11.24598 1.30849 +11.26274 1.33328 +11.27934 1.35812 +11.29579 1.38303 +11.31209 1.40799 +11.32824 1.43302 +11.34424 1.45810 +11.36009 1.48324 +11.37579 1.50843 +11.39134 1.53368 +11.40674 1.55899 +11.42199 1.58435 +11.43709 1.60977 +11.45204 1.63523 +11.46685 1.66076 +11.48150 1.68633 +11.49601 1.71196 +11.51037 1.73763 +11.52458 1.76336 +11.53864 1.78914 +11.55256 1.81496 +11.56633 1.84084 +11.57995 1.86676 +11.59342 1.89273 +11.60675 1.91874 +11.61993 1.94480 +11.63296 1.97091 +11.64585 1.99706 +11.65859 2.02326 +11.67118 2.04950 +11.68363 2.07578 +11.69593 2.10211 +11.70809 2.12847 +11.72010 2.15488 +11.73196 2.18133 +11.74368 2.20781 +11.75526 2.23434 +11.76669 2.26091 +11.77797 2.28751 +11.78911 2.31415 +11.80010 2.34083 +11.81095 2.36754 +11.82166 2.39429 +11.83222 2.42107 +11.84263 2.44789 +11.85290 2.47474 +11.86303 2.50163 +11.87301 2.52855 +11.88285 2.55550 +11.89255 2.58248 +11.90210 2.60949 +11.91151 2.63653 +11.92077 2.66360 +11.92989 2.69070 +11.93887 2.71783 +11.94770 2.74499 +11.95639 2.77217 +11.96494 2.79938 +11.97334 2.82661 +11.98160 2.85387 +11.98972 2.88116 +11.99769 2.90847 +12.00552 2.93580 +12.01321 2.96316 +12.02076 2.99054 +12.02816 3.01794 +12.03542 3.04536 +12.04254 3.07280 +12.04952 3.10026 +12.05635 3.12774 +12.06304 3.15524 +12.06959 3.18276 +12.07600 3.21029 +12.08226 3.23784 +12.08839 3.26541 +12.09437 3.29299 +12.10021 3.32059 +12.10590 3.34821 +12.11146 3.37583 +12.11688 3.40347 +12.12215 3.43113 +12.12728 3.45879 +12.13227 3.48647 +12.13712 3.51416 +12.14183 3.54185 +12.14640 3.56956 +12.15082 3.59728 +12.15511 3.62500 +12.15925 3.65274 +12.16326 3.68048 +12.16712 3.70822 +12.17084 3.73598 +12.17442 3.76374 +12.17786 3.79150 +12.18117 3.81927 +12.18433 3.84704 +12.18735 3.87482 +12.19023 3.90259 +12.19297 3.93037 +12.19557 3.95816 +12.19803 3.98594 +12.20035 4.01372 +12.20253 4.04150 +12.20457 4.06928 +12.20648 4.09706 +12.20824 4.12484 +12.20986 4.15261 +12.21135 4.18038 +12.21269 4.20815 +12.21390 4.23591 +12.21496 4.26367 +12.21589 4.29142 +12.21668 4.31917 +12.21733 4.34691 +12.21785 4.37464 +12.21822 4.40236 +12.21845 4.43007 +12.21855 4.45778 +12.21851 4.48547 +12.21833 4.51316 +12.21801 4.54083 +12.21756 4.56849 +12.21697 4.59614 +12.21624 4.62378 +12.21537 4.65140 +12.21436 4.67901 +12.21322 4.70661 +12.21194 4.73419 +12.21052 4.76175 +12.20897 4.78930 +12.20728 4.81683 +12.20545 4.84434 +12.20349 4.87184 +12.20139 4.89931 +12.19915 4.92677 +12.19677 4.95421 +12.19426 4.98162 +12.19162 5.00902 +12.18884 5.03639 +12.18592 5.06374 +12.18287 5.09107 +12.17968 5.11837 +12.17635 5.14565 +12.17289 5.17291 +12.16930 5.20014 +12.16557 5.22735 +12.16170 5.25452 +12.15771 5.28168 +12.15357 5.30880 +12.14930 5.33590 +12.14490 5.36296 +12.14036 5.39000 +12.13569 5.41701 +12.13089 5.44398 +12.12595 5.47093 +12.12087 5.49784 +12.11567 5.52473 +12.11033 5.55157 +12.10486 5.57839 +12.09925 5.60517 +12.09351 5.63192 +12.08764 5.65863 +12.08164 5.68530 +12.07550 5.71194 +12.06923 5.73855 +12.06283 5.76511 +12.05630 5.79164 +12.04963 5.81812 +12.04283 5.84457 +12.03591 5.87098 +12.02885 5.89735 +12.02166 5.92367 +12.01433 5.94996 +12.00688 5.97620 +11.99930 6.00240 +11.99159 6.02856 +11.98374 6.05467 +11.97577 6.08074 +11.96766 6.10676 +11.95943 6.13273 +11.95107 6.15866 +11.94257 6.18455 +11.93395 6.21038 +11.92520 6.23617 +11.91632 6.26191 +11.90731 6.28760 +11.89817 6.31323 +11.88891 6.33882 +11.87951 6.36436 +11.86999 6.38984 +11.86034 6.41528 +11.85057 6.44066 +11.84066 6.46599 +11.83063 6.49126 +11.82047 6.51648 +11.81019 6.54164 +11.79977 6.56675 +11.78923 6.59180 +11.77857 6.61679 +11.76778 6.64173 +11.75686 6.66660 +11.74582 6.69142 +11.73465 6.71618 +11.72336 6.74088 +11.71194 6.76552 +11.70040 6.79010 +11.68873 6.81462 +11.67694 6.83907 +11.66503 6.86346 +11.65299 6.88779 +11.64083 6.91205 +11.62854 6.93625 +11.61613 6.96038 +11.60360 6.98445 +11.59094 7.00845 +11.57816 7.03239 +11.56526 7.05626 +11.55224 7.08005 +11.53910 7.10378 +11.52583 7.12744 +11.51244 7.15104 +11.49894 7.17456 +11.48531 7.19800 +11.47156 7.22138 +11.45769 7.24469 +11.44370 7.26792 +11.42958 7.29108 +11.41535 7.31416 +11.40100 7.33717 +11.38653 7.36011 +11.37195 7.38296 +11.35724 7.40575 +11.34241 7.42845 +11.32747 7.45108 +11.31241 7.47363 +11.29723 7.49610 +11.28193 7.51849 +11.26651 7.54080 +11.25098 7.56303 +11.23533 7.58518 +11.21957 7.60725 +11.20369 7.62923 +11.18769 7.65113 +11.17157 7.67295 +11.15534 7.69469 +11.13900 7.71633 +11.12254 7.73790 +11.10597 7.75938 +11.08928 7.78077 +11.07247 7.80207 +11.05556 7.82329 +11.03853 7.84441 +11.02138 7.86545 +11.00412 7.88640 +10.98675 7.90726 +10.96927 7.92803 +10.95168 7.94870 +10.93397 7.96929 +10.91615 7.98978 +10.89822 8.01018 +10.88018 8.03048 +10.86202 8.05069 +10.84376 8.07081 +10.82538 8.09082 +10.80690 8.11075 +10.78831 8.13057 +10.76960 8.15030 +10.75079 8.16993 +10.73186 8.18946 +10.71283 8.20889 +10.69369 8.22822 +10.67444 8.24745 +10.65509 8.26658 +10.63562 8.28561 +10.61605 8.30453 +10.59637 8.32335 +10.57659 8.34207 +10.55670 8.36068 +10.53670 8.37919 +10.51659 8.39759 +10.49638 8.41589 +10.47607 8.43408 +10.45565 8.45216 +10.43512 8.47013 +10.41449 8.48799 +10.39376 8.50575 +10.37292 8.52339 +10.35198 8.54092 +10.33093 8.55834 +10.30979 8.57565 +10.28853 8.59285 +10.26718 8.60993 +10.24572 8.62689 +10.22417 8.64375 +10.20251 8.66048 +10.18074 8.67710 +10.15888 8.69361 +10.13692 8.70999 +10.11485 8.72626 +10.09269 8.74241 +10.07043 8.75844 +10.04806 8.77435 +10.02560 8.79013 +10.00304 8.80580 +9.98038 8.82134 +9.95762 8.83676 +9.93476 8.85206 +9.91180 8.86723 +9.88875 8.88227 +9.86560 8.89719 +9.84235 8.91199 +9.81900 8.92665 +9.79556 8.94119 +9.77202 8.95560 +9.74839 8.96988 +9.72466 8.98402 +9.70083 8.99804 +9.67691 9.01192 +9.65290 9.02568 +9.62879 9.03929 +9.60458 9.05278 +9.58028 9.06613 +9.55589 9.07934 +9.53141 9.09241 +9.50683 9.10535 +9.48215 9.11815 +9.45739 9.13081 +9.43253 9.14333 +9.40758 9.15571 +9.38254 9.16795 +9.35741 9.18005 +9.33218 9.19200 +9.30686 9.20381 +9.28146 9.21547 +9.25596 9.22699 +9.23037 9.23836 +9.20469 9.24959 +9.17892 9.26066 +9.15306 9.27159 +9.12712 9.28236 +9.10108 9.29299 +9.07495 9.30346 +9.04874 9.31378 +9.02243 9.32394 +8.99604 9.33395 +8.96956 9.34380 +8.94299 9.35350 +8.91633 9.36304 +8.88959 9.37242 +8.86276 9.38164 +8.83584 9.39069 +8.80883 9.39959 +8.78174 9.40832 +8.75456 9.41689 +8.72729 9.42529 +8.69994 9.43353 +8.67250 9.44160 +8.64498 9.44950 +8.61737 9.45723 +8.58967 9.46478 +8.56189 9.47217 +8.53402 9.47938 +8.50607 9.48642 +8.47803 9.49328 +8.44991 9.49997 +8.42170 9.50647 +8.39341 9.51280 +8.36503 9.51894 +8.33657 9.52490 +8.30802 9.53068 +8.27939 9.53627 +8.25067 9.54168 +8.22187 9.54690 +8.19298 9.55192 +8.16401 9.55676 +8.13496 9.56140 +8.10582 9.56585 +8.07659 9.57010 +8.04728 9.57416 +8.01789 9.57801 +7.98841 9.58167 +7.95884 9.58512 +7.92920 9.58836 +7.89946 9.59140 +7.86964 9.59423 +7.83974 9.59686 +7.80975 9.59926 +7.77967 9.60146 +7.74951 9.60344 +7.71926 9.60520 +7.68892 9.60674 +7.65850 9.60805 +7.62799 9.60914 +7.59740 9.61001 +7.56671 9.61064 +7.53594 9.61104 +7.50508 9.61121 +7.47413 9.61114 +7.44309 9.61083 +7.41196 9.61027 +7.38074 9.60947 +7.34943 9.60843 +7.31802 9.60713 +7.28653 9.60557 +7.25494 9.60376 +7.22326 9.60169 +7.19148 9.59935 +7.15960 9.59674 +7.12763 9.59386 +7.09557 9.59071 +7.06340 9.58728 +7.03113 9.58356 +6.99877 9.57955 +6.96630 9.57526 +6.93373 9.57066 +6.90105 9.56577 +6.86827 9.56057 +6.83538 9.55506 +6.80238 9.54923 +6.76926 9.54308 +6.73604 9.53660 +6.70270 9.52979 +6.66924 9.52264 +6.63567 9.51514 +6.60197 9.50729 +6.56815 9.49908 +6.53420 9.49050 +6.50012 9.48155 +6.46591 9.47221 +6.43156 9.46248 +6.39708 9.45235 +6.36244 9.44181 +6.32767 9.43084 +6.29274 9.41944 +6.25765 9.40761 +6.22240 9.39531 +6.18699 9.38255 +6.15141 9.36931 +6.11565 9.35557 +6.07970 9.34132 +6.04356 9.32654 +6.00722 9.31122 +5.97068 9.29533 +5.93392 9.27886 +5.89694 9.26179 +5.85972 9.24408 +5.82225 9.22573 +5.78452 9.20669 +5.74652 9.18694 +5.70822 9.16645 +5.66963 9.14518 +5.63071 9.12309 +5.59144 9.10015 +5.55181 9.07629 +5.51178 9.05147 +5.47133 9.02564 +5.43043 8.99871 +5.38904 8.97063 +5.34711 8.94130 +5.30460 8.91063 +5.26145 8.87850 +5.21760 8.84478 +5.17296 8.80932 +5.12744 8.77194 +5.08093 8.73241 +5.03329 8.69047 +4.98434 8.64578 +4.93386 8.59790 +4.88154 8.54628 +4.82698 8.49015 +4.76961 8.42843 +4.70857 8.35952 +4.64243 8.28078 +4.56857 8.18739 +4.48095 8.06825 +4.35469 7.87798 +4.24481 7.69069 +4.12202 7.45061 +4.04236 7.27224 +3.99228 7.14844 +3.95432 7.04733 +3.92342 6.95961 +3.89728 6.88103 +3.87460 6.80919 +3.85459 6.74262 +3.83671 6.68030 +3.82057 6.62151 +3.80591 6.56571 +3.79249 6.51251 +3.78015 6.46157 +3.76875 6.41263 +3.75819 6.36548 +3.74837 6.31994 +3.73922 6.27587 +3.73067 6.23313 +3.72266 6.19162 +3.71515 6.15124 +3.70810 6.11191 +3.70147 6.07355 +3.69522 6.03610 +3.68933 5.99951 +3.68378 5.96371 +3.67854 5.92867 +3.67358 5.89433 +3.66890 5.86067 +3.66447 5.82765 +3.66027 5.79523 +3.65631 5.76339 +3.65255 5.73209 +3.64900 5.70132 +3.64563 5.67105 +3.64245 5.64126 +3.63943 5.61193 +3.63658 5.58304 +3.63388 5.55458 +3.63133 5.52652 +3.62892 5.49885 +3.62664 5.47157 +3.62449 5.44464 +3.62246 5.41807 +3.62055 5.39184 +3.61875 5.36594 +3.61705 5.34036 +3.61546 5.31508 +3.61397 5.29011 +3.61257 5.26542 +3.61127 5.24101 +3.61005 5.21688 +3.60891 5.19302 +3.60786 5.16941 +3.60688 5.14605 +3.60598 5.12293 +3.60516 5.10006 +3.60440 5.07741 +3.60371 5.05499 +3.60309 5.03279 +3.60253 5.01081 +3.60203 4.98903 +3.60159 4.96746 +3.60121 4.94609 +3.60088 4.92491 +3.60061 4.90392 +3.60039 4.88312 +3.60022 4.86250 +3.60010 4.84206 +3.60003 4.82179 +3.60000 4.80169 +3.60002 4.78176 +3.60008 4.76199 +3.60019 4.74238 +3.60033 4.72293 +3.60052 4.70363 +3.60074 4.68449 +3.60100 4.66549 +3.60130 4.64663 +3.60164 4.62792 +3.60201 4.60934 +3.60241 4.59091 +3.60285 4.57260 +3.60332 4.55443 +3.60382 4.53639 +3.60435 4.51848 +3.60492 4.50069 +3.60551 4.48302 +3.60613 4.46547 +3.60677 4.44805 +3.60745 4.43074 +3.60815 4.41354 +3.60888 4.39646 +3.60963 4.37948 +3.61041 4.36262 +3.61121 4.34586 +3.61203 4.32921 +3.61288 4.31266 +3.61375 4.29622 +3.61464 4.27987 +3.61556 4.26363 +3.61649 4.24748 +3.61745 4.23143 +3.61843 4.21547 +3.61942 4.19961 +3.62044 4.18384 +3.62147 4.16816 +3.62253 4.15256 +3.62360 4.13706 +3.62469 4.12164 +3.62579 4.10631 +3.62692 4.09106 +3.62806 4.07590 +3.62922 4.06082 +3.63039 4.04582 +3.63158 4.03089 +3.63278 4.01605 +3.63400 4.00129 +3.63524 3.98660 +3.63649 3.97198 +3.63775 3.95744 +3.63903 3.94298 +3.64033 3.92858 +3.64163 3.91426 +3.64295 3.90001 +3.64429 3.88583 +3.64563 3.87172 +3.64699 3.85767 +3.64836 3.84370 +3.64975 3.82979 +3.65115 3.81594 +3.65255 3.80216 +3.65397 3.78844 +3.65541 3.77479 +3.65685 3.76120 +3.65830 3.74767 +3.65977 3.73420 +3.66125 3.72079 +3.66273 3.70744 +3.66423 3.69415 +3.66574 3.68092 +3.66726 3.66774 +3.66879 3.65463 +3.67033 3.64156 +3.67188 3.62856 +3.67343 3.61560 +3.67500 3.60270 +3.67658 3.58986 +3.67817 3.57707 +3.67976 3.56433 +3.68137 3.55164 +3.68298 3.53900 +3.68461 3.52641 +3.68624 3.51388 +3.68788 3.50139 +3.68953 3.48895 +3.69118 3.47656 +3.69285 3.46422 +3.69452 3.45192 +3.69620 3.43967 +3.69789 3.42747 +3.69959 3.41532 +3.70130 3.40320 +3.70301 3.39114 +3.70473 3.37912 +3.70646 3.36714 +3.70820 3.35520 +3.70994 3.34331 +3.71169 3.33146 +3.71345 3.31965 +3.71522 3.30789 +3.71699 3.29616 +3.71877 3.28448 +3.72056 3.27283 +3.72235 3.26123 +3.72415 3.24966 +3.72596 3.23814 +3.72778 3.22665 +3.72960 3.21520 +3.73142 3.20379 +3.73326 3.19242 +3.73510 3.18108 +3.73695 3.16978 +3.73880 3.15852 +3.74066 3.14729 +3.74253 3.13610 +3.74440 3.12494 +3.74628 3.11382 +3.74817 3.10274 +3.75006 3.09168 +3.75196 3.08067 +3.75386 3.06968 +3.75577 3.05873 +3.75769 3.04781 +3.75961 3.03692 +3.76154 3.02607 +3.76347 3.01525 +3.76541 3.00446 +3.76736 2.99370 +3.76931 2.98297 +3.77127 2.97227 +3.77323 2.96160 +3.77520 2.95097 +3.77718 2.94036 +3.77916 2.92978 +3.78115 2.91923 +3.78314 2.90871 +3.78514 2.89822 +3.78714 2.88776 +3.78915 2.87733 +3.79116 2.86692 +3.79318 2.85654 +3.79521 2.84619 +3.79724 2.83586 +3.79928 2.82557 +3.80132 2.81529 +3.80337 2.80505 +3.80542 2.79483 +3.80748 2.78464 +3.80954 2.77447 +3.81161 2.76433 +3.81369 2.75421 +3.81577 2.74412 +3.81786 2.73405 +3.81995 2.72401 +3.82204 2.71399 +3.82415 2.70399 +3.82625 2.69402 +3.82837 2.68407 +3.83049 2.67414 +3.83261 2.66424 +3.83474 2.65436 +3.83687 2.64451 +3.83901 2.63467 +3.84116 2.62486 +3.84331 2.61507 +3.84547 2.60530 +3.84763 2.59555 +3.84979 2.58582 +3.85197 2.57612 +3.85414 2.56643 +3.85633 2.55677 +3.85852 2.54713 +3.86071 2.53750 +3.86291 2.52790 +3.86511 2.51832 +3.86732 2.50875 +3.86954 2.49921 +3.87176 2.48968 +3.87399 2.48018 +3.87622 2.47069 +3.87846 2.46122 +3.88070 2.45177 +3.88295 2.44234 +3.88520 2.43293 +3.88746 2.42353 +3.88973 2.41415 +3.89200 2.40479 +3.89427 2.39545 +3.89656 2.38613 +3.89884 2.37682 +3.90114 2.36753 +3.90343 2.35825 +3.90574 2.34900 +3.90805 2.33975 +3.91036 2.33053 +3.91268 2.32132 +3.91501 2.31213 +3.91734 2.30295 +3.91968 2.29379 +3.92203 2.28464 +3.92438 2.27551 +3.92673 2.26640 +3.92909 2.25729 +3.93146 2.24821 +3.93383 2.23914 +3.93621 2.23008 +3.93860 2.22104 +3.94099 2.21201 +3.94339 2.20299 +3.94579 2.19399 +3.94820 2.18501 +3.95061 2.17603 +3.95303 2.16707 +3.95546 2.15813 +3.95790 2.14919 +3.96033 2.14027 +3.96278 2.13137 +3.96523 2.12247 +3.96769 2.11359 +3.97016 2.10472 +3.97263 2.09586 +3.97510 2.08702 +3.97759 2.07818 +3.98008 2.06936 +3.98257 2.06055 +3.98508 2.05175 +3.98759 2.04297 +3.99010 2.03419 +3.99263 2.02543 +3.99515 2.01667 +3.99769 2.00793 +4.00023 1.99920 +4.00278 1.99048 +4.00534 1.98177 +4.00790 1.97307 +4.01047 1.96438 +4.01305 1.95570 +4.01563 1.94703 +4.01822 1.93837 +4.02082 1.92972 +4.02343 1.92108 +4.02604 1.91245 +4.02866 1.90382 +4.03128 1.89521 +4.03392 1.88661 +4.03656 1.87801 +4.03921 1.86943 +4.04186 1.86085 +4.04453 1.85228 +4.04720 1.84372 +4.04987 1.83517 +4.05256 1.82663 +4.05525 1.81809 +4.05795 1.80956 +4.06066 1.80104 +4.06338 1.79253 +4.06610 1.78403 +4.06884 1.77553 +4.07158 1.76704 +4.07433 1.75856 +4.07708 1.75008 +4.07985 1.74162 +4.08262 1.73315 +4.08540 1.72470 +4.08819 1.71625 +4.09099 1.70781 +4.09379 1.69938 +4.09661 1.69095 +4.09943 1.68252 +4.10226 1.67411 +4.10511 1.66570 +4.10795 1.65729 +4.11081 1.64889 +4.11368 1.64050 +4.11656 1.63211 +4.11944 1.62373 +4.12233 1.61535 +4.12524 1.60698 +4.12815 1.59861 +4.13107 1.59025 +4.13400 1.58189 +4.13694 1.57354 +4.13989 1.56519 +4.14285 1.55685 +4.14582 1.54851 +4.14880 1.54017 +4.15179 1.53184 +4.15479 1.52351 +4.15780 1.51519 +4.16082 1.50687 +4.16385 1.49856 +4.16689 1.49024 +4.16994 1.48193 +4.17300 1.47363 +4.17607 1.46533 +4.17915 1.45703 +4.18224 1.44873 +4.18534 1.44043 +4.18846 1.43214 +4.19158 1.42386 +4.19472 1.41557 +4.19786 1.40729 +4.20102 1.39900 +4.20419 1.39072 +4.20737 1.38245 +4.21056 1.37417 +4.21377 1.36590 +4.21698 1.35763 +4.22021 1.34936 +4.22345 1.34109 +4.22670 1.33282 +4.22997 1.32455 +4.23324 1.31629 +4.23653 1.30803 +4.23983 1.29976 +4.24314 1.29150 +4.24647 1.28324 +4.24981 1.27498 +4.25316 1.26672 +4.25653 1.25846 +4.25991 1.25020 +4.26330 1.24194 +4.26670 1.23368 +4.27012 1.22542 +4.27355 1.21715 +4.27700 1.20889 +4.28046 1.20063 +4.28393 1.19237 +4.28742 1.18411 +4.29093 1.17584 +4.29444 1.16758 +4.29798 1.15931 +4.30152 1.15104 +4.30509 1.14278 +4.30866 1.13451 +4.31225 1.12623 +4.31586 1.11796 +4.31949 1.10969 +4.32313 1.10141 +4.32678 1.09313 +4.33045 1.08485 +4.33414 1.07656 +4.33784 1.06828 +4.34156 1.05999 +4.34530 1.05170 +4.34905 1.04340 +4.35282 1.03510 +4.35661 1.02680 +4.36042 1.01850 +4.36424 1.01019 +4.36808 1.00188 +4.37194 0.99357 +4.37582 0.98525 +4.37972 0.97693 +4.38363 0.96860 +4.38756 0.96027 +4.39151 0.95193 +4.39549 0.94360 +4.39948 0.93525 +4.40349 0.92690 +4.40752 0.91855 +4.41157 0.91019 +4.41564 0.90183 +4.41973 0.89346 +4.42384 0.88508 +4.42798 0.87670 +4.43213 0.86832 +4.43631 0.85993 +4.44050 0.85153 +4.44472 0.84313 +4.44896 0.83472 +4.45323 0.82630 +4.45752 0.81788 +4.46183 0.80945 +4.46616 0.80101 +4.47052 0.79257 +4.47490 0.78412 +4.47930 0.77566 +4.48373 0.76719 +4.48819 0.75872 +4.49267 0.75024 +4.49717 0.74175 +4.50171 0.73325 +4.50626 0.72474 +4.51085 0.71623 +4.51546 0.70770 +4.52009 0.69917 +4.52476 0.69063 +4.52945 0.68208 +4.53417 0.67352 +4.53892 0.66495 +4.54370 0.65637 +4.54851 0.64778 +4.55334 0.63918 +4.55821 0.63057 +4.56311 0.62195 +4.56804 0.61332 +4.57300 0.60467 +4.57799 0.59602 +4.58302 0.58735 +4.58807 0.57868 +4.59316 0.56999 +4.59828 0.56129 +4.60344 0.55258 +4.60863 0.54385 +4.61386 0.53512 +4.61912 0.52637 +4.62442 0.51760 +4.62976 0.50883 +4.63513 0.50004 +4.64054 0.49123 +4.64599 0.48242 +4.65148 0.47358 +4.65700 0.46474 +4.66257 0.45588 +4.66818 0.44700 +4.67383 0.43811 +4.67952 0.42921 +4.68525 0.42028 +4.69103 0.41135 +4.69685 0.40239 +4.70271 0.39342 +4.70862 0.38444 +4.71458 0.37543 +4.72058 0.36641 +4.72664 0.35737 +4.73274 0.34831 +4.73889 0.33924 +4.74509 0.33014 +4.75134 0.32103 +4.75764 0.31190 +4.76399 0.30275 +4.77040 0.29358 +4.77687 0.28439 +4.78339 0.27518 +4.78996 0.26594 +4.79660 0.25669 +4.80329 0.24742 +4.81005 0.23812 +4.81686 0.22880 +4.82374 0.21946 +4.83068 0.21009 +4.83768 0.20071 +4.84475 0.19129 +4.85189 0.18186 +4.85910 0.17240 +4.86637 0.16291 +4.87372 0.15340 +4.88114 0.14386 +4.88863 0.13430 +4.89621 0.12470 +4.90385 0.11509 +4.91158 0.10544 +4.91939 0.09576 +4.92728 0.08606 +4.93526 0.07633 +4.94332 0.06656 +4.95147 0.05677 +4.95971 0.04694 +4.96804 0.03708 +4.97647 0.02719 +4.98500 0.01727 +4.99362 0.00731 +5.00235 -0.00268 +5.01118 -0.01271 +5.02012 -0.02277 +5.02916 -0.03287 +5.03832 -0.04301 +5.04760 -0.05318 +5.05699 -0.06340 +5.06650 -0.07365 +5.07614 -0.08395 +5.08591 -0.09428 +5.09581 -0.10466 +5.10584 -0.11508 +5.11602 -0.12555 +5.12634 -0.13606 +5.13680 -0.14662 +5.14742 -0.15723 +5.15820 -0.16789 +5.16914 -0.17859 +5.18024 -0.18935 +5.19152 -0.20016 +5.20298 -0.21102 +5.21462 -0.22194 +5.22645 -0.23292 +5.23848 -0.24395 +5.25071 -0.25505 +5.26316 -0.26620 +5.27582 -0.27742 +5.28872 -0.28871 +5.30185 -0.30006 +5.31523 -0.31149 +5.32886 -0.32298 +5.34276 -0.33455 +5.35694 -0.34620 +5.37141 -0.35792 +5.38619 -0.36973 +5.40128 -0.38162 +5.41670 -0.39360 +5.43248 -0.40567 +5.44862 -0.41783 +5.46514 -0.43009 +5.48207 -0.44246 +5.49943 -0.45493 +5.51724 -0.46752 +5.53553 -0.48022 +5.55433 -0.49305 +5.57367 -0.50600 +5.59359 -0.51909 +5.61412 -0.53232 +5.63530 -0.54570 +5.65720 -0.55925 +5.67986 -0.57296 +5.70334 -0.58685 +5.72773 -0.60094 +5.75309 -0.61524 +5.77952 -0.62976 +5.80714 -0.64452 +5.83607 -0.65955 +5.86648 -0.67488 +5.89854 -0.69052 +5.93249 -0.70652 +5.96862 -0.72294 +6.00730 -0.73982 +6.04901 -0.75724 +6.09440 -0.77530 +6.14442 -0.79416 +6.20046 -0.81401 +6.26480 -0.83521 +6.34164 -0.85836 +6.44070 -0.88489 +6.60174 -0.92047 diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001.mp new file mode 100644 index 0000000000..5bb0ab195c --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/cubiques/K001.mp @@ -0,0 +1,71 @@ +input geom2d; +gddU := 0.5cm; +labeloffset := 8pt; +gddTailleLabel := 1; + +beginfig(1); + A := Point(3.6,4.8); + B := Point(0,0); + C := Point(10,0); + T := Triangle(A,B,C); + X_74 := Point(3.6,-4.8); + + C1 := CourbeDat("K001-1",0); + C2 := CourbeDat("K001-2",1); + + CE1 := CercleExinscrit(T,1); + CE2 := CercleExinscrit(T,2); + CE3 := CercleExinscrit(T,3); + I_1 := Centre(CE1); + I_2 := Centre(CE2); + I_3 := Centre(CE3); + CC := CercleCirconscrit(T); + O := Centre(CC); + + drawoptions(withcolor LightBlue); + trace Droite(A,B); + trace Droite(B,C); + trace Droite(C,A); + trace Droite(I_1,I_2); + trace Droite(I_2,I_3); + trace Droite(I_3,I_1); + trace CE1; + trace CE2; + trace CE3; + trace CC; + colorie T withcolor LightGrey; + drawoptions(withpen pencircle scaled 1.5); + trace T; + drawoptions(withcolor DodgerBlue withpen pencircle scaled 1.5); + trace Droite(O,A); + trace Droite(X_74, Point(2.2,0)); + drawoptions(withpen pencircle scaled 2); + trace C1 withcolor FireBrick; + trace C2 withcolor FireBrick; + drawoptions(withcolor Olive); + trace Droite(A,X_74); + trace Droite(B,X_74); + trace Droite(C,X_74); + drawoptions(); + pointe A; + pointe B; + pointe C; + pointe I_1; + pointe I_2; + pointe I_3; + pointe O; + pointe X_74; + + marque.urt "A"; + marque.llft "B"; + marque.lrt "C"; + marque.rt "I_1"; + marque.rt "I_2"; + marque.lft "I_3"; + marque.bot "O"; + marque.llft "X_74"; + + Fenetre(-4,-13,16,15); +endfig; + +end
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/brach-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/brach-1.pdf Binary files differnew file mode 100644 index 0000000000..afeb4adb35 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/brach-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/brach.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/brach.mp new file mode 100644 index 0000000000..12bdb994c3 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/brach.mp @@ -0,0 +1,54 @@ +input geom2d; + +color darkred,darkblue; +darkred=(.6,0,0); +darkblue=(0,0,.6); + +labeloffset := 6; +gddTaillePoint := 3; +gddCouleurPoint := (1,1,1); + + +% la cycloide +vardef f(expr t)= + t-sin(t) +enddef; +vardef g(expr t)= + cos(t)-1 +enddef; + + +beginfig(1); + Repere(6,4,1,3,1,1); + Axes; + Debut; + Axes; + Graduations; Unites(2); + + A = Point(0,0); + B = Point(f(3),g(3)); + C = Point(2.4,-1); + M = Point(f(2.4),g(2.4)); + N = Point(2.4,0); + C1 = Cercle(C,1); + trace Arc(C,.3,Pi/2,Pi/2+2.4); + trace Droite((2.4,0),C) dashed evenly; + trace Courbe(f,g,0,3,500) withcolor darkred withpen pencircle scaled 1pt; + trace Courbe(f,g,3,4.5,100) dashed evenly; + trace Courbe(f,g,-2,0,100) dashed evenly; + trace C1; + trace Segment(C,M); + trace Arc(C,1,Pi/2,Pi/2+2.4) withcolor darkblue withpen pencircle scaled .7pt; + trace Segment(A,N) withcolor darkblue withpen pencircle scaled .7pt; + + marque.rt "C"; + marque.llft "M"; + pointe(N); + label.urt(textext("$N$"),PtR(N)); + label.ulft(textext("$\theta$"),PtR(C)+.2*gddU*(cos(Pi/2+1.2),sin(Pi/2+1.2))); + gddCouleurPoint := Yellow; + marque.urt "A"; + marque.llft "B"; + Fin; +endfig; +end
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/divers-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/divers-1.pdf Binary files differnew file mode 100644 index 0000000000..2605afcf7d --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/divers-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/divers.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/divers.mp new file mode 100644 index 0000000000..ec691d5e5e --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/divers.mp @@ -0,0 +1,14 @@ +input geom2d; + +beginfig(1); + +A = Point(2,2); +B = Rotation(A,Pi/2); +pointe origine; +pointe A; +pointe B; +C = RotationCentre(B,A,Pi/2); +pointe C; + +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/epicycloide-const-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/epicycloide-const-1.pdf Binary files differnew file mode 100644 index 0000000000..141ce02802 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/epicycloide-const-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/epicycloide-const.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/epicycloide-const.mp new file mode 100644 index 0000000000..5b743ff695 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/epicycloide-const.mp @@ -0,0 +1,66 @@ +input geom2d; +input geom2d-rep; +input geom2d-lbl; +input geom2d-tra; +input geom2d-fct; +input geom2d-plt; +input geom2d-arc; +input svgnames; + +lblPreambule := "\usepackage[frenchb]{babel}" & + "\usepackage[garamond]{mathdesign}" & + "\usepackage{amsmath}"; + +labeloffset := 4; +gddU:=1.3cm; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + +beginfig(1); + + Repere(10,10,5,4,3,3); + Axes; + Debut; + Graduations; + Axes; + ColorieAvecTransparence(Cercle(origine,1),LightSlateGrey,0.5); + trace Cercle(origine,1) avecCrayon(1.5,LightSlateGrey); + + trace Cercle(4/3(cosd(130),sind(130)),1/3); + + drawoptions(withcolor LightSlateGrey); + trace Cercle((0,4/3),1/3); + + centre = Point(4/3cosd(130),4/3sind(130)); + mobile = Point(4/3cosd(130)+1/3cosd(70),4/3sind(130)+1/3sind(70)); + + trace (0,0)--Pt(centre)--Pt(mobile) dashed evenly; + + trace Arc(centre,1/3,-5Pi/18,7Pi/18) avecCrayon(1,DodgerBlue); + trace Arc(origine,1,Pi/2,13Pi/18) avecCrayon(1,DodgerBlue); + fleche Arc(centre,1/6,-5Pi/18,7Pi/18); + fleche Arc(origine,1/3,Pi/2,13Pi/18); + + pointe Point(0,4/3); + pointe centre; + pointe Point(0,0); + pointe Point(cosd(130),sind(130)); + + gddCouleurPoint := Crimson; + + pointe Point(0,1); + pointe mobile; + + drawoptions(withcolor black); + + label.lrt(TEX("\(O\)"),PtR(origine)); + label.ulft(TEX("\(\Omega(\theta)\)"),PtR(centre)); + label.urt(TEX("\(M(\theta)\)"),PtR(mobile)); + label.top(TEX("\(\theta\)"),(1/3cos(11Pi/18),1/3sin(11Pi/18)) gddEnPlace); + label.rt(TEX("\(3\theta\)"),PtR(Addition(centre,(1/6,0)))); + label.bot(TEX("\(N(\theta)\)"),(cos(13Pi/18),sin(13Pi/18)) gddEnPlace); + Fin; + +endfig; + +end
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/pascalline-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/pascalline-1.pdf Binary files differnew file mode 100644 index 0000000000..f08d33ee17 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/pascalline-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/pascalline.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/pascalline.mp new file mode 100644 index 0000000000..f7471da779 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/pascalline.mp @@ -0,0 +1,28 @@ +input geom2d; + +beginfig(1); +C = Cercle(origine,3); +for i:=1 upto 6: + rd := uniformdeviate(1.0/6)+(i-1)/6; + P[i] := PointDe(C,rd); +endfor; +D1 = Droite(P1,P3); S1 = Segment(P1,P3); +D2 = Droite(P3,P5); S2 = Segment(P3,P5); +D3 = Droite(P6,P2); S3 = Segment(P6,P2); +D4 = Droite(P4,P6); S4 = Segment(P4,P6); +D5 = Droite(P5,P2); S5 = Segment(P5,P2); +D6 = Droite(P1,P4); S6 = Segment(P1,P4); +I1 = IntersectionDroites(D1,D3); +I2 = IntersectionDroites(D2,D4); +I3 = IntersectionDroites(D5,D6); +PL = Segment(I1,I2); +trace C; +drawoptions(withcolor (0.7,0.1,0.1)); +trace S1; trace S2; trace S3; trace S4; trace S5; trace S6; +drawoptions(withcolor (0.1,0.7,0.1)); +trace PL; +drawoptions(); +pointe(P1); pointe P2; pointe P3; pointe P4; pointe P5; pointe P6; +pointe I1; pointe I2; pointe I3; +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/point-0.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/point-0.pdf Binary files differnew file mode 100644 index 0000000000..9256dd2d2d --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/point-0.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/point.0 b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/point.0 new file mode 100644 index 0000000000..a620b964b9 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/point.0 @@ -0,0 +1,446 @@ +%!PS +%%BoundingBox: 26 15 144 99 +%%HiResBoundingBox: 26.3517 15.35753 143.727 98.02957 +%%Creator: MetaPost 2.10 +%%CreationDate: 2024.05.27:1529 +%%Pages: 1 +%%BeginProlog +%%EndProlog +%%Page: 1 1 + 0 0 0 setrgbcolor 0 0.5 dtransform truncate idtransform setlinewidth pop + [] 0 setdash 1 setlinejoin 10 setmiterlimit +newpath 141.73225 28.34602 moveto +145.4914 35.8643 143.12198 46.06082 135.14781 56.69247 curveto +127.17451 67.32455 114.24915 77.52065 99.21259 85.03893 curveto +84.17601 92.5572 68.26358 96.78001 54.97446 96.77959 curveto +41.68446 96.78044 32.10559 92.55806 28.34645 85.03978 curveto +24.58731 77.5215 26.95673 67.32498 34.9309 56.69333 curveto +42.90419 46.06125 55.82956 35.86516 70.86613 28.34688 curveto +85.9027 20.8286 101.81512 16.60579 115.10425 16.60622 curveto +128.39424 16.60536 137.97311 20.82774 141.73225 28.34602 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 143.23225 28.34602 moveto +143.23225 28.74387 143.07419 29.12537 142.7929 29.40666 curveto +142.5116 29.68796 142.1301 29.84602 141.73225 29.84602 curveto +141.33441 29.84602 140.95291 29.68796 140.67162 29.40666 curveto +140.39032 29.12537 140.23225 28.74387 140.23225 28.34602 curveto +140.23225 27.94818 140.39032 27.56668 140.67162 27.28539 curveto +140.95291 27.00409 141.33441 26.84602 141.73225 26.84602 curveto +142.1301 26.84602 142.5116 27.00409 142.7929 27.28539 curveto +143.07419 27.56668 143.23225 27.94818 143.23225 28.34602 curveto closepath fill + 0 0 0 setrgbcolor +newpath 143.23225 28.34602 moveto +143.23225 28.74387 143.07419 29.12537 142.7929 29.40666 curveto +142.5116 29.68796 142.1301 29.84602 141.73225 29.84602 curveto +141.33441 29.84602 140.95291 29.68796 140.67162 29.40666 curveto +140.39032 29.12537 140.23225 28.74387 140.23225 28.34602 curveto +140.23225 27.94818 140.39032 27.56668 140.67162 27.28539 curveto +140.95291 27.00409 141.33441 26.84602 141.73225 26.84602 curveto +142.1301 26.84602 142.5116 27.00409 142.7929 27.28539 curveto +143.07419 27.56668 143.23225 27.94818 143.23225 28.34602 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 140.75471 50.38484 moveto +140.75471 50.78268 140.59665 51.16418 140.31535 51.44548 curveto +140.03406 51.72678 139.65256 51.88484 139.25471 51.88484 curveto +138.85687 51.88484 138.47537 51.72678 138.19408 51.44548 curveto +137.91278 51.16418 137.75471 50.78268 137.75471 50.38484 curveto +137.75471 49.987 137.91278 49.6055 138.19408 49.3242 curveto +138.47537 49.04291 138.85687 48.88484 139.25471 48.88484 curveto +139.65256 48.88484 140.03406 49.04291 140.31535 49.3242 curveto +140.59665 49.6055 140.75471 49.987 140.75471 50.38484 curveto closepath fill + 0 0 0 setrgbcolor +newpath 140.75471 50.38484 moveto +140.75471 50.78268 140.59665 51.16418 140.31535 51.44548 curveto +140.03406 51.72678 139.65256 51.88484 139.25471 51.88484 curveto +138.85687 51.88484 138.47537 51.72678 138.19408 51.44548 curveto +137.91278 51.16418 137.75471 50.78268 137.75471 50.38484 curveto +137.75471 49.987 137.91278 49.6055 138.19408 49.3242 curveto +138.47537 49.04291 138.85687 48.88484 139.25471 48.88484 curveto +139.65256 48.88484 140.03406 49.04291 140.31535 49.3242 curveto +140.59665 49.6055 140.75471 49.987 140.75471 50.38484 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 117.55756 74.87787 moveto +117.55756 75.27571 117.39949 75.65721 117.1182 75.9385 curveto +116.8369 76.2198 116.4554 76.37787 116.05756 76.37787 curveto +115.65971 76.37787 115.27821 76.2198 114.99692 75.9385 curveto +114.71562 75.65721 114.55756 75.27571 114.55756 74.87787 curveto +114.55756 74.48003 114.71562 74.09853 114.99692 73.81723 curveto +115.27821 73.53593 115.65971 73.37787 116.05756 73.37787 curveto +116.4554 73.37787 116.8369 73.53593 117.1182 73.81723 curveto +117.39949 74.09853 117.55756 74.48003 117.55756 74.87787 curveto closepath fill + 0 0 0 setrgbcolor +newpath 117.55756 74.87787 moveto +117.55756 75.27571 117.39949 75.65721 117.1182 75.9385 curveto +116.8369 76.2198 116.4554 76.37787 116.05756 76.37787 curveto +115.65971 76.37787 115.27821 76.2198 114.99692 75.9385 curveto +114.71562 75.65721 114.55756 75.27571 114.55756 74.87787 curveto +114.55756 74.48003 114.71562 74.09853 114.99692 73.81723 curveto +115.27821 73.53593 115.65971 73.37787 116.05756 73.37787 curveto +116.4554 73.37787 116.8369 73.53593 117.1182 73.81723 curveto +117.39949 74.09853 117.55756 74.48003 117.55756 74.87787 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 82.46533 92.42181 moveto +82.46533 92.81966 82.30727 93.20116 82.02597 93.48245 curveto +81.74467 93.76375 81.36317 93.92181 80.96533 93.92181 curveto +80.56749 93.92181 80.18599 93.76375 79.9047 93.48245 curveto +79.6234 93.20116 79.46533 92.81966 79.46533 92.42181 curveto +79.46533 92.02397 79.6234 91.64247 79.9047 91.36118 curveto +80.18599 91.07988 80.56749 90.92181 80.96533 90.92181 curveto +81.36317 90.92181 81.74467 91.07988 82.02597 91.36118 curveto +82.30727 91.64247 82.46533 92.02397 82.46533 92.42181 curveto closepath fill + 0 0 0 setrgbcolor +newpath 82.46533 92.42181 moveto +82.46533 92.81966 82.30727 93.20116 82.02597 93.48245 curveto +81.74467 93.76375 81.36317 93.92181 80.96533 93.92181 curveto +80.56749 93.92181 80.18599 93.76375 79.9047 93.48245 curveto +79.6234 93.20116 79.46533 92.81966 79.46533 92.42181 curveto +79.46533 92.02397 79.6234 91.64247 79.9047 91.36118 curveto +80.18599 91.07988 80.56749 90.92181 80.96533 90.92181 curveto +81.36317 90.92181 81.74467 91.07988 82.02597 91.36118 curveto +82.30727 91.64247 82.46533 92.02397 82.46533 92.42181 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 48.95618 96.27957 moveto +48.95618 96.67741 48.79811 97.05891 48.51682 97.34021 curveto +48.23552 97.6215 47.85402 97.77957 47.45618 97.77957 curveto +47.05833 97.77957 46.67683 97.6215 46.39554 97.34021 curveto +46.11424 97.05891 45.95618 96.67741 45.95618 96.27957 curveto +45.95618 95.88173 46.11424 95.50023 46.39554 95.21893 curveto +46.67683 94.93764 47.05833 94.77957 47.45618 94.77957 curveto +47.85402 94.77957 48.23552 94.93764 48.51682 95.21893 curveto +48.79811 95.50023 48.95618 95.88173 48.95618 96.27957 curveto closepath fill + 0 0 0 setrgbcolor +newpath 48.95618 96.27957 moveto +48.95618 96.67741 48.79811 97.05891 48.51682 97.34021 curveto +48.23552 97.6215 47.85402 97.77957 47.45618 97.77957 curveto +47.05833 97.77957 46.67683 97.6215 46.39554 97.34021 curveto +46.11424 97.05891 45.95618 96.67741 45.95618 96.27957 curveto +45.95618 95.88173 46.11424 95.50023 46.39554 95.21893 curveto +46.67683 94.93764 47.05833 94.77957 47.45618 94.77957 curveto +47.85402 94.77957 48.23552 94.93764 48.51682 95.21893 curveto +48.79811 95.50023 48.95618 95.88173 48.95618 96.27957 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 29.84386 85.03459 moveto +29.84386 85.43243 29.68579 85.81393 29.4045 86.09523 curveto +29.1232 86.37653 28.7417 86.53459 28.34386 86.53459 curveto +27.94601 86.53459 27.56451 86.37653 27.28322 86.09523 curveto +27.00192 85.81393 26.84386 85.43243 26.84386 85.03459 curveto +26.84386 84.63675 27.00192 84.25525 27.28322 83.97395 curveto +27.56451 83.69266 27.94601 83.53459 28.34386 83.53459 curveto +28.7417 83.53459 29.1232 83.69266 29.4045 83.97395 curveto +29.68579 84.25525 29.84386 84.63675 29.84386 85.03459 curveto closepath fill + 0 0 0 setrgbcolor +newpath 29.84386 85.03459 moveto +29.84386 85.43243 29.68579 85.81393 29.4045 86.09523 curveto +29.1232 86.37653 28.7417 86.53459 28.34386 86.53459 curveto +27.94601 86.53459 27.56451 86.37653 27.28322 86.09523 curveto +27.00192 85.81393 26.84386 85.43243 26.84386 85.03459 curveto +26.84386 84.63675 27.00192 84.25525 27.28322 83.97395 curveto +27.56451 83.69266 27.94601 83.53459 28.34386 83.53459 curveto +28.7417 83.53459 29.1232 83.69266 29.4045 83.97395 curveto +29.68579 84.25525 29.84386 84.63675 29.84386 85.03459 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 32.3279 62.99316 moveto +32.3279 63.391 32.16983 63.7725 31.88853 64.0538 curveto +31.60724 64.3351 31.22574 64.49316 30.8279 64.49316 curveto +30.43005 64.49316 30.04855 64.3351 29.76726 64.0538 curveto +29.48596 63.7725 29.3279 63.391 29.3279 62.99316 curveto +29.3279 62.59532 29.48596 62.21382 29.76726 61.93253 curveto +30.04855 61.65123 30.43005 61.49316 30.8279 61.49316 curveto +31.22574 61.49316 31.60724 61.65123 31.88853 61.93253 curveto +32.16983 62.21382 32.3279 62.59532 32.3279 62.99316 curveto closepath fill + 0 0 0 setrgbcolor +newpath 32.3279 62.99316 moveto +32.3279 63.391 32.16983 63.7725 31.88853 64.0538 curveto +31.60724 64.3351 31.22574 64.49316 30.8279 64.49316 curveto +30.43005 64.49316 30.04855 64.3351 29.76726 64.0538 curveto +29.48596 63.7725 29.3279 63.391 29.3279 62.99316 curveto +29.3279 62.59532 29.48596 62.21382 29.76726 61.93253 curveto +30.04855 61.65123 30.43005 61.49316 30.8279 61.49316 curveto +31.22574 61.49316 31.60724 61.65123 31.88853 61.93253 curveto +32.16983 62.21382 32.3279 62.59532 32.3279 62.99316 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 55.53067 38.50102 moveto +55.53067 38.89886 55.3726 39.28036 55.09131 39.56166 curveto +54.81001 39.84296 54.42851 40.00102 54.03067 40.00102 curveto +53.63283 40.00102 53.25133 39.84296 52.97003 39.56166 curveto +52.68874 39.28036 52.53067 38.89886 52.53067 38.50102 curveto +52.53067 38.10318 52.68874 37.72168 52.97003 37.44038 curveto +53.25133 37.15909 53.63283 37.00102 54.03067 37.00102 curveto +54.42851 37.00102 54.81001 37.15909 55.09131 37.44038 curveto +55.3726 37.72168 55.53067 38.10318 55.53067 38.50102 curveto closepath fill + 0 0 0 setrgbcolor +newpath 55.53067 38.50102 moveto +55.53067 38.89886 55.3726 39.28036 55.09131 39.56166 curveto +54.81001 39.84296 54.42851 40.00102 54.03067 40.00102 curveto +53.63283 40.00102 53.25133 39.84296 52.97003 39.56166 curveto +52.68874 39.28036 52.53067 38.89886 52.53067 38.50102 curveto +52.53067 38.10318 52.68874 37.72168 52.97003 37.44038 curveto +53.25133 37.15909 53.63283 37.00102 54.03067 37.00102 curveto +54.42851 37.00102 54.81001 37.15909 55.09131 37.44038 curveto +55.3726 37.72168 55.53067 38.10318 55.53067 38.50102 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 90.62419 20.96053 moveto +90.62419 21.35837 90.46613 21.73987 90.18483 22.02116 curveto +89.90353 22.30246 89.52203 22.46053 89.12419 22.46053 curveto +88.72635 22.46053 88.34485 22.30246 88.06355 22.02116 curveto +87.78226 21.73987 87.62419 21.35837 87.62419 20.96053 curveto +87.62419 20.56268 87.78226 20.18118 88.06355 19.89989 curveto +88.34485 19.61859 88.72635 19.46053 89.12419 19.46053 curveto +89.52203 19.46053 89.90353 19.61859 90.18483 19.89989 curveto +90.46613 20.18118 90.62419 20.56268 90.62419 20.96053 curveto closepath fill + 0 0 0 setrgbcolor +newpath 90.62419 20.96053 moveto +90.62419 21.35837 90.46613 21.73987 90.18483 22.02116 curveto +89.90353 22.30246 89.52203 22.46053 89.12419 22.46053 curveto +88.72635 22.46053 88.34485 22.30246 88.06355 22.02116 curveto +87.78226 21.73987 87.62419 21.35837 87.62419 20.96053 curveto +87.62419 20.56268 87.78226 20.18118 88.06355 19.89989 curveto +88.34485 19.61859 88.72635 19.46053 89.12419 19.46053 curveto +89.52203 19.46053 89.90353 19.61859 90.18483 19.89989 curveto +90.46613 20.18118 90.62419 20.56268 90.62419 20.96053 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 124.13162 17.10753 moveto +124.13162 17.50537 123.97356 17.88687 123.69226 18.16817 curveto +123.41096 18.44946 123.02946 18.60753 122.63162 18.60753 curveto +122.23378 18.60753 121.85228 18.44946 121.57098 18.16817 curveto +121.28969 17.88687 121.13162 17.50537 121.13162 17.10753 curveto +121.13162 16.70969 121.28969 16.32819 121.57098 16.04689 curveto +121.85228 15.7656 122.23378 15.60753 122.63162 15.60753 curveto +123.02946 15.60753 123.41096 15.7656 123.69226 16.04689 curveto +123.97356 16.32819 124.13162 16.70969 124.13162 17.10753 curveto closepath fill + 0 0 0 setrgbcolor +newpath 124.13162 17.10753 moveto +124.13162 17.50537 123.97356 17.88687 123.69226 18.16817 curveto +123.41096 18.44946 123.02946 18.60753 122.63162 18.60753 curveto +122.23378 18.60753 121.85228 18.44946 121.57098 18.16817 curveto +121.28969 17.88687 121.13162 17.50537 121.13162 17.10753 curveto +121.13162 16.70969 121.28969 16.32819 121.57098 16.04689 curveto +121.85228 15.7656 122.23378 15.60753 122.63162 15.60753 curveto +123.02946 15.60753 123.41096 15.7656 123.69226 16.04689 curveto +123.97356 16.32819 124.13162 16.70969 124.13162 17.10753 curveto closepath stroke +newpath 141.73225 28.34645 moveto +99.21259 85.03935 lineto +85.03935 56.6929 lineto + closepath stroke + 1 1 1 setrgbcolor +newpath 143.23225 28.34645 moveto +143.23225 28.7443 143.07419 29.1258 142.7929 29.40709 curveto +142.5116 29.68839 142.1301 29.84645 141.73225 29.84645 curveto +141.33441 29.84645 140.95291 29.68839 140.67162 29.40709 curveto +140.39032 29.1258 140.23225 28.7443 140.23225 28.34645 curveto +140.23225 27.94861 140.39032 27.56711 140.67162 27.28581 curveto +140.95291 27.00452 141.33441 26.84645 141.73225 26.84645 curveto +142.1301 26.84645 142.5116 27.00452 142.7929 27.28581 curveto +143.07419 27.56711 143.23225 27.94861 143.23225 28.34645 curveto closepath fill + 0 0 0 setrgbcolor +newpath 143.23225 28.34645 moveto +143.23225 28.7443 143.07419 29.1258 142.7929 29.40709 curveto +142.5116 29.68839 142.1301 29.84645 141.73225 29.84645 curveto +141.33441 29.84645 140.95291 29.68839 140.67162 29.40709 curveto +140.39032 29.1258 140.23225 28.7443 140.23225 28.34645 curveto +140.23225 27.94861 140.39032 27.56711 140.67162 27.28581 curveto +140.95291 27.00452 141.33441 26.84645 141.73225 26.84645 curveto +142.1301 26.84645 142.5116 27.00452 142.7929 27.28581 curveto +143.07419 27.56711 143.23225 27.94861 143.23225 28.34645 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 130.47557 45.35536 moveto +130.47557 45.7532 130.3175 46.1347 130.03621 46.416 curveto +129.75491 46.6973 129.37341 46.85536 128.97557 46.85536 curveto +128.57773 46.85536 128.19623 46.6973 127.91493 46.416 curveto +127.63364 46.1347 127.47557 45.7532 127.47557 45.35536 curveto +127.47557 44.95752 127.63364 44.57602 127.91493 44.29472 curveto +128.19623 44.01343 128.57773 43.85536 128.97557 43.85536 curveto +129.37341 43.85536 129.75491 44.01343 130.03621 44.29472 curveto +130.3175 44.57602 130.47557 44.95752 130.47557 45.35536 curveto closepath fill + 0 0 0 setrgbcolor +newpath 130.47557 45.35536 moveto +130.47557 45.7532 130.3175 46.1347 130.03621 46.416 curveto +129.75491 46.6973 129.37341 46.85536 128.97557 46.85536 curveto +128.57773 46.85536 128.19623 46.6973 127.91493 46.416 curveto +127.63364 46.1347 127.47557 45.7532 127.47557 45.35536 curveto +127.47557 44.95752 127.63364 44.57602 127.91493 44.29472 curveto +128.19623 44.01343 128.57773 43.85536 128.97557 43.85536 curveto +129.37341 43.85536 129.75491 44.01343 130.03621 44.29472 curveto +130.3175 44.57602 130.47557 44.95752 130.47557 45.35536 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 117.71889 62.36427 moveto +117.71889 62.76212 117.56082 63.14362 117.27953 63.42491 curveto +116.99823 63.7062 116.61673 63.86427 116.21889 63.86427 curveto +115.82104 63.86427 115.43954 63.7062 115.15825 63.42491 curveto +114.87695 63.14362 114.71889 62.76212 114.71889 62.36427 curveto +114.71889 61.96643 114.87695 61.58493 115.15825 61.30363 curveto +115.43954 61.02234 115.82104 60.86427 116.21889 60.86427 curveto +116.61673 60.86427 116.99823 61.02234 117.27953 61.30363 curveto +117.56082 61.58493 117.71889 61.96643 117.71889 62.36427 curveto closepath fill + 0 0 0 setrgbcolor +newpath 117.71889 62.36427 moveto +117.71889 62.76212 117.56082 63.14362 117.27953 63.42491 curveto +116.99823 63.7062 116.61673 63.86427 116.21889 63.86427 curveto +115.82104 63.86427 115.43954 63.7062 115.15825 63.42491 curveto +114.87695 63.14362 114.71889 62.76212 114.71889 62.36427 curveto +114.71889 61.96643 114.87695 61.58493 115.15825 61.30363 curveto +115.43954 61.02234 115.82104 60.86427 116.21889 60.86427 curveto +116.61673 60.86427 116.99823 61.02234 117.27953 61.30363 curveto +117.56082 61.58493 117.71889 61.96643 117.71889 62.36427 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 104.9622 79.37274 moveto +104.9622 79.77058 104.80414 80.15208 104.52284 80.43338 curveto +104.24155 80.71468 103.86005 80.87274 103.4622 80.87274 curveto +103.06436 80.87274 102.68286 80.71468 102.40157 80.43338 curveto +102.12027 80.15208 101.9622 79.77058 101.9622 79.37274 curveto +101.9622 78.9749 102.12027 78.5934 102.40157 78.3121 curveto +102.68286 78.0308 103.06436 77.87274 103.4622 77.87274 curveto +103.86005 77.87274 104.24155 78.0308 104.52284 78.3121 curveto +104.80414 78.5934 104.9622 78.9749 104.9622 79.37274 curveto closepath fill + 0 0 0 setrgbcolor +newpath 104.9622 79.37274 moveto +104.9622 79.77058 104.80414 80.15208 104.52284 80.43338 curveto +104.24155 80.71468 103.86005 80.87274 103.4622 80.87274 curveto +103.06436 80.87274 102.68286 80.71468 102.40157 80.43338 curveto +102.12027 80.15208 101.9622 79.77058 101.9622 79.37274 curveto +101.9622 78.9749 102.12027 78.5934 102.40157 78.3121 curveto +102.68286 78.0308 103.06436 77.87274 103.4622 77.87274 curveto +103.86005 77.87274 104.24155 78.0308 104.52284 78.3121 curveto +104.80414 78.5934 104.9622 78.9749 104.9622 79.37274 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 97.87733 79.36755 moveto +97.87733 79.7654 97.71927 80.1469 97.43797 80.42819 curveto +97.15668 80.70949 96.77518 80.86755 96.37733 80.86755 curveto +95.97949 80.86755 95.59799 80.70949 95.3167 80.42819 curveto +95.0354 80.1469 94.87733 79.7654 94.87733 79.36755 curveto +94.87733 78.96971 95.0354 78.58821 95.3167 78.30692 curveto +95.59799 78.02562 95.97949 77.86755 96.37733 77.86755 curveto +96.77518 77.86755 97.15668 78.02562 97.43797 78.30692 curveto +97.71927 78.58821 97.87733 78.96971 97.87733 79.36755 curveto closepath fill + 0 0 0 setrgbcolor +newpath 97.87733 79.36755 moveto +97.87733 79.7654 97.71927 80.1469 97.43797 80.42819 curveto +97.15668 80.70949 96.77518 80.86755 96.37733 80.86755 curveto +95.97949 80.86755 95.59799 80.70949 95.3167 80.42819 curveto +95.0354 80.1469 94.87733 79.7654 94.87733 79.36755 curveto +94.87733 78.96971 95.0354 78.58821 95.3167 78.30692 curveto +95.59799 78.02562 95.97949 77.86755 96.37733 77.86755 curveto +96.77518 77.86755 97.15668 78.02562 97.43797 78.30692 curveto +97.71927 78.58821 97.87733 78.96971 97.87733 79.36755 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 93.62424 70.86397 moveto +93.62424 71.26181 93.46617 71.64331 93.18488 71.9246 curveto +92.90358 72.2059 92.52208 72.36397 92.12424 72.36397 curveto +91.7264 72.36397 91.3449 72.2059 91.0636 71.9246 curveto +90.7823 71.64331 90.62424 71.26181 90.62424 70.86397 curveto +90.62424 70.46613 90.7823 70.08463 91.0636 69.80333 curveto +91.3449 69.52203 91.7264 69.36397 92.12424 69.36397 curveto +92.52208 69.36397 92.90358 69.52203 93.18488 69.80333 curveto +93.46617 70.08463 93.62424 70.46613 93.62424 70.86397 curveto closepath fill + 0 0 0 setrgbcolor +newpath 93.62424 70.86397 moveto +93.62424 71.26181 93.46617 71.64331 93.18488 71.9246 curveto +92.90358 72.2059 92.52208 72.36397 92.12424 72.36397 curveto +91.7264 72.36397 91.3449 72.2059 91.0636 71.9246 curveto +90.7823 71.64331 90.62424 71.26181 90.62424 70.86397 curveto +90.62424 70.46613 90.7823 70.08463 91.0636 69.80333 curveto +91.3449 69.52203 91.7264 69.36397 92.12424 69.36397 curveto +92.52208 69.36397 92.90358 69.52203 93.18488 69.80333 curveto +93.46617 70.08463 93.62424 70.46613 93.62424 70.86397 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 89.37201 62.35951 moveto +89.37201 62.75735 89.21394 63.13885 88.93265 63.42015 curveto +88.65135 63.70145 88.26985 63.85951 87.87201 63.85951 curveto +87.47417 63.85951 87.09267 63.70145 86.81137 63.42015 curveto +86.53008 63.13885 86.37201 62.75735 86.37201 62.35951 curveto +86.37201 61.96167 86.53008 61.58017 86.81137 61.29887 curveto +87.09267 61.01758 87.47417 60.85951 87.87201 60.85951 curveto +88.26985 60.85951 88.65135 61.01758 88.93265 61.29887 curveto +89.21394 61.58017 89.37201 61.96167 89.37201 62.35951 curveto closepath fill + 0 0 0 setrgbcolor +newpath 89.37201 62.35951 moveto +89.37201 62.75735 89.21394 63.13885 88.93265 63.42015 curveto +88.65135 63.70145 88.26985 63.85951 87.87201 63.85951 curveto +87.47417 63.85951 87.09267 63.70145 86.81137 63.42015 curveto +86.53008 63.13885 86.37201 62.75735 86.37201 62.35951 curveto +86.37201 61.96167 86.53008 61.58017 86.81137 61.29887 curveto +87.09267 61.01758 87.47417 60.85951 87.87201 60.85951 curveto +88.26985 60.85951 88.65135 61.01758 88.93265 61.29887 curveto +89.21394 61.58017 89.37201 61.96167 89.37201 62.35951 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 92.21634 53.85506 moveto +92.21634 54.2529 92.05827 54.6344 91.77698 54.9157 curveto +91.49568 55.19699 91.11418 55.35506 90.71634 55.35506 curveto +90.3185 55.35506 89.937 55.19699 89.6557 54.9157 curveto +89.3744 54.6344 89.21634 54.2529 89.21634 53.85506 curveto +89.21634 53.45721 89.3744 53.07571 89.6557 52.79442 curveto +89.937 52.51312 90.3185 52.35506 90.71634 52.35506 curveto +91.11418 52.35506 91.49568 52.51312 91.77698 52.79442 curveto +92.05827 53.07571 92.21634 53.45721 92.21634 53.85506 curveto closepath fill + 0 0 0 setrgbcolor +newpath 92.21634 53.85506 moveto +92.21634 54.2529 92.05827 54.6344 91.77698 54.9157 curveto +91.49568 55.19699 91.11418 55.35506 90.71634 55.35506 curveto +90.3185 55.35506 89.937 55.19699 89.6557 54.9157 curveto +89.3744 54.6344 89.21634 54.2529 89.21634 53.85506 curveto +89.21634 53.45721 89.3744 53.07571 89.6557 52.79442 curveto +89.937 52.51312 90.3185 52.35506 90.71634 52.35506 curveto +91.11418 52.35506 91.49568 52.51312 91.77698 52.79442 curveto +92.05827 53.07571 92.21634 53.45721 92.21634 53.85506 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 109.22482 45.35017 moveto +109.22482 45.74802 109.06676 46.12952 108.78546 46.41081 curveto +108.50417 46.69211 108.12267 46.85017 107.72482 46.85017 curveto +107.32698 46.85017 106.94548 46.69211 106.66418 46.41081 curveto +106.38289 46.12952 106.22482 45.74802 106.22482 45.35017 curveto +106.22482 44.95233 106.38289 44.57083 106.66418 44.28954 curveto +106.94548 44.00824 107.32698 43.85017 107.72482 43.85017 curveto +108.12267 43.85017 108.50417 44.00824 108.78546 44.28954 curveto +109.06676 44.57083 109.22482 44.95233 109.22482 45.35017 curveto closepath fill + 0 0 0 setrgbcolor +newpath 109.22482 45.35017 moveto +109.22482 45.74802 109.06676 46.12952 108.78546 46.41081 curveto +108.50417 46.69211 108.12267 46.85017 107.72482 46.85017 curveto +107.32698 46.85017 106.94548 46.69211 106.66418 46.41081 curveto +106.38289 46.12952 106.22482 45.74802 106.22482 45.35017 curveto +106.22482 44.95233 106.38289 44.57083 106.66418 44.28954 curveto +106.94548 44.00824 107.32698 43.85017 107.72482 43.85017 curveto +108.12267 43.85017 108.50417 44.00824 108.78546 44.28954 curveto +109.06676 44.57083 109.22482 44.95233 109.22482 45.35017 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 126.23372 36.84572 moveto +126.23372 37.24356 126.07565 37.62506 125.79436 37.90636 curveto +125.51306 38.18765 125.13156 38.34572 124.73372 38.34572 curveto +124.33588 38.34572 123.95438 38.18765 123.67308 37.90636 curveto +123.39178 37.62506 123.23372 37.24356 123.23372 36.84572 curveto +123.23372 36.44788 123.39178 36.06638 123.67308 35.78508 curveto +123.95438 35.50378 124.33588 35.34572 124.73372 35.34572 curveto +125.13156 35.34572 125.51306 35.50378 125.79436 35.78508 curveto +126.07565 36.06638 126.23372 36.44788 126.23372 36.84572 curveto closepath fill + 0 0 0 setrgbcolor +newpath 126.23372 36.84572 moveto +126.23372 37.24356 126.07565 37.62506 125.79436 37.90636 curveto +125.51306 38.18765 125.13156 38.34572 124.73372 38.34572 curveto +124.33588 38.34572 123.95438 38.18765 123.67308 37.90636 curveto +123.39178 37.62506 123.23372 37.24356 123.23372 36.84572 curveto +123.23372 36.44788 123.39178 36.06638 123.67308 35.78508 curveto +123.95438 35.50378 124.33588 35.34572 124.73372 35.34572 curveto +125.13156 35.34572 125.51306 35.50378 125.79436 35.78508 curveto +126.07565 36.06638 126.23372 36.44788 126.23372 36.84572 curveto closepath stroke + 1 1 1 setrgbcolor +newpath 100.71259 85.03806 moveto +100.71259 85.4359 100.55452 85.8174 100.27322 86.0987 curveto +99.99193 86.37999 99.61043 86.53806 99.21259 86.53806 curveto +98.81474 86.53806 98.43324 86.37999 98.15195 86.0987 curveto +97.87065 85.8174 97.71259 85.4359 97.71259 85.03806 curveto +97.71259 84.64021 97.87065 84.25871 98.15195 83.97742 curveto +98.43324 83.69612 98.81474 83.53806 99.21259 83.53806 curveto +99.61043 83.53806 99.99193 83.69612 100.27322 83.97742 curveto +100.55452 84.25871 100.71259 84.64021 100.71259 85.03806 curveto closepath fill + 0 0 0 setrgbcolor +newpath 100.71259 85.03806 moveto +100.71259 85.4359 100.55452 85.8174 100.27322 86.0987 curveto +99.99193 86.37999 99.61043 86.53806 99.21259 86.53806 curveto +98.81474 86.53806 98.43324 86.37999 98.15195 86.0987 curveto +97.87065 85.8174 97.71259 85.4359 97.71259 85.03806 curveto +97.71259 84.64021 97.87065 84.25871 98.15195 83.97742 curveto +98.43324 83.69612 98.81474 83.53806 99.21259 83.53806 curveto +99.61043 83.53806 99.99193 83.69612 100.27322 83.97742 curveto +100.55452 84.25871 100.71259 84.64021 100.71259 85.03806 curveto closepath stroke +showpage +%%EOF diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/point.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/point.mp new file mode 100644 index 0000000000..24c969abd1 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/point.mp @@ -0,0 +1,25 @@ +input geom2d; + +beginfig(0); + + C = Point(3,2); + A = Point(5,1); + B = Point(3.5,3) ; + E = Ellipse(C,A,B); + trace E; +for i=0 step 0.1 until 1: +pointe PointDe(E,i); +endfor + +T = Triangle(A,B,C); +trace T; + +for i=0 step 0.1 until 1: +pointe PointDe(T,i); +endfor + +pointe PointDe(0.33333,T); + +endfig; + +end. diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/polygone-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/polygone-1.pdf Binary files differnew file mode 100644 index 0000000000..e3c0e1d154 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/polygone-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/polygone.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/polygone.mp new file mode 100644 index 0000000000..619e978fa5 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/polygone.mp @@ -0,0 +1,20 @@ +input geom2d; + +beginfig(1); + + + A = Point(0,0); + B = Point(3,3); + C = Point(3,4); + D = Point(2,2.4); + F = Point(0,5); + G = Barycentre(A,B,C,D,F); + P = Polygone(A,B,C,D,F); + Q1 = PolygoneRegulier(10,2,0,(2,2)); + trace(P); + pointe(G); + trace(Q1); + pointe(PointPolygone(Q1,1)); + pointe(CentrePolygone(Q1)); +endfig; +end
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/vecteurs-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/vecteurs-1.pdf Binary files differnew file mode 100644 index 0000000000..787f569ced --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/vecteurs-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/vecteurs.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/vecteurs.mp new file mode 100644 index 0000000000..95a6dff144 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/divers/vecteurs.mp @@ -0,0 +1,14 @@ +input geom2d; + +beginfig(1); + A = Point(2,0); + B = Point(3,3); + C = Vecteur(2,2); + D = Segment(A,B); + fleche C; + fleche D; + E = SegmentToVecteur(D); + fleche E; + show ProduitScalaire(C,E); +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/cos-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/cos-1.pdf Binary files differnew file mode 100644 index 0000000000..6c5a08e777 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/cos-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/cos.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/cos.mp new file mode 100644 index 0000000000..471fe58e10 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/cos.mp @@ -0,0 +1,10 @@ +input geom2d; +beginfig(1); +RepereMinMax(-2Pi,2Pi,-1.1,1.1,0.5,1); +Axes; +Graduations; +Debut; +trace Representation(cos,-2Pi,2Pi,100); +Fin; +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction1-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction1-1.pdf Binary files differnew file mode 100644 index 0000000000..69a7e72076 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction1-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction1.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction1.mp new file mode 100644 index 0000000000..f81d13067b --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction1.mp @@ -0,0 +1,25 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef f(expr x) = sqrt(x+3-4*sqrt(x-1))+sqrt(x+8-6*sqrt(x-1)) enddef; + + +beginfig(1); + +Repere(10,6,1,2,.8,0.8); + Axes; + Debut; + Graduations; Unites(1); + + trace Representation(f,1,12,100) avecCrayon(1.5,Indigo); + + pointe Point(5,1); + pointe Point(10,1); + + label.top(textext("\(y=\sqrt{x+3-4\sqrt{x-1}}+\sqrt{x+8-6\sqrt{x-1}}\)"), + (7,2.5) gddEnPlace) withcolor Olive; + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction2-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction2-1.pdf Binary files differnew file mode 100644 index 0000000000..f25b1b9d27 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction2-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction2.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction2.mp new file mode 100644 index 0000000000..695c65842a --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/fonctions/fonction2.mp @@ -0,0 +1,53 @@ +input geom2d; + +labeloffset := 6; +gddU:=0.9cm; + +vardef f(expr x) = x*(Pi-x) enddef; % f +vardef g(expr x) = Pi-2*x enddef; % f' +vardef h(expr x) = -2 enddef; % f'' + +beginfig(1); + +Repere(9,6,5,3,.8,0.8); +Axes; + Debut; + Graduations; + + trace (Pi,-2)--(Pi,2) dashed evenly; + trace (-Pi,-2)--(-Pi,2) dashed evenly; + + trace Representation(f,0,Pi,100) avecCrayon(1.5,Indigo); + trace (Representation(f,0,Pi,100) scaled -1) avecCrayon(1.5,Indigo); + trace (Representation(f,0,Pi,100) shifted (-2*Pi,0)) avecCrayon(1.5,Indigo); + trace (Representation(f,0,Pi,100) scaled -1 shifted (2*Pi,0)) avecCrayon(1.5,Indigo); + + trace Representation(g,0,Pi,100) avecCrayon(1.5,Olive); + trace (Representation(g,0,Pi,100) xscaled -1) avecCrayon(1.5,Olive); + trace (Representation(g,0,Pi,100) shifted (-2*Pi,0)) avecCrayon(1.5,Olive); + trace (Representation(g,0,Pi,100) xscaled -1 shifted (2*Pi,0)) avecCrayon(1.5,Olive); + + trace Representation(h,0,Pi,100) avecCrayon(1.5,Orange); + trace (Representation(h,0,Pi,100) scaled -1) avecCrayon(1.5,Orange); + trace (Representation(h,0,Pi,100) shifted (-2*Pi,0)) avecCrayon(1.5,Orange); + trace (Representation(h,0,Pi,100) scaled -1 shifted (2*Pi,0)) avecCrayon(1.5,Orange); + + pointe Point(Pi,2); + pointe Point(Pi,-2); + pointe Point(-Pi,2); + pointe Point(-Pi,-2); + + label.urt(textext("\(-\pi\)"), (-Pi,0) gddEnPlace) withcolor Peru; + label.ulft(textext("\(\pi\)"), (Pi,0) gddEnPlace) withcolor Peru; +Fin; + +trace (0,-0.5)--(1,-0.5) avecCrayon(1.5,Indigo); +label.rt(textext("\(f\)"), (1,-0.5) gddEnPlace); +trace (2,-0.5)--(3,-0.5) avecCrayon(1.5,Olive); +label.rt(textext("\(f'\)"), (3,-0.5) gddEnPlace); +trace (4,-0.5)--(5,-0.5) avecCrayon(1.5,Orange); +label.rt(textext("\(f''\)"), (5,-0.5) gddEnPlace); + +endfig; + +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol01-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol01-1.pdf Binary files differnew file mode 100644 index 0000000000..b2d5723139 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol01-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol01.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol01.mp new file mode 100644 index 0000000000..a806fb6e56 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol01.mp @@ -0,0 +1,40 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef r(expr t) = 1/(cos(t)-cos(2*t)) enddef; +vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef; +vardef f(expr t) = 3/2*t*t-7/18 enddef; + +def DroiteN(expr r, t) = Droite((r*cos(t),r*sin(t)), (r*cos(t)-2*sin(t),r*sin(t)+2*cos(t))) enddef; +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + +def Crayon(expr t,c) = drawoptions(withpen pencircle scaled t withcolor c) enddef; + +beginfig(1); +Repere(10,10,2,5,3.5,3.5); +Axes; + Debut; + Graduations; Unites(1); + trace Cercle(origine,1); + Crayon(0.75,1.1*LightSlateGrey); + trace rp(-arccos(1/4))--(0,0)--rp(arccos(1/4)) dashed evenly; + Crayon(0.75,1.1*FireBrick); + trace DroiteN(-2/3/sqrt(3),7*Pi/6); + trace DroiteN(-2/3/sqrt(3),5*Pi/6); + trace Representation(f,-3,3,100) rotated -90; + Crayon(1.5,0.8*LightSlateGrey); + trace CourbeEnPolaires(r,0.1,2*Pi/3-0.1,100); + trace CourbeEnPolaires(r,-0.1,-2*Pi/3+0.1,100); + trace CourbeEnPolaires(r,2*Pi/3+0.1,4*Pi/3-0.1,100); + Crayon(1,DodgerBlue); + traceDoubleVecteur(rp(Pi),(0,0.2)); + traceDoubleVecteur(rp(arccos(1/4)),0.05*(-sqrt(15),1)); + traceDoubleVecteur(rp(-arccos(1/4)),0.05*(sqrt(15),1)); + pointe rp(Pi); + pointe rp(arccos(1/4)); + pointe rp(-arccos(1/4)); + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol02-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol02-1.pdf Binary files differnew file mode 100644 index 0000000000..9b66ecc5ef --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol02-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol02.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol02.mp new file mode 100644 index 0000000000..017fe938e8 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol02.mp @@ -0,0 +1,52 @@ +input geom2d; + +labeloffset := 6; +gddU:=0.8cm; + +vardef r(expr t) = 1+cos(t) enddef; +vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef; + +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + +beginfig(1); + Repere(10,10,2,5,3.5,3.5); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + draw fullcircle shifted (0.5,0) gddEnPlace avecCrayon(1,Gold); + + nb = 80; + pas = 2Pi / nb; + for i=0 upto nb: + theta := i * pas; + draw (fullcircle scaled 2cos(theta) + shifted (cos(theta)*cos(theta),cos(theta)*sin(theta))) gddEnPlace; + endfor; + + + traceDoubleVecteur(rp(0),(0,0.3)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(Pi/3),(0.3,0)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(Pi/2),(0.2,0.2)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(2Pi/3),(0,0.3)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(-Pi/3),(0.3,0)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(-Pi/2),(0.2,-0.2)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(-2Pi/3),(0,0.3)) avecCrayon(1,LightPink); + + fleche Segment(origine,(-0.3,0)) avecCrayon(1,LightPink); + trace CourbeEnPolaires(r,-Pi,Pi,100) avecCrayon(1.5,Indigo); + + pointe Point(0,0); + pointe Point(2,0); + pointe PairTOPoint(rp(Pi/3)); + pointe PairTOPoint(rp(-Pi/3)); + pointe PairTOPoint(rp(2Pi/3)); + pointe PairTOPoint(rp(-2Pi/3)); + pointe Point(0,1); + pointe Point(0,-1); + + label.urt(textext("\(\mathcal{C}\)"),PtR(Point(1,0))) withcolor Magenta; + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol03-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol03-1.pdf Binary files differnew file mode 100644 index 0000000000..d542588f38 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol03-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol03.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol03.mp new file mode 100644 index 0000000000..20f1a95fb6 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol03.mp @@ -0,0 +1,33 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef r(expr t) = 1+2*cos(t) enddef; +vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef; + +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + +beginfig(1); + Repere(10,10,2.2,5,2,2); + Axes; + Debut; + Graduations; Unites(1); + drawoptions(withcolor LightSlateGrey); + + nb = 50; + pas = 4 / nb; + for i=1 upto nb: + vardef rt(expr t) = 1 + (-1+i*pas)*cos(t) enddef; + trace CourbeEnPolaires(rt,-Pi,Pi,100) withcolor ((i/nb)[Gainsboro,Chartreuse]); + endfor; + + trace CourbeEnPolaires(r,-Pi,Pi,100) avecCrayon(1.5,LightSeaGreen); + + pointe Point(0,0); + pointe Point(0,1); + pointe Point(0,-1); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol04-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol04-1.pdf Binary files differnew file mode 100644 index 0000000000..bdc593c6b3 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol04-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol04.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol04.mp new file mode 100644 index 0000000000..385f876f98 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol04.mp @@ -0,0 +1,44 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef r(expr t) = cos(2t)+cos(t)*cos(t) enddef; +vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef; + +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + +a = arccos(1/sqrt(3)); + +beginfig(1); + Repere(10,8,5,4,2,2); + Axes; + Debut; + Graduations; Unites(1); + drawoptions(withcolor LightBlue); + + nb = 60; + pas = 2Pi/ nb; + for i:=0 upto nb: + trace (0,0) -- rp(i*pas); + endfor; + + traceDoubleVecteur((0,0),0.5(cos(a),sin(a))) avecCrayon(1,MediumVioletRed); + traceDoubleVecteur((0,0),0.5(-cos(a),sin(a))) avecCrayon(1,MediumVioletRed); + traceDoubleVecteur((2,0),(0,0.5)) avecCrayon(1,MediumVioletRed); + traceDoubleVecteur((-2,0),(0,0.5)) avecCrayon(1,MediumVioletRed); + traceDoubleVecteur((0,1),(0.5,0)) avecCrayon(1,MediumVioletRed); + traceDoubleVecteur((0,-1),(-0.5,0)) avecCrayon(1,MediumVioletRed); + + trace CourbeEnPolaires(r,-Pi,Pi,150) avecCrayon(1.5,DarkOliveGreen); + + pointe Point(0,0); + pointe Point(0,1); + pointe Point(0,-1); + pointe Point(2,0); + pointe Point(-2,0); + + Fin; +endfig; + +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol05-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol05-1.pdf Binary files differnew file mode 100644 index 0000000000..45e6e36582 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol05-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol05.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol05.mp new file mode 100644 index 0000000000..376990a5b4 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol05.mp @@ -0,0 +1,57 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.2cm; + +vardef r(expr t) = sqrt(cos(2*t)) enddef; +vardef ri(expr t) = -sqrt(cos(2*t)) enddef; +vardef rh(expr t) = 1 / r(t) enddef; +vardef rhi(expr t) = 1 / ri(t) enddef; + +vardef u(expr v) = sqrt(v*v+4) enddef; +vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef; + +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + +a = arccos(1/sqrt(3)); + +beginfig(1); + Repere(10,6,5,3,3,3); + Axes; + Debut; + Graduations; + drawoptions(withcolor Gainsboro); + + nb = 40; + pas = Pi / (2*nb); + for i:=0 upto nb: + trace Droite((0,0),(cos(-Pi/4+i*pas),sin(-Pi/4+i*pas))); + endfor; + + trace Droite((0,0),(1,1)); + trace Droite((0,0),(-1,1)); + + trace CourbeEnPolaires(rh,-Pi/4+0.01,Pi/4-0.01,150) + avecCrayon(0.75,Crimson); + trace CourbeEnPolaires(rhi,-Pi/4+0.01,Pi/4-0.01,150) + avecCrayon(0.75,Crimson); + + traceDoubleVecteur((0,0),0.25(1,1)) avecCrayon(1,LightSalmon); + traceDoubleVecteur((0,0),0.25(-1,1)) avecCrayon(1,LightSalmon); + traceDoubleVecteur((1,0),(0,0.2)) avecCrayon(1,LightSalmon); + traceDoubleVecteur((-1,0),(0,0.2)) avecCrayon(1,LightSalmon); + traceDoubleVecteur(rp(Pi/6),(0.2,0)) avecCrayon(1,LightSalmon); + traceDoubleVecteur(rp(-Pi/6),(0.2,0)) avecCrayon(1,LightSalmon); + traceDoubleVecteur(rp(5Pi/6),(0.2,0)) avecCrayon(1,LightSalmon); + traceDoubleVecteur(rp(-5Pi/6),(0.2,0)) avecCrayon(1,LightSalmon); + + trace (0,0)--CourbeEnPolaires(r,-Pi/4+0.0001,Pi/4-0.0001,150)--cycle + avecCrayon(1.5,LightSlateGrey); + trace (0,0)--CourbeEnPolaires(ri,-Pi/4+0.0001,Pi/4-0.0001,150)--cycle + avecCrayon(1.5,LightSlateGrey); + + pointe Point(0,0); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol06-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol06-1.pdf Binary files differnew file mode 100644 index 0000000000..526f1f8063 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol06-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol06.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol06.mp new file mode 100644 index 0000000000..74a2fd81ac --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol06.mp @@ -0,0 +1,42 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.5cm; + +vardef r(expr t) = cos(t)*cos(t)*cos(t)-sin(t)*sin(t)*sin(t) enddef; +vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef; + +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + +a = arccos(1/sqrt(3)); + +beginfig(1); + + Repere(6,6,2,4,3,3); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor Gainsboro); + + trace (0,0)--rp(-Pi/12); + trace (0,0)--rp(-Pi/4); + trace (0,0)--rp(-5Pi/12); + + traceDoubleVecteur(rp(Pi/4),(0.18,0.18)) avecCrayon(1,DarkOrchid); + traceDoubleVecteur(rp(-Pi/4),(0.18,0.18)) avecCrayon(1,DarkOrchid); + traceDoubleVecteur(rp(-Pi/12),(0.18,0.18)) avecCrayon(1,DarkOrchid); + traceDoubleVecteur(rp(-5Pi/12),(0.18,0.18)) avecCrayon(1,DarkOrchid); + + trace CourbeEnPolaires(r,-Pi/2,Pi/2,150) avecCrayon(1.5,Crimson); + + drawoptions(withcolor LightGoldenrod); + + pointe Point(0,0); + pointe rp(-Pi/12); + pointe rp(-Pi/4); + pointe rp(-5Pi/12); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol07-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol07-1.pdf Binary files differnew file mode 100644 index 0000000000..2b2f5a7d11 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol07-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol07.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol07.mp new file mode 100644 index 0000000000..35ba629654 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/polaires/pol07.mp @@ -0,0 +1,29 @@ +input geom2d; + +labeloffset := 6; +gddU:=1.5cm; + +vardef r(expr t) = 4*cos(t/3)*cos(t/3)*cos(t/3) enddef; +vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef; + +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + + + +beginfig(1); + Repere(8,8,2,4,1,1); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor Gainsboro); + + trace CourbeEnPolaires(r,0,3Pi,450) + avecCrayon(1.5,Crimson); + + drawoptions(withcolor LightGoldenrod); + + pointe Point(0,0); + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/mptextmp.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/mptextmp.mp new file mode 100644 index 0000000000..3ca1aafb46 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/mptextmp.mp @@ -0,0 +1 @@ +btex $\vec\jmath$ etex diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/mpxerr.tex b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/mpxerr.tex new file mode 100644 index 0000000000..8d1b74bb84 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/mpxerr.tex @@ -0,0 +1,14 @@ +\gdef\mpxshipout{\shipout\hbox\bgroup% + \setbox0=\hbox\bgroup}% +\gdef\stopmpxshipout{\egroup \dimen0=\ht0 \advance\dimen0\dp0 + \dimen1=\ht0 \dimen2=\dp0 + \setbox0=\hbox\bgroup + \box0 + \ifnum\dimen0>0 \vrule width1sp height\dimen1 depth\dimen2 + \else \vrule width1sp height1sp depth0sp\relax + \fi\egroup + \ht0=0pt \dp0=0pt \box0 \egroup} +\mpxshipout% line 1 ./mptextmp.mp +\(y\vec\jmath\)% +\stopmpxshipout +\end{document} diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes1-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes1-1.pdf Binary files differnew file mode 100644 index 0000000000..0363226636 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes1-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes1.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes1.mp new file mode 100644 index 0000000000..55feff5ce4 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes1.mp @@ -0,0 +1,49 @@ +input geom2d; + +labeloffset := 4; +gddU:=1.3cm; + +beginfig(1); + + + O = Point(0,0); + I = Point(1,0); + J = Point(0.3,0.8); + M = PointDansRepere(5,3,O,I,J); + H = PointDansRepere(5,0,O,I,J); + K = PointDansRepere(0,3,O,I,J); + + Repere(8,6,1.5,1.5,1,1); + Debut; + + trace Droite(O,I); + trace Droite(O,J); + trace Pt(K)--Pt(M)--Pt(H) dashed evenly; + + marque.urt "M"; + + drawoptions(withpen pencircle scaled 1pt withcolor DodgerBlue); + trace Vecteur(O,K); + trace Vecteur(O,H); + trace Vecteur(O,M); + label.top(textext("$x\vec\imath$"),PtR(Milieu(O,H))); + label.rt(textext("$y\vec\jmath$"),PtR(Milieu(O,K))); + + drawoptions(withpen pencircle scaled 1.5pt withcolor Crimson); + trace Vecteur(O,I); + trace Vecteur(O,J); + + drawoptions(); + marque.llft "O"; + + label.bot(textext("$x$"), PtR(H)); + label.lft(textext("$y$"), PtR(K)); + label.bot(textext("$\vec\imath$"), PtR(I)); + label.lft(textext("$\vec\jmath$"), PtR(J)); + + Fin; + + +endfig; + +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes2-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes2-1.pdf Binary files differnew file mode 100644 index 0000000000..eaa6100c43 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes2-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes2.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes2.mp new file mode 100644 index 0000000000..bdb86d553b --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/reperes/reperes2.mp @@ -0,0 +1,69 @@ +input geom2d; + +labeloffset := 4; +gddU:=1.cm; + +beginfig(1); + O = Point(0,0); + I = Point(1,0); + J = Point(0.3,0.8); + M = PointDansRepere(5,3,O,I,J); + H = PointDansRepere(5,0,O,I,J); + K = PointDansRepere(0,3,O,I,J); + O' = Point(3,2); + I' = Point(3.7,1.8); + J' = Point(2.8,3); + + pair Mt; + Mt = CoordonneesRepere(M,O',I',J'); + H' = PointDansRepere(xpart Mt,0,O',I',J'); + K' = PointDansRepere(0,ypart Mt,O',I',J'); + + Repere(8,6,1.5,1.5,1,1); + Debut; + trace Droite(O,I); + trace Droite(O,J); + trace Droite(O',I'); + trace Droite(O',J'); + + trace Pt(K)--Pt(M)--Pt(H) dashed evenly; + trace Pt(K')--Pt(M)--Pt(H') dashed evenly; + + marque.urt "M"; + + drawoptions(withpen pencircle scaled 1pt withcolor DodgerBlue); + fleche Segment(O,K); + fleche Segment(O,H); + fleche Segment(O,M); + + drawoptions(withpen pencircle scaled 1pt withcolor LimeGreen); + fleche Segment(O',M); + fleche Segment(O',H'); + fleche Segment(O',K'); + + drawoptions(withpen pencircle scaled 1.5pt withcolor Crimson); + fleche Segment(O,I); + fleche Segment(O,J); + fleche Segment(O',I'); + fleche Segment(O',J'); + + drawoptions(withpen pencircle scaled 1pt withcolor LightCoral); + fleche Segment(O,O'); + + drawoptions(); + marque.llft "O"; + marque.llft "O'"; + + label.bot(textext("\(x\)"), PtR(H)); + label.lft(textext("\(y\)"), PtR(K)); + label.bot(textext("\(\vec\imath\)"), PtR(I)); + label.lft(textext("\(\vec\jmath\)"), PtR(J)); + + label.bot(textext("\(x'\)"), PtR(H')); + label.urt(textext("\(y'\)"), PtR(K')); + label.bot(textext("\(\vec\imath'\)"), PtR(I')); + label.lft(textext("\(\vec\jmath'\)"), PtR(J')); + + Fin; +endfig; +end diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/svgnames/palette-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/svgnames/palette-1.pdf Binary files differnew file mode 100644 index 0000000000..090883d771 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/svgnames/palette-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/svgnames/palette.1 b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/svgnames/palette.1 new file mode 100644 index 0000000000..79db8deef8 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/svgnames/palette.1 @@ -0,0 +1,2343 @@ +%!PS +%%BoundingBox: -1 -437 438 10 +%%HiResBoundingBox: -0.25 -436.56975 437.76807 9.32108 +%%Creator: MetaPost 2.10 +%%CreationDate: 2024.10.13:2206 +%%Pages: 1 +%*Font: cmr9 8.96637 8.96637 0b:a0000000000003defdda03effffb +%%BeginProlog +%%EndProlog +%%Page: 1 1 + 0.94 0.972 1 setrgbcolor +newpath 0 0 moveto +18.14215 0 lineto +18.14215 9.07108 lineto +0 9.07108 lineto + closepath fill + 0 0 0 setrgbcolor 0 0.5 dtransform truncate idtransform setlinewidth pop + [] 0 setdash 1 setlinejoin 10 setmiterlimit +newpath 0 0 moveto +18.14215 0 lineto +18.14215 9.07108 lineto +0 9.07108 lineto + closepath stroke +21.14215 1.42218 moveto +(AliceBlue) cmr9 8.96637 fshow + 0.98 0.92 0.844 setrgbcolor +newpath 108.8529 0 moveto +126.99506 0 lineto +126.99506 9.07108 lineto +108.8529 9.07108 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 0 moveto +126.99506 0 lineto +126.99506 9.07108 lineto +108.8529 9.07108 lineto + closepath stroke +129.99506 2.29393 moveto +(An) cmr9 8.96637 fshow +141.76886 2.29393 moveto +(tiqueWhite) cmr9 8.96637 fshow + 0 1 1 setrgbcolor +newpath 217.70581 0 moveto +235.84796 0 lineto +235.84796 9.07108 lineto +217.70581 9.07108 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 0 moveto +235.84796 0 lineto +235.84796 9.07108 lineto +217.70581 9.07108 lineto + closepath stroke +238.84796 2.34378 moveto +(Aqua) cmr9 8.96637 fshow + 0.498 1 0.83 setrgbcolor +newpath 326.55872 0 moveto +344.70087 0 lineto +344.70087 9.07108 lineto +326.55872 9.07108 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 0 moveto +344.70087 0 lineto +344.70087 9.07108 lineto +326.55872 9.07108 lineto + closepath stroke +347.70087 2.34378 moveto +(Aquamarine) cmr9 8.96637 fshow + 0.94 1 1 setrgbcolor +newpath 0 -11.79242 moveto +18.14215 -11.79242 lineto +18.14215 -2.72134 lineto +0 -2.72134 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -11.79242 moveto +18.14215 -11.79242 lineto +18.14215 -2.72134 lineto +0 -2.72134 lineto + closepath stroke +21.14215 -10.32039 moveto +(Azure) cmr9 8.96637 fshow + 0.96 0.96 0.864 setrgbcolor +newpath 108.8529 -11.79242 moveto +126.99506 -11.79242 lineto +126.99506 -2.72134 lineto +108.8529 -2.72134 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -11.79242 moveto +126.99506 -11.79242 lineto +126.99506 -2.72134 lineto +108.8529 -2.72134 lineto + closepath stroke +129.99506 -9.44864 moveto +(Beige) cmr9 8.96637 fshow + 1 0.894 0.77 setrgbcolor +newpath 217.70581 -11.79242 moveto +235.84796 -11.79242 lineto +235.84796 -2.72134 lineto +217.70581 -2.72134 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -11.79242 moveto +235.84796 -11.79242 lineto +235.84796 -2.72134 lineto +217.70581 -2.72134 lineto + closepath stroke +238.84796 -9.44864 moveto +(Bisque) cmr9 8.96637 fshow +newpath 326.55872 -11.79242 moveto +344.70087 -11.79242 lineto +344.70087 -2.72134 lineto +326.55872 -2.72134 lineto + closepath fill +newpath 326.55872 -11.79242 moveto +344.70087 -11.79242 lineto +344.70087 -2.72134 lineto +326.55872 -2.72134 lineto + closepath stroke +347.70087 -10.37024 moveto +(Blac) cmr9 8.96637 fshow +365.23497 -10.37024 moveto +(k) cmr9 8.96637 fshow + 1 0.92 0.804 setrgbcolor +newpath 0 -23.58485 moveto +18.14215 -23.58485 lineto +18.14215 -14.51378 lineto +0 -14.51378 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -23.58485 moveto +18.14215 -23.58485 lineto +18.14215 -14.51378 lineto +0 -14.51378 lineto + closepath stroke +21.14215 -22.16267 moveto +(Blanc) cmr9 8.96637 fshow +43.79594 -22.16267 moveto +(hedAlmond) cmr9 8.96637 fshow + 0 0 1 setrgbcolor +newpath 108.8529 -23.58485 moveto +126.99506 -23.58485 lineto +126.99506 -14.51378 lineto +108.8529 -14.51378 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -23.58485 moveto +126.99506 -23.58485 lineto +126.99506 -14.51378 lineto +108.8529 -14.51378 lineto + closepath stroke +129.99506 -22.16267 moveto +(Blue) cmr9 8.96637 fshow + 0.54 0.17 0.888 setrgbcolor +newpath 217.70581 -23.58485 moveto +235.84796 -23.58485 lineto +235.84796 -14.51378 lineto +217.70581 -14.51378 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -23.58485 moveto +235.84796 -23.58485 lineto +235.84796 -14.51378 lineto +217.70581 -14.51378 lineto + closepath stroke +238.84796 -22.16267 moveto +(BlueViolet) cmr9 8.96637 fshow + 0.648 0.165 0.165 setrgbcolor +newpath 326.55872 -23.58485 moveto +344.70087 -23.58485 lineto +344.70087 -14.51378 lineto +326.55872 -14.51378 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -23.58485 moveto +344.70087 -23.58485 lineto +344.70087 -14.51378 lineto +326.55872 -14.51378 lineto + closepath stroke +347.70087 -22.11282 moveto +(Bro) cmr9 8.96637 fshow +362.18396 -22.11282 moveto +(wn) cmr9 8.96637 fshow + 0.87 0.72 0.53 setrgbcolor +newpath 0 -35.37727 moveto +18.14215 -35.37727 lineto +18.14215 -26.3062 lineto +0 -26.3062 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -35.37727 moveto +18.14215 -35.37727 lineto +18.14215 -26.3062 lineto +0 -26.3062 lineto + closepath stroke +21.14215 -33.08334 moveto +(BurlyW) cmr9 8.96637 fshow +52.51865 -33.08334 moveto +(o) cmr9 8.96637 fshow +57.38235 -33.08334 moveto +(o) cmr9 8.96637 fshow +62.24605 -33.08334 moveto +(d) cmr9 8.96637 fshow + 0.372 0.62 0.628 setrgbcolor +newpath 108.8529 -35.37727 moveto +126.99506 -35.37727 lineto +126.99506 -26.3062 lineto +108.8529 -26.3062 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -35.37727 moveto +126.99506 -35.37727 lineto +126.99506 -26.3062 lineto +108.8529 -26.3062 lineto + closepath stroke +129.99506 -33.9551 moveto +(CadetBlue) cmr9 8.96637 fshow + 0.498 1 0 setrgbcolor +newpath 217.70581 -35.37727 moveto +235.84796 -35.37727 lineto +235.84796 -26.3062 lineto +217.70581 -26.3062 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -35.37727 moveto +235.84796 -35.37727 lineto +235.84796 -26.3062 lineto +217.70581 -26.3062 lineto + closepath stroke +238.84796 -33.9551 moveto +(Chartreuse) cmr9 8.96637 fshow + 0.824 0.41 0.116 setrgbcolor +newpath 326.55872 -35.37727 moveto +344.70087 -35.37727 lineto +344.70087 -26.3062 lineto +326.55872 -26.3062 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -35.37727 moveto +344.70087 -35.37727 lineto +344.70087 -26.3062 lineto +326.55872 -26.3062 lineto + closepath stroke +347.70087 -33.9551 moveto +(Cho) cmr9 8.96637 fshow +364.33977 -33.9551 moveto +(colate) cmr9 8.96637 fshow + 1 0.498 0.312 setrgbcolor +newpath 0 -47.16971 moveto +18.14215 -47.16971 lineto +18.14215 -38.09863 lineto +0 -38.09863 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -47.16971 moveto +18.14215 -47.16971 lineto +18.14215 -38.09863 lineto +0 -38.09863 lineto + closepath stroke +21.14215 -45.74753 moveto +(Coral) cmr9 8.96637 fshow + 0.392 0.585 0.93 setrgbcolor +newpath 108.8529 -47.16971 moveto +126.99506 -47.16971 lineto +126.99506 -38.09863 lineto +108.8529 -38.09863 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -47.16971 moveto +126.99506 -47.16971 lineto +126.99506 -38.09863 lineto +108.8529 -38.09863 lineto + closepath stroke +129.99506 -45.74753 moveto +(Corn\015o) cmr9 8.96637 fshow +159.45386 -45.74753 moveto +(w) cmr9 8.96637 fshow +165.85336 -45.74753 moveto +(erBlue) cmr9 8.96637 fshow + 1 0.972 0.864 setrgbcolor +newpath 217.70581 -47.16971 moveto +235.84796 -47.16971 lineto +235.84796 -38.09863 lineto +217.70581 -38.09863 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -47.16971 moveto +235.84796 -47.16971 lineto +235.84796 -38.09863 lineto +217.70581 -38.09863 lineto + closepath stroke +238.84796 -45.74753 moveto +(Cornsilk) cmr9 8.96637 fshow + 0.864 0.08 0.235 setrgbcolor +newpath 326.55872 -47.16971 moveto +344.70087 -47.16971 lineto +344.70087 -38.09863 lineto +326.55872 -38.09863 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -47.16971 moveto +344.70087 -47.16971 lineto +344.70087 -38.09863 lineto +326.55872 -38.09863 lineto + closepath stroke +347.70087 -45.69768 moveto +(Crimson) cmr9 8.96637 fshow + 0 1 1 setrgbcolor +newpath 0 -58.96213 moveto +18.14215 -58.96213 lineto +18.14215 -49.89105 lineto +0 -49.89105 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -58.96213 moveto +18.14215 -58.96213 lineto +18.14215 -49.89105 lineto +0 -49.89105 lineto + closepath stroke +21.14215 -56.61835 moveto +(Cy) cmr9 8.96637 fshow +32.40535 -56.61835 moveto +(an) cmr9 8.96637 fshow + 0 0 0.545 setrgbcolor +newpath 108.8529 -58.96213 moveto +126.99506 -58.96213 lineto +126.99506 -49.89105 lineto +108.8529 -49.89105 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -58.96213 moveto +126.99506 -58.96213 lineto +126.99506 -49.89105 lineto +108.8529 -49.89105 lineto + closepath stroke +129.99506 -57.53995 moveto +(DarkBlue) cmr9 8.96637 fshow + 0 0.545 0.545 setrgbcolor +newpath 217.70581 -58.96213 moveto +235.84796 -58.96213 lineto +235.84796 -49.89105 lineto +217.70581 -49.89105 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -58.96213 moveto +235.84796 -58.96213 lineto +235.84796 -49.89105 lineto +217.70581 -49.89105 lineto + closepath stroke +238.84796 -56.6682 moveto +(DarkCy) cmr9 8.96637 fshow +270.22586 -56.6682 moveto +(an) cmr9 8.96637 fshow + 0.72 0.525 0.044 setrgbcolor +newpath 326.55872 -58.96213 moveto +344.70087 -58.96213 lineto +344.70087 -49.89105 lineto +326.55872 -49.89105 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -58.96213 moveto +344.70087 -58.96213 lineto +344.70087 -49.89105 lineto +326.55872 -49.89105 lineto + closepath stroke +347.70087 -57.53995 moveto +(DarkGoldenro) cmr9 8.96637 fshow +405.02097 -57.53995 moveto +(d) cmr9 8.96637 fshow + 0.664 0.664 0.664 setrgbcolor +newpath 0 -70.75455 moveto +18.14215 -70.75455 lineto +18.14215 -61.68347 lineto +0 -61.68347 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -70.75455 moveto +18.14215 -70.75455 lineto +18.14215 -61.68347 lineto +0 -61.68347 lineto + closepath stroke +21.14215 -68.46062 moveto +(DarkGra) cmr9 8.96637 fshow +56.44424 -68.46062 moveto +(y) cmr9 8.96637 fshow + 0 0.392 0 setrgbcolor +newpath 108.8529 -70.75455 moveto +126.99506 -70.75455 lineto +126.99506 -61.68347 lineto +108.8529 -61.68347 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -70.75455 moveto +126.99506 -70.75455 lineto +126.99506 -61.68347 lineto +108.8529 -61.68347 lineto + closepath stroke +129.99506 -69.33237 moveto +(DarkGreen) cmr9 8.96637 fshow + 0.664 0.664 0.664 setrgbcolor +newpath 217.70581 -70.75455 moveto +235.84796 -70.75455 lineto +235.84796 -61.68347 lineto +217.70581 -61.68347 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -70.75455 moveto +235.84796 -70.75455 lineto +235.84796 -61.68347 lineto +217.70581 -61.68347 lineto + closepath stroke +238.84796 -68.46062 moveto +(DarkGrey) cmr9 8.96637 fshow + 0.74 0.716 0.42 setrgbcolor +newpath 326.55872 -70.75455 moveto +344.70087 -70.75455 lineto +344.70087 -61.68347 lineto +326.55872 -61.68347 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -70.75455 moveto +344.70087 -70.75455 lineto +344.70087 -61.68347 lineto +326.55872 -61.68347 lineto + closepath stroke +347.70087 -69.33237 moveto +(DarkKhaki) cmr9 8.96637 fshow + 0.545 0 0.545 setrgbcolor +newpath 0 -82.54698 moveto +18.14215 -82.54698 lineto +18.14215 -73.4759 lineto +0 -73.4759 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -82.54698 moveto +18.14215 -82.54698 lineto +18.14215 -73.4759 lineto +0 -73.4759 lineto + closepath stroke +21.14215 -80.25305 moveto +(DarkMagen) cmr9 8.96637 fshow +67.88115 -80.25305 moveto +(ta) cmr9 8.96637 fshow + 0.332 0.42 0.185 setrgbcolor +newpath 108.8529 -82.54698 moveto +126.99506 -82.54698 lineto +126.99506 -73.4759 lineto +108.8529 -73.4759 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -82.54698 moveto +126.99506 -82.54698 lineto +126.99506 -73.4759 lineto +108.8529 -73.4759 lineto + closepath stroke +129.99506 -81.1248 moveto +(DarkOliv) cmr9 8.96637 fshow +167.00465 -81.1248 moveto +(eGreen) cmr9 8.96637 fshow + 1 0.55 0 setrgbcolor +newpath 217.70581 -82.54698 moveto +235.84796 -82.54698 lineto +235.84796 -73.4759 lineto +217.70581 -73.4759 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -82.54698 moveto +235.84796 -82.54698 lineto +235.84796 -73.4759 lineto +217.70581 -73.4759 lineto + closepath stroke +238.84796 -80.25305 moveto +(DarkOrange) cmr9 8.96637 fshow + 0.6 0.196 0.8 setrgbcolor +newpath 326.55872 -82.54698 moveto +344.70087 -82.54698 lineto +344.70087 -73.4759 lineto +326.55872 -73.4759 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -82.54698 moveto +344.70087 -82.54698 lineto +344.70087 -73.4759 lineto +326.55872 -73.4759 lineto + closepath stroke +347.70087 -81.1248 moveto +(DarkOrc) cmr9 8.96637 fshow +382.42737 -81.1248 moveto +(hid) cmr9 8.96637 fshow + 0.545 0 0 setrgbcolor +newpath 0 -94.3394 moveto +18.14215 -94.3394 lineto +18.14215 -85.26833 lineto +0 -85.26833 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -94.3394 moveto +18.14215 -94.3394 lineto +18.14215 -85.26833 lineto +0 -85.26833 lineto + closepath stroke +21.14215 -92.91722 moveto +(DarkRed) cmr9 8.96637 fshow + 0.912 0.59 0.48 setrgbcolor +newpath 108.8529 -94.3394 moveto +126.99506 -94.3394 lineto +126.99506 -85.26833 lineto +108.8529 -85.26833 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -94.3394 moveto +126.99506 -94.3394 lineto +126.99506 -85.26833 lineto +108.8529 -85.26833 lineto + closepath stroke +129.99506 -92.91722 moveto +(DarkSalmon) cmr9 8.96637 fshow + 0.56 0.736 0.56 setrgbcolor +newpath 217.70581 -94.3394 moveto +235.84796 -94.3394 lineto +235.84796 -85.26833 lineto +217.70581 -85.26833 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -94.3394 moveto +235.84796 -94.3394 lineto +235.84796 -85.26833 lineto +217.70581 -85.26833 lineto + closepath stroke +238.84796 -92.91722 moveto +(DarkSeaGreen) cmr9 8.96637 fshow + 0.284 0.24 0.545 setrgbcolor +newpath 326.55872 -94.3394 moveto +344.70087 -94.3394 lineto +344.70087 -85.26833 lineto +326.55872 -85.26833 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -94.3394 moveto +344.70087 -94.3394 lineto +344.70087 -85.26833 lineto +326.55872 -85.26833 lineto + closepath stroke +347.70087 -92.91722 moveto +(DarkSlateBlue) cmr9 8.96637 fshow + 0.185 0.31 0.31 setrgbcolor +newpath 0 -106.13184 moveto +18.14215 -106.13184 lineto +18.14215 -97.06076 lineto +0 -97.06076 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -106.13184 moveto +18.14215 -106.13184 lineto +18.14215 -97.06076 lineto +0 -97.06076 lineto + closepath stroke +21.14215 -103.8379 moveto +(DarkSlateGra) cmr9 8.96637 fshow +76.41435 -103.8379 moveto +(y) cmr9 8.96637 fshow + 0.185 0.31 0.31 setrgbcolor +newpath 108.8529 -106.13184 moveto +126.99506 -106.13184 lineto +126.99506 -97.06076 lineto +108.8529 -97.06076 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -106.13184 moveto +126.99506 -106.13184 lineto +126.99506 -97.06076 lineto +108.8529 -97.06076 lineto + closepath stroke +129.99506 -103.8379 moveto +(DarkSlateGrey) cmr9 8.96637 fshow + 0 0.808 0.82 setrgbcolor +newpath 217.70581 -106.13184 moveto +235.84796 -106.13184 lineto +235.84796 -97.06076 lineto +217.70581 -97.06076 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -106.13184 moveto +235.84796 -106.13184 lineto +235.84796 -97.06076 lineto +217.70581 -97.06076 lineto + closepath stroke +238.84796 -103.8379 moveto +(DarkT) cmr9 8.96637 fshow +264.85027 -103.8379 moveto +(urquoise) cmr9 8.96637 fshow + 0.58 0 0.828 setrgbcolor +newpath 326.55872 -106.13184 moveto +344.70087 -106.13184 lineto +344.70087 -97.06076 lineto +326.55872 -97.06076 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -106.13184 moveto +344.70087 -106.13184 lineto +344.70087 -97.06076 lineto +326.55872 -97.06076 lineto + closepath stroke +347.70087 -104.70966 moveto +(DarkViolet) cmr9 8.96637 fshow + 1 0.08 0.576 setrgbcolor +newpath 0 -117.92426 moveto +18.14215 -117.92426 lineto +18.14215 -108.85318 lineto +0 -108.85318 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -117.92426 moveto +18.14215 -117.92426 lineto +18.14215 -108.85318 lineto +0 -108.85318 lineto + closepath stroke +21.14215 -115.63033 moveto +(DeepPink) cmr9 8.96637 fshow + 0 0.75 1 setrgbcolor +newpath 108.8529 -117.92426 moveto +126.99506 -117.92426 lineto +126.99506 -108.85318 lineto +108.8529 -108.85318 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -117.92426 moveto +126.99506 -117.92426 lineto +126.99506 -108.85318 lineto +108.8529 -108.85318 lineto + closepath stroke +129.99506 -115.63033 moveto +(DeepSkyBlue) cmr9 8.96637 fshow + 0.41 0.41 0.41 setrgbcolor +newpath 217.70581 -117.92426 moveto +235.84796 -117.92426 lineto +235.84796 -108.85318 lineto +217.70581 -108.85318 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -117.92426 moveto +235.84796 -117.92426 lineto +235.84796 -108.85318 lineto +217.70581 -108.85318 lineto + closepath stroke +238.84796 -115.58047 moveto +(DimGra) cmr9 8.96637 fshow +271.31346 -115.58047 moveto +(y) cmr9 8.96637 fshow + 0.41 0.41 0.41 setrgbcolor +newpath 326.55872 -117.92426 moveto +344.70087 -117.92426 lineto +344.70087 -108.85318 lineto +326.55872 -108.85318 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -117.92426 moveto +344.70087 -117.92426 lineto +344.70087 -108.85318 lineto +326.55872 -108.85318 lineto + closepath stroke +347.70087 -115.58047 moveto +(DimGrey) cmr9 8.96637 fshow + 0.116 0.565 1 setrgbcolor +newpath 0 -129.71669 moveto +18.14215 -129.71669 lineto +18.14215 -120.64561 lineto +0 -120.64561 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -129.71669 moveto +18.14215 -129.71669 lineto +18.14215 -120.64561 lineto +0 -120.64561 lineto + closepath stroke +21.14215 -127.42276 moveto +(Do) cmr9 8.96637 fshow +33.04465 -127.42276 moveto +(dgerBlue) cmr9 8.96637 fshow + 0.698 0.132 0.132 setrgbcolor +newpath 108.8529 -129.71669 moveto +126.99506 -129.71669 lineto +126.99506 -120.64561 lineto +108.8529 -120.64561 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -129.71669 moveto +126.99506 -129.71669 lineto +126.99506 -120.64561 lineto +108.8529 -120.64561 lineto + closepath stroke +129.99506 -128.29451 moveto +(FireBric) cmr9 8.96637 fshow +162.80435 -128.29451 moveto +(k) cmr9 8.96637 fshow + 1 0.98 0.94 setrgbcolor +newpath 217.70581 -129.71669 moveto +235.84796 -129.71669 lineto +235.84796 -120.64561 lineto +217.70581 -120.64561 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -129.71669 moveto +235.84796 -129.71669 lineto +235.84796 -120.64561 lineto +217.70581 -120.64561 lineto + closepath stroke +238.84796 -128.29451 moveto +(FloralWhite) cmr9 8.96637 fshow + 0.132 0.545 0.132 setrgbcolor +newpath 326.55872 -129.71669 moveto +344.70087 -129.71669 lineto +344.70087 -120.64561 lineto +326.55872 -120.64561 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -129.71669 moveto +344.70087 -129.71669 lineto +344.70087 -120.64561 lineto +326.55872 -120.64561 lineto + closepath stroke +347.70087 -128.24466 moveto +(F) cmr9 8.96637 fshow +352.94777 -128.24466 moveto +(orestGreen) cmr9 8.96637 fshow + 1 0 1 setrgbcolor +newpath 0 -141.50911 moveto +18.14215 -141.50911 lineto +18.14215 -132.43803 lineto +0 -132.43803 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -141.50911 moveto +18.14215 -141.50911 lineto +18.14215 -132.43803 lineto +0 -132.43803 lineto + closepath stroke +21.14215 -140.08693 moveto +(F) cmr9 8.96637 fshow +26.38905 -140.08693 moveto +(uc) cmr9 8.96637 fshow +35.34845 -140.08693 moveto +(hsia) cmr9 8.96637 fshow + 0.864 0.864 0.864 setrgbcolor +newpath 108.8529 -141.50911 moveto +126.99506 -141.50911 lineto +126.99506 -132.43803 lineto +108.8529 -132.43803 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -141.50911 moveto +126.99506 -141.50911 lineto +126.99506 -132.43803 lineto +108.8529 -132.43803 lineto + closepath stroke +129.99506 -140.08693 moveto +(Gainsb) cmr9 8.96637 fshow +158.52396 -140.08693 moveto +(oro) cmr9 8.96637 fshow + 0.972 0.972 1 setrgbcolor +newpath 217.70581 -141.50911 moveto +235.84796 -141.50911 lineto +235.84796 -132.43803 lineto +217.70581 -132.43803 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -141.50911 moveto +235.84796 -141.50911 lineto +235.84796 -132.43803 lineto +217.70581 -132.43803 lineto + closepath stroke +238.84796 -140.08693 moveto +(GhostWhite) cmr9 8.96637 fshow + 1 0.844 0 setrgbcolor +newpath 326.55872 -141.50911 moveto +344.70087 -141.50911 lineto +344.70087 -132.43803 lineto +326.55872 -132.43803 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -141.50911 moveto +344.70087 -141.50911 lineto +344.70087 -132.43803 lineto +326.55872 -132.43803 lineto + closepath stroke +347.70087 -140.08693 moveto +(Gold) cmr9 8.96637 fshow + 0.855 0.648 0.125 setrgbcolor +newpath 0 -153.30153 moveto +18.14215 -153.30153 lineto +18.14215 -144.23045 lineto +0 -144.23045 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -153.30153 moveto +18.14215 -153.30153 lineto +18.14215 -144.23045 lineto +0 -144.23045 lineto + closepath stroke +21.14215 -151.87935 moveto +(Goldenro) cmr9 8.96637 fshow +58.34755 -151.87935 moveto +(d) cmr9 8.96637 fshow + 0.5 0.5 0.5 setrgbcolor +newpath 108.8529 -153.30153 moveto +126.99506 -153.30153 lineto +126.99506 -144.23045 lineto +108.8529 -144.23045 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -153.30153 moveto +126.99506 -153.30153 lineto +126.99506 -144.23045 lineto +108.8529 -144.23045 lineto + closepath stroke +129.99506 -150.95775 moveto +(Gra) cmr9 8.96637 fshow +145.18245 -150.95775 moveto +(y) cmr9 8.96637 fshow + 0 0.5 0 setrgbcolor +newpath 217.70581 -153.30153 moveto +235.84796 -153.30153 lineto +235.84796 -144.23045 lineto +217.70581 -144.23045 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -153.30153 moveto +235.84796 -153.30153 lineto +235.84796 -144.23045 lineto +217.70581 -144.23045 lineto + closepath stroke +238.84796 -151.8295 moveto +(Green) cmr9 8.96637 fshow + 0.68 1 0.185 setrgbcolor +newpath 326.55872 -153.30153 moveto +344.70087 -153.30153 lineto +344.70087 -144.23045 lineto +326.55872 -144.23045 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -153.30153 moveto +344.70087 -153.30153 lineto +344.70087 -144.23045 lineto +326.55872 -144.23045 lineto + closepath stroke +347.70087 -151.87935 moveto +(GreenY) cmr9 8.96637 fshow +377.99677 -151.87935 moveto +(ello) cmr9 8.96637 fshow +391.56726 -151.87935 moveto +(w) cmr9 8.96637 fshow + 0.5 0.5 0.5 setrgbcolor +newpath 0 -165.09396 moveto +18.14215 -165.09396 lineto +18.14215 -156.02289 lineto +0 -156.02289 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -165.09396 moveto +18.14215 -165.09396 lineto +18.14215 -156.02289 lineto +0 -156.02289 lineto + closepath stroke +21.14215 -162.75018 moveto +(Grey) cmr9 8.96637 fshow + 0.94 1 0.94 setrgbcolor +newpath 108.8529 -165.09396 moveto +126.99506 -165.09396 lineto +126.99506 -156.02289 lineto +108.8529 -156.02289 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -165.09396 moveto +126.99506 -165.09396 lineto +126.99506 -156.02289 lineto +108.8529 -156.02289 lineto + closepath stroke +129.99506 -162.80003 moveto +(Honeydew) cmr9 8.96637 fshow + 1 0.41 0.705 setrgbcolor +newpath 217.70581 -165.09396 moveto +235.84796 -165.09396 lineto +235.84796 -156.02289 lineto +217.70581 -156.02289 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -165.09396 moveto +235.84796 -165.09396 lineto +235.84796 -156.02289 lineto +217.70581 -156.02289 lineto + closepath stroke +238.84796 -163.67178 moveto +(HotPink) cmr9 8.96637 fshow + 0.804 0.36 0.36 setrgbcolor +newpath 326.55872 -165.09396 moveto +344.70087 -165.09396 lineto +344.70087 -156.02289 lineto +326.55872 -156.02289 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -165.09396 moveto +344.70087 -165.09396 lineto +344.70087 -156.02289 lineto +326.55872 -156.02289 lineto + closepath stroke +347.70087 -163.67178 moveto +(IndianRed) cmr9 8.96637 fshow + 0.294 0 0.51 setrgbcolor +newpath 0 -176.88638 moveto +18.14215 -176.88638 lineto +18.14215 -167.8153 lineto +0 -167.8153 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -176.88638 moveto +18.14215 -176.88638 lineto +18.14215 -167.8153 lineto +0 -167.8153 lineto + closepath stroke +21.14215 -174.59245 moveto +(Indigo) cmr9 8.96637 fshow + 1 1 0.94 setrgbcolor +newpath 108.8529 -176.88638 moveto +126.99506 -176.88638 lineto +126.99506 -167.8153 lineto +108.8529 -167.8153 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -176.88638 moveto +126.99506 -176.88638 lineto +126.99506 -167.8153 lineto +108.8529 -167.8153 lineto + closepath stroke +129.99506 -174.5426 moveto +(Iv) cmr9 8.96637 fshow +137.92915 -174.5426 moveto +(ory) cmr9 8.96637 fshow + 0.94 0.9 0.55 setrgbcolor +newpath 217.70581 -176.88638 moveto +235.84796 -176.88638 lineto +235.84796 -167.8153 lineto +217.70581 -167.8153 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -176.88638 moveto +235.84796 -176.88638 lineto +235.84796 -167.8153 lineto +217.70581 -167.8153 lineto + closepath stroke +238.84796 -175.4642 moveto +(Khaki) cmr9 8.96637 fshow + 0.9 0.9 0.98 setrgbcolor +newpath 326.55872 -176.88638 moveto +344.70087 -176.88638 lineto +344.70087 -167.8153 lineto +326.55872 -167.8153 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -176.88638 moveto +344.70087 -176.88638 lineto +344.70087 -167.8153 lineto +326.55872 -167.8153 lineto + closepath stroke +347.70087 -175.4642 moveto +(La) cmr9 8.96637 fshow +357.81146 -175.4642 moveto +(v) cmr9 8.96637 fshow +362.41917 -175.4642 moveto +(ender) cmr9 8.96637 fshow + 1 0.94 0.96 setrgbcolor +newpath 0 -188.67882 moveto +18.14215 -188.67882 lineto +18.14215 -179.60774 lineto +0 -179.60774 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -188.67882 moveto +18.14215 -188.67882 lineto +18.14215 -179.60774 lineto +0 -179.60774 lineto + closepath stroke +21.14215 -187.25664 moveto +(La) cmr9 8.96637 fshow +31.25275 -187.25664 moveto +(v) cmr9 8.96637 fshow +35.86046 -187.25664 moveto +(enderBlush) cmr9 8.96637 fshow + 0.488 0.99 0 setrgbcolor +newpath 108.8529 -188.67882 moveto +126.99506 -188.67882 lineto +126.99506 -179.60774 lineto +108.8529 -179.60774 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -188.67882 moveto +126.99506 -188.67882 lineto +126.99506 -179.60774 lineto +108.8529 -179.60774 lineto + closepath stroke +129.99506 -187.20679 moveto +(La) cmr9 8.96637 fshow +140.10565 -187.20679 moveto +(wnGreen) cmr9 8.96637 fshow + 1 0.98 0.804 setrgbcolor +newpath 217.70581 -188.67882 moveto +235.84796 -188.67882 lineto +235.84796 -179.60774 lineto +217.70581 -179.60774 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -188.67882 moveto +235.84796 -188.67882 lineto +235.84796 -179.60774 lineto +217.70581 -179.60774 lineto + closepath stroke +238.84796 -187.25664 moveto +(LemonChi\013on) cmr9 8.96637 fshow + 0.68 0.848 0.9 setrgbcolor +newpath 326.55872 -188.67882 moveto +344.70087 -188.67882 lineto +344.70087 -179.60774 lineto +326.55872 -179.60774 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -188.67882 moveto +344.70087 -188.67882 lineto +344.70087 -179.60774 lineto +326.55872 -179.60774 lineto + closepath stroke +347.70087 -186.38489 moveto +(Ligh) cmr9 8.96637 fshow +365.49097 -186.38489 moveto +(tBlue) cmr9 8.96637 fshow + 0.94 0.5 0.5 setrgbcolor +newpath 0 -200.47124 moveto +18.14215 -200.47124 lineto +18.14215 -191.40016 lineto +0 -191.40016 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -200.47124 moveto +18.14215 -200.47124 lineto +18.14215 -191.40016 lineto +0 -191.40016 lineto + closepath stroke +21.14215 -198.1773 moveto +(Ligh) cmr9 8.96637 fshow +38.93225 -198.1773 moveto +(tCoral) cmr9 8.96637 fshow + 0.88 1 1 setrgbcolor +newpath 108.8529 -200.47124 moveto +126.99506 -200.47124 lineto +126.99506 -191.40016 lineto +108.8529 -191.40016 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -200.47124 moveto +126.99506 -200.47124 lineto +126.99506 -191.40016 lineto +108.8529 -191.40016 lineto + closepath stroke +129.99506 -198.1773 moveto +(Ligh) cmr9 8.96637 fshow +147.78516 -198.1773 moveto +(tCy) cmr9 8.96637 fshow +162.63216 -198.1773 moveto +(an) cmr9 8.96637 fshow + 0.933 0.867 0.51 setrgbcolor +newpath 217.70581 -200.47124 moveto +235.84796 -200.47124 lineto +235.84796 -191.40016 lineto +217.70581 -191.40016 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -200.47124 moveto +235.84796 -200.47124 lineto +235.84796 -191.40016 lineto +217.70581 -191.40016 lineto + closepath stroke +238.84796 -198.1773 moveto +(Ligh) cmr9 8.96637 fshow +256.63806 -198.1773 moveto +(tGoldenro) cmr9 8.96637 fshow +297.42715 -198.1773 moveto +(d) cmr9 8.96637 fshow + 0.98 0.98 0.824 setrgbcolor +newpath 326.55872 -200.47124 moveto +344.70087 -200.47124 lineto +344.70087 -191.40016 lineto +326.55872 -191.40016 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -200.47124 moveto +344.70087 -200.47124 lineto +344.70087 -191.40016 lineto +326.55872 -191.40016 lineto + closepath stroke +347.70087 -198.1773 moveto +(Ligh) cmr9 8.96637 fshow +365.49097 -198.1773 moveto +(tGoldenro) cmr9 8.96637 fshow +406.28006 -198.1773 moveto +(dY) cmr9 8.96637 fshow +417.54196 -198.1773 moveto +(ello) cmr9 8.96637 fshow +431.11247 -198.1773 moveto +(w) cmr9 8.96637 fshow + 0.828 0.828 0.828 setrgbcolor +newpath 0 -212.26366 moveto +18.14215 -212.26366 lineto +18.14215 -203.19258 lineto +0 -203.19258 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -212.26366 moveto +18.14215 -212.26366 lineto +18.14215 -203.19258 lineto +0 -203.19258 lineto + closepath stroke +21.14215 -209.96973 moveto +(Ligh) cmr9 8.96637 fshow +38.93225 -209.96973 moveto +(tGra) cmr9 8.96637 fshow +57.70335 -209.96973 moveto +(y) cmr9 8.96637 fshow + 0.565 0.932 0.565 setrgbcolor +newpath 108.8529 -212.26366 moveto +126.99506 -212.26366 lineto +126.99506 -203.19258 lineto +108.8529 -203.19258 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -212.26366 moveto +126.99506 -212.26366 lineto +126.99506 -203.19258 lineto +108.8529 -203.19258 lineto + closepath stroke +129.99506 -209.96973 moveto +(Ligh) cmr9 8.96637 fshow +147.78516 -209.96973 moveto +(tGreen) cmr9 8.96637 fshow + 0.828 0.828 0.828 setrgbcolor +newpath 217.70581 -212.26366 moveto +235.84796 -212.26366 lineto +235.84796 -203.19258 lineto +217.70581 -203.19258 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -212.26366 moveto +235.84796 -212.26366 lineto +235.84796 -203.19258 lineto +217.70581 -203.19258 lineto + closepath stroke +238.84796 -209.96973 moveto +(Ligh) cmr9 8.96637 fshow +256.63806 -209.96973 moveto +(tGrey) cmr9 8.96637 fshow + 1 0.712 0.756 setrgbcolor +newpath 326.55872 -212.26366 moveto +344.70087 -212.26366 lineto +344.70087 -203.19258 lineto +326.55872 -203.19258 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -212.26366 moveto +344.70087 -212.26366 lineto +344.70087 -203.19258 lineto +326.55872 -203.19258 lineto + closepath stroke +347.70087 -209.96973 moveto +(Ligh) cmr9 8.96637 fshow +365.49097 -209.96973 moveto +(tPink) cmr9 8.96637 fshow + 1 0.628 0.48 setrgbcolor +newpath 0 -224.05609 moveto +18.14215 -224.05609 lineto +18.14215 -214.98502 lineto +0 -214.98502 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -224.05609 moveto +18.14215 -224.05609 lineto +18.14215 -214.98502 lineto +0 -214.98502 lineto + closepath stroke +21.14215 -221.76216 moveto +(Ligh) cmr9 8.96637 fshow +38.93225 -221.76216 moveto +(tSalmon) cmr9 8.96637 fshow + 0.125 0.698 0.668 setrgbcolor +newpath 108.8529 -224.05609 moveto +126.99506 -224.05609 lineto +126.99506 -214.98502 lineto +108.8529 -214.98502 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -224.05609 moveto +126.99506 -224.05609 lineto +126.99506 -214.98502 lineto +108.8529 -214.98502 lineto + closepath stroke +129.99506 -221.76216 moveto +(Ligh) cmr9 8.96637 fshow +147.78516 -221.76216 moveto +(tSeaGreen) cmr9 8.96637 fshow + 0.53 0.808 0.98 setrgbcolor +newpath 217.70581 -224.05609 moveto +235.84796 -224.05609 lineto +235.84796 -214.98502 lineto +217.70581 -214.98502 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -224.05609 moveto +235.84796 -224.05609 lineto +235.84796 -214.98502 lineto +217.70581 -214.98502 lineto + closepath stroke +238.84796 -221.76216 moveto +(Ligh) cmr9 8.96637 fshow +256.63806 -221.76216 moveto +(tSkyBlue) cmr9 8.96637 fshow + 0.518 0.44 1 setrgbcolor +newpath 326.55872 -224.05609 moveto +344.70087 -224.05609 lineto +344.70087 -214.98502 lineto +326.55872 -214.98502 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -224.05609 moveto +344.70087 -224.05609 lineto +344.70087 -214.98502 lineto +326.55872 -214.98502 lineto + closepath stroke +347.70087 -221.76216 moveto +(Ligh) cmr9 8.96637 fshow +365.49097 -221.76216 moveto +(tSlateBlue) cmr9 8.96637 fshow + 0.468 0.532 0.6 setrgbcolor +newpath 0 -235.84851 moveto +18.14215 -235.84851 lineto +18.14215 -226.77744 lineto +0 -226.77744 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -235.84851 moveto +18.14215 -235.84851 lineto +18.14215 -226.77744 lineto +0 -226.77744 lineto + closepath stroke +21.14215 -233.55458 moveto +(Ligh) cmr9 8.96637 fshow +38.93225 -233.55458 moveto +(tSlateGra) cmr9 8.96637 fshow +77.67355 -233.55458 moveto +(y) cmr9 8.96637 fshow + 0.468 0.532 0.6 setrgbcolor +newpath 108.8529 -235.84851 moveto +126.99506 -235.84851 lineto +126.99506 -226.77744 lineto +108.8529 -226.77744 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -235.84851 moveto +126.99506 -235.84851 lineto +126.99506 -226.77744 lineto +108.8529 -226.77744 lineto + closepath stroke +129.99506 -233.55458 moveto +(Ligh) cmr9 8.96637 fshow +147.78516 -233.55458 moveto +(tSlateGrey) cmr9 8.96637 fshow + 0.69 0.77 0.87 setrgbcolor +newpath 217.70581 -235.84851 moveto +235.84796 -235.84851 lineto +235.84796 -226.77744 lineto +217.70581 -226.77744 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -235.84851 moveto +235.84796 -235.84851 lineto +235.84796 -226.77744 lineto +217.70581 -226.77744 lineto + closepath stroke +238.84796 -233.55458 moveto +(Ligh) cmr9 8.96637 fshow +256.63806 -233.55458 moveto +(tSteelBlue) cmr9 8.96637 fshow + 1 1 0.88 setrgbcolor +newpath 326.55872 -235.84851 moveto +344.70087 -235.84851 lineto +344.70087 -226.77744 lineto +326.55872 -226.77744 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -235.84851 moveto +344.70087 -235.84851 lineto +344.70087 -226.77744 lineto +326.55872 -226.77744 lineto + closepath stroke +347.70087 -233.55458 moveto +(Ligh) cmr9 8.96637 fshow +365.49097 -233.55458 moveto +(tY) cmr9 8.96637 fshow +375.21687 -233.55458 moveto +(ello) cmr9 8.96637 fshow +388.78746 -233.55458 moveto +(w) cmr9 8.96637 fshow + 0 1 0 setrgbcolor +newpath 0 -247.64095 moveto +18.14215 -247.64095 lineto +18.14215 -238.56987 lineto +0 -238.56987 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -247.64095 moveto +18.14215 -247.64095 lineto +18.14215 -238.56987 lineto +0 -238.56987 lineto + closepath stroke +21.14215 -246.16891 moveto +(Lime) cmr9 8.96637 fshow + 0.196 0.804 0.196 setrgbcolor +newpath 108.8529 -247.64095 moveto +126.99506 -247.64095 lineto +126.99506 -238.56987 lineto +108.8529 -238.56987 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -247.64095 moveto +126.99506 -247.64095 lineto +126.99506 -238.56987 lineto +108.8529 -238.56987 lineto + closepath stroke +129.99506 -246.16891 moveto +(LimeGreen) cmr9 8.96637 fshow + 0.98 0.94 0.9 setrgbcolor +newpath 217.70581 -247.64095 moveto +235.84796 -247.64095 lineto +235.84796 -238.56987 lineto +217.70581 -238.56987 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -247.64095 moveto +235.84796 -247.64095 lineto +235.84796 -238.56987 lineto +217.70581 -238.56987 lineto + closepath stroke +238.84796 -246.16891 moveto +(Linen) cmr9 8.96637 fshow + 1 0 1 setrgbcolor +newpath 326.55872 -247.64095 moveto +344.70087 -247.64095 lineto +344.70087 -238.56987 lineto +326.55872 -238.56987 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -247.64095 moveto +344.70087 -247.64095 lineto +344.70087 -238.56987 lineto +326.55872 -238.56987 lineto + closepath stroke +347.70087 -245.29716 moveto +(Magen) cmr9 8.96637 fshow +374.32516 -245.29716 moveto +(ta) cmr9 8.96637 fshow + 0.5 0 0 setrgbcolor +newpath 0 -259.43336 moveto +18.14215 -259.43336 lineto +18.14215 -250.36229 lineto +0 -250.36229 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -259.43336 moveto +18.14215 -259.43336 lineto +18.14215 -250.36229 lineto +0 -250.36229 lineto + closepath stroke +21.14215 -257.96133 moveto +(Maro) cmr9 8.96637 fshow +42.66405 -257.96133 moveto +(on) cmr9 8.96637 fshow + 0.4 0.804 0.668 setrgbcolor +newpath 108.8529 -259.43336 moveto +126.99506 -259.43336 lineto +126.99506 -250.36229 lineto +108.8529 -250.36229 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -259.43336 moveto +126.99506 -259.43336 lineto +126.99506 -250.36229 lineto +108.8529 -250.36229 lineto + closepath stroke +129.99506 -257.13943 moveto +(MediumAquamarine) cmr9 8.96637 fshow + 0 0 0.804 setrgbcolor +newpath 217.70581 -259.43336 moveto +235.84796 -259.43336 lineto +235.84796 -250.36229 lineto +217.70581 -250.36229 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -259.43336 moveto +235.84796 -259.43336 lineto +235.84796 -250.36229 lineto +217.70581 -250.36229 lineto + closepath stroke +238.84796 -258.01118 moveto +(MediumBlue) cmr9 8.96637 fshow + 0.73 0.332 0.828 setrgbcolor +newpath 326.55872 -259.43336 moveto +344.70087 -259.43336 lineto +344.70087 -250.36229 lineto +326.55872 -250.36229 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -259.43336 moveto +344.70087 -259.43336 lineto +344.70087 -250.36229 lineto +326.55872 -250.36229 lineto + closepath stroke +347.70087 -258.01118 moveto +(MediumOrc) cmr9 8.96637 fshow +395.33647 -258.01118 moveto +(hid) cmr9 8.96637 fshow + 0.576 0.44 0.86 setrgbcolor +newpath 0 -271.2258 moveto +18.14215 -271.2258 lineto +18.14215 -262.15472 lineto +0 -262.15472 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -271.2258 moveto +18.14215 -271.2258 lineto +18.14215 -262.15472 lineto +0 -262.15472 lineto + closepath stroke +21.14215 -268.93187 moveto +(MediumPurple) cmr9 8.96637 fshow + 0.235 0.7 0.444 setrgbcolor +newpath 108.8529 -271.2258 moveto +126.99506 -271.2258 lineto +126.99506 -262.15472 lineto +108.8529 -262.15472 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -271.2258 moveto +126.99506 -271.2258 lineto +126.99506 -262.15472 lineto +108.8529 -262.15472 lineto + closepath stroke +129.99506 -269.80362 moveto +(MediumSeaGreen) cmr9 8.96637 fshow + 0.484 0.408 0.932 setrgbcolor +newpath 217.70581 -271.2258 moveto +235.84796 -271.2258 lineto +235.84796 -262.15472 lineto +217.70581 -262.15472 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -271.2258 moveto +235.84796 -271.2258 lineto +235.84796 -262.15472 lineto +217.70581 -262.15472 lineto + closepath stroke +238.84796 -269.80362 moveto +(MediumSlateBlue) cmr9 8.96637 fshow + 0 0.98 0.604 setrgbcolor +newpath 326.55872 -271.2258 moveto +344.70087 -271.2258 lineto +344.70087 -262.15472 lineto +326.55872 -262.15472 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -271.2258 moveto +344.70087 -271.2258 lineto +344.70087 -262.15472 lineto +326.55872 -262.15472 lineto + closepath stroke +347.70087 -268.93187 moveto +(MediumSpringGreen) cmr9 8.96637 fshow + 0.284 0.82 0.8 setrgbcolor +newpath 0 -283.01822 moveto +18.14215 -283.01822 lineto +18.14215 -273.94714 lineto +0 -273.94714 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -283.01822 moveto +18.14215 -283.01822 lineto +18.14215 -273.94714 lineto +0 -273.94714 lineto + closepath stroke +21.14215 -280.72429 moveto +(MediumT) cmr9 8.96637 fshow +60.05356 -280.72429 moveto +(urquoise) cmr9 8.96637 fshow + 0.78 0.084 0.52 setrgbcolor +newpath 108.8529 -283.01822 moveto +126.99506 -283.01822 lineto +126.99506 -273.94714 lineto +108.8529 -273.94714 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -283.01822 moveto +126.99506 -283.01822 lineto +126.99506 -273.94714 lineto +108.8529 -273.94714 lineto + closepath stroke +129.99506 -281.59604 moveto +(MediumVioletRed) cmr9 8.96637 fshow + 0.098 0.098 0.44 setrgbcolor +newpath 217.70581 -283.01822 moveto +235.84796 -283.01822 lineto +235.84796 -273.94714 lineto +217.70581 -273.94714 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -283.01822 moveto +235.84796 -283.01822 lineto +235.84796 -273.94714 lineto +217.70581 -273.94714 lineto + closepath stroke +238.84796 -280.72429 moveto +(Midnigh) cmr9 8.96637 fshow +272.12436 -280.72429 moveto +(tBlue) cmr9 8.96637 fshow + 0.96 1 0.98 setrgbcolor +newpath 326.55872 -283.01822 moveto +344.70087 -283.01822 lineto +344.70087 -273.94714 lineto +326.55872 -273.94714 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -283.01822 moveto +344.70087 -283.01822 lineto +344.70087 -273.94714 lineto +326.55872 -273.94714 lineto + closepath stroke +347.70087 -281.54619 moveto +(Min) cmr9 8.96637 fshow +363.57037 -281.54619 moveto +(tCream) cmr9 8.96637 fshow + 1 0.894 0.884 setrgbcolor +newpath 0 -294.81064 moveto +18.14215 -294.81064 lineto +18.14215 -285.73956 lineto +0 -285.73956 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -294.81064 moveto +18.14215 -294.81064 lineto +18.14215 -285.73956 lineto +0 -285.73956 lineto + closepath stroke +21.14215 -292.46686 moveto +(Mist) cmr9 8.96637 fshow +39.11075 -292.46686 moveto +(yRose) cmr9 8.96637 fshow + 1 0.894 0.71 setrgbcolor +newpath 108.8529 -294.81064 moveto +126.99506 -294.81064 lineto +126.99506 -285.73956 lineto +108.8529 -285.73956 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -294.81064 moveto +126.99506 -294.81064 lineto +126.99506 -285.73956 lineto +108.8529 -285.73956 lineto + closepath stroke +129.99506 -293.33861 moveto +(Mo) cmr9 8.96637 fshow +143.30475 -293.33861 moveto +(ccasin) cmr9 8.96637 fshow + 1 0.87 0.68 setrgbcolor +newpath 217.70581 -294.81064 moveto +235.84796 -294.81064 lineto +235.84796 -285.73956 lineto +217.70581 -285.73956 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -294.81064 moveto +235.84796 -294.81064 lineto +235.84796 -285.73956 lineto +217.70581 -285.73956 lineto + closepath stroke +238.84796 -292.51671 moveto +(Na) cmr9 8.96637 fshow +250.10976 -292.51671 moveto +(v) cmr9 8.96637 fshow +254.46156 -292.51671 moveto +(a) cmr9 8.96637 fshow +259.58116 -292.51671 moveto +(joWhite) cmr9 8.96637 fshow + 0 0 0.5 setrgbcolor +newpath 326.55872 -294.81064 moveto +344.70087 -294.81064 lineto +344.70087 -285.73956 lineto +326.55872 -285.73956 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -294.81064 moveto +344.70087 -294.81064 lineto +344.70087 -285.73956 lineto +326.55872 -285.73956 lineto + closepath stroke +347.70087 -292.46686 moveto +(Na) cmr9 8.96637 fshow +358.96266 -292.46686 moveto +(vy) cmr9 8.96637 fshow + 0 0 0.5 setrgbcolor +newpath 0 -306.60307 moveto +18.14215 -306.60307 lineto +18.14215 -297.532 lineto +0 -297.532 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -306.60307 moveto +18.14215 -306.60307 lineto +18.14215 -297.532 lineto +0 -297.532 lineto + closepath stroke +21.14215 -304.30914 moveto +(Na) cmr9 8.96637 fshow +32.40395 -304.30914 moveto +(vyBlue) cmr9 8.96637 fshow + 0.992 0.96 0.9 setrgbcolor +newpath 108.8529 -306.60307 moveto +126.99506 -306.60307 lineto +126.99506 -297.532 lineto +108.8529 -297.532 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -306.60307 moveto +126.99506 -306.60307 lineto +126.99506 -297.532 lineto +108.8529 -297.532 lineto + closepath stroke +129.99506 -305.1809 moveto +(OldLace) cmr9 8.96637 fshow + 0.5 0.5 0 setrgbcolor +newpath 217.70581 -306.60307 moveto +235.84796 -306.60307 lineto +235.84796 -297.532 lineto +217.70581 -297.532 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -306.60307 moveto +235.84796 -306.60307 lineto +235.84796 -297.532 lineto +217.70581 -297.532 lineto + closepath stroke +238.84796 -305.1809 moveto +(Oliv) cmr9 8.96637 fshow +255.74286 -305.1809 moveto +(e) cmr9 8.96637 fshow + 0.42 0.556 0.136 setrgbcolor +newpath 326.55872 -306.60307 moveto +344.70087 -306.60307 lineto +344.70087 -297.532 lineto +326.55872 -297.532 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -306.60307 moveto +344.70087 -306.60307 lineto +344.70087 -297.532 lineto +326.55872 -297.532 lineto + closepath stroke +347.70087 -305.1809 moveto +(Oliv) cmr9 8.96637 fshow +364.59576 -305.1809 moveto +(eDrab) cmr9 8.96637 fshow + 1 0.648 0 setrgbcolor +newpath 0 -318.3955 moveto +18.14215 -318.3955 lineto +18.14215 -309.32442 lineto +0 -309.32442 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -318.3955 moveto +18.14215 -318.3955 lineto +18.14215 -309.32442 lineto +0 -309.32442 lineto + closepath stroke +21.14215 -316.05171 moveto +(Orange) cmr9 8.96637 fshow + 1 0.27 0 setrgbcolor +newpath 108.8529 -318.3955 moveto +126.99506 -318.3955 lineto +126.99506 -309.32442 lineto +108.8529 -309.32442 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -318.3955 moveto +126.99506 -318.3955 lineto +126.99506 -309.32442 lineto +108.8529 -309.32442 lineto + closepath stroke +129.99506 -316.10156 moveto +(OrangeRed) cmr9 8.96637 fshow + 0.855 0.44 0.84 setrgbcolor +newpath 217.70581 -318.3955 moveto +235.84796 -318.3955 lineto +235.84796 -309.32442 lineto +217.70581 -309.32442 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -318.3955 moveto +235.84796 -318.3955 lineto +235.84796 -309.32442 lineto +217.70581 -309.32442 lineto + closepath stroke +238.84796 -316.97331 moveto +(Orc) cmr9 8.96637 fshow +253.45976 -316.97331 moveto +(hid) cmr9 8.96637 fshow + 0.932 0.91 0.668 setrgbcolor +newpath 326.55872 -318.3955 moveto +344.70087 -318.3955 lineto +344.70087 -309.32442 lineto +326.55872 -309.32442 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -318.3955 moveto +344.70087 -318.3955 lineto +344.70087 -309.32442 lineto +326.55872 -309.32442 lineto + closepath stroke +347.70087 -316.97331 moveto +(P) cmr9 8.96637 fshow +353.71576 -316.97331 moveto +(aleGoldenro) cmr9 8.96637 fshow +402.18776 -316.97331 moveto +(d) cmr9 8.96637 fshow + 0.596 0.985 0.596 setrgbcolor +newpath 0 -330.18793 moveto +18.14215 -330.18793 lineto +18.14215 -321.11685 lineto +0 -321.11685 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -330.18793 moveto +18.14215 -330.18793 lineto +18.14215 -321.11685 lineto +0 -321.11685 lineto + closepath stroke +21.14215 -328.76575 moveto +(P) cmr9 8.96637 fshow +27.15704 -328.76575 moveto +(aleGreen) cmr9 8.96637 fshow + 0.688 0.932 0.932 setrgbcolor +newpath 108.8529 -330.18793 moveto +126.99506 -330.18793 lineto +126.99506 -321.11685 lineto +108.8529 -321.11685 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -330.18793 moveto +126.99506 -330.18793 lineto +126.99506 -321.11685 lineto +108.8529 -321.11685 lineto + closepath stroke +129.99506 -327.894 moveto +(P) cmr9 8.96637 fshow +136.00995 -327.894 moveto +(aleT) cmr9 8.96637 fshow +153.16426 -327.894 moveto +(urquoise) cmr9 8.96637 fshow + 0.86 0.44 0.576 setrgbcolor +newpath 217.70581 -330.18793 moveto +235.84796 -330.18793 lineto +235.84796 -321.11685 lineto +217.70581 -321.11685 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -330.18793 moveto +235.84796 -330.18793 lineto +235.84796 -321.11685 lineto +217.70581 -321.11685 lineto + closepath stroke +238.84796 -328.76575 moveto +(P) cmr9 8.96637 fshow +244.86285 -328.76575 moveto +(aleVioletRed) cmr9 8.96637 fshow + 1 0.936 0.835 setrgbcolor +newpath 326.55872 -330.18793 moveto +344.70087 -330.18793 lineto +344.70087 -321.11685 lineto +326.55872 -321.11685 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -330.18793 moveto +344.70087 -330.18793 lineto +344.70087 -321.11685 lineto +326.55872 -321.11685 lineto + closepath stroke +347.70087 -327.894 moveto +(P) cmr9 8.96637 fshow +353.71576 -327.894 moveto +(apa) cmr9 8.96637 fshow +367.79477 -327.894 moveto +(y) cmr9 8.96637 fshow +372.40247 -327.894 moveto +(aWhip) cmr9 8.96637 fshow + 1 0.855 0.725 setrgbcolor +newpath 0 -341.98035 moveto +18.14215 -341.98035 lineto +18.14215 -332.90927 lineto +0 -332.90927 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -341.98035 moveto +18.14215 -341.98035 lineto +18.14215 -332.90927 lineto +0 -332.90927 lineto + closepath stroke +21.14215 -340.55817 moveto +(P) cmr9 8.96637 fshow +27.15704 -340.55817 moveto +(eac) cmr9 8.96637 fshow +39.70364 -340.55817 moveto +(hPu\013) cmr9 8.96637 fshow + 0.804 0.52 0.248 setrgbcolor +newpath 108.8529 -341.98035 moveto +126.99506 -341.98035 lineto +126.99506 -332.90927 lineto +108.8529 -332.90927 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -341.98035 moveto +126.99506 -341.98035 lineto +126.99506 -332.90927 lineto +108.8529 -332.90927 lineto + closepath stroke +129.99506 -340.50832 moveto +(P) cmr9 8.96637 fshow +136.00995 -340.50832 moveto +(eru) cmr9 8.96637 fshow + 1 0.752 0.796 setrgbcolor +newpath 217.70581 -341.98035 moveto +235.84796 -341.98035 lineto +235.84796 -332.90927 lineto +217.70581 -332.90927 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -341.98035 moveto +235.84796 -341.98035 lineto +235.84796 -332.90927 lineto +217.70581 -332.90927 lineto + closepath stroke +238.84796 -340.55817 moveto +(Pink) cmr9 8.96637 fshow + 0.868 0.628 0.868 setrgbcolor +newpath 326.55872 -341.98035 moveto +344.70087 -341.98035 lineto +344.70087 -332.90927 lineto +326.55872 -332.90927 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -341.98035 moveto +344.70087 -341.98035 lineto +344.70087 -332.90927 lineto +326.55872 -332.90927 lineto + closepath stroke +347.70087 -340.55817 moveto +(Plum) cmr9 8.96637 fshow + 0.69 0.88 0.9 setrgbcolor +newpath 0 -353.77277 moveto +18.14215 -353.77277 lineto +18.14215 -344.70169 lineto +0 -344.70169 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -353.77277 moveto +18.14215 -353.77277 lineto +18.14215 -344.70169 lineto +0 -344.70169 lineto + closepath stroke +21.14215 -352.35059 moveto +(P) cmr9 8.96637 fshow +27.15704 -352.35059 moveto +(o) cmr9 8.96637 fshow +31.50874 -352.35059 moveto +(wderBlue) cmr9 8.96637 fshow + 0.5 0 0.5 setrgbcolor +newpath 108.8529 -353.77277 moveto +126.99506 -353.77277 lineto +126.99506 -344.70169 lineto +108.8529 -344.70169 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -353.77277 moveto +126.99506 -353.77277 lineto +126.99506 -344.70169 lineto +108.8529 -344.70169 lineto + closepath stroke +129.99506 -351.47884 moveto +(Purple) cmr9 8.96637 fshow + 1 0 0 setrgbcolor +newpath 217.70581 -353.77277 moveto +235.84796 -353.77277 lineto +235.84796 -344.70169 lineto +217.70581 -344.70169 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -353.77277 moveto +235.84796 -353.77277 lineto +235.84796 -344.70169 lineto +217.70581 -344.70169 lineto + closepath stroke +238.84796 -352.35059 moveto +(Red) cmr9 8.96637 fshow + 0.736 0.56 0.56 setrgbcolor +newpath 326.55872 -353.77277 moveto +344.70087 -353.77277 lineto +344.70087 -344.70169 lineto +326.55872 -344.70169 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -353.77277 moveto +344.70087 -353.77277 lineto +344.70087 -344.70169 lineto +326.55872 -344.70169 lineto + closepath stroke +347.70087 -351.42899 moveto +(RosyBro) cmr9 8.96637 fshow +382.07306 -351.42899 moveto +(wn) cmr9 8.96637 fshow + 0.255 0.41 0.884 setrgbcolor +newpath 0 -365.5652 moveto +18.14215 -365.5652 lineto +18.14215 -356.49413 lineto +0 -356.49413 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -365.5652 moveto +18.14215 -365.5652 lineto +18.14215 -356.49413 lineto +0 -356.49413 lineto + closepath stroke +21.14215 -363.27127 moveto +(Ro) cmr9 8.96637 fshow +32.27666 -363.27127 moveto +(y) cmr9 8.96637 fshow +36.88435 -363.27127 moveto +(alBlue) cmr9 8.96637 fshow + 0.545 0.27 0.075 setrgbcolor +newpath 108.8529 -365.5652 moveto +126.99506 -365.5652 lineto +126.99506 -356.49413 lineto +108.8529 -356.49413 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -365.5652 moveto +126.99506 -365.5652 lineto +126.99506 -356.49413 lineto +108.8529 -356.49413 lineto + closepath stroke +129.99506 -364.14302 moveto +(SaddleBro) cmr9 8.96637 fshow +171.10376 -364.14302 moveto +(wn) cmr9 8.96637 fshow + 0.98 0.5 0.448 setrgbcolor +newpath 217.70581 -365.5652 moveto +235.84796 -365.5652 lineto +235.84796 -356.49413 lineto +217.70581 -356.49413 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -365.5652 moveto +235.84796 -365.5652 lineto +235.84796 -356.49413 lineto +217.70581 -356.49413 lineto + closepath stroke +238.84796 -364.14302 moveto +(Salmon) cmr9 8.96637 fshow + 0.956 0.644 0.376 setrgbcolor +newpath 326.55872 -365.5652 moveto +344.70087 -365.5652 lineto +344.70087 -356.49413 lineto +326.55872 -356.49413 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -365.5652 moveto +344.70087 -365.5652 lineto +344.70087 -356.49413 lineto +326.55872 -356.49413 lineto + closepath stroke +347.70087 -363.27127 moveto +(SandyBro) cmr9 8.96637 fshow +387.01427 -363.27127 moveto +(wn) cmr9 8.96637 fshow + 0.18 0.545 0.34 setrgbcolor +newpath 0 -377.35762 moveto +18.14215 -377.35762 lineto +18.14215 -368.28654 lineto +0 -368.28654 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -377.35762 moveto +18.14215 -377.35762 lineto +18.14215 -368.28654 lineto +0 -368.28654 lineto + closepath stroke +21.14215 -375.88559 moveto +(SeaGreen) cmr9 8.96637 fshow + 1 0.96 0.932 setrgbcolor +newpath 108.8529 -377.35762 moveto +126.99506 -377.35762 lineto +126.99506 -368.28654 lineto +108.8529 -368.28654 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -377.35762 moveto +126.99506 -377.35762 lineto +126.99506 -368.28654 lineto +108.8529 -368.28654 lineto + closepath stroke +129.99506 -375.93544 moveto +(Seashell) cmr9 8.96637 fshow + 0.628 0.32 0.176 setrgbcolor +newpath 217.70581 -377.35762 moveto +235.84796 -377.35762 lineto +235.84796 -368.28654 lineto +217.70581 -368.28654 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -377.35762 moveto +235.84796 -377.35762 lineto +235.84796 -368.28654 lineto +217.70581 -368.28654 lineto + closepath stroke +238.84796 -375.88559 moveto +(Sienna) cmr9 8.96637 fshow + 0.752 0.752 0.752 setrgbcolor +newpath 326.55872 -377.35762 moveto +344.70087 -377.35762 lineto +344.70087 -368.28654 lineto +326.55872 -368.28654 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -377.35762 moveto +344.70087 -377.35762 lineto +344.70087 -368.28654 lineto +326.55872 -368.28654 lineto + closepath stroke +347.70087 -375.93544 moveto +(Silv) cmr9 8.96637 fshow +362.54787 -375.93544 moveto +(er) cmr9 8.96637 fshow + 0.53 0.808 0.92 setrgbcolor +newpath 0 -389.15005 moveto +18.14215 -389.15005 lineto +18.14215 -380.07898 lineto +0 -380.07898 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -389.15005 moveto +18.14215 -389.15005 lineto +18.14215 -380.07898 lineto +0 -380.07898 lineto + closepath stroke +21.14215 -386.85612 moveto +(SkyBlue) cmr9 8.96637 fshow + 0.415 0.352 0.804 setrgbcolor +newpath 108.8529 -389.15005 moveto +126.99506 -389.15005 lineto +126.99506 -380.07898 lineto +108.8529 -380.07898 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -389.15005 moveto +126.99506 -389.15005 lineto +126.99506 -380.07898 lineto +108.8529 -380.07898 lineto + closepath stroke +129.99506 -387.72787 moveto +(SlateBlue) cmr9 8.96637 fshow + 0.44 0.5 0.565 setrgbcolor +newpath 217.70581 -389.15005 moveto +235.84796 -389.15005 lineto +235.84796 -380.07898 lineto +217.70581 -380.07898 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -389.15005 moveto +235.84796 -389.15005 lineto +235.84796 -380.07898 lineto +217.70581 -380.07898 lineto + closepath stroke +238.84796 -386.85612 moveto +(SlateGra) cmr9 8.96637 fshow +274.00546 -386.85612 moveto +(y) cmr9 8.96637 fshow + 0.44 0.5 0.565 setrgbcolor +newpath 326.55872 -389.15005 moveto +344.70087 -389.15005 lineto +344.70087 -380.07898 lineto +326.55872 -380.07898 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -389.15005 moveto +344.70087 -389.15005 lineto +344.70087 -380.07898 lineto +326.55872 -380.07898 lineto + closepath stroke +347.70087 -386.85612 moveto +(SlateGrey) cmr9 8.96637 fshow + 1 0.98 0.98 setrgbcolor +newpath 0 -400.94247 moveto +18.14215 -400.94247 lineto +18.14215 -391.8714 lineto +0 -391.8714 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -400.94247 moveto +18.14215 -400.94247 lineto +18.14215 -391.8714 lineto +0 -391.8714 lineto + closepath stroke +21.14215 -399.47044 moveto +(Sno) cmr9 8.96637 fshow +35.73315 -399.47044 moveto +(w) cmr9 8.96637 fshow + 0 1 0.498 setrgbcolor +newpath 108.8529 -400.94247 moveto +126.99506 -400.94247 lineto +126.99506 -391.8714 lineto +108.8529 -391.8714 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -400.94247 moveto +126.99506 -400.94247 lineto +126.99506 -391.8714 lineto +108.8529 -391.8714 lineto + closepath stroke +129.99506 -398.5987 moveto +(SpringGreen) cmr9 8.96637 fshow + 0.275 0.51 0.705 setrgbcolor +newpath 217.70581 -400.94247 moveto +235.84796 -400.94247 lineto +235.84796 -391.8714 lineto +217.70581 -391.8714 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -400.94247 moveto +235.84796 -400.94247 lineto +235.84796 -391.8714 lineto +217.70581 -391.8714 lineto + closepath stroke +238.84796 -399.5203 moveto +(SteelBlue) cmr9 8.96637 fshow + 0.824 0.705 0.55 setrgbcolor +newpath 326.55872 -400.94247 moveto +344.70087 -400.94247 lineto +344.70087 -391.8714 lineto +326.55872 -391.8714 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -400.94247 moveto +344.70087 -400.94247 lineto +344.70087 -391.8714 lineto +326.55872 -391.8714 lineto + closepath stroke +347.70087 -399.47044 moveto +(T) cmr9 8.96637 fshow +353.58847 -399.47044 moveto +(an) cmr9 8.96637 fshow + 0 0.5 0.5 setrgbcolor +newpath 0 -412.7349 moveto +18.14215 -412.7349 lineto +18.14215 -403.66382 lineto +0 -403.66382 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -412.7349 moveto +18.14215 -412.7349 lineto +18.14215 -403.66382 lineto +0 -403.66382 lineto + closepath stroke +21.14215 -411.31271 moveto +(T) cmr9 8.96637 fshow +27.02975 -411.31271 moveto +(eal) cmr9 8.96637 fshow + 0.848 0.75 0.848 setrgbcolor +newpath 108.8529 -412.7349 moveto +126.99506 -412.7349 lineto +126.99506 -403.66382 lineto +108.8529 -403.66382 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -412.7349 moveto +126.99506 -412.7349 lineto +126.99506 -403.66382 lineto +108.8529 -403.66382 lineto + closepath stroke +129.99506 -411.31271 moveto +(Thistle) cmr9 8.96637 fshow + 1 0.39 0.28 setrgbcolor +newpath 217.70581 -412.7349 moveto +235.84796 -412.7349 lineto +235.84796 -403.66382 lineto +217.70581 -403.66382 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -412.7349 moveto +235.84796 -412.7349 lineto +235.84796 -403.66382 lineto +217.70581 -403.66382 lineto + closepath stroke +238.84796 -411.26286 moveto +(T) cmr9 8.96637 fshow +244.73557 -411.26286 moveto +(omato) cmr9 8.96637 fshow + 0.25 0.88 0.815 setrgbcolor +newpath 326.55872 -412.7349 moveto +344.70087 -412.7349 lineto +344.70087 -403.66382 lineto +326.55872 -403.66382 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -412.7349 moveto +344.70087 -412.7349 lineto +344.70087 -403.66382 lineto +326.55872 -403.66382 lineto + closepath stroke +347.70087 -410.39111 moveto +(T) cmr9 8.96637 fshow +353.58847 -410.39111 moveto +(urquoise) cmr9 8.96637 fshow + 0.932 0.51 0.932 setrgbcolor +newpath 0 -424.52733 moveto +18.14215 -424.52733 lineto +18.14215 -415.45625 lineto +0 -415.45625 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -424.52733 moveto +18.14215 -424.52733 lineto +18.14215 -415.45625 lineto +0 -415.45625 lineto + closepath stroke +21.14215 -423.10515 moveto +(Violet) cmr9 8.96637 fshow + 0.816 0.125 0.565 setrgbcolor +newpath 108.8529 -424.52733 moveto +126.99506 -424.52733 lineto +126.99506 -415.45625 lineto +108.8529 -415.45625 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -424.52733 moveto +126.99506 -424.52733 lineto +126.99506 -415.45625 lineto +108.8529 -415.45625 lineto + closepath stroke +129.99506 -423.10515 moveto +(VioletRed) cmr9 8.96637 fshow + 0.96 0.87 0.7 setrgbcolor +newpath 217.70581 -424.52733 moveto +235.84796 -424.52733 lineto +235.84796 -415.45625 lineto +217.70581 -415.45625 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -424.52733 moveto +235.84796 -424.52733 lineto +235.84796 -415.45625 lineto +217.70581 -415.45625 lineto + closepath stroke +238.84796 -423.10515 moveto +(Wheat) cmr9 8.96637 fshow + 1 1 1 setrgbcolor +newpath 326.55872 -424.52733 moveto +344.70087 -424.52733 lineto +344.70087 -415.45625 lineto +326.55872 -415.45625 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 326.55872 -424.52733 moveto +344.70087 -424.52733 lineto +344.70087 -415.45625 lineto +326.55872 -415.45625 lineto + closepath stroke +347.70087 -423.10515 moveto +(White) cmr9 8.96637 fshow + 0.96 0.96 0.96 setrgbcolor +newpath 0 -436.31975 moveto +18.14215 -436.31975 lineto +18.14215 -427.24867 lineto +0 -427.24867 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 0 -436.31975 moveto +18.14215 -436.31975 lineto +18.14215 -427.24867 lineto +0 -427.24867 lineto + closepath stroke +21.14215 -434.89757 moveto +(WhiteSmok) cmr9 8.96637 fshow +67.98904 -434.89757 moveto +(e) cmr9 8.96637 fshow + 1 1 0 setrgbcolor +newpath 108.8529 -436.31975 moveto +126.99506 -436.31975 lineto +126.99506 -427.24867 lineto +108.8529 -427.24867 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 108.8529 -436.31975 moveto +126.99506 -436.31975 lineto +126.99506 -427.24867 lineto +108.8529 -427.24867 lineto + closepath stroke +129.99506 -434.89757 moveto +(Y) cmr9 8.96637 fshow +136.13725 -434.89757 moveto +(ello) cmr9 8.96637 fshow +149.70776 -434.89757 moveto +(w) cmr9 8.96637 fshow + 0.604 0.804 0.196 setrgbcolor +newpath 217.70581 -436.31975 moveto +235.84796 -436.31975 lineto +235.84796 -427.24867 lineto +217.70581 -427.24867 lineto + closepath fill + 0 0 0 setrgbcolor +newpath 217.70581 -436.31975 moveto +235.84796 -436.31975 lineto +235.84796 -427.24867 lineto +217.70581 -427.24867 lineto + closepath stroke +238.84796 -434.89757 moveto +(Y) cmr9 8.96637 fshow +244.99016 -434.89757 moveto +(ello) cmr9 8.96637 fshow +258.56067 -434.89757 moveto +(wGreen) cmr9 8.96637 fshow +showpage +%%EOF diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/svgnames/palette.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/svgnames/palette.mp new file mode 100644 index 0000000000..f3f4ee137b --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/svgnames/palette.mp @@ -0,0 +1,168 @@ +input geom2d; + +gddU:=0.32cm; +beginfig(1); +i:=0; +N:=4; +for t= +"AliceBlue", +"AntiqueWhite", +"Aqua", +"Aquamarine", +"Azure", +"Beige", +"Bisque", +"Black", +"BlanchedAlmond", +"Blue", +"BlueViolet", +"Brown", +"BurlyWood", +"CadetBlue", +"Chartreuse", +"Chocolate", +"Coral", +"CornflowerBlue", +"Cornsilk", +"Crimson", +"Cyan", +"DarkBlue", +"DarkCyan", +"DarkGoldenrod", +"DarkGray", +"DarkGreen", +"DarkGrey", +"DarkKhaki", +"DarkMagenta", +"DarkOliveGreen", +"DarkOrange", +"DarkOrchid", +"DarkRed", +"DarkSalmon", +"DarkSeaGreen", +"DarkSlateBlue", +"DarkSlateGray", +"DarkSlateGrey", +"DarkTurquoise", +"DarkViolet", +"DeepPink", +"DeepSkyBlue", +"DimGray", +"DimGrey", +"DodgerBlue", +"FireBrick", +"FloralWhite", +"ForestGreen", +"Fuchsia", +"Gainsboro", +"GhostWhite", +"Gold", +"Goldenrod", +"Gray", +"Green", +"GreenYellow", +"Grey", +"Honeydew", +"HotPink", +"IndianRed", +"Indigo", +"Ivory", +"Khaki", +"Lavender", +"LavenderBlush", +"LawnGreen", +"LemonChiffon", +"LightBlue", +"LightCoral", +"LightCyan", +"LightGoldenrod", +"LightGoldenrodYellow", +"LightGray", +"LightGreen", +"LightGrey", +"LightPink", +"LightSalmon", +"LightSeaGreen", +"LightSkyBlue", +"LightSlateBlue", +"LightSlateGray", +"LightSlateGrey", +"LightSteelBlue", +"LightYellow", +"Lime", +"LimeGreen", +"Linen", +"Magenta", +"Maroon", +"MediumAquamarine", +"MediumBlue", +"MediumOrchid", +"MediumPurple", +"MediumSeaGreen", +"MediumSlateBlue", +"MediumSpringGreen", +"MediumTurquoise", +"MediumVioletRed", +"MidnightBlue", +"MintCream", +"MistyRose", +"Moccasin", +"NavajoWhite", +"Navy", +"NavyBlue", +"OldLace", +"Olive", +"OliveDrab", +"Orange", +"OrangeRed", +"Orchid", +"PaleGoldenrod", +"PaleGreen", +"PaleTurquoise", +"PaleVioletRed", +"PapayaWhip", +"PeachPuff", +"Peru", +"Pink", +"Plum", +"PowderBlue", +"Purple", +"Red", +"RosyBrown", +"RoyalBlue", +"SaddleBrown", +"Salmon", +"SandyBrown", +"SeaGreen", +"Seashell", +"Sienna", +"Silver", +"SkyBlue", +"SlateBlue", +"SlateGray", +"SlateGrey", +"Snow", +"SpringGreen", +"SteelBlue", +"Tan", +"Teal", +"Thistle", +"Tomato", +"Turquoise", +"Violet", +"VioletRed", +"Wheat", +"White", +"WhiteSmoke", +"Yellow", +"YellowGreen": +fill ((0,0)--(2,0)--(2,1)--(0,1)--cycle) scaled gddU shifted (((i mod N) +)*(gddU+11*gddU),-(i div N)*1.3*gddU) withcolor scantokens t; +draw ((0,0)--(2,0)--(2,1)--(0,1)--cycle) scaled gddU shifted ((i mod +N )*(gddU+11*gddU),-(i div N)*1.3*gddU); +label.rt(textext("\small "&t),(((i mod N) +)*(gddU+11*gddU)+2*gddU,-(i div N)*1.3*gddU+0.5*gddU)); +i:=i+1; +endfor; +endfig; +end. diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/homothetie-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/homothetie-1.pdf Binary files differnew file mode 100644 index 0000000000..5f3a9ac552 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/homothetie-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/homothetie.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/homothetie.mp new file mode 100644 index 0000000000..f398d17da2 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/homothetie.mp @@ -0,0 +1,36 @@ +input geom2d; + +beginfig(1); + O = Point(0,0); + P = Point(2,1); + A = Point(3,2); + Q = Point(-1,2); + R = Point(0,4); + B = Homothetie(A,P,3); + fleche Segment(O,P); + fleche Segment(P,A); + fleche Segment(A,B); + + T = Triangle(A,Q,R); + T'= Homothetie(T,P,3); + trace T; + trace T'; + + C = Cercle(A,1.5); + trace C; + CC = Homothetie(C,P,3); + trace CC; + + path p; + p:=Pt(A)..Pt(Q)..Pt(R); + W = Chemin(p); + trace W; + X = Homothetie(W,P,3); + trace X; + + Q1 = PolygoneRegulier(10,2,0,(2,2)); + trace Q1; + Q2 = Homothetie(Q1,P,3); + trace Q2; +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/inversion-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/inversion-1.pdf Binary files differnew file mode 100644 index 0000000000..cce481b377 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/inversion-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/inversion.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/inversion.mp new file mode 100644 index 0000000000..fcd762b574 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/inversion.mp @@ -0,0 +1,40 @@ +input geom2d; + +beginfig(1); +A = Point(2,2); +C = Cercle(A,2); +trace C; +marque.rt "A"; +B = Point(0,1); +D = Inversion(B,C); +drawoptions(withcolor DarkRed); +CB = Cercle(B,1); +trace CB; +CD = Inversion(CB,C); +trace CB; +trace CD; + marque.rt "B"; marque.rt "D"; + +drawoptions(withcolor DarkBlue); +E = Point(3,1); +CE = Cercle(E,0.5); +trace CE; +marque.rt "E"; +iCE = Inversion(CE,C); +trace iCE; + + +drawoptions(withcolor DarkGreen); +d = Droite((3,3),(4,2)); +trace d; +Cd = Inversion(d,C); +trace Cd; + +drawoptions(withcolor Salmon); +S = Point(1,3); +CS = CercleCP(S,A); +trace CS; +dS = Inversion(CS,C); +trace dS; +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrie-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrie-1.pdf Binary files differnew file mode 100644 index 0000000000..1c4288a545 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrie-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrie.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrie.mp new file mode 100644 index 0000000000..d152d9018a --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrie.mp @@ -0,0 +1,26 @@ +input geom2d; + +beginfig(1); + +A = Point(2,2); +a = Point(-1,-1); +b = Point(2,0); +c = Point(3,-2); +aa = Point(-1,-1.5); +DD = Droite(aa,c); +D = Droite(a,b); +B = SymetrieAxialePoint(A,D); +pointe A; +pointe B; +trace D; +C = Cercle(A,2); +P = ParaboleFD(A,DD); +trace C; +CC = SymetrieAxiale(C,D); +PP = SymetrieAxiale(P,D); +trace CC; +trace P; +trace PP; + +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrieCentrale-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrieCentrale-1.pdf Binary files differnew file mode 100644 index 0000000000..c32b7f91f2 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrieCentrale-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrieCentrale.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrieCentrale.mp new file mode 100644 index 0000000000..077b216de6 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/transformations/symetrieCentrale.mp @@ -0,0 +1,27 @@ +input geom2d; + +beginfig(1); + +A = Point(2,2); +a = Point(-1,-1); +b = Point(2,0); +c = Point(3,-2); +aa = Point(-1,-1.5); +DD = Droite(aa,c); +D = Droite(a,b); +B = SymetrieCentralePoint(A,a); +pointe a avecCrayon(1,red); +pointe A; +pointe B; +%trace D; +C = Cercle(A,2); +P = ParaboleFD(A,DD); +trace C; +CC = SymetrieCentrale(C,a); +PP = SymetrieCentrale(P,a); +trace CC; +trace P; +trace PP; + +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/apollonius-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/apollonius-1.pdf Binary files differnew file mode 100644 index 0000000000..0af9a23393 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/apollonius-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/apollonius.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/apollonius.mp new file mode 100644 index 0000000000..8658139b1b --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/apollonius.mp @@ -0,0 +1,90 @@ +input geom2d; +gddU:=0.35cm; +beginfig(1); +% nos trois points +A = Point(0,0); +B = Point(6,0); +C = Point(0.8,4); +T_ABC = Triangle(A,B,C); + +C_I = CercleInscrit(T_ABC); +C_A = CercleExinscrit(T_ABC,2); +C_B = CercleExinscrit(T_ABC,3); +C_C = CercleExinscrit(T_ABC,1); + +d_AB = Droite(A,B); +d_BC = Droite(B,C); +d_CA = Droite(C,A); + +I = Centre(C_I); +I_C_A = Centre(C_A); +I_C_B = Centre(C_B); +I_C_C = Centre(C_C); +d_CAA = Droite(A,I_C_A); +d_CAB = Droite(B,I_C_B); +d_CAC = Droite(C,I_C_C); + +A_S = AxeDeSimilitude(C_A,C_B,C_C); +P_CA = ProjectionPointSurDroite(I_C_A,A_S); +P_CB = ProjectionPointSurDroite(I_C_B,A_S); +P_CC = ProjectionPointSurDroite(I_C_C,A_S); + +P_A = Inversion(P_CA,C_A); +P_B = Inversion(P_CB,C_B); +P_C = Inversion(P_CC,C_C); + +C_R = CentreRadical(C_A,C_B,C_C); +% les neuf points pour les cercles d’euler (tangent intérieur) +% et d’apollonius (tangent extérieur) +D1 = Droite(C_R,P_A); +P1 = IntersectionDroiteCercle(D1,C_A,1); +Q1 = IntersectionDroiteCercle(D1,C_A,2); + +D2 = Droite(C_R,P_B); +P2 = IntersectionDroiteCercle(D2,C_B,1); +Q2 = IntersectionDroiteCercle(D2,C_B,2); + +D3 = Droite(C_R,P_C); +P3 = IntersectionDroiteCercle(D3,C_C,2); +Q3 = IntersectionDroiteCercle(D3,C_C,1); + +% le cercle d’apollonius +Apol = CercleTroisPoints(P1,P2,P3); +colorie Apol withcolor 1.05*Lavender; +trace Apol withcolor CadetBlue; + +% cercle inscrit +colorie C_I withcolor LightBlue; +% cercles exinscrits +colorie C_A withcolor PapayaWhip; +colorie C_B withcolor PapayaWhip; +colorie C_C withcolor PapayaWhip; + +trace d_AB; +trace d_BC; +trace d_CA; + +trace d_CAA dashed evenly; +trace d_CAB dashed evenly; +trace d_CAC dashed evenly; + +trace T_ABC withpen pencircle scaled 2 withcolor Chocolate; + +C_E = CercleEuler(T_ABC); +trace C_E withcolor Goldenrod; + +pointe P1; +pointe P2; +pointe P3; + +pointe Q1; +pointe Q2; +pointe Q3; + + +marque.llft "A"; +marque.urt "B"; +marque.urt "C"; +Fenetre(-7,-12,20,15) +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/pedale-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/pedale-1.pdf Binary files differnew file mode 100644 index 0000000000..d3adab46ec --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/pedale-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/pedale.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/pedale.mp new file mode 100644 index 0000000000..b581ddfbda --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/pedale.mp @@ -0,0 +1,106 @@ +input geom2d; +gddU:=1.5cm; +beginfig(1); +numeric A[],B[],C[],E[],F[],G[],U[],W[],V[],T[],R[],P[]; +A[1] = Point(0,0); +B1 = Point(1,2); +C1 = Point(2.5,0.2); +W1 = PointDe(Segment(A1,B1),0.2); +U1 = PointDe(Segment(B1,C1),0.23); +V1 = PointDe(Segment(C1,A1),0.3); +G1 = ProjectionPointSurDroite(B1,Droite(A1,C1)); +F1 = ProjectionPointSurDroite(C1,Droite(A1,B1)); +E1 = ProjectionPointSurDroite(A1,Droite(B1,C1)); + + + +for i:=0 step 3 until 3: + +D[1+i] = Droite(B[1+i],C[1+i]); +A[2+i] = SymetrieAxiale(A[1+i],D[1+i]); + +B[2+i] = B[1+i]; +C[2+i] = C[1+i]; + +W[2+i] = SymetrieAxiale(W[1+i],D[1+i]); +V[2+i] = SymetrieAxiale(V[1+i],D[1+i]); +U[2+i] = U[1+i]; + +G[2+i] = SymetrieAxiale(G[1+i],D[1+i]); +F[2+i] = SymetrieAxiale(F[1+i],D[1+i]); +E[2+i] = E[1+i]; + +D[2+i] = Droite(A[2+i],C[2+i]); +B[3+i] = SymetrieAxiale(B[2+i],D[2+i]); +A[3+i] = A[2+i]; +C[3+i] = C[2+i]; +W[3+i] = SymetrieAxiale(W[2+i],D[2+i]); +U[3+i] = SymetrieAxiale(U[2+i],D[2+i]); +V[3+i] = V[2+i]; +E[3+i] = SymetrieAxiale(E[2+i],D[2+i]); +F[3+i] = SymetrieAxiale(F[2+i],D[2+i]); +G[3+i] = G[2+i]; + +D[3+i] = Droite(A[3+i],B[3+i]); +C[4+i] = SymetrieAxiale(C[3+i],D[3+i]); +A[4+i] = A[3+i]; +B[4+i] = B[3+i]; +U[4+i] = SymetrieAxiale(U[3+i],D[3+i]); +V[4+i] = SymetrieAxiale(V[3+i],D[3+i]); +W[4+i] = W[3+i]; +E[4+i] = SymetrieAxiale(E[3+i],D[3+i]); +G[4+i] = SymetrieAxiale(G[3+i],D[3+i]); +F[4+i] = F[3+i]; +endfor; + +for i:=1 upto 7: + T[i] = Triangle(A[i],B[i],C[i]); + Q[i] = Triangle(U[i],V[i],W[i]); + P[i] = Triangle(E[i],F[i],G[i]); + colorie Q[i] avecCrayon(0.5,LightGray); + trace P[i] avecCrayon(0.8,MediumSlateBlue); +endfor; +for i:=1 upto 7: + trace T[i] avecCrayon(1,black); +endfor; + +trace LigneBrisee(U1,V2,W3,U4,V5,W6,U7) avecCrayon(1,Peru) ; +trace Segment(U1,U7) dashed evenly; +trace Segment(E1,E7) dashed evenly; +pointe A1; pointe B1; pointe C1; +pointe A2; pointe B3; pointe C4; +pointe A5; pointe B6; pointe C7; +gddLabel.lft(textext("$A$"),A1); +gddLabel.lft(textext("$B$"),B1); +gddLabel.bot(textext("$C$"),C1); +gddLabel.top(textext("$A'$"),A2); +gddLabel.bot(textext("$B'$"),B3); +gddLabel.top(textext("$C'$"),C4); +gddLabel.bot(textext("$A''$"),A5); +gddLabel.top(textext("$B''$"),B7); +gddLabel.bot(textext("$C''$"),C7); + +pointe U1; pointe V1; pointe W1; +label.lft(textext("$U$"),PtR(U1)) withcolor Gray; +label.bot(textext("$V$"),PtR(V1)) withcolor Gray; +label.lft(textext("$W$"),PtR(W1)) withcolor Gray; + +label.lft(textext("$U'$"),PtR(U4)) withcolor Gray; +label.lrt(textext("$V'$"),PtR(V2)) withcolor Gray; +label.urt(textext("$W'$"),PtR(W3)) withcolor Gray; +label.urt(textext("$U''$"),PtR(U7)) withcolor Gray; +label.urt(textext("$V''$"),PtR(V5)) withcolor Gray; +label.lrt(textext("$W''$"),PtR(W7)) withcolor Gray; +pointe U4; pointe V2; pointe W3; +pointe U7; pointe V5; pointe W7; +pointe E1; pointe F1; pointe G1; +label.lrt(textext("$E$"),PtR(E1)) withcolor MediumSlateBlue; +label.lft(textext("$F$"),PtR(F1)) withcolor MediumSlateBlue; +label.bot(textext("$G$"),PtR(G1)) withcolor MediumSlateBlue; + +label.ulft(textext("$F''$"),PtR(F7)) withcolor MediumSlateBlue; +pointe F7; +label.rt(textext("$E''$"),PtR(E7)) withcolor MediumSlateBlue; +pointe E7; +endfig; +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/triangles-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/triangles-1.pdf Binary files differnew file mode 100644 index 0000000000..e3afa92dd4 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/triangles-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/triangles.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/triangles.mp new file mode 100644 index 0000000000..882335af1f --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/triangles/triangles.mp @@ -0,0 +1,27 @@ +input geom2d; + +beginfig(1); + + A = Point(0,0); + B = Point(7,0.3); + C = Point(1,3); + TABC = Triangle(A,B,C); + D = Orthocentre(TABC); + C_C = CercleCirconscrit(TABC); + C_E = CercleEuler(TABC); + trace TABC; + trace C_C withcolor DarkBlue; + trace C_E withcolor DarkRed; + pointe A; + pointe B; + pointe C; + pointe D; + pointe Centre(C_C); + pointe Centre(C_E); + marque.lft "A"; + marque.rt "B"; + marque.lft "C"; + marque.rt "D"; +endfig; + +end.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/vecteur/vecteur-1.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/vecteur/vecteur-1.pdf Binary files differnew file mode 100644 index 0000000000..e8626844e4 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/vecteur/vecteur-1.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/vecteur/vecteur.mp b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/vecteur/vecteur.mp new file mode 100644 index 0000000000..082aea0dd3 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/exemples/vecteur/vecteur.mp @@ -0,0 +1,10 @@ +input geom2d; +beginfig(1); +AB = Vecteur(2,3); +pair a; +a := (3,2); +A = VecteurP(a); +trace AB; +trace A; +endfig; +end. diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/figure.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/figure.pdf Binary files differnew file mode 100644 index 0000000000..54db90cf07 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/figure.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/fond.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/fond.pdf Binary files differnew file mode 100644 index 0000000000..22218152cc --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/fond.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/locctan.bib b/graphics/metapost/contrib/macros/mp-geom2d/doc/locctan.bib new file mode 100644 index 0000000000..0b05da83d4 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/locctan.bib @@ -0,0 +1,78 @@ +@manual{ctan-metapost, + title = {The \texttt{metapost} package}, + subtitle = {A development of Metafont for creating graphics}, + author = {{The MetaPost Team} and John Hobby}, + date = {2021-08-26}, + license = {lgpl}, + url = {https://ctan.org/pkg/metapost}, + annotation = {MetaPost uses a language based on that of + to produce precise + technical illustrations. Its output is scalable PostScript or + SVG, rather than the bitmaps Metafont creates.}, +} + +@manual{ctan-luamplib, + title = {The \texttt{luamplib} package}, + subtitle = {Use LuaTeX’s built-in MetaPost interpreter}, + author = {Hans Hagen and Taco Hoekwater and Élie Roux and Manuel Pégourié-Gonnard and Philipp Gesang and Dohyun Kim}, + date = {2024-08-03}, + version = {2.34.5}, + license = {gpl2}, + mirror = {https://mirror.ctan.org/macros/luatex/generic/luamplib}, + url = {https://ctan.org/pkg/luamplib}, +} + +@manual{ctan-minim-mp, + title = {The \texttt{minim-mp} package}, + subtitle = {Low-level mplib integration for LuaTeX}, + author = {Esger Renkema}, + date = {2024-04-06}, + version = {2024/1.6}, + license = {eupl}, + mirror = {https://mirror.ctan.org/macros/luatex/generic/minim-mp}, + url = {https://ctan.org/pkg/minim-mp}, +} + +@manual{ctan-latexmp, + title = {The \texttt{latexMP} package}, + subtitle = {Interface for \LaTeX{}-based typesetting in MetaPost}, + author = {Jens-Uwe Morawski}, + date = {2020-06-21}, + version = {1.2.1}, + license = {pd}, + mirror = {https://mirror.ctan.org/graphics/metapost/contrib/macros/latexmp}, + url = {https://ctan.org/pkg/latexmp}, + annotation = {The MetaPost package latexMP implements a user-friendly + interface to access \LaTeX{}-based typesetting capabilities in + MetaPost. The text to be typeset is given as string. This + allows even dynamic text elements, for example counters, to be + used in labels. Compared to other implementations it is much + more flexible, since it can be used as direct replacement for + , and much faster, compared for example to the + solution provided by .}, +} + +@book{toeplitz, + Author = {Rademacher, Hans and Toeplitz, Otto}, + Title = {The enjoyment of math. {Translated} from the {German}. {With} a new foreword by {Alex} {Kontorovich}}, + Edition = {Reprint}, + FSeries = {Princeton Science Library}, + Series = {Princeton Sci. Libr.}, + ISBN = {978-0-691-24154-8; 978-0-691-24153-1}, + Year = {2023}, + Publisher = {Princeton, NJ: Princeton University Press}, + Language = {English}, + DOI = {10.1515/9780691241531}, + Keywords = {00A08,01A75}, +} + +@manual{ctan-drawing-with-metapost, + title = {The \texttt{Drawing-with-Metapost} package}, + subtitle = {How to draw technical diagrams with MetaPost}, + author = {Toby Thurston}, + date = {2023-04-16}, + version = {}, + license = {opl}, + mirror = {https://mirror.ctan.org/info/drawing-with-metapost}, + url = {https://ctan.org/pkg/drawing-with-metapost}, +}
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/mp-geom2d-doc.pdf b/graphics/metapost/contrib/macros/mp-geom2d/doc/mp-geom2d-doc.pdf Binary files differnew file mode 100644 index 0000000000..a233a118e9 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/mp-geom2d-doc.pdf diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/mp-geom2d-doc.tex b/graphics/metapost/contrib/macros/mp-geom2d/doc/mp-geom2d-doc.tex new file mode 100644 index 0000000000..857a38e8a6 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/mp-geom2d-doc.tex @@ -0,0 +1,3491 @@ + +%! TEX root +\documentclass[a4paper,french]{article} + +\usepackage[math-style=ISO]{xcharter-otf} +\usepackage[left=4cm]{geometry} +\usepackage{xspace} +\usepackage[svgnames]{xcolor} +\usepackage{multicol} +\usepackage{hologo} +\usepackage{listings} +\usepackage{showexpl} % examples +\usepackage{mflogo} +\usepackage{babel} +\usepackage{tikz} +\usepackage{url} +\usepackage{tikz} +\usepackage{luamplib} +\usepackage{siunitx} +\usepackage{pdflscape} +\usepackage{fancyvrb,xparse,xargs} +\usepackage{imakeidx} +\usepackage[colorlinks]{hyperref} +\setmonofont{FiraMono}[ +%BoldFont=FiraCode-Bold, +%Contextuals=Alternate, % Activate the calt feature +%Scale=MatchLowercase +] +\usepackage{biblatex} + +\makeindex[title=Index, columns=2] +%\usepackage[verbatim]{lstfiracode} % Activate ligatures in verbatim +\usepackage[most]{tcolorbox} +\tcbuselibrary{listings,breakable} +\addbibresource{locctan.bib} +\newcommand\package[1]{\href{https://ctan.org/pkg/#1}{#1}} + +\newtcolorbox{colourband}[1][]{% +arc=0pt,outer arc=0pt,enhanced, breakable, spread sidewards, left*=0pt, right*=0pt, boxrule=0pt, colback=LightSteelBlue!10, #1} + + +\definecolor{hellgelb}{rgb}{1,1,0.85} +\definecolor{colKeys}{rgb}{0,0,1} +\definecolor{colIdentifier}{rgb}{0,0,0} +\definecolor{colComments}{rgb}{0.3,0.7,0.3} +\definecolor{colString}{rgb}{0,0.5,0} +\definecolor{mpcode}{rgb}{0.5,0.1,0.1} + +\lstset{% + language=metapost,% + float=hbp,% + basicstyle=\ttfamily, % + identifierstyle=\color{DarkSlateGrey}, % + keywordstyle=\color{DarkBlue}, % + stringstyle=\color{Green}, % + commentstyle=\color{LightSlateGrey}\itshape, % + columns=flexible, % + tabsize=4, % + extendedchars=true, % + showspaces=false, % + showstringspaces=false, % + numbers=left, + numbersep=1em, + numberstyle=\tiny\color{gray}, % + breaklines=true, % + breakautoindent=true, + captionpos=b, + xleftmargin=0em, + sensitive=true, + morekeywords=[10]{colorie, trace,fermeture,fleche,pointe,marque,gddLabel,avecCrayon,ChampVecteurs,ChampVecteursDD,EtiquetteChemin}, + keywordstyle=[10]\color{Salmon}, + morekeywords=[7]{Abscisse,Addition,AdditionAbscisses,AdditionOrdonnee,AdditionVecteur,AireTriangle,Arc,arccos,arctan,arcsin,AsymptoteHyperbole,AxeDeSimilitude,AxeRadical,Axes,AxesBords, + Barycentre,Bissectrice, + CadreRepere,Centre,CentreRadical,Cercle,CercleCirconscrit,CercleCP,CercleD,CercleEuler,CercleExinscrit,CercleInscrit,CerclePrincipale,CercleTroisPoints,ch,Chemin,cos,Courbe,CourbeDat,CourbeEnPolaires, + CoVertex, + Debut,DemiHyperbole,DemiGrandAxe,DemiPetitAxe,Directrice,DistancePointDroite,Droite,DroitePerpendiculaire, + Ellipse,EllipseF, EquationDroite,Excentricite,exp, + Fenetre, Fin,Foyer, + gddEnPlace,gddTraceArcDeCercle,gddTraceObjet,Graduations,GraduationsBords,GrilleRepere, + Homothetie,HyperboleFD, + Inclinaison,IntersectionCercles,IntersectionDroiteCercle,IntersectionDroites,Inversion,IsoBarycentre, + LigneBrisee,ln,Longueur,LongueurSegment, + Marque,MarqueTrait,Milieu, + NombreCotesPolygone, + Norme, + Ordonnee,OrdonneeRelativePointDroite,Orthocentre, + PairImp,PairTOPoint,ParaboleFD,Point,PointDansRepere,PointDe, + PointImp,PointPolygone,PointTOPair,Polygone,PolygoneRegulier,ProduitScalaire,ProjectionPointSurDroite,ProjectionPointSurDroite, + Rayon,Repere,RepereMinMax,ReportSurDroite,Representation,Rotation,RotationCentre, + ScalaireVecteur,Segment,SegmentTOVecteur,sh,SigneOrtho,sin,Sommet,SoustractionVecteur,SymetrieAxiale,SymetrieCentrale, + tan,TangenteCommuneExterieure,TangenteCommuneInterieure,TangenteExterieureEllipse,TangenteEllipse,th,Triangle, + Unites, + Vecteur,VecteurP,Vertex}, + keywordstyle=[7]\color{FireBrick}, + morekeywords=[8]{gddO,gddA,gddB,gddC,gddD,gddE,gddF,gddT,gddP,gddS,gddX,gddPX,gddU,gddW,gddCouleurCerclePoint,gddCouleurPoint,gddExtensionDroite,gddTaillePoint,gddPointType, + gddXlabel,gddYlabel, _E, Pi, gddC2Dparam , + AliceBlue, +AntiqueWhite, +Aqua, +Aquamarine, +Azure, +Beige, +Bisque, +Black, +BlanchedAlmond, +Blue, +BlueViolet, +Brown, +BurlyWood, +CadetBlue, +Chartreuse, +Chocolate, +Coral, +CornflowerBlue, +Cornsilk, +Crimson, +Cyan, +DarkBlue, +DarkCyan, +DarkGoldenrod, +DarkGray, +DarkGreen, +DarkGrey, +DarkKhaki, +DarkMagenta, +DarkOliveGreen, +DarkOrange, +DarkOrchid, +DarkRed, +DarkSalmon, +DarkSeaGreen, +DarkSlateBlue, +DarkSlateGray, +DarkSlateGrey, +DarkTurquoise, +DarkViolet, +DeepPink, +DeepSkyBlue, +DimGray, +DimGrey, +DodgerBlue, +FireBrick, +FloralWhite, +ForestGreen, +Fuchsia, +Gainsboro, +GhostWhite, +Gold, +Goldenrod, +Gray, +Green, +GreenYellow, +Grey, +Honeydew, +HotPink, +IndianRed, +Indigo, +Ivory, +Khaki, +Lavender, +LavenderBlush, +LawnGreen, +LemonChiffon, +LightBlue, +LightCoral, +LightCyan, +LightGoldenrod, +LightGoldenrodYellow, +LightGray, +LightGreen, +LightGrey, +LightPink, +LightSalmon, +LightSeaGreen, +LightSkyBlue, +LightSlateBlue, +LightSlateGray, +LightSlateGrey, +LightSteelBlue, +LightYellow, +Lime, +LimeGreen, +Linen, +Magenta, +Maroon, +MediumAquamarine, +MediumBlue, +MediumOrchid, +MediumPurple, +MediumSeaGreen, +MediumSlateBlue, +MediumSpringGreen, +MediumTurquoise, +MediumVioletRed, +MidnightBlue, +MintCream, +MistyRose, +Moccasin, +NavajoWhite, +Navy, +NavyBlue, +OldLace, +Olive, +OliveDrab, +Orange, +OrangeRed, +Orchid, +PaleGoldenrod, +PaleGreen, +PaleTurquoise, +PaleVioletRed, +PapayaWhip, +PeachPuff, +Peru, +Pink, +Plum, +PowderBlue, +Purple, +Red, +RosyBrown, +RoyalBlue, +SaddleBrown, +Salmon, +SandyBrown, +SeaGreen, +Seashell, +Sienna, +Silver, +SkyBlue, +SlateBlue, +SlateGray, +SlateGrey, +Snow, +SpringGreen, +SteelBlue, +Tan, +Teal, +Thistle, +Tomato, +Turquoise, +Violet, +VioletRed, +Wheat, +White, +WhiteSmoke, +Yellow, +YellowGreen}, + keywordstyle=[8]\color{Sienna}, + morekeywords=[9]{}, + keywordstyle=[9]\color{Olive} +} +\lstset{explpreset={pos=t,wide=false,rframe={},preset=\centering}} +\lstdefinestyle{syntax}{backgroundcolor=\color{blue!15},numbers=none,xleftmargin=0pt,xrightmargin=0pt, + frame=single} +\lstdefinestyle{code}{backgroundcolor=\color{red!15},%numbers=left, + xleftmargin=0pt,xrightmargin=0pt, + frame=single} + +\newtcblisting{mpcode}{ + arc=0pt,outer arc=0pt, + colback=mpcode!3, + breakable, + boxsep=0pt,left=2pt,right=2pt,top=0pt,bottom=0pt, bottomtitle = + 3pt, toptitle=3pt, + boxrule=0pt,bottomrule=0.pt,toprule=0.pt, toprule at break = + 0pt, bottomrule at break = 0pt, + listing only,boxsep=0pt,listing + options={breaklines} +} + +\makeatletter +\tcbset{% + listing metapost/.code={% + \def\tcbuselistingtext@input{\begin{mplibcode} + background:=(.988,.976,.976); input \jobname.listing; + \end{mplibcode}}% + } +} +\makeatother +\newtcblisting[auto counter,]{ExempleMP}[1][]{% + arc=0pt,outer arc=0pt, + colback=FireBrick!3, + colframe=FireBrick, + breakable,fontupper=\small, + boxsep=0pt,left=2pt,right=2pt,top=0pt,bottom=2pt, bottomtitle = + 3pt, toptitle=3pt, lefttitle=5pt, + boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = + 0pt, bottomrule at break = 0pt, + listing side text, + listing metapost, + title={\bfseries\sffamily Exemple~\thetcbcounter}, + listing options={breaklines},#1 +} + + +\newcommand\mpgeomdd{\texttt{mp-geom2d}\xspace} +\newcommand\fichier[1]{\texttt{#1}} +\newcommand\variableGDD[1]{\texttt{\color{Sienna}#1}} +\newcommand\typeMP[1]{\texorpdfstring{\texttt{\color{Tomato}#1}}{#1}} +\newcommand\typeGDD[1]{\texorpdfstring{\texttt{\color{Sienna}#1}}{#1}} +\newcommand\foncGDD[1]{\texorpdfstring{\texttt{\color{Sienna}#1}}{#1}} + +\newenvironment{Note}{ + \noindent\textbf{Note~---~}} + {} + + + +% +\colorlet{code}{blue!80!black} +\newcommand\cmd{\texttt} +\newcommand\code[1]{\texorpdfstring{\texttt{\color{code}#1}}{#1}} +\newcommand*\cs[1]{\code{\textbackslash #1}} +\newcommand*\macro{\par\bigskip\noindent\hspace{-30pt}% + \SaveVerb[aftersave={% + \UseVerb{Vitem}% + }% + ]{Vitem}% + % \bigskip +} +\newcommand\vitem[1][]{\SaveVerb[% + aftersave={\item[\textnormal{\UseVerb[#1]{vsave}}]}]{vsave}} +\newcommand*\textme[1]{\textcolor{black}{\rmfamily\textit{#1}}} +\newcommand*\meta[1]{% % meta + \textme{\ensuremath{\langle}#1\ensuremath{\rangle}}% +} +\newcommand*\optstar{% % optional star + \meta{\ensuremath{*}}\xspace +} +\DefineShortVerb{\|} +\setlength{\fboxsep}{2pt} +\fvset{% + codes={\catcode`\«\active \catcode`\×\active }, + defineactive={\makefancyog\makefancytimes}, + formatcom=\color{FireBrick}, + frame=single +} +% rendre «...» équivalent à \meta{...} +{\catcode`\«\active + \newcommandx\makefancyog[0][addprefix=\global]{% + \def«##1»{\meta{##1}}}} +% rendre × équivalent à \optstar +{\catcode`\×\active + \newcommandx\makefancytimes[0][addprefix=\global]{% + \def×{\optstar{}}}} + +\NewDocumentEnvironment{Macro}{ov}{% +\Verb+#2+ +}{% +} +\newcommand{\return}[1]{~$\rightarrow$~#1} +\newcommand{\indication}[1]{\hfill(\itshape #1)} + +\newcommand{\R}{\mathbf{R}} + +\begin{document} +%% === Page de garde =================================================== +\thispagestyle{empty} +\begin{tikzpicture}[remember picture, overlay] + \node[below right, shift={(-4pt,4pt)}] at (current page.north west) {% + \includegraphics{fond.pdf}% + }; +\end{tikzpicture}% + +\noindent +{\includegraphics{mp-geom2d}\\ +\Large Paquet \MP{} pour des figures de géométrie plane}\\[1cm] +\parbox{0.5\textwidth}{ +\includegraphics[scale=0.86]{figure.pdf} +}\hfill +\parbox{0.5\textwidth}{\Large\raggedleft + \textbf{Contributeurs}\\ + Maxime \textsc{Chupin}\\ + Jean-Michel \textsc{Sarlat} +} +\vfill +\begin{center} +Version 1.1 du 22 octobre 2024\\ +\url{https://gitlab.gutenberg-asso.fr/mchupin/mp-geom2d}\\ +\url{https://ctan.org/pkg/mp-geom2d} +\end{center} +%% == Page de garde ==================================================== +\newpage + + + +\section{Objectif} + +\mpgeomdd a été écrit avec le but de proposer des macros \MP{} permettant +de réaliser une figure de géométrie \emph{en collant} d'assez près +à une description impérative: +\begin{quote}\itshape +Soit \(A\) le point de coordonnées (2,3).\\ +Soit \(B\) le point de coordonnées (4,5).\\ +Trace la droite \((A,B)\).\\ +.... +\end{quote} +Dans ce cadre, les objets géométriques sont le plus souvent nommés +(\(A\), \(B\), etc.) ou désignés par leur nature et leurs attributs +(droite \((A,B)\), etc.). Pour ne pas avoir à dépasser ce mode de +description, en particulier pour éviter d'avoir à déclarer le +\emph{type} de ces objets, le choix a été fait de les identifier par +un \emph{index}\footnote{Le type \typeMP{numeric}, qui est le type par +défaut dans \MP, ne demande pas de déclaration préalable.} dans des +tables qui en précisent les caractéristiques. + +\begin{Note} À ce jour, l'objectif n'est pas atteint, le +développement est loin d'être achevé; il est encore nécessaire de +faire appel à des commandes \MP{} ou à des \emph{macros +intermédiaires} pour décrire une figure. Cela évoluera sans doute +avec le temps, le temps de trouver une syntaxe satisfaisante... +\end{Note} + + +\section{Les fichiers} + +\mpgeomdd est un ensemble d'outils pour la géométrie plane avec +\MP~\cite{ctan-metapost}. Cet +ensemble est organisé en plusieurs fichiers : + +\begin{enumerate} +\item \fichier{geom2d.mp} : c'est le fichier principal, qui charge tous les +autres ; +\item \fichier{geom2d-main.mp} : il contient + les structures et fonctions générales ; +\item \fichier{geom2d-arc.mp} : + contient tout ce qui concerne les arcs de cercles ; +\item \fichier{geom2d-c2d.mp} : + contient tout ce qui concerne les courbes du second degré ; +\item \fichier{geom2d-fct.mp} : + contient quelques fonctions mathématiques usuelles ; +\item \fichier{geom2d-lbl.mp} : + contient les fonctions relatives aux labels ; +\item \fichier{geom2d-plt.mp} : + contient des fonctions facilitant la représentation de fonctions + mathématiques ; +\item \fichier{geom2d-rep.mp} + contient différents outils pour le tracé de figure dans un repère ; +\item \fichier{geom2d-tra.mp} + contient les fonctions permettant de gérer la transparence (code + emprunté à Anthony \bsc{Phan}) ; +\item \fichier{geom2d-svgnames.mp} fournit les 150 couleurs de la spécification +SVG. +\end{enumerate} + +Nous allons, dans la suite, décrire plus en détails chacune de ces +fonctions. Certaines fonctions s'appuient sur +l'extension \fichier{graph.mp} présente dans toutes les bonnes +distributions \TeX. + +\section{Principe général de fonctionnement} + +\mpgeomdd utilise des tables comme structure principale. Chaque objet est +numéroté \emph{via} le compteur \variableGDD{gddO}, son type\footnote{Les types +sont propres à \mpgeomdd et seront décrits plus tard.} est stocké dans +la table \variableGDD{gddT[]} à la place \variableGDD{gddT[gddO]}. Les +propriétés des objets sont définies dans, là encore, des tables de +type \typeMP{numeric} qui sont \variableGDD{gddA[]}, \variableGDD{gddB[]}, +\dots, \variableGDD{gddF[]}. + +Par exemple, pour un \typeGDD{Point} (type \mpgeomdd), la première coordonnée +se trouve dans \variableGDD{gddA[]} et la seconde dans \variableGDD{gddB[]} +(les autres table ne sont pas utilisées pour un tel objet). + +Il y a trois tables particulières \variableGDD{gddP[]} qui est du type +\typeMP{path}, \variableGDD{gddPX[][]} qui est sa version étendue, et \variableGDD{gddS[]} qui est du type +\typeMP{string}. Nous verrons plus tard quelle est leur utilité. + +Bien entendu, lors d'une utilisation classique de \mpgeomdd, l'appel à +toutes ces tables n'est pas chose courante. Les fonctions que nous +allons décrire dans la suite de ce document permettent de ne pas +avoir recours trop précisément à cette machinerie. + + +\section{Tracés} + +\mpgeomdd fournit des macros pour tracer des objets. Une commande permet de tracer +la plupart des objets de \mpgeomdd (qui sont décrits dans la +section~\ref{sec:types}), ainsi que certains type \MP. Les exemples tout au long +de la documentation permettront d'illustrer les commandes de tracé. + +Pour comprendre comment fonctionne les représentations avec \mpgeomdd, il nous faut +tout d'abord décrire le mécanisme de gestion des unités. + +\subsection{Unité} + +\mpgeomdd définit une unité générale avec la variable globale +\lstinline+gddU+. Ce \typeMP{numeric} vaut par +défaut \SI{1}{cm}. +\begin{colourband} + \macro|gddU| + \index{gddU@\lstinline+gddU+} + \end{colourband} +\subsection{En place} + +Lors de l'utilisation des commandes de tracé, \mpgeomdd utilise la macro\label{gddEnPlace} +\begin{colourband} +\macro|gddEnPlace| +\index{gddEnPlace@\lstinline+gddEnPlace+} +\end{colourband} +Cette macro permet de spécifier les transformations géométriques nécessaires au +placement de l'objet, notamment le facteur d'échelle relatif à l'unité +\lstinline+gddU+. + +En interne, cette macro est un \lstinline+scantoken+ de la variable globale +\variableGDD{gddW}\index{gddW@\lstinline+gddW+} (\typeMP{string}) qui contient les transformations. + +\subsection{Commandes de tracés}\label{sec:trace} + +La macro de tracé la plus courante est la macro \lstinline+trace+. +\begin{colourband} +\macro|trace(«objet»)| +\begin{description} + \item[\meta{objet}:] + \begin{itemize} + \item pour le côté \MP, un \typeMP{path}, une + \typeMP{picture} ou un \typeMP{pair}, et dans ce cas \lstinline+trace+ sera + équivalent à \lstinline+draw+; + \item du côté de \mpgeomdd, + n'importe quel des 6 objets définis jusque là : \typeGDD{triangle}, + \typeGDD{segment}, \typeGDD{droite}, \typeGDD{cercle}, \typeGDD{ellipse}, + \typeGDD{parabole}, \typeGDD{hyperbole}, + \typeGDD{polygone}, \typeGDD{chemin}, + \typeGDD{courbe} ou \typeGDD{vecteur} (pour ce dernier, une flèche sera + ajoutée à l'extrémité du vecteur). + \end{itemize} +\end{description}\index{trace@\lstinline+trace+} +\end{colourband} + +Lorsque \lstinline+trace+ est utilisée sur un objet de \mpgeomdd, la macro fait +appel à la commande \MP\ \lstinline+draw+ avec le mécanisme de mise en place +décrit plus haut. + +\mpgeomdd fournit un tracé avec flèche faisant non plus appel à \lstinline+draw+ +mais à \lstinline+drawarrow+. + +\begin{colourband} +\macro|fleche(«objet»)| +\begin{description} + \item[\meta{objet}:] + \begin{itemize} + \item pour le côté \MP, un \typeMP{path}, une + \typeMP{picture} ou un \typeMP{pair}, et dans ce cas \lstinline+trace+ sera + équivalent à \lstinline+drawarrow+; + \item du côté de \mpgeomdd, + n'importe quel des 6 objets définis jusque là : \typeGDD{triangle}, + \typeGDD{segment}, \typeGDD{droite}, \typeGDD{cercle}, \typeGDD{ellipse}, + \typeGDD{polygone}, \typeGDD{chemin}, + \typeGDD{courbe} ou \typeGDD{vecteur} (pour ce dernier, une flèche sera + ajoutée à l'extrémité du vecteur). + \end{itemize} +\end{description}\index{fleche@\lstinline+fleche+} +\end{colourband} + +On peut aussi colorier un objet grâce à la macro suivante. +\begin{colourband} +\macro|colorie(«objet»)| +\begin{description} + \item[\meta{objet}:] peut être: + \begin{itemize} + \item pour le côté \MP, uniquement un \typeMP{path} et dans ce cas \lstinline+trace+ sera équivalent à \lstinline+fill+; + \item du côté de \mpgeomdd, + n'importe quel objet coloriable : \typeGDD{triangle}, + \typeGDD{cercle}, \typeGDD{ellipse}, \typeGDD{polygone}, \typeGDD{chemin}, ou + \typeGDD{courbe}. + \end{itemize} +\end{description}\index{colorie@\lstinline+colorie+} +\end{colourband} + + +Les commandes de tracés de \mpgeomdd font appel aux macros de +base de \MP : \lstinline+draw+ et \lstinline+fill+. Ainsi, pour spécifier la +couleur, on pourra +utiliser la commande \lstinline+withcolor+ ou bien la macro +\lstinline+drawoptions+. + + +On peut aussi colorier avec de la transparence\footnote{En réalité, on simule de +la transparence avec le code emprunté à Anthony Phan : +\url{http://www-math.univ-poitiers.fr/~phan/metalpha.html}} avec la commande +suivante. +\begin{colourband} +\macro|colorieAvecTransparence(«objet»,«couleur»,«coefficient de transparence»)| +\begin{description} + \item[\meta{objet}:] peut être: + \begin{itemize} + \item pour le côté \MP, uniquement un \typeMP{path} et dans ce cas \lstinline+trace+ sera équivalent à \lstinline+fill+; + \item du côté de \mpgeomdd, + n'importe quel objet coloriable : \typeGDD{triangle}, + \typeGDD{cercle}, \typeGDD{ellipse}, \typeGDD{polygone}, \typeGDD{chemin}, ou + \typeGDD{courbe}. + \end{itemize} + \item[\meta{couleur}:] est une \typeMP{color}. + \item[\meta{coefficient de transparence}:] est un \typeMP{numeric} compris + entre 0 et 1, 0 pour un coloriage opaque et 1 pour un coloriage invisible. +\end{description}\index{colorie@\lstinline+colorie+} +\end{colourband} + + + + +Les macros ci-dessus, font appel à une macro plus bas niveau qui permet de +retourner le \typeMP{path} à tracer ou colorier pour tous les objets \mpgeomdd. + +\begin{colourband} +\macro|gddTraceObjet(«objet»)|\return{\typeMP{path}} +\begin{description} + \item[\meta{objet}:] + \typeGDD{triangle}, \typeGDD{segment}, \typeGDD{vecteur}, + \typeGDD{cercle}, \typeGDD{ellipse}, \typeGDD{parabole}, \typeGDD{hyperbole},\typeGDD{polygone}, \typeGDD{chemin}, ou + \typeGDD{courbe}. +\end{description}\index{gddTraceObjet@\lstinline+gddTraceObjet+} +\end{colourband} + +Si l'objet n'est pas fermé, \mpgeomdd fournit la macro suivante qui ajoute un +\lstinline+--cycle+ à la suite du chemin : +\begin{colourband} +\macro|fermeture(«objet»)|\return{\typeMP{path}}\indication{fermé \lstinline+--cycle+} +\begin{description} + \item[\meta{objet}:] + \begin{itemize} + \item du côté de \MP, \typeMP{path} ; + \item du côté de \mpgeomdd, \typeGDD{triangle}, \typeGDD{segment}, \typeGDD{vecteur}, + \typeGDD{cercle}, \typeGDD{chemin}, ou + \typeGDD{courbe}. + \end{itemize} +\end{description}\index{fermeture@\lstinline+fermeture+} +\end{colourband} + +On pourra spécifier le \emph{crayon} utilisé pour les tracés avec la commande +suivante: + +\begin{colourband} + \macro|avecCrayon(«taille»,«couleur»)| + \begin{description} + \item[\meta{taille}:] facteur d'échelle \typeMP{numeric} du \typeMP{pen} + \lstinline+pencircle+ de \MP{} utilisé ; + \item[\meta{couleur}:] couleur \typeMP{color} à utiliser. + \end{description}\index{avecCrayon@\lstinline+avecCrayon+} +\end{colourband} + +Cette macro est un raccourci pour le \emph{classique} \texttt{withpen +pencircle scaled ... withcolor ...}. On peut d'ailleurs évidemment toujours +utiliser les commandes \MP{} pour le dessin. + +On peut représenter les objets de type \typeGDD{point}. Pour cela, on dispose +d'une commande qui trace un petit cercle coloré à l'endroit du point. La +commande est la suivante : + +\begin{colourband} +\macro|pointe(«point»)| +\begin{description} + \item[\meta{point}:] \typeGDD{point} ou \typeMP{pair} +\end{description}\index{pointe@\lstinline+pointe+} +\end{colourband} + +Cette macro utilise deux variables globales de \mpgeomdd qui sont +\begin{colourband} +\macro|gddTaillePoint|\indication{\typeMP{numeric}, valeur par défaut 3} +\index{gddTaillePoint@\lstinline+gddTaillePoint+} +\end{colourband} +et +\begin{colourband} +\macro|gddCouleurPoint| \indication{\typeMP{color}, valeur par défaut \lstinline+white+} +\index{gddCouleurPoint@\lstinline+gddCouleurPoint+} +\end{colourband} + +Il existe deux autres types de pointage de point : la simple croix et le simple +disque. Pour choisir un autre type de pointage (en utilisant la même commande +\lstinline+pointe+), on modifiera la variable globale suivante: +\begin{colourband} + \macro|gddPointType| \indication{\typeMP{string}, valeur par défaut + \lstinline+"pointe"+} + \par + + Peut valoir : \lstinline+"pointe"+, \lstinline+"croix"+ ou \lstinline+"disque"+. + \index{gddPointType@\lstinline+gddPointType+} +\end{colourband} +\subsection{Contenir les tracés} + +Il est souvent nécessaire de restreindre les tracés à une zone du plan $\R^2$. +Pour cela, \mpgeomdd fournit la commande \lstinline+Fenetre+: +\begin{colourband} +\macro|Fenetre(«Xmin»,«Ymin»,«Xmax»,«Ymin»)| +\index{Fenetre@\lstinline+Fenetre+} +\end{colourband} +Cette fonction trace un rectangle dont deux sommets opposés sont les points +\lstinline|(Xmin,Ymin)| et \lstinline|(Xmax,Ymax)| avec la couleur \MP{} +\lstinline+background+ et découpe l'image courante autour de ce cadre (avec la +commande \MP{} \lstinline+clip currentpicture+). + + +\section{Les types}\label{sec:types} + +\mpgeomdd, fournit plusieurs types d'objets. Le type d'objet est +stocké dans la table \variableGDD{gddT[]}, et les tables \variableGDD{gddA[]} +à \variableGDD{gddF[]}, ainsi que la table \variableGDD{gddX} contiennent les propriétés des objets. + +Nous allons ici décrire chaque type de l'extension \mpgeomdd, +leurs propriétés respectives, ainsi que des méthodes associées directement à +l'objet. + +\subsection{Le type \typeGDD{point}} + +Ce type correspond au point de +l'espace euclidien. + +\subsubsection{Constructeur} + +Pour être plus clair voici la fonction principale +pour créer un tel objet : +% +\begin{mpcode} +vardef Point(expr a,b) = + gddT[incr gddO] = "point"; + gddA[gddO] = a; gddB[gddO] = b; gddO +enddef; +\end{mpcode} + +\begin{colourband} +\macro|Point(«x»,«y»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{x}:] \typeMP{numeric} ; + \item[\meta{y}:] \typeMP{numeric}. +\end{description}\index{Point@\lstinline+Point+} +\end{colourband} +\bigskip + + +Cette fonction \og{}retourne\fg{} le compteur \variableGDD{gdd0} et crée dans la +table de type une entrée \typeGDD{point} et les attributs (coordonnées) +correspondants \variableGDD{a} et \variableGDD{b} dans les tables +\variableGDD{gddA} et \variableGDD{gddB}. + +Avec un tel type de fonctionnement, la plupart des manipulations se +fait sur des \typeMP{numeric}s. En effet, pour déclarer un +\typeGDD{point}, il suffit d'écrire +\begin{mpcode} +A = Point(2,3); +\end{mpcode} +\variableGDD{A} prend alors la valeur courante de \variableGDD{gddO}. C'est +l'identifiant du point. + +On peut aussi définir un \typeGDD{point} par ses coordonnées \emph{polaires} +avec la commande suivante. + +\begin{colourband} +\macro|PointPolaire(«r»,«a»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{r}:] \typeMP{numeric}, module du point; + \item[\meta{a}:] \typeMP{numeric}, angle par rapport à l'axe des abscisses. +\end{description}\index{Point@\lstinline+Point+} +\end{colourband} +\bigskip + + + +On peut définir un point dans un repère défini lui par un point +d'origine et deux vecteurs avec la fonction suivante: +\begin{colourband} +\macro|PointDansRepere(«x»,«y»,«o»,«i»,«j»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{x}:] \typeMP{numeric} ; + \item[\meta{y}:] \typeMP{numeric} ; + \item[\meta{o}:] \typeGDD{point} d'origine du repère ; + \item[\meta{i}:] \typeGDD{vecteur} (ou \typeGDD{point}) définissant l'axe des abscisses ; + \item[\meta{j}:] \typeGDD{vecteur} (ou \typeGDD{point}) définissant l'axe des ordonnées. +\end{description}\index{PointDansRepere@\lstinline+PointDansRepere+} +\end{colourband} + +\bigskip + +Le code suivant illustre l'utilisation de cette commande (avec des +\typeGDD{point}s au lieu de \typeGDD{vecteur}s, type décrit plus tard). +\begin{mpcode} +O = Point(0,0); +I = Point(2,0); +J = Point(0,3); +A = PointDansRepere(2,3,O,I,J); +\end{mpcode} + + +\subsubsection{Macros associées} + +On peut récupérer l'abscisse et l'ordonnée d'un point avec les commandes +suivantes : +\begin{colourband} +\macro|Abscisse(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{point}, \typeGDD{vecteur} ou \typeMP{pair}. +\end{description}\index{Abscisse@\lstinline+Abscisse+} +\end{colourband} + +\begin{colourband} +\macro|Ordonnee(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{point}, \typeGDD{vecteur} ou \typeMP{pair}. +\end{description}\index{Ordonnee@\lstinline+Ordonnee+} +\end{colourband} + +On pourra ajouter les abscisses, les ordonnées ou bien, à la manière des +vecteurs, des points entre eux avec les commandes suivantes. +\begin{colourband} +\macro|AdditionAbscisses(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}. +\end{description}\index{AdditionAbscisses@\lstinline+AdditionAbscisses+} +\end{colourband} +\begin{colourband} +\macro|AdditionOrdonnee(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}. +\end{description}\index{AdditionOrdonnee@\lstinline+AdditionOrdonnee+} +\end{colourband} +et +\begin{colourband} +\macro|Addition(«a»,«b»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}; + \item[\meta{b}:] \typeGDD{point} ou \typeMP{pair}. +\end{description}\index{Addition@\lstinline+Addition+} +\end{colourband} + +On peut aussi calculer la longueur entre deux points grâce à la commande +suivante: +\begin{colourband} +\macro|Longueur(«a»,«b»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}; + \item[\meta{b}:] \typeGDD{point} ou \typeMP{pair}. +\end{description}\index{Longueur@\lstinline+Longueur+} +\end{colourband} + +On peut calculer le point équidistant de deux points, le milieu : +\begin{colourband} +\macro|Milieu(«a»,«b»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}; + \item[\meta{b}:] \typeGDD{point} ou \typeMP{pair}. +\end{description}\index{Milieu@\lstinline+Milieu+} +\end{colourband} + +On peut réaliser la rotation d'un point autour de l'origine $(0,0)$ avec la +commande suivante: +\begin{colourband} +\macro|Rotation(«a»,«b»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}; + \item[\meta{b}:] \typeMP{numeric}, l'angle de rotation en radian. +\end{description}\index{Rotation@\lstinline+Rotation+} +\end{colourband} + +Si on veut réaliser la rotation d'un point autour d'un autre, on utilisera la +commande suivante: +\begin{colourband} +\macro|RotationCentre(«a»,«b»,«c»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}; + \item[\meta{b}:] \typeGDD{point} ou \typeMP{pair}, centre de rotation; + \item[\meta{c}:] \typeMP{numeric}, l'angle de rotation en radian. +\end{description}\index{RotationCentre@\lstinline+RotationCentre+} +\end{colourband} + +On peut calculer l'isobarycentre d'une liste de points (ou de \typeMP{pair} de \MP) avec la commande suivante. +\begin{colourband} +\macro|IsoBarycentre(«a»,«b»,«c», etc.)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}; + \item[\meta{b}:] \typeGDD{point} ou \typeMP{pair} ; + \item[] etc. +\end{description}\index{IsoBarycentre@\lstinline+IsoBarycentre+} +\end{colourband} + +On peut calculer le barycentre d'une liste de points associées à des poids (mais +ici, il n'est pas possible d'utiliser des \typeMP{pair} de \MP). +\begin{colourband} +\macro|Barycentre((«A»,«a»),(«B»,«b»),(«C»,«c»), etc.)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{A}:] \typeGDD{point} ; + \item[\meta{a}:] \typeMP{numeric}, poids associé à \meta{A} ; + \item[\meta{B}:] \typeGDD{point} ; + \item[\meta{b}:] \typeMP{numeric}, poids associé à \meta{B} ; + \item[] etc. +\end{description}\index{Barycentre@\lstinline+Barycentre+} +\end{colourband} + + +On peut déterminer la bissectrice d'un secteur angulaire défini par trois +points. La fonction retourne une \typeGDD{droite}. +\begin{colourband} +\macro|Bissectrice(«A»,«B»,«C»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{A}:] \typeGDD{point} ; + \item[\meta{B}:] \typeGDD{point} ; + \item[\meta{C}:] \typeGDD{point}. +\end{description}\index{Bissectrice@\lstinline+Bissectrice+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,0); +B = Point(0,0); +C = Point(1,1); +D = Bissectrice(A,B,C); +trace D; +marque.bot "A"; +marque.bot "B"; +marque.bot "C"; +Fenetre(-0.5,-0.5,2,2); +endfig; +\end{ExempleMP} + + +Le type \typeGDD{point} est évidemment lié au type \MP{} \typeMP{pair}. + +\mpgeomdd fournit des macros qui permettent de passer de \typeGDD{point} à +\typeMP{pair} et réciproquement. +\begin{colourband} +\macro|PointTOPair(«a»,«b»)|\return{\typeMP{pair}} +\begin{description} + \item[\meta{a}:] \typeMP{numeric}, abscisse ; + \item[\meta{b}:] \typeMP{numeric}, ordonnée. +\end{description}\index{PointTOPair@\lstinline+PointTOPair+} +\end{colourband} + + +\begin{colourband} +\macro|PairTOPoint(«p»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{p}:] \typeMP{pair}. +\end{description}\index{PairTOPoint@\lstinline+PairTOPoint+} +\end{colourband} + +Ces deux commandes sont complétées par deux autres qui assure qu'un élément est +d'un type donné: +\begin{colourband} +\macro|PairImp(«p»)|\return{\typeGDD{pair}} +\begin{description} + \item[\meta{p}:] \typeGDD{point} ou \typeMP{pair}. +\end{description}\index{PairImp@\lstinline+PairImp+} +\end{colourband} + + +\begin{colourband} +\macro|PointImp(«p»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{p}:] \typeGDD{point} ou \typeMP{pair}. +\end{description}\index{PointImp@\lstinline+PointImp+} +\end{colourband} + +On peut aussi récupérer un point le long d'un objet \mpgeomdd (décrit dans les +sections suivantes). La macro suivante retourne un \typeGDD{point} le long du +chemin (cyclique ou non) de l'objet le paramétrant entre 0 et 1. + +\begin{colourband} +\macro|PointDe(«o»,«t»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{o}:] n'importe quel objet \mpgeomdd (même un \typeGDD{point} pour + lequel lui-même est retourné); + \item[\meta{t}:] \typeMP{numeric} compris entre 0 et 1 (qui paramètre le + chemin de l'objet entre 0 et 1). +\end{description}\index{PointDe@\lstinline+PointDe+} +\end{colourband} + + + +\subsection{Le type \typeGDD{vecteur}} + +Ce type correspond aux vecteurs +définis à l'aide de deux coordonnées de l'espace euclidien. + +\subsubsection{Constructeurs} + +La fonction +créatrice d'un tel objet est celle-ci +% +\begin{mpcode} +vardef Vecteur(expr a,b) = + save n; n = incr gddO; + gddT[n] = "vecteur"; gddA[n] = a; gddB[n] = b; n +enddef; +\end{mpcode} + +\begin{colourband} +\macro|Vecteur(«a»,«b»)|\return{\typeGDD{vecteur}} +\begin{description} + \item[\meta{a}:] \typeMP{numeric} ; + \item[\meta{b}:] \typeMP{numeric}. +\end{description}\index{Vecteur@\lstinline+Vecteur+} +\end{colourband} +\bigskip + +Cette fonction a la même architecture que celle correspondante au +\typeGDD{point} : elle retourne la valeur courante de \variableGDD{gddO} +après incrémentation, puis affecte le type \typeGDD{vecteur} à +l'entrée correspondante dans la table \variableGDD{gddT}. + +On peut aussi définir un vecteur à partir d'un \typeMP{pair} \MP. +\begin{mpcode} +vardef VecteurP(expr a) = + save n; n = incr gddO; + gddT[n] = "vecteur"; gddA[n] = xpart a; gddB[n] = ypart a; n +enddef; +\end{mpcode} + +\begin{colourband} +\macro|VecteurP(«a»)|\return{\typeGDD{vecteur}} +\begin{description} + \item[\meta{a}:] \typeMP{pair}. +\end{description}\index{VecteurP@\lstinline+VecteurP+} +\end{colourband} +\bigskip + +Un vecteur peut se définir alors comme ceci: +\begin{ExempleMP} +input geom2d; +beginfig(1); +AB = Vecteur(2,3); +pair a; +a := (3,2); +A = VecteurP(a); +trace AB; +trace A; +endfig; +\end{ExempleMP} + +\subsubsection{Macros associées} + +Comme les objets de \mpgeomdd ne sont pas des \typeMP{numeric}s, les opérations classiques +de l'espace vectoriel ne peuvent pas s'écrire avec les simples caractères +\lstinline-+-, \lstinline+-+, et \lstinline-*-. + +\begin{colourband} +\macro|AdditionVecteur(«a»,«b»)|\return{\typeGDD{vecteur}} +\begin{description} + \item[\meta{a}:] \typeGDD{vecteur} ; + \item[\meta{b}:] \typeGDD{vecteur}. +\end{description}\index{AdditionVecteur@\lstinline+AdditionVecteur+} +\end{colourband} +\bigskip + + +\begin{colourband} +\macro|SoustractionVecteur(«a»,«b»)|\return{\typeGDD{vecteur}} +\begin{description} + \item[\meta{a}:] \typeGDD{vecteur} ; + \item[\meta{b}:] \typeGDD{vecteur}. +\end{description}\index{SoustractionVecteur@\lstinline+SoustractionVecteur+} +\end{colourband} +\bigskip + + +\begin{colourband} +\macro|ScalaireVecteur(«k»,«b»)|\return{\typeGDD{vecteur}} +\begin{description} + \item[\meta{k}:] \typeMP{numeric} ; + \item[\meta{b}:] \typeGDD{vecteur}. +\end{description}\index{ScalaireVecteur@\lstinline+ScalaireVecteur+} +\end{colourband} +\bigskip + +On pourra alors faire les opérations classiques sur les vecteurs. + +\begin{ExempleMP} +input geom2d; +beginfig(1); +AB = Vecteur(2,3); +BC = Vecteur(1,0); +AC = AdditionVecteur(AB,BC); +kAC = ScalaireVecteur(3.0,AC); +trace AB; +trace BC; +trace AC; +endfig; +\end{ExempleMP} + +On peut aussi calculer le produit scalaire de deux vecteurs avec la commande +suivante. + +\begin{colourband} +\macro|ProduitScalaire(«a»,«b»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{vecteur} ; + \item[\meta{b}:] \typeGDD{vecteur}. +\end{description}\index{ProduitScalaire@\lstinline+ProduitScalaire+} +\end{colourband} +\bigskip + +On peut aussi calculer la norme euclidienne d'un vecteur. +\begin{colourband} +\macro|Norme(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{vecteur}. +\end{description}\index{Norme@\lstinline+Norme+} +\end{colourband} +\bigskip + +La commande suivante permet d'obtenir l'angle, en radian, entre $[0,\uppi]$ formé +entre deux vecteurs. Si on note $u$ et $v$ les deux vecteurs de $\R^2$, l'angle +calculé par la commande suivante est obtenu avec la formule suivante : +\[\theta = \arccos \left(\frac{u\cdot v}{\|u\|\|v\|}\right).\] + +\begin{colourband} +\macro|Angle(«a»,«b»)|\return{\typeMP{numeric} (dans $[0,\uppi]$)} +\begin{description} + \item[\meta{a}:] \typeGDD{vecteur} ; + \item[\meta{b}:] \typeGDD{vecteur}. +\end{description}\index{Norme@\lstinline+Norme+} +\end{colourband} +\bigskip + + +\subsection{Le type \typeGDD{segment}} +Les segments sont +définis par deux points de $\R^2$. + + +\subsubsection{Constructeur} +La fonction créatrice de cet objet est +celle-ci +\begin{mpcode} +vardef Segment (expr a,b) = + save n; n = incr gddO; + gddT[n] = "segment"; gddA[n] = PointImp(a); gddB[n] = PointImp(b); n +enddef; +\end{mpcode} + +\begin{colourband} +\macro|Segment(«a»,«b»)|\return{\typeGDD{segment}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ; + \item[\meta{b}:] \typeGDD{point}. +\end{description}\index{Segment@\lstinline+Segment+} +\end{colourband} + +\bigskip + +Un segment se définit alors comme ceci: +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(2,3); +B = Point(4,5); +C = Point(2,1); +AB = Segment(A,B); +BC = Segment(B,C); +AC = Segment(A,C); +fleche AB; +fleche BC; +fleche AC; +endfig; +\end{ExempleMP} + +\subsubsection{Macros associées} + +On peut calculer la longueur d'un segment avec la macro suivante. +\begin{colourband} +\macro|LongueurSegment(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{segment}. +\end{description}\index{LongueurSegment@\lstinline+LongueurSegment+} +\end{colourband} + +On peut aussi convertir un segment en vecteur avec la macro suivante qui fait la +différence des coordonnées des deux points définissant le segment. +\begin{colourband} +\macro|SegmentTOVecteur(«a»)|\return{\typeGDD{vecteur}} +\begin{description} + \item[\meta{a}:] \typeGDD{segment}. +\end{description}\index{SegmentTOVecteur@\lstinline+SegmentTOVecteur+} +\end{colourband} + + + +\subsection{Le type \typeGDD{droite}} +Une droite est simplement définie par +deux points. + +\subsubsection{Constructeur} + +Ainsi la fonction créatrice de cet objet est la suivante +\begin{mpcode} +vardef Droite (expr a,b) = + save n; n = incr gddO; + gddT[n] = "droite"; gddA[n] = PointImp(a); gddB[n] = PointImp(b); n +enddef; +\end{mpcode} +\begin{colourband} +\macro|Droite(«a»,«b»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ; + \item[\meta{b}:] \typeGDD{point}. +\end{description}\index{Droite@\lstinline+Droite+} +\end{colourband} +\bigskip + +Lors de la représentation des droites (voir section~\ref{sec:trace}), le +caractère \emph{infini} de la droite est géré par la variable globale +\lstinline+gddExtensionDroite+ +\index{gddExtensionDroite@\lstinline+gddExtensionDroite+} +qui vaut 10 par défaut. + +\subsubsection{Macros associées} + + +La macro suivante permet, sous forme d'un triplet, et donc d'une \typeMP{color}, +d'obtenir les coefficients d'une droite donnée. Pour une droite $(D)$, la macro +donne le triplet $(u,v,w)\in\R^3$ tel que $\forall (x,y)\in(D)$, $ux+vy+w=0$. + +\begin{colourband} +\macro|EquationDroite(«a»)|\return{\typeMP{color}} +\begin{description} + \item[\meta{a}:] \typeGDD{droite}. +\end{description}\index{EquationDroite@\lstinline+EquationDroite+} +\end{colourband} + +On peut calculer la projection d'un point sur une droite avec la commande +suivante. + +\begin{colourband} +\macro|ProjectionPointSurDroite(«p»,«a»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{p}:] \typeGDD{point} ; + \item[\meta{a}:] \typeGDD{droite}. +\end{description}\index{ProjectionPointSurDroite@\lstinline+ProjectionPointSurDroite+} +\end{colourband} + +On peut obtenir l'ordonnée relative d'un point sur une droite avec la macro +suivante. +\begin{colourband} +\macro|OrdonneeRelativePointDroite(«p»,«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{p}:] \typeGDD{point} ; + \item[\meta{a}:] \typeGDD{droite}. +\end{description}\index{OrdonneeRelativePointDroite@\lstinline+OrdonneeRelativePointDroite+} +\end{colourband} + +Le calcul de la distance d'un point à une droite se fait avec la macro suivante. +\begin{colourband} +\macro|DistancePointDroite(«p»,«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{p}:] \typeGDD{point} ; + \item[\meta{a}:] \typeGDD{droite}. +\end{description}\index{DistancePointDroite@\lstinline+DistancePointDroite+} +\end{colourband} + +La macro suivante permet d'obtenir la droite perpendiculaire à un droite passant +par un point. +\begin{colourband} +\macro|DroitePerpendiculaire(«a»,«p»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{a}:] \typeGDD{droite} ; + \item[\meta{p}:] \typeGDD{point}. +\end{description}\index{DroitePerpendiculaire@\lstinline+DroitePerpendiculaire+} +\end{colourband} + +On pourra obtenir le \typeGDD{point} d'intersection de deux droites avec la +macro suivante. +\begin{colourband} +\macro|IntersectionDroites(«a»,«b»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{droite} ; + \item[\meta{b}:] \typeGDD{droite}. +\end{description}\index{IntersectionDroites@\lstinline+IntersectionDroites+} +\end{colourband} + +La macro suivante permet de reporter un point sur une droite avec une certaine +longueur (signée), à la manière d'un compas. + +\begin{colourband} +\macro|ReportSurDroite(«P»,«D»,«l»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{P}:] \typeGDD{point} ; + \item[\meta{D}:] \typeGDD{droite} ; + \item[\meta{l}:] \typeMP{numeric} (peut être négatif). +\end{description}\index{ReportSurDroite@\lstinline+ReportSurDroite+} +\end{colourband} + +Le côté du report par rapport au point \meta{P} dépend de la définition de +la droite : pour une droite définie par deux \typeGDD{point}s $A$ et $B$, alors +la direction du report sera suivant le vecteur $\overrightarrow{AB}$. Pour +changer de direction, il suffira de multiplier le paramètre de distance \meta{l} +par $-1$. + +Voici un exemple permettant d'illustrer l'utilisation de quelques commandes +relatives aux droites. + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(0,0); +B = Point(3,2); +AB = Droite(A,B); +trace AB; +pointe A; +pointe B; +C = Point(0,2); +DC = DroitePerpendiculaire(AB,C); +trace DC; +pointe C; +D = ProjectionPointSurDroite(C,AB); +pointe D; +Fenetre(-2,-2,4,4); +endfig; +\end{ExempleMP} + + + + + +\subsection{Le type \typeGDD{cercle}} +Un cercle est défini par un point et un +rayon. + +\subsubsection{Constructeurs} +La fonction créatrice de base de cet objet est la suivante +\begin{mpcode} +vardef Cercle (expr a,b) = + save n; n = incr gddO; + gddT[n] = "cercle"; gddA[n] = PointImp(a); gddB[n] = b; n +enddef; +\end{mpcode} +\begin{colourband} +\macro|Cercle(«a»,«b»)|\return{\typeGDD{cercle}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}, + centre du cercle ; + \item[\meta{b}:] \typeMP{numeric}, rayon du cercle. +\end{description}\index{Cercle@\lstinline+Cercle+} +\end{colourband} +\bigskip + + +Deux autres fonctions permettent de définir des cercles. La fonction +\foncGDD{CercleCP} définit le cercle par un centre et un point par lequel passe +le cercle. +\begin{colourband} +\macro|CercleCP(«a»,«b»)|\return{\typeGDD{cercle}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}, + centre du cercle ; + \item[\meta{b}:] \typeGDD{point}, + tel que \meta{b}$-$\meta{a} est le rayon. +\end{description}\index{CercleCP@\lstinline+CercleCP+} +\end{colourband} +\bigskip + + + +On peut aussi définir un cercle par deux points définissant son diamètre. La +fonction correspondante est la suivante + +\begin{colourband} +\macro|CercleD(«a»,«b»)|\return{\typeGDD{cercle}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair} ; + \item[\meta{b}:] \typeGDD{point} ou \typeMP{pair}, + tel que $($\meta{a}$-$\meta{b}$)$ est le diamètre du cercle. +\end{description}\index{CercleD@\lstinline+CercleD+} +\end{colourband} +\bigskip + +On peut aussi définir un cercle comme le cercle qui passe par trois points avec +la macro suivante. + +\begin{colourband} +\macro|CercleTroisPoints(«a»,«b»,«c»)|\return{\typeGDD{cercle}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair} ; + \item[\meta{b}:] \typeGDD{point} ou \typeMP{pair} ; + \item[\meta{c}:] \typeGDD{point} ou \typeMP{pair}. +\end{description}\index{CercleTroisPoints@\lstinline+CercleTroisPoints+} +\end{colourband} +\bigskip + + + + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(3,1); +B = Point(0,2); +O = Point(0,0); +r = 1.0; +COr = Cercle(O,r); +COA = CercleCP(O,A); +CAB = CercleD(A,B); +COAB = CercleTroisPoints(O,A,B); +trace COr; +trace COA; +trace CAB; +trace COAB; +pointe A; pointe B; pointe O; +endfig; +\end{ExempleMP} + +\subsubsection{Macros associées} + +De nombreuses macros sont associées aux cercles. + +On pourra récupérer le rayon d'un cercle avec la commande suivante. + + +\begin{colourband} +\macro|Rayon(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{cercle}. +\end{description}\index{Rayon@\lstinline+Rayon+} +\end{colourband} +\bigskip + +On pourra obtenir le centre (\typeGDD{point}) d'un cercle avec la commande : +\begin{colourband} +\macro|Centre(«a»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{cercle}, \typeGDD{ellipse} ou \typeGDD{hyperbole}. +\end{description}\index{Centre@\lstinline+Centre+} +\end{colourband} +\bigskip + +On peut calculer l'intersection entre deux cercles grâce à la macro suivante. + +\begin{colourband} +\macro|IntersectionCercles(«a»,«b»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{cercle} ; + \item[\meta{b}:] \typeGDD{cercle}. +\end{description}\index{IntersectionCercles@\lstinline+IntersectionCercles+} +\end{colourband} +\bigskip + +Cette macro ne donnera qu'un seul point d'intersection. Pour obtenir les deux +points d'intersection, il faudra inverser l'ordre d'appel sur les cercles comme +l'exemple suivant l'illustre. + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(0,0); +CA = Cercle(A,1); +B = Point(1.5,0); +CB = Cercle(B,2); +D1 = IntersectionCercles(CA,CB); +D2 = IntersectionCercles(CB,CA); +trace CA; trace CB; +pointe A; pointe B; pointe D1; pointe D2; +endfig; +\end{ExempleMP} + +Si il n'existe pas d'intersection, alors la compilation échouera avec l'erreur +\texttt{! Pythagorean subtraction X.XXXX+-+X.XXXX has been replaced by 0}. Si +les deux cercles sont confondus, alors l'erreur sera \texttt{! Division by zero.}. + +\mpgeomdd fournit aussi une macro permettant d'obtenir les intersections entre une +droite et un cercle. + +\begin{colourband} +\macro|IntersectionDroiteCercle(«d»,«c»,«n»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{d}:] \typeGDD{droite} ; + \item[\meta{c}:] \typeGDD{cercle} ; + \item[\meta{n}:] \typeMP{numeric} qui vaut 1 ou 2 suivant le point + d'intersection que l'on souhaite (s'il n'existe qu'un point d'intersection + alors les deux valeurs renvoient le même point). +\end{description}\index{IntersectionDroiteCercle@\lstinline+IntersectionDroiteCercle+} +\end{colourband} +\bigskip + +S'il n'existe pas d'intersection entre la droite et le cercle, vous obtiendrez +l'erreur \texttt{! Intersection between line and circle does not exist}. + +L'exemple suivant permet d'illuster cette macro. +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(2,2); +C_A = Cercle(A,1); +B = Point(0,1); +C = Point(4,2); +BC = Droite(B,C); +E1 = IntersectionDroiteCercle(BC,C_A,1); +trace C_A; +trace BC dashed evenly; +pointe A; pointe B; pointe C; pointe E1; +Fenetre(-0.5,-0.5,5,4); +endfig; +\end{ExempleMP} + + + +On peut obtenir les tangentes intérieures et extérieures communes à deux cercles +avec les deux macros suivantes. Là encore, comme il existe deux tangentes, pour +obtenir les deux, on inversera l'ordre d'appel des deux cercles. + +\begin{colourband} +\macro|TangenteCommuneExterieure(«a»,«b»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{a}:] \typeGDD{cercle} ; + \item[\meta{b}:] \typeGDD{cercle}. +\end{description}\index{TangenteCommuneExterieure@\lstinline+TangenteCommuneExterieure+} +\end{colourband} +\bigskip + + +\begin{colourband} +\macro|TangenteCommuneInterieure(«a»,«b»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{a}:] \typeGDD{cercle} ; + \item[\meta{b}:] \typeGDD{cercle}. +\end{description}\index{TangenteCommuneInterieure@\lstinline+TangenteCommuneInterieure+} +\end{colourband} +\bigskip + +L'exemple suivante illustre l'utilisation de ces deux macros. +\begin{ExempleMP}[sidebyside=false] +input geom2d; +beginfig(1); +C1 = Cercle((-2,0),2); +C2 = Cercle((1.5,0),1); +T1 = TangenteCommuneExterieure(C1,C2); +T2 = TangenteCommuneExterieure(C2,C1); +T3 = TangenteCommuneInterieure(C1,C2); +T4 = TangenteCommuneInterieure(C2,C1); +trace C1; trace C2; +trace T1; trace T2; +trace T3; trace T4; + +Fenetre(-5,-3,6,3); +endfig; +\end{ExempleMP} + +La macro suivante permet de calculer l'axe radical (\typeGDD{droite}) de deux +cercles\footnote{La méthode de construction a été largement inspirée du code de +T.~Thurston dans son document \emph{Drawing with \MP}~\cite{ctan-drawing-with-metapost}.}. +\begin{colourband} +\macro|AxeRadical(«a»,«b»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{a}:] \typeGDD{cercle} ; + \item[\meta{b}:] \typeGDD{cercle}. +\end{description}\index{AxeRadical@\lstinline+AxeRadical+} +\end{colourband} +\bigskip + +La macro suivante permet d'obtenir le centre radical de trois cercles. +\begin{colourband} +\macro|CentreRadical(«a»,«b»,«c»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{cercle} ; + \item[\meta{b}:] \typeGDD{cercle} ; + \item[\meta{c}:] \typeGDD{cercle}. +\end{description}\index{CentreRadical@\lstinline+CentreRadical+} +\end{colourband} +\bigskip + +La macro suivante permet de calculer l'axe de similitude de trois cercles. +\begin{colourband} +\macro|AxeDeSimilitude(«a»,«b»,«c»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{a}:] \typeGDD{cercle} ; + \item[\meta{b}:] \typeGDD{cercle} ; + \item[\meta{c}:] \typeGDD{cercle}. +\end{description}\index{AxeDeSimilitude@\lstinline+AxeDeSimilitude+} +\end{colourband} +\bigskip + +\subsection{Le type \typeGDD{ellipse}} +\subsubsection{Constructeurs} + +Les ellipses peuvent être définies de plusieurs façons. Tout d'abord, on peut la +définir avec son centre, un des points de l'ellipse sur le grand axe (appelé +vertex), et un des points de l'ellipse sur le petit axe (appelé co-vertex). +Cependant, lors de la création d'une ellipse de nombreux attributs sont calculés. + +Le code du contructeur est le suivant: +\begin{mpcode} +vardef Ellipse(expr C,A,B) = + % C : centre + % A : vertex + % B : co-vertex + save n,a,b,c,e,_tmp,slope; + pair _tmp; + n = incr gddO; + gddT[n] = "ellipse"; gddA[n] = PointImp(C); gddB[n] = PointImp(A); + gddC[n] = PointImp(B); + % calcul des deux foyers + a = Longueur(C,A); + b = Longueur(C,B); + c = sqrt(a**2-b**2); + e = c/a; + _tmp = e*(Pt(A)-Pt(C)); + % les foyers + gddD[n] = PairTOPoint(Pt(C)+_tmp); + gddE[n] = PairTOPoint(Pt(C)-_tmp); + gddX[n][1] = a; + gddX[n][2] = b; + gddX[n][3] = e; + % angle du demi-grand axe + slope = angle(PairImp(A)-PairImp(C)); + gddX[n][4] = slope; + n +enddef; +\end{mpcode} + +\begin{colourband} +\macro|Ellipse(«c»,«a»,«b»)|\return{\typeGDD{ellipse}} +\begin{description} + \item[\meta{c}:] \typeGDD{point} ou \typeMP{pair}, le centre ; + \item[\meta{a}:] \typeGDD{point} ou \typeMP{pair}, le vertex ; + \item[\meta{b}:] \typeGDD{point} ou \typeMP{pair}, le co-vertex. +\end{description}\index{Ellipse@\lstinline+Ellipse+} +\end{colourband} +\bigskip + +Cette macro s'utilise comme le montre l'exemple suivant. +\begin{ExempleMP} +input geom2d; +beginfig(1); +C = Point(0,0); +A = Point(3,1); +B = Rotation((1.5,0.5),Pi/2); +E = Ellipse(C,A,B); +trace E; +pointe A; pointe B; pointe C; +endfig; +\end{ExempleMP} + +On pourra définir une ellipse avec la donnée de ses deux foyers et du +demi-grand axe avec la commande suivante: +\begin{colourband} +\macro|EllipseF(«A»,«B»,«a»)|\return{\typeGDD{ellipse}} +\begin{description} + \item[\meta{A}:] \typeGDD{point} ou \typeMP{pair}, premier foyer ; + \item[\meta{B}:] \typeGDD{point} ou \typeMP{pair}, deuxième foyer ; + \item[\meta{a}:] \typeGDD{numeric}, le demi-grand axe. +\end{description}\index{EllipseF@\lstinline+EllipseF+} +\end{colourband} +\bigskip + + +Cette macro s'utilise comme le montre l'exemple suivant. +\begin{ExempleMP} +input geom2d; +beginfig(1); +F1 = Point(3,1); +F2 = Point(1.5,0.5); +E = EllipseF(F1,F2,1.7); +trace E; +pointe F1; pointe F2; +endfig; +\end{ExempleMP} + +\subsubsection{Macros associées} + +On pourra obtenir le centre (\typeGDD{point}) d'une ellipse avec la commande : +\begin{colourband} + \macro|Centre(«a»)|\return{\typeGDD{point}} + \begin{description} + \item[\meta{a}:] \typeGDD{cercle}, \typeGDD{ellipse} ou \typeGDD{hyperbole}. + \end{description}\index{Centre@\lstinline+Centre+} +\end{colourband} + +On obtient le vertex et le co-vertex avec les commandes suivantes: +\begin{colourband} +\macro|Vertex(«a»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}. +\end{description}\index{Vertex@\lstinline+Vertex+} +\end{colourband} +\bigskip + +\begin{colourband} +\macro|CoVertex(«a»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}. +\end{description}\index{CoVertex@\lstinline+CoVertex+} +\end{colourband} +\bigskip + +La commande suivante permet d'obtenir les deux foyers selon l'entier passé en +argument. +\begin{colourband} +\macro|Foyer(«a»,«n»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse} ; + \item[\meta{n}:] \typeMP{numeric}, entier qui vaut 1 ou 2 pour obtenir chaque + foyer. +\end{description}\index{Foyer@\lstinline+Foyer+} +\end{colourband} +\bigskip + +On peut obtenir le demi-grand axe et le demi-petit axe avec les commandes +suivantes. +\begin{colourband} +\macro|DemiGrandAxe(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}. +\end{description}\index{DemiGrandAxe@\lstinline+DemiGrandAxe+} +\end{colourband} +\bigskip + + +\begin{colourband} +\macro|DemiPetitAxe(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}. +\end{description}\index{DemiPetitAxe@\lstinline+DemiPetitAxe+} +\end{colourband} +\bigskip + +On obtient l'excentricité, souvent notée $e$, avec la commande suivante. + +\begin{colourband} +\macro|Excentricite(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}, \typeGDD{parabole} ou \typeGDD{hyperbole}. +\end{description}\index{Excentricite@\lstinline+Excentricite+} +\end{colourband} +\bigskip + +Pour obtenir l'inclinaison (coefficient directeur de la droite passant par les +foyers de l'ellipse), on utilisera la commande suivante. + +\begin{colourband} +\macro|Inclinaison(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}, \typeGDD{parabole} ou \typeGDD{hyperbole}. +\end{description}\index{Inclinaison@\lstinline+Inclinaison+} +\end{colourband} +\bigskip + +Pour obtenir la tangente (\typeGDD{droite}) à un point de l'ellipse, on +utilisera la commande suivante. + +\begin{colourband} +\macro|TangenteEllipse(«e»,«p»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{e}:] \typeGDD{ellipse} ; + \item[\meta{p}:] \typeGDD{point} ou \typeMP{pair}. +\end{description}\index{TangenteEllipse@\lstinline+TangenteEllipse+} +\end{colourband} +\bigskip + +\begin{ExempleMP} +input geom2d; +beginfig(1); +F1 = Point(3,1); +F2 = Point(1.5,0.5); +E = EllipseF(F1,F2,2.4); +pointe F1; pointe F2; +trace E; +M' = PointDe(E,0.5); +D = TangenteEllipse(E,M'); +trace D; +pointe M'; +pointe Foyer(E,1); +pointe Foyer(E,2); +Fenetre(-0.2,-2.5,6,4); +endfig; +\end{ExempleMP} + + +Pour obtenir les tangentes (\typeGDD{droite}) passant par un point extérieur à +l'ellipse, on utilisera la commande suivante. Si le point choisi n'est pas +extérieur à l'ellipse, alors il y aura une erreur de compilation. + +\begin{colourband} +\macro|TangenteExterieureEllipse(«e»,«p»,«n»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{e}:] \typeGDD{ellipse} ; + \item[\meta{p}:] \typeGDD{point} ou \typeGDD{pair} ; + \item[\meta{n}:] \typeMP{numeric} qui vaut 1 ou 2 pour choisir la tangente + parmi les deux possibles. +\end{description}\index{TangenteExterieureEllipse@\lstinline+TangenteExterieureEllipse+} +\end{colourband} +\bigskip + +Les points de tangence sont accessibles comme deuxième point de la définition de +la \typeGDD{droite} grâce à la table \variableGDD{gddB[]}. + +\begin{ExempleMP} +input geom2d; +beginfig(1); +F1 = Point(3,1); +F2 = Point(1.5,0.5); +E = EllipseF(F1,F2,2.4); +pointe F1; pointe F2; +trace E; +M = Point(4,3); +D1 = TangenteExterieureEllipse(E,M,1); +trace D1; +pointe gddB[D1]; +D2 = TangenteExterieureEllipse(E,M,2); +trace D2; +pointe gddB[D2]; +pointe M; +pointe Foyer(E,1); +pointe Foyer(E,2); +Fenetre(-0.2,-2.5,6,4); +endfig; +\end{ExempleMP} + +\subsection{Le type \typeGDD{parabole}} + +Le constructeur de base de la parabole définit cet objet à partir du foyer et +de la directrice. + +Le code du constructeur est le suivant: +\begin{mpcode} +vardef ParaboleFD(expr F,D) = + % F : foyer (point) + % D : directrice (droite) + save u, v, w, d, i, n,_tmp,slope; + pair _tmp; + n = incr gddO; + (u,v,w) = EquationDroite(D); + % ordonnée relative + d := u * gddA[F] + v * gddB[F] + w; + gddT[n] := "parabole"; + gddX[n][1] := D; % on stocke la directrice + gddX[n][2] := D; % on stocke la directrice (compatibilité avec hyperbole) + % sommet + _tmp := (((-d/2)*(u,v)) shifted PairImp(F)); + gddB[n] = PointImp(_tmp); + gddC[n] = PointImp(_tmp); + % le foyer (doublé pour compatibilité) + gddD[n] := F; + gddE[n] := F; + gddX[n][3] := 1.0; % excentricité + % angle du demi-grand axe + slope = angle(PairImp(gddA[D])-PairImp(gddB[D]))+90; + gddX[n][4] = slope; + i := -gddC2Dparam-1; + gddP[n] := ( + ((i*(v,-u)+((i*i-d*d)/(2d))*(u,v)) + for i:= -gddC2Dparam upto gddC2Dparam: + ..(i*(v,-u)+((i*i-d*d)/(2d))*(u,v)) + endfor)) shifted PairImp(F); + n +enddef; +\end{mpcode} + +\begin{colourband} + \macro|ParaboleFD(«f»,«d»)|\return{\typeGDD{chemin}} + \begin{description} + \item[\meta{f}:] est le foyer (\typeGDD{point}) de la parabole; + \item[\meta{d}:] est la directrice (\typeGDD{droite}) de la parabole. + \end{description} + \index{ParaboleFD@\lstinline+ParaboleFD+} +\end{colourband} + +Lors de la représentation d'une parabole, le caractère \emph{infini} est géré +par la variable globale \lstinline+gddC2Dparam+ qui vaut 15 par défaut. + +\subsubsection{Fonctions associées} + + +On obtient l'excentricité, souvent notée $e$, avec la commande suivante. + +\begin{colourband} +\macro|Excentricite(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}, \typeGDD{parabole} ou \typeGDD{hyperbole}. +\end{description}\index{Excentricite@\lstinline+Excentricite+} +\end{colourband} +\bigskip + + +Pour obtenir l'inclinaison (coefficient directeur de la droite axe de symétrie +de la parabole), on utilisera la commande suivante: + +\begin{colourband} +\macro|Inclinaison(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}, \typeGDD{parabole} ou \typeGDD{hyperbole}. +\end{description}\index{Inclinaison@\lstinline+Inclinaison+} +\end{colourband} +\bigskip + +On peut obtenir le sommet de la parabole avec la commande suivante: + +\begin{colourband} +\macro|Sommet(«a»,«n»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{parabole} ou \typeGDD{hyperbole} ; + \item[\meta{n}:] 1 ou 2 (\typeMP{numeric}), argument utile pour l'hyperbole + qui possède deux sommets. Ici, peu importe la valeur de \meta{n}, l'unique + sommet sera donné. +\end{description}\index{Sommet@\lstinline+Sommet+} +\end{colourband} +\bigskip + +On peut obtenir la directrice de la parabole avec la commande suivante: + +\begin{colourband} +\macro|Directrice(«a»,«n»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{a}:] \typeGDD{parabole} ou \typeGDD{hyperbole} ; + \item[\meta{n}:] 1 ou 2 (\typeMP{numeric}), argument utile pour l'hyperbole + qui possède deux directrices. Ici, peu importe la valeur de \meta{n}, + l'unique directrice sera donnée. +\end{description}\index{Directrice@\lstinline+Directrice+} +\end{colourband} +\bigskip + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(0,0); +B = Point(3,2); +AB = Droite(A,B); +F = Point(-1,1); +Para = ParaboleFD(F,AB); +trace AB; +trace Para; +pointe Sommet(Para,1); +pointe F; +Fenetre(-4,-5,2,5); +endfig; +\end{ExempleMP} + + +\subsection{Le type \typeGDD{hyperbole}} + +Le constructeur de base de l'hyperbole définit cet objet à partir du foyer et +de la directrice. + +Le code du constructeur est le suivant: +\begin{mpcode} +vardef HyperboleFD(expr F,D,e) = + % F : foyer (point) + % D : directrice (droite) + % e : exentricité (numeric) + % pm : +1 ou -1 pour les deux branches + save u, v, w, d, i, n,_tmp,slope,aa,bb; + pair _tmp; + n = incr gddO; + + (u,v,w) = EquationDroite(D); + d := u * gddA[F] + v * gddB[F] + w; + gddT[n] := "hyperbole"; + + % sommets + _tmp := -(d+1*sqrt(e*e*d*d))/(e*e-1)*(u,v)shifted (ProduitScalaire(F,Vecteur(v,-u))*(v,-u)); + gddB[n] := PointImp(_tmp); + _tmp := -(d-1*sqrt(e*e*d*d))/(e*e-1)*(u,v)shifted + (ProduitScalaire(F,Vecteur(v,-u))*(v,-u)); + gddC[n] := PointImp(_tmp); + % centre comme milieu des deux sommets + gddA[n] = Milieu(gddB[n],gddC[n]); + % le foyer (doublé pour compatibilité) + gddD[n] := F; + gddE[n] := RotationCentre(F, gddA[n], Pi); + gddX[n][3] := e; % excentricité + % directrices + gddX[n][1] := D; % on stocke la directrice + gddX[n][2] := Droite(RotationCentre(gddA[D], gddA[n], Pi),RotationCentre(gddB[D], gddA[n], Pi)); + % angle de l'axe + slope = angle(PairImp(gddA[D])-PairImp(gddB[D]))+90; + gddX[n][4] = slope; + % cercle principale + gddX[n][5] = CercleD(gddB[n],gddC[n]); + % asymptotes + aa = IntersectionDroiteCercle(D,gddX[n][5],1); + bb = IntersectionDroiteCercle(D,gddX[n][5],2); + gddX[n][6] = Droite(gddA[n],aa); + gddX[n][7] = Droite(gddA[n],bb); + % tracés des moitiés + i := -gddC2Dparam-1; + gddPX[n][1] := ( + ( + (i*(v,-u)-(d+sqrt(e*e*d*d+i*i*(e*e-1)))/(e*e-1)*(u,v)) + for i:= -gddC2Dparam upto gddC2Dparam: + ..(i*(v,-u)-(d+sqrt(e*e*d*d+i*i*(e*e-1)))/(e*e-1)*(u,v)) + endfor + ) shifted (ProduitScalaire(F,Vecteur(v,-u))*(v,-u)) + ); + gddPX[n][2] := ( + ( + (i*(v,-u)-(d-sqrt(e*e*d*d+i*i*(e*e-1)))/(e*e-1)*(u,v)) + for i:= -gddC2Dparam upto gddC2Dparam: + ..(i*(v,-u)-(d-sqrt(e*e*d*d+i*i*(e*e-1)))/(e*e-1)*(u,v)) + endfor + ) shifted (ProduitScalaire(F,Vecteur(v,-u))*(v,-u)) + ); + n +enddef; +\end{mpcode} + +On peut voir dans ce constructeur l'utilisation de la table de \typeMP{path} +étendu \variableGDD{gddPX[][]} qui permet d'associer plusieurs \typeMP{path}s à +un seul objet. + +\begin{colourband} + \macro|HyperboleFD(«f»,«d»,«e»)|\return{\typeGDD{chemin}} + \begin{description} + \item[\meta{f}:] est le foyer (\typeGDD{point}) de la parabole; + \item[\meta{d}:] est la directrice (\typeGDD{droite}) de la parabole; + \item[\meta{e}:] est l'excentricité de l'hyperbole. + \end{description} + \index{HyperboleFD@\lstinline+HyperboleFD+} +\end{colourband} + +\subsubsection{Fonctions associées} + +On pourra obtenir le centre (\typeGDD{point}) d'une hyperbole avec la commande : +\begin{colourband} + \macro|Centre(«a»)|\return{\typeGDD{point}} + \begin{description} + \item[\meta{a}:] \typeGDD{cercle}, \typeGDD{ellipse} ou \typeGDD{hyperbole}. + \end{description}\index{Centre@\lstinline+Centre+} +\end{colourband} + + +On obtient l'excentricité, souvent notée $e$, avec la commande suivante. + +\begin{colourband} +\macro|Excentricite(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}, \typeGDD{parabole} ou \typeGDD{hyperbole}. +\end{description}\index{Excentricite@\lstinline+Excentricite+} +\end{colourband} +\bigskip + + +Pour obtenir l'inclinaison (coefficient directeur de la droite passant par les +foyers de l'hyperbole), on utilisera la commande suivante. + +\begin{colourband} +\macro|Inclinaison(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{ellipse}, \typeGDD{parabole} ou \typeGDD{hyperbole}. +\end{description}\index{Inclinaison@\lstinline+Inclinaison+} +\end{colourband} +\bigskip + +On peut obtenir les sommets de l'hyperbole avec la commande suivante: + +\begin{colourband} +\macro|Sommet(«a»,«n»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{parabole} ou \typeGDD{hyperbole} ; + \item[\meta{n}:] 1 ou 2 (\typeMP{numeric}), pour choisir l'un des deux sommets. +\end{description}\index{Sommet@\lstinline+Sommet+} +\end{colourband} +\bigskip + +On peut obtenir les directrices de l'hyperbole avec la commande suivante: + +\begin{colourband} +\macro|Directrice(«a»,«n»)|\return{\typeGDD{droite}} +\begin{description} + \item[\meta{a}:] \typeGDD{parabole} ou \typeGDD{hyperbole} ; + \item[\meta{n}:] 1 ou 2 (\typeMP{numeric}), pour choisir l'une des deux + directrices. +\end{description}\index{Directrice@\lstinline+Directrice+} +\end{colourband} +\bigskip + +Pour obtenir le \emph{cercle principal} de l'hyperbole, on pourra utiliser la +commande suivante: + + +\begin{colourband} + \macro|CerclePrincipale(«h»)|\return{\typeGDD{cercle}} + \begin{description} + \item[\meta{h}:] \typeGDD{hyperbole}. + \end{description}\index{CerclePrincipale@\lstinline+CerclePrincipale+} +\end{colourband} +\bigskip + +On pourra aussi obtenir les deux asymptotes de l'hyperbole avec la commande +suivante: + +\begin{colourband} + \macro|AsymptoteHyperbole(«h»,«n»)|\return{\typeGDD{droite}} + \begin{description} + \item[\meta{h}:] \typeGDD{hyperbole} ; + \item[\meta{n}:] 1 ou 2 (\typeMP{numeric}), pour choisir l'une des deux + asymptotes. + \end{description}\index{AsymptoteHyperbole@\lstinline+AsymptoteHyperbole+} +\end{colourband} +\bigskip + +Parce qu'une hyperbole est constituée de deux parties disjointes, on ne peut +pas, comme pour les autres objets \mpgeomdd, utiliser directement la commande +\lstinline+trace+ directement sur l'objet. Il faudra utiliser la commande +suivante pour obtenir le \typeMP{path} associé à une des deux parties de +l'hyperbole. + +\begin{colourband} + \macro|DemiHyperbole(«h»,«n»)|\return{\typeGDD{path}} + \begin{description} + \item[\meta{h}:] \typeGDD{hyperbole} ; + \item[\meta{n}:] 1 ou 2 (\typeMP{numeric}), pour choisir l'une des deux + parties. + \end{description}\index{DemiHyperbole@\lstinline+DemiHyperbole+} +\end{colourband} +\bigskip + + + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(0,0); +B = Point(3,2); +AB = Droite(A,B); +F = Point(-1,1); +Hyper = HyperboleFD(F,AB,1.5); +trace AB; +trace DemiHyperbole(Hyper,1); +trace DemiHyperbole(Hyper,2); +trace Directrice(Hyper,2); +trace CerclePrincipale(Hyper) dashed evenly; +trace AsymptoteHyperbole(Hyper,1) dashed evenly; +trace AsymptoteHyperbole(Hyper,2) dashed evenly; +pointe Centre(Hyper); +pointe Foyer(Hyper,1); +pointe Foyer(Hyper,2); +pointe Sommet(Hyper,1); +pointe Sommet(Hyper,2); +Fenetre(-3,-5,3,5); +endfig; +\end{ExempleMP} + + +\subsection{Le type \typeGDD{triangle}} + +Les triangles sont définis par trois +points de $\R^2$. + +\subsubsection{Constructeur} +La fonction créatrice de cet objet est la suivante +\begin{mpcode} +vardef Triangle (expr a,b,c) = + save n; n = incr gddO; gddT[n] = "triangle"; + gddA[n] = PointImp(a); gddB[n] = PointImp(b); gddC[n] = PointImp(c); n +enddef; +\end{mpcode} + +\begin{colourband} +\macro|Triangle(«a»,«b»,«c»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{point} ; + \item[\meta{b}:] \typeGDD{point} ; + \item[\meta{c}:] \typeGDD{point}. +\end{description}\index{Triangle@\lstinline+Triangle+} +\end{colourband} + + +\bigskip + +Ici, on voit l'appel à la troisième table \variableGDD{gddC} pour stocker le +troisième point. + +Un triangle se définit alors comme ceci: +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(3,1); +B = Point(1,3); +C = Point(0,0); +ABC = Triangle(A,B,C); +trace ABC; +endfig; +\end{ExempleMP} + +\subsubsection{Macros associées} + +La macro suivante permet de calculer l'aire d'un triangle. +\begin{colourband} +\macro|AireTriangle(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{triangle}. +\end{description}\index{AireTriangle@\lstinline+AireTriangle+} +\end{colourband} + +On peut calculer aussi l'orthocentre d'un triangle avec la commande suivante. +\begin{colourband} +\macro|Orthocentre(«a»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{triangle}. +\end{description}\index{Orthocentre@\lstinline+Orthocentre+} +\end{colourband} + +La macro suivante calcule le cercle inscrit d'un triangle. +\begin{colourband} +\macro|CercleInscrit(«a»)|\return{\typeGDD{cercle}} +\begin{description} + \item[\meta{a}:] \typeGDD{triangle}. +\end{description}\index{CercleInscrit@\lstinline+CercleInscrit+} +\end{colourband} + +On peut aussi obtenir le cercle circonscrit avec la macro suivante. +\begin{colourband} +\macro|CercleCirconscrit(«a»)|\return{\typeGDD{cercle}} +\begin{description} + \item[\meta{a}:] \typeGDD{triangle}. +\end{description}\index{CercleCirconscrit@\lstinline+CercleCirconscrit+} +\end{colourband} + +On peut aussi calculer les cercles exinscrits. Soient $A$, $B$ et $C$ trois points +définissant un triangle $ABC$\footnote{Évidemment, les points peuvent s'appeler +autrement.}. La commande suivante permet d'obtenir, au choix, un des trois +cercles exinscrits. +\begin{colourband} +\macro|CercleExinscrit(«a»,«n»)|\return{\typeGDD{cercle}} +\begin{description} + \item[\meta{a}:] \typeGDD{triangle} ; + \item[\meta{n}:] \typeMP{numeric} qui vaut 1, 2 ou 3. Si \meta{n}$=1$, c'est + le cercle exinscrit tangent au côté $[BC]$ du triangle, si \meta{n}$=2$, c'est + celui tangent au côté $[AC]$ et si \meta{n}$=3$, c'est celui tangent au côté $[AB]$. +\end{description}\index{CercleExinscrit@\lstinline+CercleExinscrit+} +\end{colourband} + +On peut aussi obtenir le cercle d'Euler d'un triangle avec la commande suivante. +\begin{colourband} +\macro|CercleEuler(«a»)|\return{\typeGDD{cercle}} +\begin{description} + \item[\meta{a}:] \typeGDD{triangle}. +\end{description}\index{CercleEuler@\lstinline+CercleEuler+} +\end{colourband} + +Voici un exemple d'illustration des quelques unes des macros relatives aux +triangles. +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(3,1); +B = Point(1,3); +C = Point(0,0); +AB = Droite(A,B); +BC = Droite(B,C); +ABC = Triangle(A,B,C); +trace AB dashed evenly; +trace BC dashed evenly; +trace ABC avecCrayon(1.5,black); +Euler = CercleEuler(ABC); +trace Euler avecCrayon(1,DarkRed); +C_E1 = CercleExinscrit(ABC,2); +trace C_E1 avecCrayon(1,LightBlue); +C_C = CercleCirconscrit(ABC); +trace C_C avecCrayon(1,LightCoral); +Fenetre(-1,-4,4,4); +endfig; +\end{ExempleMP} + +\subsection{Le type \typeGDD{polygone}} +Les triangles sont définis par $N$ +points de $\R^2$. + +\subsubsection{Constructeurs} + +La fonction créatrice de cet objet est la suivante +\begin{mpcode} +vardef Polygone (text plist) = + save n,_point,i; n = incr gddO; gddT[n] = "polygone"; + i:=1; + for _point = plist: + gddX[gddO][i] = PointImp(_point); + i:=i+1; + endfor + gddA[n] = i-1; % nombre de côté + gddB[n] = IsoBarycentre(plist); % centre + n +enddef; +\end{mpcode} + +\begin{colourband} +\macro|Polygone(«liste»)|\return{\typeGDD{polygone}} +\begin{description} + \item[\meta{liste}:] est une liste de \typeGDD{point} ou de \typeMP{pair}. +\end{description}\index{Polygone@\lstinline+Polygone+} +\end{colourband} + + +\bigskip + +Ici, on voit l'appel à la \emph{double} table \variableGDD{gddX} pour stocker +les $N$ points. + +Un polygone se définit alors comme ceci: +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(2,0); +B = Point(3,1); +C = Point(0,2); +D = Point(0,0); +P = Polygone(A,B,C,D); +trace P; +endfig; +\end{ExempleMP} + +On pourra aussi construire des polygones réguliers avec la commande suivante. +\begin{colourband} +\macro|PolygoneRegulier(«N»,«rayon»,«rotation»,«translation»)|\return{\typeGDD{polygone}} +\begin{description} + \item[\meta{N}:] entier (\typeMP{numeric}) indiquant le nombre de points ; + \item[\meta{rayon}:] \typeMP{numeric}, rayon du cercle circonscrit ; + \item[\meta{rotation}:] \typeMP{numeric}, rotation du polygone ; + \item[\meta{translation}:] \typeGDD(point) ou \typeGDD{vecteur} (ou même + \typeMP{pair}), déplacement du centre du polygone. +\end{description}\index{PolygoneRegulier@\lstinline+PolygoneRegulier+} +\end{colourband} + +\begin{ExempleMP} + input geom2d; + beginfig(1); + P = PolygoneRegulier(7,3,0,origine); + trace P; + endfig; + \end{ExempleMP} + +\subsubsection{Macros associées} + +On pourra obtenir le nombre de côté d'un polygone avec la commande suivante. + +\begin{colourband} +\macro|NombreCotesPolygone(«a»)|\return{\typeMP{numeric}} +\begin{description} + \item[\meta{a}:] \typeGDD{polygone}. +\end{description}\index{NombreCotesPolygone@\lstinline+NombreCotesPolygone+} +\end{colourband} +\bigskip + +On pourra avoir accès aux différents sommets du polygone, numérotés à partir de +1, avec la macro suivante. + +\begin{colourband} +\macro|PointPolygone(«a»,«i»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{a}:] \typeGDD{polygone} ; + \item[\meta{i}:] \typeMP{numeric}, entier plus grand que 1, permettant + d'accéder au $i$\ieme{} point du polygone. +\end{description}\index{PointPolygone@\lstinline+PointPolygone+} +\end{colourband} + \bigskip + +\subsection{Le type \typeGDD{chemin}} Pour ce type particulier, \mpgeomdd stocke +le \typeMP{path} dans la table \variableGDD{gddP} réservée. Ainsi la fonction +créatrice de ce type d'objet est la suivante +\begin{mpcode} +vardef Chemin (expr p) = +gddT[incr gddO] = "chemin"; gddP[gddO] = p; gddO +enddef; +\end{mpcode} +\begin{colourband} +\macro|Chemin(«p»)|\return{\typeGDD{chemin}} +\begin{description} + \item[\meta{p}:] un \typeMP{path} de \MP +\end{description}\index{Chemin@\lstinline+Chemin+} +\end{colourband} + + +\subsubsection{Macros associées} + +La macro suivante contruit, à partir d'une liste de \typeGDD{point}s, une ligne +brisée de type \typeGDD{chemin}. + +\begin{colourband} + \macro|LigneBrisee(«liste»)|\return{\typeGDD{chemin}} + \begin{description} + \item[\meta{liste}:] est une liste de \typeGDD{point} ou de \typeMP{pair}. + \end{description}\index{LigneBrisee@\lstinline+LigneBrisee+} +\end{colourband} + + +\subsection{Le type \typeGDD{courbe}} + +Pour ce type particulier, \mpgeomdd stocke +une chaine de caractère (un nom de fichier à exploiter avec l'extension +\fichier{graph.mp}) dans la table \variableGDD{gddS} réservée. + +\subsubsection{Constructeur} + +Ainsi la fonction +créatrice de ce type d'objet est la suivante +\begin{mpcode} +vardef CourbeDat (expr s) = + gddT[incr gddO] = "courbe"; gddS[gddO] = s; gddO +enddef; +\end{mpcode} +\begin{colourband} +\macro|CourbeDat(«s»)|\return{\typeGDD{courbe}} +\begin{description} + \item[\meta{s}:] un nom de fichier sous forme de \typeMP{string} de \MP +\end{description}\index{CourbeDat@\lstinline+CourbeDat+} +\end{colourband} + +\bigskip + +\section{Arc de cercle} + +Avec \mpgeomdd{}, quelques commandes permettent de travailler avec les arcs de +cercle. Tout d'abord, on peut décider de ne représenter qu'un arc de cercle d'un +\typeGDD{cercle} précédemment défini. Ceci se fait avec la commande suivante qui +prend en argument un \typeGDD{cercle} et deux angles en radian, et retourne un +\typeMP{path} de \MP{} correspondant à l'arc de cercle compris entre les deux +angles donnés (l'angle 0 étant parallèle à l'axe $Ox$). + +\begin{colourband} +\macro|gddTraceArcDeCercle(«C»,«a»,«b»)|\return{\typeMP{path}} +\begin{description} + \item[\meta{C}:] \typeGDD{cercle} dont on souhaite représenter un arc ; + \item[\meta{a}:] premier angle en radian (\typeMP{numeric}) ; + \item[\meta{b}:] deuxième angle en radian (\typeMP{numeric}). +\end{description}\index{gddTraceArcDeCercle@\lstinline+gddTraceArcDeCercle+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +C = Cercle(origine,2); +trace C; +trace gddTraceArcDeCercle(C,Pi/3,Pi) avecCrayon(2,DarkRed); +endfig; +\end{ExempleMP} + +On peut aussi définir un objet \typeGDD{chemin}. Pour cela on pourra utiliser +les deux commandes suivantes. La première permet de définir un arc de cercle à +partir d'un point, d'un rayon et de deux angles. + +\begin{colourband} +\macro|Arc(«P»,«r»,«a»,«b»)|\return{\typeGDD{chemin}} +\begin{description} + \item[\meta{P}:] \typeGDD{point} ou \typeMP{pair} centre de l'arc de cercle ; + \item[\meta{r}:] rayon de l'arc de cercle (\typeMP{numeric}) ; + \item[\meta{a}:] premier angle en radian (\typeMP{numeric}) ; + \item[\meta{b}:] premier angle en radian (\typeMP{numeric}). +\end{description}\index{Arc@\lstinline+Arc+} +\end{colourband} + + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(2,2); +Ac = Arc(A,2,Pi/3,Pi); +pointe A; +trace Ac; +endfig; +\end{ExempleMP} + +La deuxième commande définissant un \typeGDD{chemin} est la suivante. Elle prend +comme arguments trois points, notons les $C$, $A$ et $B$ : le centre de l'arc de +cercle $C$, et les points $A$ et $B$. Elle prend ensuite comme argument le rayon +de l'arc défini entre les segments $[C,A]$ et $[C,B]$. + +\begin{colourband} +\macro|ArcEntrePoints(«P»,«r»,«A»,«B»,«s»)|\return{\typeGDD{chemin}} +\begin{description} + \item[\meta{P}:] \typeGDD{point} ou \typeMP{pair} centre de l'arc de cercle ; + \item[\meta{r}:] rayon de l'arc de cercle (\typeMP{numeric}) ; + \item[\meta{A}:] premier \typeGDD{point} ou \typeMP{pair} ; + \item[\meta{B}:] deuxième \typeGDD{point} ou \typeMP{pair} ; + \item[\meta{s}:] \typeMP{numeric}, $-1$ ou $1$ suivant le sens choisi. +\end{description}\index{Arc@\lstinline+Arc+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +C = Point(0,0); +A = Point(2,2); +B = Point(0,3); +Cab = ArcEntrePoints(C,1,A,B,1); +Cba = ArcEntrePoints(C,1,A,B,-1); +trace Segment(C,A); +trace Segment(C,B); +pointe A; pointe B; pointe C; +fleche Cab; +fleche Cba avecCrayon(1,DarkRed); +endfig; +\end{ExempleMP} + + +\section{Quelques transformations} + +\subsection{Homothétie} + +On peut réaliser une homothétie sur n'importe quel objet \mpgeomdd avec la commande +suivante. + +\begin{colourband} +\macro|Homothetie(«p»,«o»,«k»)|\return{du même type que \meta{p}} +\begin{description} + \item[\meta{p}:] un objet \mpgeomdd ; + \item[\meta{o}:] \typeGDD{point} ou \typeMP{pair}, centre de l'homothétie ; + \item[\meta{k}:] \typeMP{numeric}, facteur de l'homothétie. +\end{description}\index{Homothetie@\lstinline+Homothetie+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,2); +B = Point(0,2); +C_B = Cercle(B,1); +T = Triangle((1,1),(0,0),(0,1)); +C_H = Homothetie(C_B, A, 2); +T_H = Homothetie(T, A ,-1); +trace C_B; trace C_H; +trace T; trace T_H; +pointe A; pointe B; +endfig; +\end{ExempleMP} + +\subsection{Symétrie axiale} + +On peut réaliser une symétrie axiale sur n'importe quel objet \mpgeomdd avec la +commande suivante. + +\begin{colourband} +\macro|SymetrieAxiale(«p»,«d»)|\return{du même type que \meta{p}} +\begin{description} + \item[\meta{p}:] un objet \mpgeomdd ; + \item[\meta{d}:] \typeGDD{droite} définissant l'axe de symétrie. +\end{description}\index{SymetrieAxiale@\lstinline+SymetrieAxiale+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,2); +B = Point(0,2); +C_B = Cercle(B,1); +T = Triangle((1,1),(0,0),(0,1)); +D = Droite((-1,0),(3,-1)); +C_H = SymetrieAxiale(C_B, D); +T_H = SymetrieAxiale(T, D); +trace C_B; trace C_H; +trace T; trace T_H; +trace D; +pointe A; pointe B; +Fenetre(-2.5,-3.5,3,3.2); +endfig; +\end{ExempleMP} + +\subsection{Symétrie centrale} + +On peut réaliser une symétrie centrale sur n'importe quel objet \mpgeomdd avec la +commande suivante. + +\begin{colourband} +\macro|SymetrieCentrale(«p»,«d»)|\return{du même type que \meta{p}} +\begin{description} + \item[\meta{p}:] un objet \mpgeomdd ; + \item[\meta{d}:] \typeGDD{point} définissant le centre de symétrie. +\end{description}\index{SymetrieCentrale@\lstinline+SymetrieCentrale+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,2); +B = Point(0,2); +C_B = Cercle(B,1); +T = Triangle((1,1),(0,0),(0,1)); +D = Point(-1,0); +C_H = SymetrieCentrale(C_B, D); +T_H = SymetrieCentrale(T, D); +trace C_B; trace C_H; +trace T; trace T_H; +pointe D; +pointe A; pointe B; +Fenetre(-3.5,-3.5,3,3.2); +endfig; +\end{ExempleMP} + +\subsection{Inversion} + +On peut calculer l'inversion d'un point, d'un cercle ou d'une droite par rapport à un cercle avec la macro +suivante. +\begin{colourband} +\macro|Inversion(«p»,«c»)|\return{\typeGDD{point}} +\begin{description} + \item[\meta{p}:] \typeGDD{point}, \typeGDD{cercle} ou \typeGDD{droite} ; + \item[\meta{c}:] \typeGDD{cercle}. +\end{description}\index{Inversion@\lstinline+Inversion+} +\end{colourband} +\bigskip + +\begin{ExempleMP} +input geom2d; +beginfig(1); + A = Point(2,2); + C = Cercle(A,2); + trace C; + marque.rt "A"; + B = Point(-0.5,1); + D = Inversion(B,C); + drawoptions(withcolor DarkRed); + marque.rt "B"; marque.rt "D"; + + drawoptions(withcolor DarkBlue); + E = Point(3,1); + CE = Cercle(E,0.5); + trace CE; + marque.rt "E"; + iCE = Inversion(CE,C); + trace iCE; + + + drawoptions(withcolor DarkGreen); + d = Droite((3,3),(4,2)); + trace d; + Cd = Inversion(d,C); + trace Cd; + Fenetre(-1,-1,5.5,6); +endfig; +\end{ExempleMP} + + +\section{Annotations et labels} + +\subsection{Signes} + +\mpgeomdd fournit la macro suivante pour marquer un angle droit formé par trois +points: +\begin{colourband} +\macro|SigneOrtho(«a»,«b»,«c»,«x»)| +\begin{description} + \item[\meta{a},\meta{b},\meta{c}:] sont les trois \typeGDD{point}s formant + l'angle droit $\widehat{ABC}$ ; + \item[\meta{x}:] est la \og{}taille\fg{} (\typeMP{numeric}) du signe d'orthogonalité. +\end{description}\index{SigneOrtho@\lstinline+SigneOrtho+} +\end{colourband} + +On peut aussi réaliser des marques entre deux points ou sur un segment, un +vecteur, ou tout type d'objet. Pour cela, la première macro est la suivante: +\begin{colourband} +\macro|Marque(«a»,«b»,«n»)| +\begin{description} + \item[\meta{a}:] premier \typeGDD{point} formant + le segment à marquer; + \item[\meta{b}:] deuxième \typeGDD{point} formant + le segment à marquer; + \item[\meta{n}:] est le type (\typeMP{numeric}) de marque, il y en a quatre + \meta{n}$=1$, $2$, $3$ ou $4$. +\end{description}\index{Marque@\lstinline+Marque+} +\end{colourband} + +On peut aussi marquer n'importe quel type de trait avec la macro suivante: +\begin{colourband} +\macro|MarqueTrait(«a»,«n»)| +\begin{description} + \item[\meta{a}:] est n'importe quel objet \mpgeomdd ou même un \typeMP{path} \MP; + \item[\meta{n}:] est le type (\typeMP{numeric}) de marque, il y en a quatre + \meta{n}$=1$, $2$, $3$ ou $4$. +\end{description}\index{MarqueTrait@\lstinline+MarqueTrait+} +\end{colourband} + + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(4,0); +B = Point(0,0); +C = Point(0,2); +trace Segment(B,A); +trace Segment(B,C); +marque.bot "A"; +marque.bot "B"; +marque.lft "C"; +trace SigneOrtho(A,B,C,0.5); +trace Marque(A,B,1); +trace MarqueTrait(Segment(B,C),3); +endfig; +\end{ExempleMP} + + +\subsection{Labels} + +Comme le code produit avec \mpgeomdd est un code \MP{}\cite{ctan-metapost}, on peut utiliser les outils +classiques de labélisation. Cependant, pour permettre plus de flexibilité (et +notamment une compatibilité avec \hologo{LuaLaTeX} et +\package{luamplib}~\cite{ctan-luamplib} ou +\package{minim-mp}~\cite{ctan-minim-mp}), si le code est compilé avec \MP{}, +alors le package~\package{latexmp}~\cite{ctan-latexmp} est chargé et fournit la +commande \lstinline+textext()+. + +De plus, \mpgeomdd fournit quelques commandes pour se faciliter la vie. + +On peut marquer les points avec la commande suivante. Cette commande +\emph{pointe} le point (avec la commande \lstinline+pointe+, voir +section~\ref{sec:trace}) et inscrit un label. +\begin{colourband} +\macro|marque.«place» "«nom»"| +\begin{description} + \item[\meta{place}:] peut être les classiques placement de \MP{} : + \lstinline+top+, \lstinline+bot+, \lstinline+rt+, + \lstinline+lft+,+\lstinline+urt+, \lstinline+ulft+, \lstinline+lrt+, \lstinline+llft+. + \item[\meta{nom}:] entre double quote, doit être un nom de variable de + point. Le nom sera composé en mode mathématique (entre \lstinline+$+). Si le + nom contient un \lstinline+_+, tout ce qui sera après sera mis en + indice (ex. \lstinline+A_be+ deviendra $A_{be}$). Si le nom est + \lstinline+alpha+, \lstinline+beta+, \lstinline+gamma+ ou \lstinline+delta+, + alors le résultat donnera la lettre grecque composée en mode mathématique. +\end{description}\index{marque@\lstinline+marque+} +\end{colourband} + + +\mpgeomdd fournit aussi une adaptation au classique \lstinline+label+ de \MP{}. + +\begin{colourband} +\macro|gddLabel.«place»(«materiel»,«point»)| +\begin{description} + \item[\meta{place}:] peut être les classiques placement de \MP{} : + \lstinline+top+, \lstinline+bot+, \lstinline+rt+, + \lstinline+lft+,+\lstinline+urt+, \lstinline+ulft+, \lstinline+lrt+, \lstinline+llft+. + \item[\meta{materiel}:] classiquement ce qu'on donne à \lstinline+label+, une + chaîne de caractères, ou une \typeMP{picture} (qui peut-être produite par + exemple avec \lstinline+btex ... etex+ ou, puisque \package{latexmp} est + chargé par \mpgeomdd, \lstinline+textext()+). + \item[\meta{point}:] doit être un \typeGDD{point} de \mpgeomdd. +\end{description}\index{gddLabel@\lstinline+gddLabel+} +\end{colourband} + +On peut aussi étiquetter un \typeGDD{chemin}, une \typeGDD{courbe} ou un +\typeMP{path} avec la macro suivante: + +\begin{colourband} +\macro|EtiquetteChemin.«place»(«materiel»,«chemin»,«position»)| +\begin{description} + \item[\meta{place}:] peut être les classiques placement de \MP{} : + \lstinline+top+, \lstinline+bot+, \lstinline+rt+, + \lstinline+lft+,+\lstinline+urt+, \lstinline+ulft+, \lstinline+lrt+, \lstinline+llft+. + \item[\meta{materiel}:] classiquement ce qu'on donne à \lstinline+label+, une + chaîne de caractères, ou une \typeMP{picture} (qui peut-être produite par + exemple avec \lstinline+btex ... etex+ ou, puisque \package{latexmp} est + chargé par \mpgeomdd, \lstinline+textext()+). + \item[\meta{chemin}:] doit être un \typeGDD{chemin}, une \typeGDD{courbe}, ou + un \typeMP{path}. +\end{description}\index{EtiquetteChemin@\lstinline+EtiquetteChemin+} +\end{colourband} + + + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(0,0); +B_23 = Point(3,3); +alpha = Point(0,2); +trace Segment(A,B_23); +C = Milieu(A,B_23); +pointe C; +gddLabel.top(textext("Milieu"),C); +marque.top "A"; +marque.urt "B_23"; +marque.llft "alpha"; +P = Chemin(Pt(A)..Pt(alpha)..Pt(B_23)); +trace P; +EtiquetteChemin.top("Test",P,0.6); +endfig; +\end{ExempleMP} + + +\section{Repère} + +\mpgeomdd fournit un ensemble de commandes permettant de faciliter le dessin de +repère. + +La commande principale est la définition du repère, c'est-à-dire la boîte dans +laquelle le dessin sera représenté. +\begin{colourband} + \macro|Repere(«l»,«h»,«ox»,«oy»,«ux»,«uy»)| + \begin{description} + \item[\meta{l}:] \typeMP{numeric}, largeur du repère (en unité \lstinline+gddU+) ; + \item[\meta{h}:] \typeMP{numeric}, hauteur du repère (en unité \lstinline+gddU+) ; + \item[\meta{ox}:] \typeMP{numeric}, distance (en unité \lstinline+gddU+) de + l'origine (\typeGDD{point} $(0,0)$) par rapport au bord gauche ; + \item[\meta{oy}:] \typeMP{numeric}, distance (en unité \lstinline+gddU+) de + l'origine (\typeGDD{point} $(0,0)$) par rapport au bord bas ; + \item[\meta{ux}:] \typeMP{numeric}, unité de l'axe $(Ox)$ (en unité \lstinline+gddU+) ; + \item[\meta{uy}:] \typeMP{numeric}, unité de l'axe $(Oy)$ (en unité \lstinline+gddU+). + \end{description}\index{Repere@\lstinline+Repere+} +\end{colourband} + +Ce commande ne retourne, ni ne trace rien. Elle sert à spécifier quelques +variables internes de définition du dessin. Elle modifie d'ailleurs le +comportement de la macro \lstinline+gddEnPlace+ (voir +page~\pageref{gddEnPlace}). Noter que cette commande impose le fait que +l'origine (c'est-à-dire le \typeGDD{point} $(0,0)$) soit à l'intérieur du +repère. + +Cette macro s'accompagne de deux autres, elles aussi \emph{silencieuses}, ne +servant qu'à : +\begin{itemize} +\item sauvegarder la \typeMP{picture} courante ; +\item construire une \typeMP{picture} avec le contenu se trouvant entre +\lstinline+Debut+ et \lstinline+Fin+ ; +\item rogner (avec \lstinline+clip+) la \typeMP{picture} aux cadre du repère +construit ; +\item ajouter la \typeMP{picture} courant à celle sauvegarder ; +\item enfin rétablir le +fonctionnement de \lstinline+gddEnPlace+ comme avant l'utilisation de +\lstinline+Repere+. +\end{itemize} + +Ces deux commandes sont appelées \lstinline+Debut+ et +\lstinline+Fin+. + +\begin{colourband} +\macro|Debut| +\index{Debut@\lstinline+Debut+} +\end{colourband} + + +\begin{colourband} +\macro|Fin| +\index{Fin@\lstinline+Fin+} +\end{colourband} + +Ainsi, il est très simple d'illustrer le fait qu'à un changement de base +orthogonale prêt, un cercle est une ellipse. + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,1); +CA = Cercle(A,2); +Repere(5,5,1,1,1,0.5); +Debut; +trace CA; +Fin; +endfig; +\end{ExempleMP} + +On dispose de deux commandes pour tracer les axes du repère. La première trace +les axes passant par l'origine. +\begin{colourband} +\macro|Axes|\indication{trace un ensemble d'éléments sur le repère} +\index{Axes@\lstinline+Axes+} +\end{colourband} + +Cette commande inscrit aussi les labels des axes des abscisses et des ordonnées +qui sont stockées dans les variables globales dédiées suivantes: +\begin{colourband} +\macro|gddXlabel|\indication{\typeMP{string}, valeur par défaut \lstinline+"$x$"+} +\index{gddXlabel@\lstinline+gddXlabel+} +\end{colourband} + +\begin{colourband} +\macro|gddYlabel|\indication{\typeMP{string}, valeur par défaut \lstinline+"$y$"+} +\index{gddYlabel@\lstinline+gddYlabel+} +\end{colourband} + +Attention, ces commandes doivent s'utiliser avant l'appel à \lstinline+Debut+. + +L'exemple suivant permet d'illustrer le tracé des axes. + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,1); +CA = Cercle(A,2); +Repere(5,5,1,1,1,1); +gddYlabel:="$z$"; +Axes; +Debut; +trace CA; +Fin; +endfig; +\end{ExempleMP} + +On pourra aussi définir un repère en utilisant une syntaxe permettant de +spécifier les abscisses et les ordonnées extrémales. + +\begin{colourband} + \macro|RepereMinMax(«xmin»,«xmax»,«ymin»,«ymax»,«ux»,«uy»)| + \begin{description} + \item[\meta{xmin}:] \typeMP{numeric}, abscisse minimum (en unité \lstinline+gddU+). + \item[\meta{xmax}:] \typeMP{numeric}, abscisse maximum (en unité \lstinline+gddU+). + \item[\meta{ymin}:] \typeMP{numeric}, ordonnée minimum (en unité \lstinline+gddU+). + \item[\meta{ymax}:] \typeMP{numeric}, ordonnée maximum (en unité \lstinline+gddU+). + \item[\meta{ux}:] \typeMP{numeric}, unité de l'axe $(Ox)$ (en unité \lstinline+gddU+). + \item[\meta{uy}:] \typeMP{numeric}, unité de l'axe $(Oy)$ (en unité \lstinline+gddU+). + \end{description}\index{RepereMinMax@\lstinline+RepereMinMax+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,1); +CA = Cercle(A,2); +RepereMinMax(-1,4,-1,4,1,1); +Axes; +Debut; +trace CA; +Fin; +endfig; +\end{ExempleMP} + +\mpgeomdd fournit aussi de quoi tracer les axes sur le bord du cadre avec la +commande suivante. +\begin{colourband} +\macro|AxesBords|\indication{trace un ensemble d'éléments sur le repère} +\index{AxesBords@\lstinline+AxesBords+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,1); +CA = Cercle(A,2); +RepereMinMax(-1,4,-1,4,1,1); +AxesBords; +Debut; +trace CA; +Fin; +endfig; +\end{ExempleMP} + +Les commandes suivantes permettent de graduer les axes (classiques ou sur le +bord). Là encore, ce sont des commandes qui n'ont pas d'arguments ni ne +retournent rien et qui tracent. + +\begin{colourband} +\macro|Graduations|\indication{trace un ensemble d'éléments sur le repère} +\index{Graduations@\lstinline+Graduations+} +\end{colourband} + + +\begin{colourband} +\macro|GraduationsBords|\indication{trace un ensemble d'éléments sur le repère} +\index{GraduationsBords@\lstinline+GraduationsBords+} +\end{colourband} + +On utilisera la version en cohérence avec les axes choisis. + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,1); +CA = Cercle(A,2); +RepereMinMax(-1,4,-1,4,1,1); +AxesBords; +GraduationsBords; +Debut; +trace CA; +Fin; +endfig; +\end{ExempleMP} + +Si on désire marquer les unités, \mpgeomdd{} propose la macro suivante (qui n'est +utilisable que si l'on ne place pas les axes sur le bord). +\begin{colourband} +\macro|Unites(«unité»)|\indication{trace un ensemble d'éléments sur le repère} +\begin{description} + \item[\meta{unité}:] \typeMP{numeric}, valeur à inscrire sur les deux axes. +\end{description} +\index{Unites@\lstinline+Unites+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,1); +CA = Cercle(A,2); +RepereMinMax(-1,4,-1,4,1,1); +Axes; +Debut; + Graduations; + Unites(2); + trace CA; +Fin; +endfig; +\end{ExempleMP} + +On peut aussi ajouter une grille sur notre repère avec la macro suivante. +\begin{colourband} +\macro|GrilleRepere|\indication{trace un ensemble d'éléments sur le repère} +\index{GrilleRepere@\lstinline+GrilleRepere+} +\end{colourband} +Dans l'exemple suivant, on règle la couleur de la grille avec la commande +\hologo{MetaPost} \lstinline+drawoptions+. +\begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,1); +CA = Cercle(A,2); +RepereMinMax(-1,4,-1,4,1,1); +drawoptions(withcolor LightGrey); +GrilleRepere; +drawoptions(); +Axes; +Debut; + Graduations; + Unites(1); + trace CA; +Fin; +endfig; +\end{ExempleMP} +On pourra aussi ajouter un cadre au repère avec la macro suivante. +\begin{colourband} + \macro|CadreRepere|\return{\typeMP{path}} + \index{CadreRepere@\lstinline+CadreRepere+} +\end{colourband} + Dans l'exemple suivant, on règle la couleur de la grille avec la commande + \hologo{MetaPost} \lstinline+drawoptions+. + \begin{ExempleMP} +input geom2d; +beginfig(1); +A = Point(1,1); +CA = Cercle(A,2); +RepereMinMax(-1,4,-1,4,1,1); +drawoptions(withcolor LightGrey); +GrilleRepere; +drawoptions(); +Axes; +Debut; + Graduations; + Unites(1); + trace CA; + trace CadreRepere withcolor OrangeRed; +Fin; +endfig; + \end{ExempleMP} + +\section{Quelques constantes et fonctions mathématiques} + +\mpgeomdd définit deux constantes mathématiques \lstinline+Pi+ et \lstinline+_E+ +\index{Pi@\lstinline+Pi+}\index{_E@\lstinline+_E+} pour les constantes +$\uppi\simeq 3.14159265$ et $\mathrm{e}=2.71828183$. + +De plus, le package définit quelques fonctions mathématiques de la variable +réelle : +\begin{colourband} +\macro|sin(«x»)| \index{sin@\lstinline+sin+} +\macro|cos(«x»)| \index{cos@\lstinline+cos+} +\macro|tan(«x»)| \index{tan@\lstinline+tan+} +\macro|exp(«x»)| \index{exp@\lstinline+exp+} +\macro|ln(«x»)| \index{ln@\lstinline+ln+} +\macro|ch(«x»)| \index{ch@\lstinline+ch+} +\macro|sh(«x»)| \index{sh@\lstinline+sh+} +\macro|th(«x»)| \index{th@\lstinline+th+} +\macro|arcsin(«x»)| \index{arcsin@\lstinline+arcsin+} +\macro|arccos(«x»)| \index{arccos@\lstinline+arccos+} +\macro|arctan(«x»)| \index{arctan@\lstinline+arctan+} +\end{colourband} + +\section{Représentation de courbes et de fonctions} + +\mpgeomdd{} fournit aussi quelques macros facilitant la représentation simple de +courbes et de fonctions mathématiques. + +\subsection{Fonction de la variable réelle} + +Pour représenter une fonction de la variable réelle, on utilisera la macro +suivante: +\begin{colourband} + \macro|Representation(«fonction»)(«ti»,«tf»,«n»)|\return{\typeMP{path}} + \begin{description} + \item[\meta{fonction}:] est une macro \MP{} qui définit la fonction + mathématique d'une variable réelle que l'on souhaite représenter ; + \item[\meta{ti}:] est la valeur (\typeMP{numeric}) initiale de la variable à + partir de laquelle on souhaite construire la représentation de la fonction ; + \item[\meta{tf}:] est la valeur (\typeMP{numeric}) finale de la variable + jusqu'à laquelle on souhaite construire la représentation de la fonction ; + \item[\meta{n}:] est le nombre de pas (\typeMP{numeric}) utilisé pour la + discrétisation de la représentation. + \end{description} + \index{Representation@\lstinline+Representation+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +beginfig(1); +RepereMinMax(-2Pi,2Pi,-1.1,1.1,0.4,1); +Axes; +Debut; + Graduations; + trace Representation(cos,-2Pi,2Pi,100); +Fin; +endfig; + \end{ExempleMP} + +\subsection{Courbe paramétrique} + +Pour représenter une courbe plane définie par deux fonctions décrivant +l'abscisse et l'ordonnée en fonction d'un paramètre, on utilisera la macro suivante: +\begin{colourband} + \macro|Courbe(«fct_abscisse»)(«fct_ordonnee»)(«ti»,«tf»,«n»)|\return{\typeMP{path}} + \begin{description} + \item[\meta{fct\_abscisse}:] est une macro \MP{} qui définit la fonction + mathématique d'une variable réelle décrivant l'évolution de l'abscisse des + points de la courbe que l'on souhaite représenter ; + \item[\meta{fct\_ordonnee}:] est une macro \MP{} qui définit la fonction + mathématique d'une variable réelle décrivant l'évolution de l'ordonnée des + points de la courbe que l'on souhaite représenter ; + \item[\meta{ti}:] est la valeur (\typeMP{numeric}) initiale de la variable à + partir de laquelle on souhaite construire la représentation de la fonction ; + \item[\meta{tf}:] est la valeur (\typeMP{numeric}) finale de la variable + jusqu'à laquelle on souhaite construire la représentation de la fonction ; + \item[\meta{n}:] est le nombre de pas (\typeMP{numeric}) utilisé pour la + discrétisation de la représentation. + \end{description} + \index{Courbe@\lstinline+Courbe+} +\end{colourband} + +\begin{ExempleMP} +input geom2d; +vardef f_a(expr t)= cos(t) enddef; +vardef f_o(expr t)= sin(2*t) enddef; + +beginfig(1); +RepereMinMax(-1.1,1.1,-1.1,1.1,2,2); +Axes; +Debut; + Graduations; + trace Courbe(f_a,f_o,-2Pi,2Pi,100); +Fin; +endfig; + \end{ExempleMP} + + Pour représenter une courbe plane définie par une fonction décrivant les + coordonées polaires en fonction d'un paramètre, on utilisera la macro suivante: + \begin{colourband} + \macro|CourbeEnPolaires(«fonction»)(«ti»,«tf»,«n»)|\return{\typeMP{path}} + \begin{description} + \item[\meta{fonction}:] est une macro \MP{} qui définit la fonction + mathématique d'une variable réelle décrivant l'évolution des coordonnées polaires des + points de la courbe que l'on souhaite représenter ; + \item[\meta{ti}:] est la valeur (\typeMP{numeric}) initiale de la variable à + partir de laquelle on souhaite construire la représentation de la fonction ; + \item[\meta{tf}:] est la valeur (\typeMP{numeric}) finale de la variable + jusqu'à laquelle on souhaite construire la représentation de la fonction ; + \item[\meta{n}:] est le nombre de pas (\typeMP{numeric}) utilisé pour la + discrétisation de la représentation. + \end{description} + \index{CourbeEnPolaires@\lstinline+CourbeEnPolaires+} + \end{colourband} + + \begin{ExempleMP} +input geom2d; +a := 2; +vardef cardioide(expr t)= a*(1+cos(t)) enddef; +beginfig(1); +RepereMinMax(-1.1,4.1,-2.8,2.8,1,1); +Axes; +Debut; + Graduations; + trace CourbeEnPolaires(cardioide,0,2Pi,100); +Fin; +endfig; + \end{ExempleMP} + + +\subsection{Champs de vecteurs} + +\mpgeomdd fournit des macros pour la représentation des champs de vecteurs. + +Tout d'abord, on peut tracer des champs de vecteurs associée à une équation +différentielle du premier ordre pour une fonction $y$ de la variable $x$: +\[y'=F(x,y).\] +La macro associée est la suivante: +\begin{colourband} + \macro|ChampVecteurs(«fonction»)(«x»,«y»,«px»,«py»,«dx»,«couleur»)|\return{\typeMP{path}} + \begin{description} + \item[\meta{fonction}:] est une macro \MP{} qui définit une fonction + mathématique de $\R^2$ dans $\R$ ; + \item[\meta{x}:] est une valeur (\typeMP{numeric}), en unité \variableGDD{gddU}, qui permet de décaler la + grille des vecteurs suivant la direction $x$, les points étant tous les + \meta{x}$+i$\meta{px} pour $i$ entier ; + \item[\meta{y}:] est une valeur (\typeMP{numeric}), en unité \variableGDD{gddU}, qui permet de décaler la + grille des vecteurs suivant la direction $y$, les points étant tous les + \meta{y}$+i$\meta{py} pour $i$ entier ; + \item[\meta{px}:] est la valeur (\typeMP{numeric}), en unité + \variableGDD{gddU}, du pas de la grille suivant l'axe $x$ pour + la représentation des vecteurs ; + \item[\meta{py}:] est la valeur (\typeMP{numeric}), en unité + \variableGDD{gddU}, du pas de la grille suivant l'axe $y$ pour + la représentation des vecteurs ; + \item[\meta{dx}:] est la norme (\typeMP{numeric}), en unité + \variableGDD{gddU}, des vecteurs du champ de vecteur ; + \item[\meta{couleur}:] est la couleur (\typeMP{color}) utilisée pour tracer + les vecteurs. + \end{description} + \index{ChampVecteurs@\lstinline+ChampVecteurs+} +\end{colourband} + +Comme cette macro utilise la macro \lstinline+drawarrow+ de \MP{}, il faudra +jouer avec le paramètre \lstinline+ahlength+ pour régler la taille du triangle +des flèches (voir~\cite{ctan-metapost}). + +\begin{ExempleMP} +input geom2d; +vardef F(expr x,y) = x - 2 * x * y enddef; +vardef f(expr x) = 1/2 + a * exp(- x*x) enddef; +beginfig(1); +RepereMinMax(-2.5,2.5,-2.8,2.8,1,1); +Axes; +Debut; +Graduations; +ahlength := 1; +ChampVecteurs(F,0,0,0.2,0.2,0.1,0.5white); +% Courbes intégrales +for n = 0 upto 16: + a := (n/2) - 4; + trace Representation(f,-2.5,2.5,50) + avecCrayon(1,(0.7,0.2,0.2)); +endfor +Fin; +endfig; + \end{ExempleMP} + +Sur le même modèle, on peut tracer des champs de vecteurs d'une fonction de +$\R^2$ dans $\R^2$. +La macro associée est la suivante: +\begin{colourband} + \macro|ChampVecteursDD(«fonction»)(«x»,«y»,«px»,«py»,«dx»,«couleur»)|\return{\typeMP{path}} + \begin{description} + \item[\meta{fonction}:] est une macro \MP{} qui définit une fonction + mathématique de $\R^2$ dans $\R^2$ (donc qui retourne une \typeMP{pair}) ; + \item[\meta{x}:] est une valeur (\typeMP{numeric}), en unité \variableGDD{gddU}, qui permet de décaler la + grille des vecteurs suivant la direction $x$, les points étant tous les + \meta{x}$+i$\meta{px} pour $i$ entier ; + \item[\meta{y}:] est une valeur (\typeMP{numeric}), en unité \variableGDD{gddU}, qui permet de décaler la + grille des vecteurs suivant la direction $y$, les points étant tous les + \meta{y}$+i$\meta{py} pour $i$ entier ; + \item[\meta{px}:] est la valeur (\typeMP{numeric}), en unité + \variableGDD{gddU}, du pas de la grille suivant l'axe $x$ pour + la représentation des vecteurs ; + \item[\meta{py}:] est la valeur (\typeMP{numeric}), en unité + \variableGDD{gddU}, du pas de la grille suivant l'axe $y$ pour + la représentation des vecteurs ; + \item[\meta{dx}:] est la norme (\typeMP{numeric}), en unité + \variableGDD{gddU}, des vecteurs du champ de vecteur ; + \item[\meta{couleur}:] est la couleur (\typeMP{color}) utilisée pour tracer + les vecteurs. + \end{description} + \index{ChampVecteursDD@\lstinline+ChampVecteursDD+} +\end{colourband} + + \begin{ExempleMP}[sidebyside=false] +input geom2d; +gddXlabel := "$\theta$"; +gddYlabel := "$\dot\theta$"; +numeric b,c; +b:=0.5; +c=1.0; + +vardef F(expr x,y) = (y,-b*y-c*sin(x)) enddef; + +beginfig(1); +Repere(10,6,2,4,2,2); +Axes; +Unites(1); +Debut; +Graduations; +trajectoire := CourbeDat("solution0",0); +ChampVecteursDD(F,0.5,0.5,0.2,0.2,0.15,0.5white); +trace trajectoire avecCrayon(1,(0.7,0.2,0.2)); +pointe Point(0,0) avecCrayon(1,(0.7,0.2,0.2)); +pointe Point(3.1415,0) avecCrayon(1,(0.7,0.2,0.2)); +Fin; +endfig; + \end{ExempleMP} + + + + +\section{Couleurs \texttt{svgnames}} + +\begin{mplibcode} +input exemples/svgnames/palette.mp +\end{mplibcode} + + + +\pagestyle{empty} +\begin{landscape} + \section{Galerie} + \subsection{Repère et tangentes extérieure} + \begin{minipage}{0.5\linewidth} + \begin{center} + \begin{mplibcode} + input exemples/cercles/cercles2.mp; + \end{mplibcode} + \end{center} + \end{minipage} + \begin{minipage}{0.5\linewidth} + \lstinputlisting[basicstyle=\ttfamily\small]{exemples/cercles/cercles2.mp} + \end{minipage} +\end{landscape} + +\begin{landscape} + \subsection{Vecteur dans un repère} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/reperes/reperes2.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/reperes/reperes2.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Théorème de Pascal} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/divers/pascalline.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/divers/pascalline.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Hyperbole} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/coniques/hyper.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/coniques/hyper.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Astroïde comme enveloppe de droites} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/courbes/cp01.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/courbes/cp01.mp} + \end{multicols} +\end{landscape} + + +\begin{landscape} + \subsection{Courbe de Lissajous} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/courbes/cp02.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/courbes/cp02.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Étude de fonctions} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/courbes/cp05.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/courbes/cp05.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Le bicorne} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/courbes/cp08.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/courbes/cp08.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Une fonction et ses dérivées} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/fonctions/fonction2.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/fonctions/fonction2.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Cardioïde} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/polaires/pol02.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/polaires/pol02.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Axe de similitude} + \begin{center} + \begin{mplibcode} + input exemples/cercles/axessimilitude.mp; + \end{mplibcode} + \end{center} + \begin{multicols}{2} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/cercles/axessimilitude.mp} + \end{multicols} +\end{landscape} + + +\begin{landscape} + \subsection{Tracé d'une cubique} + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/cubiques/K001.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/cubiques/K001.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Apollonius} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/triangles/apollonius.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/triangles/apollonius.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Épure d'ogive} + + \begin{multicols}{2} + \begin{center} + \begin{mplibcode} + input exemples/construction/ogiveentiers.mp; + \end{mplibcode} + \end{center} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/construction/ogiveentiers.mp} + \end{multicols} +\end{landscape} + +\begin{landscape} + \subsection{Triangle orthique et problème de Fagnano} + + Figure 21 de~\cite{toeplitz}. + \begin{center} + \begin{mplibcode} + input exemples/triangles/pedale.mp; + \end{mplibcode} + \end{center} + \begin{multicols}{2} + \lstinputlisting[basicstyle=\ttfamily\scriptsize]{exemples/triangles/pedale.mp} + \end{multicols} +\end{landscape} +\newpage +\section{Historique} +\begin{description} + \item[21 octobre 2024:] corrections de Quark67 (merci à lui) sur la + documentation et modifications suite à ses remarques. + \lstinline+DemieHyperbole+ devient + \lstinline+DemiHyperbole+ (sans compatibilité). Création de deux nouveaux + types + de pointage de \typeGDD{point} : croix et disque (voir commande \lstinline+pointe+). + \item[13 octobre 2024:] publication de la version 1.0 sur le CTAN. +\end{description} + +\printbibliography +\addcontentsline{toc}{section}{Références}%Including it as a chapter +\printindex +\addcontentsline{toc}{section}{Index}%Including it as a chapter + + +\end{document} diff --git a/graphics/metapost/contrib/macros/mp-geom2d/doc/solution0.dat b/graphics/metapost/contrib/macros/mp-geom2d/doc/solution0.dat new file mode 100644 index 0000000000..225ff5a9c9 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/doc/solution0.dat @@ -0,0 +1,101 @@ +3.13159 0.00000 +3.13129 -0.00237 +3.13042 -0.00461 +3.12899 -0.00686 +3.12698 -0.00924 +3.12434 -0.01189 +3.12100 -0.01494 +3.11683 -0.01850 +3.11169 -0.02274 +3.10539 -0.02783 +3.09769 -0.03396 +3.08830 -0.04137 +3.07687 -0.05035 +3.06297 -0.06124 +3.04606 -0.07446 +3.02550 -0.09050 +3.00052 -0.10997 +2.97017 -0.13357 +2.93332 -0.16218 +2.88859 -0.19678 +2.83433 -0.23856 +2.76860 -0.28883 +2.68909 -0.34904 +2.59313 -0.42065 +2.47770 -0.50493 +2.33954 -0.60261 +2.17531 -0.71326 +1.98203 -0.83441 +1.75769 -0.96045 +1.50220 -1.08156 +1.21850 -1.18348 +0.91349 -1.24911 +0.59833 -1.26236 +0.28752 -1.21344 +-0.00322 -1.10279 +-0.25960 -0.94110 +-0.47092 -0.74535 +-0.63096 -0.53366 +-0.73772 -0.32146 +-0.79260 -0.12012 +-0.79935 0.06255 +-0.76333 0.22118 +-0.69110 0.35173 +-0.59008 0.45099 +-0.46841 0.51659 +-0.33468 0.54751 +-0.19748 0.54459 +-0.06496 0.51084 +0.05578 0.45130 +0.15908 0.37245 +0.24099 0.28137 +0.29933 0.18501 +0.33357 0.08961 +0.34466 0.00047 +0.33468 -0.07822 +0.30668 -0.14334 +0.26432 -0.19281 +0.21167 -0.22558 +0.15292 -0.24161 +0.09218 -0.24180 +0.03320 -0.22790 +-0.02079 -0.20232 +-0.06722 -0.16793 +-0.10427 -0.12778 +-0.13089 -0.08493 +-0.14675 -0.04218 +-0.15220 -0.00202 +-0.14814 0.03354 +-0.13594 0.06298 +-0.11725 0.08531 +-0.09392 0.10007 +-0.06785 0.10727 +-0.04088 0.10737 +-0.01469 0.10118 +0.00928 0.08981 +0.02989 0.07453 +0.04634 0.05669 +0.05814 0.03764 +0.06516 0.01863 +0.06755 0.00076 +0.06571 -0.01505 +0.06025 -0.02812 +0.05192 -0.03802 +0.04153 -0.04453 +0.02993 -0.04768 +0.01795 -0.04768 +0.00633 -0.04488 +-0.00430 -0.03980 +-0.01343 -0.03298 +-0.02070 -0.02504 +-0.02590 -0.01657 +-0.02898 -0.00812 +-0.03001 -0.00020 +-0.02916 0.00681 +-0.02671 0.01260 +-0.02298 0.01697 +-0.01835 0.01983 +-0.01319 0.02120 +-0.00787 0.02117 +-0.00271 0.01991 +0.00200 0.01763 diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-arc.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-arc.mp new file mode 100644 index 0000000000..931f4af3d4 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-arc.mp @@ -0,0 +1,56 @@ +%%% -------------------------------------------------------------------------- +%%% Arcs de cercles +%%% -------------------------------------------------------------------------- + +vardef Arc(expr c,r,a,b) = + % c: centre de l’arc (point ou pair) + % r: rayon (numeric) + % a: angle de départ (numeric) + % b: angle d’arrivée (numeric) + save n,centre,pas; n = incr gddO; + gddT[n] = "chemin"; + pair centre; centre = PairImp(c); pas =(b-a)/10; + gddP[n]:=(centre+r*(cos(a),sin(a))) for i=0 upto 10: .. + (centre+r*(cos(a+i*pas),sin(a+i*pas))) endfor; + n +enddef; + +vardef ArcEntrePoints(expr C, r, A, B,s) = + % C : centre de l’arc (point ou pair) + % r : rayon (numeric) + % A : point ou pair de départ de l’arc + % B : point ou pair d’arrivée + % s : sens 1 ou -1 + save n,cercle,t; n = incr gddO; + gddT[n] = "chemin"; + numeric t[]; + path cercle; + cercle := fullcircle scaled 2r shifted PairImp(C); + (t1,t2) = cercle intersectiontimes (PairImp(C)--5[PairImp(C),PairImp(A)]); + (t3,t4) = cercle intersectiontimes (PairImp(C)--5[PairImp(C),PairImp(B)]); + + if(t1<t3): + t5 = t1; + t6 = t3; + else: + t5 = t3; + t6 = t1; + fi + if(s=1): + gddP[n] := subpath (t5,t6) of cercle; + else: + gddP[n] := subpath (t5,t6-8) of cercle; + fi + n +enddef; + + +% obtenir seulement une partie d’un cercle déjà défini +vardef gddTraceArcDeCercle(expr C,r,d)= + % C : cercle 4 + % r : premier angle en radian + % d : deuxième angle en radian + (subpath(r/Pi*4,d/Pi*4) of gddTraceObjet(C)) +enddef; + +endinput
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-c2d.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-c2d.mp new file mode 100644 index 0000000000..900d64582b --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-c2d.mp @@ -0,0 +1,300 @@ +%%% -------------------------------------------------------------------------- +%%% mp-gdd %%% Courbes du second degré +%%% -------------------------------------------------------------------------- + +gddC2Dparam := 15; % pour les tracés des parabole et hyperbole + +% macros factorisées + +vardef Foyer(expr c,n) = + % c : ellipse, parabole, hyperbole + % n : 1 ou 2 + if(n=1): + gddD[c] + else: + if(gddT[c]="parabole"): % si parabole c’est le même foyer + gddD[c] + else: + gddE[c] + fi + fi +enddef; + +vardef Excentricite(expr c)= + gddX[c][3] +enddef; + +vardef Inclinaison(expr c)= + gddX[c][4] +enddef; + +% Ellipse ---------------------------------------------------------------------- + +vardef Ellipse(expr C,A,B) = + % C : centre + % A : vertex + % B : co-vertex + save n,a,b,c,e,_tmp,slope; + pair _tmp; + n = incr gddO; + gddT[n] = "ellipse"; gddA[n] = PointImp(C); gddB[n] = PointImp(A); + gddC[n] = PointImp(B); + % calcul des deux foyers + a = Longueur(C,A); + b = Longueur(C,B); + c = sqrt(a**2-b**2); + e = c/a; + _tmp = e*(Pt(A)-Pt(C)); + % les foyers + gddD[n] = PairTOPoint(Pt(C)+_tmp); + gddE[n] = PairTOPoint(Pt(C)-_tmp); + gddX[n][1] = a; + gddX[n][2] = b; + gddX[n][3] = e; + % angle du demi grand axe + slope = angle(PairImp(A)-PairImp(C)); + gddX[n][4] = slope; + n +enddef; + +vardef EllipseF(expr A,B,a) = + % A : foyer 1 + % B : foyer 2 + save n,b,c,e,_tmp,slope; + pair _tmp; + n = incr gddO; + gddT[n] = "ellipse"; + % Foyers + gddD[n] = PointImp(A); + gddE[n] = PointImp(B); + % centre + gddA[n] = Milieu(A,B); + % La distance entre les deux foyers est égale à 2c + c = Longueur(A,B)/2; + if(c>a): + errmessage("le demi grand axe est trop petit"); + fi + e = c/a; + + b = sqrt(a**2-c**2); + + % vertex et co-vertex + _tmp := 1.0/c*(Pt(B)-Pt(gddA[n])); + gddB[n] = PairTOPoint(Pt(gddA[n])+a*_tmp); + gddC[n] = PairTOPoint(Pt(gddA[n])+b*Pt(Rotation(_tmp,Pi/2))); + gddX[n][1] = a; + gddX[n][2] = b; + gddX[n][3] = e; + % angle du demi grand axe + slope = angle(PairImp(gddB[n])-PairImp(gddA[n])); + gddX[n][4] = slope; + n +enddef; + + + +vardef Vertex(expr c) = + gddB[c] +enddef; + +vardef Covertex(expr c) = + gddC[c] +enddef; + + + +vardef DemiGrandAxe(expr c)= + gddX[c][1] +enddef; + +vardef DemiPetitAxe(expr c)= + gddX[c][2] +enddef; + + + + +vardef TangenteEllipse(expr e,p) = + % détermine la tangente à une ellipse e au point p + % appartenant à l’ellipse + % par la méthode de la bissectrice + save F,Fp,M,B; + F = Foyer(e,1); + Fp = Foyer(e,2); + M = PointImp(p); + B = Bissectrice(F,M,Fp); + DroitePerpendiculaire(B,M) +enddef; + +vardef TangenteExterieureEllipse(expr ell, p,n) = + % ell : ellipse + % p : point + % n : 1 ou 2 pour choisir la tangente + % http://choumac44.free.fr/NGEOMETRIE/Ellipse.htm + % Du point p comme centre tracer un arc de cercle de rayon PF' + % Du foyer F comme centre tracer un arc de cercle de rayon 2a + % l'intersection des 2 arcs donne le point T + % Tracer la droite TF puis la droite TF' et sa médiatrice , l'intersection de + % la médiatrice et la droite TF nous donne le point ( M ) ( contact avec la + % courbe) -> ici on laisse MetaPost trouver l’intersection segment,ellipse + save F,P,T,C,Ip,U,DU,M; + P = PointImp(p); + if(n=1): + F1 = Foyer(ell,1); + F2 = Foyer(ell,2); + else: + F1 = Foyer(ell,2); + F2 = Foyer(ell,1); + fi + C1 = CercleCP(P,F1); + C2 = Cercle(F2,2*DemiGrandAxe(ell)); + T1 = IntersectionCercles(C1,C2); + T2 = IntersectionCercles(C2,C1); + if(Longueur(F1,T1)<Longueur(F1,T2)): + U = T1; + else: + U = T2; + fi + DU = Segment(F2,U); + pair Ip; + Ip := (gddTraceObjet(DU)) intersectionpoint (gddTraceObjet(ell)); + M = PointImp(Ip); + Droite(P,M) +enddef; + + +%%% Paraboles ---------------------------------------------------------------- + +% Parabole par Foyer-Directrice. + + + +vardef ParaboleFD(expr F,D) = + % F : foyer (point) + % D : directrice (droite) + save u, v, w, d, i, n,_tmp,slope; + pair _tmp; + n = incr gddO; + (u,v,w) = EquationDroite(D); + % ordonnée relative + d := u * gddA[F] + v * gddB[F] + w; + gddT[n] := "parabole"; + gddX[n][1] := D; % on stock la directrice + gddX[n][2] := D; % on stock la directrice (compatibilité avec hyperbole) + % sommet + _tmp := (((-d/2)*(u,v)) shifted PairImp(F)); + gddB[n] = PointImp(_tmp); + gddC[n] = PointImp(_tmp); + % le foyer (doublé pour compatibilité) + gddD[n] := F; + gddE[n] := F; + gddX[n][3] := 1.0; % excentricité + % angle du demi grand axe + slope = angle(PairImp(gddA[D])-PairImp(gddB[D]))+90; + gddX[n][4] = slope; + i := -gddC2Dparam-1; + gddP[n] := ( + ((i*(v,-u)+((i*i-d*d)/(2d))*(u,v)) + for i:= -gddC2Dparam upto gddC2Dparam: + ..(i*(v,-u)+((i*i-d*d)/(2d))*(u,v)) + endfor)) shifted PairImp(F); + n +enddef; + +% Parabole par Foyer-Sommet +vardef ParaboleFS(expr F,S) = +enddef; + + +%% Hyperbole ---------------------------------------------------------- + +vardef HyperboleFD(expr F,D,e) = + % F : foyer (point) + % D : directrice (droite) + % e : exentricité (numeric) + % pm : +1 ou -1 pour les deux branches + save u, v, w, d, i, n,_tmp,slope,aa,bb; + pair _tmp; + n = incr gddO; + + (u,v,w) = EquationDroite(D); + d := u * gddA[F] + v * gddB[F] + w; + gddT[n] := "hyperbole"; + + % sommets + _tmp := -(d+1*sqrt(e*e*d*d))/(e*e-1)*(u,v)shifted (ProduitScalaire(F,Vecteur(v,-u))*(v,-u)); + gddB[n] := PointImp(_tmp); + _tmp := -(d-1*sqrt(e*e*d*d))/(e*e-1)*(u,v)shifted + (ProduitScalaire(F,Vecteur(v,-u))*(v,-u)); + gddC[n] := PointImp(_tmp); + % centre comme milieu des deux sommets + gddA[n] = Milieu(gddB[n],gddC[n]); + % le foyer (doublé pour compatibilité) + gddD[n] := F; + gddE[n] := RotationCentre(F, gddA[n], Pi); + gddX[n][3] := e; % excentricité + % directrices + gddX[n][1] := D; % on stock la directrice + gddX[n][2] := Droite(RotationCentre(gddA[D], gddA[n], Pi),RotationCentre(gddB[D], gddA[n], Pi)); + % angle de l’axe + slope = angle(PairImp(gddA[D])-PairImp(gddB[D]))+90; + gddX[n][4] = slope; + % cercle principale + gddX[n][5] = CercleD(gddB[n],gddC[n]); + % asymptotes + aa = IntersectionDroiteCercle(D,gddX[n][5],1); + bb = IntersectionDroiteCercle(D,gddX[n][5],2); + gddX[n][6] = Droite(gddA[n],aa); + gddX[n][7] = Droite(gddA[n],bb); + % tracés des moitiées + i := -gddC2Dparam-1; + gddPX[n][1] := ( + ( + (i*(v,-u)-(d+sqrt(e*e*d*d+i*i*(e*e-1)))/(e*e-1)*(u,v)) + for i:= -gddC2Dparam upto gddC2Dparam: + ..(i*(v,-u)-(d+sqrt(e*e*d*d+i*i*(e*e-1)))/(e*e-1)*(u,v)) + endfor + ) shifted (ProduitScalaire(F,Vecteur(v,-u))*(v,-u)) + ); + gddPX[n][2] := ( + ( + (i*(v,-u)-(d-sqrt(e*e*d*d+i*i*(e*e-1)))/(e*e-1)*(u,v)) + for i:= -gddC2Dparam upto gddC2Dparam: + ..(i*(v,-u)-(d-sqrt(e*e*d*d+i*i*(e*e-1)))/(e*e-1)*(u,v)) + endfor + ) shifted (ProduitScalaire(F,Vecteur(v,-u))*(v,-u)) + ); + n +enddef; + +vardef CerclePrincipale(expr h)= + %h : hyperbole + gddX[h][5] +enddef; + +vardef AsymptoteHyperbole(expr h,n)= + % h : hyperbole + % n : 1 ou 2 pour choisir l’hyperbole + gddX[h][5+n] +enddef; + +vardef DemiHyperbole(expr h,n)= + gddPX[h][n] +enddef; + +% sommet +vardef Sommet(expr p,n) = + % p : parabole ou hyperbole + % n : 1 ou 2, choisir un des sommets (le même pour la parabole) + if n=1: + gddB[p] + else: + gddC[p] + fi +enddef; + +vardef Directrice(expr p,n) = + % p : parabole ou hyperbole + gddX[p][n] +enddef; +endinput
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-fct.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-fct.mp new file mode 100644 index 0000000000..8d70154b5f --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-fct.mp @@ -0,0 +1,22 @@ +numeric Pi; +numeric _E; + +Pi := 3.14159265; +_E := 2.71828183; + +vardef sin(expr x) = sind(x/Pi*180) enddef; +vardef cos(expr x) = cosd(x/Pi*180) enddef; +vardef tan(expr x) = sin(x)/cos(x) enddef; + +vardef exp(expr x) = _E**x enddef; + +vardef ln(expr x) = mlog(x)/256 enddef; +vardef ch(expr x) = (_E**x + _E**(-x))/2 enddef; +vardef sh(expr x) = (_E**x - _E**(-x))/2 enddef; +vardef th(expr x) = (_E**(2*x) - 1)/(_E**(2*x) + 1) enddef; + +vardef arcsin(expr t) = angle((sqrt(1-t**2),t)) / 180 * Pi enddef; +vardef arccos(expr t) = angle(t,(sqrt(1-t**2))) / 180 * Pi enddef; +vardef arctan(expr t) = angle(1,t) / 180 * Pi enddef; + +endinput
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-lbl.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-lbl.mp new file mode 100644 index 0000000000..562a321b23 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-lbl.mp @@ -0,0 +1,84 @@ + +string lblS[]; +lblS[0] = "alpha"; +lblS[1] = "beta"; +lblS[2] = "gamma"; +lblS[3] = "delta"; +lblN = 3; + + +vardef lTEX primary s = + textext("$"&scanchaine_label(s)&"$") +enddef; + +vardef gddLabel.@#(expr s,p) = + % comme label mais qui s’applique à un point + % s : matériel de l’annotation + % p : point mpgdd + label.@#(s,Pt(p) gddEnPlace) +enddef; + +vardef Etiquette.@#(expr s,t,p) = label.@#(textext(s) scaled t,p gddEnPlace) enddef; + +vardef EtiquetteChemin.@#(expr s,p,pos) = % label, chemin, position + save chemin; + path chemin; + if path p: + chemin:=p; + else: + chemin:=gddP[p]; % fonction pour chemin et courbe + fi; + label.@#(textext(s), _milieuChemin(chemin,pos) gddEnPlace) +enddef; + +vardef _milieuChemin(expr p,pos) = % p est du type path + save midtime; + midtime = arctime (pos*(arclength(p))) of p; + point infinity of (subpath (0,midtime) of p) +enddef; + +vardef FICHIER primary s = + save _s; string _s; _s = "input " & s; + scantokens _s +enddef; + +vardef m_arque.@# expr p = + pointe p; + label.@#(gddL[p] scaled gddTailleLabel,PointTOPair(p) gddEnPlace); +enddef; + +vardef m_a_rque.@# expr p = + pointe(scantokens p); + label.@#(lTEX(p) scaled gddTailleLabel,PointTOPair(scantokens p) gddEnPlace); +enddef; + +vardef marque.@# expr p = + if string p: m_a_rque.@# p else: m_arque.@# p fi +enddef; + + + +vardef scanchaine_label(expr s) = + save d,m,f,c,l,flag,i; string d,m,f,c; + d := ""; m := ""; f := ""; + l = length(s); flag := 0; + for i:=0 upto l: + c := substring (i,i+1) of s; + if c = "'": + f := f & c; flag := 2; + elseif c = "_": + flag := 1; + else: + if flag = 0: + d := d & c + else: + m := m & c + fi; + fi + endfor; + for i:=0 upto lblN: + if d = lblS[i]: d := "\" & d fi + endfor; + d := d & "_{" & m & "}" & f; d +enddef; +endinput
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-main.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-main.mp new file mode 100644 index 0000000000..9e09c6f672 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-main.mp @@ -0,0 +1,1071 @@ + + +%%% ---------------------------------------------------------------------------- +%%% Déclarations +%%% ---------------------------------------------------------------------------- + +numeric gddA[]; +numeric gddB[]; +numeric gddC[]; +numeric gddD[]; +numeric gddE[]; +numeric gddF[]; +numeric gddX[][]; +picture gddL[]; % Table des labels TeX (btex .. etex) +numeric gddO; % Compteur des objets +path gddP[]; % Table des chemins (paths internes) +path gddPX[][]; % Tables des chemins étendues +string gddS[]; % Table des chaînes (noms de fichiers) +string gddT[]; % Table des types +numeric gddU; % Unité graphique +string gddW; % Chaîne spécifiant le placement des objets + +%%% ---------------------------------------------------------------------------- +%%% Initialisations +%%% ---------------------------------------------------------------------------- + +% Initialisation de gddO ------------------------------------------------------- +gddO := 0; + +% Valeur par défaut de gddU ---------------------------------------------------- +gddU := 1cm; + +% Initialisation de gddW et procédure associée --------------------------------- +gddW = "scaled gddU"; +def gddEnPlace = scantokens gddW enddef; + +%%% ---------------------------------------------------------------------------- +%%% Définition des objets +%%% ---------------------------------------------------------------------------- + +% Point ------------------------------------------------------------------------ +vardef Point(expr a,b) = + gddT[incr gddO] = "point"; + gddA[gddO] = a; gddB[gddO] = b; gddO +enddef; + +vardef PointPolaire(expr r,a) = + % r : rayon + % a : angle en radian + gddT[incr gddO] = "point"; + gddA[gddO] = r*cos(a); gddB[gddO] = r*sin(a); gddO +enddef; + +vardef PointDansRepere(expr x,y,o,i,j) = + gddT[incr gddO] = "point"; + gddA[gddO] = gddA[o] + x*(gddA[i]-gddA[o]) + y*(gddA[j]-gddA[o]); + gddB[gddO] = gddB[o] + x*(gddB[i]-gddB[o]) + y*(gddB[j]-gddB[o]); + gddO +enddef; + +vardef CoordonneesRepere(expr m,o,i,j) = + save x,y; numeric x,y; + gddA[m] = (gddA[i]-gddA[o])*x + (gddA[j]-gddA[o])*y + gddA[o]; + gddB[m] = (gddB[i]-gddB[o])*x + (gddB[j]-gddB[o])*y + gddB[o]; + (x,y) +enddef; + +vardef Milieu(expr a,b) = + gddT[incr gddO] = "point"; + gddA[gddO] = 0.5*(gddA[a]+gddA[b]); + gddB[gddO] = 0.5*(gddB[a]+gddB[b]); + gddO +enddef; + +vardef Rotation(expr A, a) = + % A : point + % a : angle + save _tmp,n; + n = incr gddO; + _tmp = PointImp(A); + gddT[n] = "point"; + gddA[n] = cos(a)*gddA[_tmp]-sin(a)*gddB[_tmp]; + gddB[n] = sin(a)*gddA[_tmp]+cos(a)*gddB[_tmp]; + n +enddef; + +vardef RotationCentre(expr A, C, a) = + % A : point + % C : point centre de la rotation + % a : angle + save _tmp,_tmp,n; + n = incr gddO; + _tmp1 = PointImp(A); + _tmp2 = PointImp(C); + gddT[n] = "point"; + gddA[n] = cos(a)*(gddA[_tmp1]-gddA[_tmp2])-sin(a)*(gddB[_tmp1]-gddB[_tmp2])+gddA[_tmp2]; + gddB[n] = sin(a)*(gddA[_tmp1]-gddA[_tmp2])+cos(a)*(gddB[_tmp1]-gddB[_tmp2])+gddB[_tmp2]; + n +enddef; + +vardef IsoBarycentre(text t) = + save n, G; + pair G; numeric n; + G := origin; n:=0; + for a=t: + G:=G+PairImp(a); + n:=n+1; + endfor; + PointImp(G/n) +enddef; + +vardef Barycentre(text t) = + % liste sous la forme (A,a),(B,b),(C,c), etc. + save n, Gs; + pair G; numeric n; + G := origin; n:=0; + for a=t: + G:=G+((ypart a)*Pt(xpart a)); + n:=n+(ypart a); + endfor; + PointImp(G/n) +enddef; + + +% Transformations pair <-> Point ----------------------------------------------- +def PointTOPair(expr a) = (gddA[a],gddB[a]) enddef; +def PairTOPoint(expr p) = Point(xpart p,ypart p) enddef; +def PairImp(expr a) = if pair a: a else: PointTOPair(a) fi enddef; +def PointImp(expr a) = if pair a: PairTOPoint(a) else: a fi enddef; +def Pt(expr a) = (gddA[a],gddB[a]) enddef; +def PtR(expr a) = (gddA[a],gddB[a]) gddEnPlace enddef; + +% Transformations pair <-> Point ----------------------------------------------- +def VecteurTOPair(expr a) = (gddA[a],gddB[a]) enddef; +def PairTOVecteur(expr p) = Vecteur(xpart p,ypart p) enddef; + +% Abscisse et ordonnées -------------------------------------------------------- +vardef Abscisse(expr a) = if pair a: xpart a else: gddA[a] fi enddef; +vardef Ordonnee(expr a) = if pair a: ypart a else: gddB[a] fi enddef; + + +% Addition --------------------------------------------------------------------- +vardef AdditionAbscisses(expr a,b) = if pair a: xpart a else: gddA[a] fi + if pair b: xpart b else: gddA[b] fi enddef; +vardef AdditionOrdonnees(expr a,b) = if pair a: ypart a else: gddB[a] fi + if pair b: ypart b else: gddB[b] fi enddef; +vardef Addition(expr a,b) = + gddT[incr gddO] = "point"; + gddA[gddO] = AdditionAbscisses(a,b); + gddB[gddO] = AdditionOrdonnees(a,b); + gddO +enddef; + +vardef Longueur (expr a,b) = + abs(PairImp(a)-PairImp(b)) +enddef; + +vardef Bissectrice(expr a,b,c) = + % bisectrice du secteur angulaire défini par les points (abc) + save dba,dbc,ap,cp; + dba = Droite(b,a); + dbc = Droite(b,c); + ap = ReportSurDroite(b,dba,2); + cp = ReportSurDroite(b,dbc,2); + %% C'est une bonne idée cette procédure ReportSurDroite ! + %% Pour obtenir la bissectrice il suffit de prendre la droite qui joint + %% le sommet au milieu du segment dont les extrémités sont les reports. + %% Ainsi le cas où les droites (b,a) et (b,c) sont confondues est traité. + Droite(b,Milieu(ap,cp)) +enddef; + +% Vecteur ---------------------------------------------------------------------- +vardef Vecteur (expr a,b) = + save n; n = incr gddO; + gddT[n] = "vecteur"; gddA[n] = a; gddB[n] = b; n +enddef; + +vardef VecteurP (expr a) = + % définition d’un vecteur à partir d’un pair + save n; n = incr gddO; + gddT[n] = "vecteur"; gddA[n] =xpart a; gddB[n] = ypart a; n +enddef; + +vardef ScalaireVecteur (expr k,a) = + % multiplication par un scalaire + % k : scalaire + % a : vecteur + save x,y; + x = k*gddA[a]; + y = k*gddB[a]; + Vecteur(x,y) +enddef; + +vardef AdditionVecteur (expr u,v) = + save n,x,y; n = incr gddO; + gddT[n] = "vecteur"; + x = gddA[u]+gddA[v]; + y = gddB[u]+gddB[v]; + gddA[n] = x; gddB[n] = y; n +enddef; + +vardef SoustractionVecteur (expr u,v) = + save n,x,y; n = incr gddO; + gddT[n] = "vecteur"; + x = gddA[u]-gddA[v]; + y = gddB[u]-gddB[v]; + gddA[n] = x; gddB[n] = y; n +enddef; + + +vardef ProduitScalaire (expr u,v)= + (gddA[u]*gddA[v]+gddB[u]*gddB[v]) +enddef; + +vardef Norme (expr s) = + sqrt(gddA[s]**2+gddB[s]**2) +enddef; + +vardef VecteursAngle (expr u,v)= + arccos((ProduitScalaire(u,v))/(Norme(u)*Norme(v))) +enddef; + +% Segment ---------------------------------------------------------------------- +vardef Segment (expr a,b) = + save n; n = incr gddO; + gddT[n] = "segment"; gddA[n] = PointImp(a); gddB[n] = PointImp(b); n +enddef; + +vardef LongueurSegment (expr s) = + abs(Pt(gddA[s])-Pt(gddB[s])) +enddef; + +vardef SegmentTOVecteur (expr s)= + VecteurP(Pt(gddB[s])-Pt(gddA[s])) +enddef; + + +% Triangle --------------------------------------------------------------------- +vardef Triangle (expr a,b,c) = + save n; n = incr gddO; gddT[n] = "triangle"; + gddA[n] = PointImp(a); gddB[n] = PointImp(b); gddC[n] = PointImp(c); n +enddef; + +% Drawing with Metapost, Thurston +vardef Orthocentre (expr t) = + save A,B,C,D,p,q; + pair A,B,C,D,p,q; + A = PointTOPair(gddA[t]); + B = PointTOPair(gddB[t]); + C = PointTOPair(gddC[t]); + p = whatever[B,C] ; A-p = whatever*(B-C) rotated 90; + q = whatever[C,A] ; B-q = whatever*(C-A) rotated 90; + D = whatever[A,p] = whatever[B,q]; + PairTOPoint(D) +enddef; + + + +vardef AireTriangle ( expr t) = + save droite,h,l; + droite = Droite(gddA[t],gddB[t]); + h = ProjectionPointSurDroite(gddC[t],droite); + l = Longueur(gddC[t],h); + (Longueur(gddA[t],gddB[t])*l/2.0) +enddef; + +vardef CercleInscrit(expr t) = + save AB,BC,CA,a,b,c,I,Aire,rayon; + c = Longueur(gddA[t],gddB[t]); + a = Longueur(gddB[t],gddC[t]); + b = Longueur(gddC[t],gddA[t]); + I = Barycentre((gddA[t],a),(gddB[t],b),(gddC[t],c)); + Aire = AireTriangle(t); + rayon = 2*Aire/(a+b+c); + Cercle(I,rayon) +enddef; + + +vardef CercleExinscrit(expr t,n) = + % t : gdd triangle + % s : 1,2 ou 3 pour choisir AB, BC ou CA + save AB,BC,CA,a,b,c,I,p,Aire,rayon; + c = Longueur(gddA[t],gddB[t]); + a = Longueur(gddB[t],gddC[t]); + b = Longueur(gddC[t],gddA[t]); + p = (a+b+c)/2.0; + Aire = AireTriangle(t); + if(n=1): + rayon = Aire/(p-a); + I = Barycentre((gddA[t],-a),(gddB[t],b),(gddC[t],c)); + elseif(n=2): + rayon = Aire/(p-b); + I = Barycentre((gddA[t],a),(gddB[t],-b),(gddC[t],c)); + elseif(n=3): + rayon = Aire/(p-c); + I = Barycentre((gddA[t],a),(gddB[t],b),(gddC[t],-c)); + fi + Cercle(I,rayon) +enddef; + +vardef CercleCirconscrit(expr t) = + % t : gdd triangle + CercleTroisPoints(gddA[t],gddB[t],gddC[t]) +enddef; + +vardef CercleEuler(expr t) = + % t : gdd triangle + % cercle des neuf points + save D,C,N,r; + pair N; + D = Orthocentre(t); + C = CercleCirconscrit(t); + N = 0.5[Pt(D),Pt(Centre(C))]; + r = abs(N-1/2[Pt(gddA[t]),Pt(gddB[t])]); % un des neuf points est le + % milieu de [A,B] + Cercle(N,r) +enddef; + + +% Polygones -------------------------------------------------------------------- +vardef Polygone (text plist) = + save n,_point,i; n = incr gddO; gddT[n] = "polygone"; + i:=1; + for _point = plist: + gddX[gddO][i] = PointImp(_point); + i:=i+1; + endfor + gddB[n] = i-1; % nombre de côté + gddA[n] = IsoBarycentre(plist); % centre + n +enddef; + +vardef PolygoneRegulier (expr N,s,r,t)= + % N : (entier) nombre de côtés + % s : (numeric) rayon du cercle circonscrit + % r : (numeric en degré) rotation du polygone (premier point + % commence sur l’axe des abscisses) + % t : (pair ou point) translation + save n,_point,i; n = incr gddO; gddT[n] = "polygone"; + pair _point; + for i=1 upto N: + _point := (s*cos((2*Pi/N)*(i-1)+r/180*Pi),s*sin((2*Pi/N)*(i-1)+r/180*Pi))+PairImp(t); + gddX[n][i] = PointImp(_point); + endfor + gddB[n] = N; % nombre de côtés + gddA[n] = PointImp(t); % centre + n +enddef; + +def NombreCotesPolygone(expr p) = + gddA[p] +enddef; + +def PointPolygone(expr p,i) = + gddX[p][i] +enddef; + +% Droite ----------------------------------------------------------------------- +vardef Droite (expr a,b) = + save n; n = incr gddO; + gddT[n] = "droite"; gddA[n] = PointImp(a); gddB[n] = PointImp(b); n +enddef; + +% Équation de droite : triplet (u,v,w) tel que ux+vy+w=0 ----------------------- +% L'équation rendue est normalisée ! +vardef EquationDroite(expr d) = + save u, v, w, n; + u := gddB[gddB[d]] - gddB[gddA[d]]; + v := gddA[gddA[d]] - gddA[gddB[d]]; + w := - u * gddA[gddA[d]] - v * gddB[gddA[d]]; + n := u ++ v; + (u/n,v/n,w/n) +enddef; + +% Ordonnée relative à une droite orientée -------------------------------------- +vardef OrdonneeRelativePointDroite(expr p, d) = + savec u, v, w; + (u,v,w) = EquationDroite(d); + u * gddA[p] + v * gddB[p] + w +enddef; + +% Distance d'un point à une droite --------------------------------------------- +def DistancePointDroite(expr p, d) = + abs(OrdonneeRelativePointDroite(p, d)) +enddef; + +% Projection d'un point sur une droite ----------------------------------------- +vardef ProjectionPointSurDroite(expr p, d) = + save u,v,w, l; + (u,v,w) = EquationDroite(d); + l := - u * gddA[p] - v * gddB[p] - w; + Point(gddA[p] + l * u, gddB[p] + l * v) +enddef; + +% Droite perpendicalaire ------------------------------------------------------- + +vardef DroitePerpendiculaire (expr D,p) = + % D : droite par rapport à laquelle on doit être perpendiculaire + % p : point par lequel doit passer la droite + save n,_t,A,B,v,pP,pD; n = incr gddO; + pair _t,A,B,v,q; + A := Pt(gddA[D]); + B := Pt(gddB[D]); + v := B-A; v := (-(ypart v), xpart v); %% Vecteur normal à B-A + q := Pt(p) + v; + Droite(p,q) +enddef; + +vardef ReportSurDroite(expr P,D,d) = + % P : point de départ du segment + % D : droite sur laquelle construire le point + % d : longueure du segment + save n,_t; n = incr gddO; + pair _t; + _t := PairImp(P)+d*unitvector(Pt(gddB[D])-Pt(gddA[D])); + gddT[n] = "point"; gddA[n] = xpart _t; gddB[n] = ypart _t; n +enddef; + +% Intersection de deux droites ------------------------------------------------- +vardef IntersectionDroites (expr a,b) = + save _p; + pair _p; + _p := mpIntersectionDroites(Pt(gddA[a]),Pt(gddB[a]),Pt(gddA[b]),Pt(gddB[b])); + PairTOPoint(_p) +enddef; + +% Cercles ---------------------------------------------------------------------- +vardef Cercle (expr a,b) = + save n; n = incr gddO; + gddT[n] = "cercle"; gddA[n] = PointImp(a); gddB[n] = b; n +enddef; + + +vardef Rayon(expr c) = + gddB[c] +enddef; + + +vardef CercleCP(expr a,b) = Cercle(a,abs(Pt(a)-Pt(b))) enddef; +vardef CercleD(expr a,b) = CercleCP(Milieu(a,b),a) enddef; + +% Drawing with MetaPost Thurston +vardef CercleTroisPoints(expr A, B, C) = + save o; pair o; + o = whatever * (Pt(A)-Pt(B)) rotated 90 shifted 1/2 [Pt(A),Pt(B)] = whatever * (Pt(B)-Pt(C)) rotated 90 shifted 1/2 [Pt(B),Pt(C)]; + Cercle(o,abs(Pt(A)-o)) +enddef; + +vardef AxeDeSimilitude(expr a,b,c) = + % Axe de similitude de trois cercles + save T,E; + numeric T[],E[]; + T1 = TangenteCommuneExterieure(a,b); + T2 = TangenteCommuneExterieure(b,a); + T3 = TangenteCommuneExterieure(b,c); + T4 = TangenteCommuneExterieure(c,b); + E1 = IntersectionDroites(T1,T2); + E2 = IntersectionDroites(T3,T4); + Droite(E1,E2) +enddef; + + + +% Tangente commune extérieure à deux cercles ----------------------------------- +vardef TangenteCommuneExterieure(expr a, b) = + save O, A, d, f; pair O, A; + O = (gddB[a]/(gddB[a]-gddB[b]))[Pt(gddA[a]),Pt(gddA[b])]; % Centre de l'homothétie + d = abs(O-Pt(gddA[a])); + f := if gddA[a] < gddA[b] : 1 else: -1 fi; + A = Pt(gddA[a]) rotatedaround(O,angle(d+-+gddB[a],f*gddB[a])); + Droite(O,A) +enddef; + +% Tangente commune intérieure à deux cercles ----------------------------------- +vardef TangenteCommuneInterieure(expr a, b) = + save O, A, d, f; pair O, A; + O = (gddB[a]/(gddB[a]+gddB[b]))[Pt(gddA[a]),Pt(gddA[b])]; % Centre de l'homothétie + d = abs(O-Pt(gddA[a])); + f := if gddA[a] < gddA[b] : 1 else: -1 fi; + A = Pt(gddA[a]) rotatedaround(O,angle(d+-+gddB[a],f*gddB[a])); + Droite(O,A) +enddef; + + +% Intersection de deux cercles ------------------------------------------------- +vardef IntersectionCercles (expr a, b) = + save d, x, y, u; pair u; + u = unitvector(Pt(gddA[b])-Pt(gddA[a])); + d = abs(Pt(gddA[a])-Pt(gddA[b])); + x = (gddB[a]**2-gddB[b]**2+d**2)/(2d); + y = gddB[a]+-+x; + PairTOPoint(Pt(gddA[a])+x*u+y*(u rotated 90)) +enddef; + + + +% Intersection d’une droite et d’un cercle ------------------------------------ +vardef IntersectionDroiteCercle (expr D, CC, n) = + % D : droite + % CC : cercle + % n : identification du point 1 ou 2, le même si point unique + % résolution par le calcul + save a,b,c,Xc,Yc,R,A,B,C,Delta,Xp,Yp; + numeric a,b,c,Xc,Yc,R,A,B,C,Delta,Xp,Yp; + (a,b,c) = EquationDroite(D); + (Xc,Yc) = Pt(Centre(CC)); + R := Rayon(CC); + if(b=0): % si la droite est verticale + Xp := xpart Pt(gddA[D]); + A := 1; + B := 2*(-Yc); + C := Yc**2+(Xp-Xc)**2-R**2; + Delta := B**2-4*A*C; + if(Delta>0): + if(n=1): + Yp := (-B - sqrt(Delta))/(2*A); + elseif(n=2): + Yp := (-B + sqrt(Delta))/(2*A); + fi + elseif(Delta=0): + Yp := -B/(2*A); + fi + else: + if(abs(a/b)<8): % si la droite est suffisamment horizontale + A := 1+(-a/b)**2; + B := 2*((-a/b)*(-c/b-Yc)-Xc); + C := Xc**2+(-c/b-Yc)**2-R**2; + Delta := B**2-4*A*C; + if(Delta>0): + if(n=1): + Xp := (-B - sqrt(Delta))/(2*A); + Yp := (-a/b*Xp-c/b); + elseif(n=2): + Xp := (-B + sqrt(Delta))/(2*A); + Yp := (-a/b*Xp-c/b); + fi + elseif(Delta=0): + Xp := -B/(2*A); + Yp := -a/b*Xp-c/b; + else: + errmessage("! Intersection between line and circle does not exist") + fi + else: % sinon + A := 1+(b/a)**2; + B := 2*((b/a)*(c/a+Xc)-Yc); + C := Yc**2+(c/a+Xc)**2-R**2; + Delta := B**2-4*A*C; + if(Delta>0): + if(n=1): + Yp := (-B - sqrt(Delta))/(2*A); + Xp := (-b/a*Yp-c/a); + elseif(n=2): + Yp := (-B + sqrt(Delta))/(2*A); + Xp := (-b/a*Yp-c/a); + fi + elseif(Delta=0): + Yp := -B/(2*A); + Xp := -b/a*Yp-c/a; + else: + errmessage("! Intersection between line and circle does not exist") + fi + fi + fi + Point(Xp,Yp) +enddef; + + +% Inversion par rapport à un cercle ------------------------------------------- +vardef Inversion (expr P, C) = + save O,r,s,Cc,Pp,rr,Co,Po,ro,M,iM,R; + O = Centre(C); + r = Rayon(C); + if(gddT[P]="point"): + s = r / Longueur(P,O); + PairTOPoint(Pt(O) + (Pt(P) - Pt(O)) * s * s) + elseif(gddT[P]="cercle"): + Cc = Centre(P); + rr = Rayon(P); + if(Longueur(O,Cc)=rr): % si le cercle objet passe par le centre du cercle + % % d’inversion + % point du cercle sur rayon passant par les deux centre + M = PairTOPoint(Pt(Cc)+Pt(Cc)-Pt(O)); + % inversion de ce point + iM = Inversion(M,C); + R = Droite(O,iM); + DroitePerpendiculaire(R,iM) + else: + Pp = PairTOPoint(Pt(Cc)+rr*right); + Co = Inversion(Cc,C); + Po = Inversion(Pp,C); + CercleCP(Co,Po) + fi + elseif(gddT[P]="droite"): + R = DroitePerpendiculaire(P,O); + iM = IntersectionDroites(R,P); + M = Inversion(iM,C); + Cc = Milieu(O,M); + CercleCP(Cc,O) + fi +enddef; + + +% Axe radical entre deux cercles ----------------------------------------------- +% drawing with metapost Thurston +vardef AxeRadical (expr CA, CB) = + save O,ra,rb,d,t,C_CA,C_CB,_p,_q; + pair _p,_q; + ra = Rayon(CA); + rb = Rayon(CB); + C_CA = Centre(CA); + C_CB = Centre(CB); + d = abs(Pt(C_CA) - Pt(C_CB)); + 2t = 1 + (ra+rb) / d * (ra-rb) / d; + _p := up scaled 2*gddU + rotated angle (Pt(C_CB) - Pt(C_CA)) + shifted t[Pt(C_CA), Pt(C_CB)]; + _q := down scaled 2*gddU + rotated angle (Pt(C_CB) - Pt(C_CA)) + shifted t[Pt(C_CA), Pt(C_CB)]; + Droite(_p,_q) +enddef; + +% Centre radical de trois cercles --------------------------------------------- +% drawing with metapost Thurston +vardef CentreRadical (expr CA, CB, CC) = + save DAB,DAC; + DAB = AxeRadical(CA,CB); + DAC = AxeRadical(CA,CC); + IntersectionDroites(DAB,DAC) +enddef; + +vardef Centre(expr c) = + % pour cercle, ellipse et polygone + if((gddT[c] = "ellipse") or (gddT[c] = "cercle") or (gddT[c] = "polygone") or (gddT[c] = "hyperbole")): + gddA[c] + fi +enddef; + +% Chemin ----------------------------------------------------------------------- +vardef Chemin (expr p) = + gddT[incr gddO] = "chemin"; gddP[gddO] = p; gddO +enddef; + +vardef LigneBrisee(text t)= + save n, _p,a,i; + path _p; + i:=0; + for a=t: + if(i=0): + _p:=PairImp(a); + else: + _p:=_p--PairImp(a); + fi + i:=i+1; + endfor; + Chemin(_p) +enddef; + +% Courbe ----------------------------------------------------------------------- +vardef CourbeDat (expr s, c) = + % c = 1 ou 0, selon que la courbe doit être fermée ou pas ! + gddT[incr gddO] = "courbe"; gddS[gddO] = s; gddA[gddO] = c; gddO +enddef; + +% Homothétie ------------------------------------------------------------------ +vardef HomothetiePoint (expr p,o,k) = + % p : point + % o : centre homothetie + % k : facteur + save OP,OM; + pair OP,OM; + OP = PairImp(p)-PairImp(o); + OM = k*OP; + PairTOPoint(PairImp(o)+OM) +enddef; + + +vardef Homothetie (expr p,o,k) = + % p : objet + % o : centre homothetie + % k : facteur + save A,B,C,R,_p,X,n; + numeric X[]; + pair _p; + if((gddT[p]="point")): + HomothetiePoint(p,o,k) + elseif((gddT[p]="vecteur")): + A = HomothetiePoint(p,o,k); + Vecteur(gddA[A],gddB[A]) + elseif((gddT[p]="segment")): + A = HomothetiePoint(gddA[p],o,k); + B = HomothetiePoint(gddB[p],o,k); + Segment(A,B) + elseif((gddT[p]="droite")): + A = HomothetiePoint(gddA[p],o,k); + B = HomothetiePoint(gddB[p],o,k); + Droite(A,B) + elseif(gddT[p]="triangle"): + A = HomothetiePoint(gddA[p],o,k); + B = HomothetiePoint(gddB[p],o,k); + C = HomothetiePoint(gddC[p],o,k); + Triangle(A,B,C) + elseif(gddT[p]="cercle"): + A = HomothetiePoint(gddA[p],o,k); + R = k*Rayon(p); + Cercle(A,R) + elseif(gddT[p]="ellipse"): + % homothetie des foyers + A = HomothetiePoint(gddD[p],o,k); + B = HomothetiePoint(gddE[p],o,k); + % echelle du demi grand axe + R = k*gddX[p][1]; + EllipseF(A,B,R) + elseif(gddT[p]="parabole"): + A = HomothetiePoint(Foyer(p,1),o,k); + B = Directrice(p,1); + C = Homothetie(B,o,k); + ParaboleFD(A,C) + elseif(gddT[p]="hyperbole"): + A = HomothetiePoint(Foyer(p,1),o,k); + B = Directrice(p,1); + C = Homothetie(B,o,k); + HyperboleFD(A,C) + elseif(gddT[p]="polygone"): + % reprise du constructeur + n = incr gddO; gddT[n] = "polygone"; + for i=1 upto gddA[p]: + gddX[n][i] := HomothetiePoint(gddX[p][i],o,k); + endfor + gddA[n] := gddA[p]; % nombre de côté + gddB[n] := HomothetiePoint(gddB[p],o,k); % centre + n + elseif(gddT[p]="chemin"): + _p := PairImp(o); + Chemin(((gddP[p] shifted (-_p)) scaled k) shifted _p) + fi +enddef; + +% Symétrie ------------------------------------------------------------------ +vardef SymetrieAxialePoint (expr p,d) = + % p : point + % d : axe de symétrie + save O,l,D; + O = ProjectionPointSurDroite(p,d); + l = Longueur(p,O); + D = Droite(p,O); + ReportSurDroite(p,D,2*l) +enddef; + + +vardef SymetrieAxiale (expr p,d) = + % p : objet + % d : axe de symétrie + save A,B,C,R,_p,X,n; + numeric X[]; + pair _p; + if((gddT[p]="point")): + SymetrieAxialePoint(p,d) + elseif((gddT[p]="vecteur")): + A = SymetrieAxialePoint(p,d); + Vecteur(gddA[A],gddB[A]) + elseif((gddT[p]="segment")): + A = SymetrieAxialePoint(gddA[p],d); + B = SymetrieAxialePoint(gddB[p],d); + Segment(A,B) + elseif((gddT[p]="droite")): + A = SymetrieAxialePoint(gddA[p],d); + B = SymetrieAxialePoint(gddB[p],d); + Droite(A,B) + elseif(gddT[p]="triangle"): + A = SymetrieAxialePoint(gddA[p],d); + B = SymetrieAxialePoint(gddB[p],d); + C = SymetrieAxialePoint(gddC[p],d); + Triangle(A,B,C) + elseif(gddT[p]="cercle"): + A = SymetrieAxialePoint(gddA[p],d); + R = Rayon(p); + Cercle(A,R) + elseif(gddT[p]="ellipse"): + % homothetie des foyers + A = SymetrieAxialePoint(gddD[p],d); + B = SymetrieAxialePoint(gddE[p],d); + % echelle du demi grand axe + R = gddX[p][1]; + EllipseF(A,B,R) + elseif(gddT[p]="parabole"): + A = SymetrieAxialePoint(Foyer(p,1),d); + B = Directrice(p,1); + C = SymetrieAxiale(B,d); + ParaboleFD(A,C) + elseif(gddT[p]="hyperbole"): + A = SymetrieAxialePoint(Foyer(p,1),d); + B = Directrice(p,1); + C = SymetrieAxiale(B,d); + HyperboleFD(A,C) + elseif(gddT[p]="polygone"): + % reprise du constructeur + n = incr gddO; gddT[n] = "polygone"; + for i=1 upto gddA[p]: + gddX[n][i] := SymetrieAxialePoint(gddX[p][i],d); + endfor + gddA[n] := gddA[p]; % nombre de côté + gddB[n] := SymetrieAxialePoint(gddB[p],d); % centre + n + fi +enddef; + +% Symétrie ------------------------------------------------------------------ +vardef SymetrieCentralePoint (expr p,d) = + % p : point + % d : point centre de symétrie + save O,l,D; + RotationCentre(p,d,Pi) +enddef; + + +vardef SymetrieCentrale (expr p,d) = + % p : objet + % d : point centre de symétrie + save A,B,C,R,X,n; + numeric X[]; + if((gddT[p]="point")): + SymetrieCentralePoint(p,d) + elseif((gddT[p]="vecteur")): + A = SymetrieCentralePoint(p,d); + Vecteur(gddA[A],gddB[A]) + elseif((gddT[p]="segment")): + A = SymetrieCentralePoint(gddA[p],d); + B = SymetrieCentralePoint(gddB[p],d); + Segment(A,B) + elseif((gddT[p]="droite")): + A = SymetrieCentralePoint(gddA[p],d); + B = SymetrieCentralePoint(gddB[p],d); + Droite(A,B) + elseif(gddT[p]="triangle"): + A = SymetrieCentralePoint(gddA[p],d); + B = SymetrieCentralePoint(gddB[p],d); + C = SymetrieCentralePoint(gddC[p],d); + Triangle(A,B,C) + elseif(gddT[p]="cercle"): + A = SymetrieCentralePoint(gddA[p],d); + R = Rayon(p); + Cercle(A,R) + elseif(gddT[p]="ellipse"): + % homothetie des foyers + A = SymetrieCentralePoint(gddD[p],d); + B = SymetrieCentralePoint(gddE[p],d); + % echelle du demi grand axe + R = gddX[p][1]; + EllipseF(A,B,R) + elseif(gddT[p]="parabole"): + A = SymetrieCentralePoint(Foyer(p,1),d); + B = Directrice(p,1); + C = SymetrieCentrale(B,d); + ParaboleFD(A,C) + elseif(gddT[p]="hyperbole"): + A = SymetrieCentralePoint(Foyer(p,1),d); + B = Directrice(p,1); + C = SymetrieCentrale(B,d); + HyperboleFD(A,C) + elseif(gddT[p]="polygone"): + % reprise du constructeur + n = incr gddO; gddT[n] = "polygone"; + for i=1 upto gddA[p]: + gddX[n][i] := SymetrieCentralePoint(gddX[p][i],d); + endfor + gddA[n] := gddA[p]; % nombre de côté + gddB[n] := SymetrieCentralePoint(gddB[p],d); % centre + n + fi +enddef; + +vardef PointDe(expr o,t)= + % t: paramètre le long de l’objet entre 0 et 1 + % o: objet mpgdd + save _l,_t,_p; + path _p; + if((gddT[o]="point")): + o + else: + _p := gddTraceObjet(o); + _l := length(_p); + PointImp(point (t*_l) of _p) + fi +enddef; + +%%% ---------------------------------------------------------------------------- +%%% Définitions liées au repère +%%% ---------------------------------------------------------------------------- + +% Définition de l'origine ------------------------------------------------------ +origine = Point(0,0); + +% Définition des axes ---------------------------------------------------------- +AxeOx = Droite(origin,right); +AxeOy = Droite(origin,up); + +%%% ---------------------------------------------------------------------------- +%%% Calculs MetaPost +%%% ---------------------------------------------------------------------------- + +vardef mpIntersectionDroites (expr a,b,c,d) = + save t; pair t; t = whatever [a,b]; t = whatever [c,d]; t +enddef; + +%%% -------------------------------------------------------------------------- +%%% Tracés des courbes +%%% -------------------------------------------------------------------------- +vardef gddTraceCourbe (expr f, c) = + save s; gdata(f, s, if i>1:..fi (scantokens s1,scantokens s2)) if c>0:..cycle fi +enddef; + +%%% ---------------------------------------------------------------------------- +%%% Tracés des objets +%%% ---------------------------------------------------------------------------- + +gddExtensionDroite := 10; + + +def gddTracePolygone expr o= +%show "test"; + for i=1 upto gddB[o]: + PointTOPair(gddX[o][i])-- + endfor + cycle +enddef; + +def gddTraceEllipse expr o= + (fullcircle xscaled (2*gddX[o][1]) yscaled (2*gddX[o][2])) rotated gddX[o][4] shifted PairImp(gddA[o]) +enddef; + +def gddTraceObjet expr o = + if gddT[o] = "triangle": + PointTOPair(gddA[o])--PointTOPair(gddB[o])-- + PointTOPair(gddC[o])--cycle + elseif (gddT[o] = "segment") : + PointTOPair(gddA[o])--PointTOPair(gddB[o]) + elseif (gddT[o] = "vecteur"): + (0,0)--(gddA[o],gddB[o]) + elseif gddT[o] = "droite": + (gddExtensionDroite [ PointTOPair(gddA[o]), PointTOPair(gddB[o]) ]) -- + (gddExtensionDroite [ PointTOPair(gddB[o]), PointTOPair(gddA[o]) ]) + elseif gddT[o] = "cercle": + fullcircle scaled (gddB[o]*2) shifted PointTOPair(gddA[o]) + elseif gddT[o] = "ellipse": + gddTraceEllipse (o) + elseif ((gddT[o] = "chemin") or (gddT[o] = "parabole")): + gddP[o] + elseif gddT[o] = "courbe": + %message "This is a debug message."; + gddTraceCourbe (gddS[o] & ".dat", gddA[o]) + elseif gddT[o] = "polygone": + gddTracePolygone (o) + fi +enddef; + +def trace expr p = + if path p or picture p or pair p: draw (p) + elseif gddT[p] = "vecteur": drawarrow (gddTraceObjet p) + else: draw (gddTraceObjet p) + fi + gddEnPlace +enddef; + +def fleche expr p = + if path p or picture p: drawarrow (p) + else: drawarrow (gddTraceObjet p) + fi gddEnPlace +enddef; + +def colorie expr p = + if path p: fill p else: fill (gddTraceObjet p) fi gddEnPlace +enddef; + +def fermeture expr p = + if path p: p else: (gddTraceObjet p) fi -- cycle +enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + +%%% -------------------------------------------------------------------------- +%%% Marque et label des points +%%% -------------------------------------------------------------------------- +gddTaillePoint := 3; % Diamètre des cercles marquant un point. +color gddCouleurPoint; % Couleur de fond de la marque d'un point. +gddCouleurPoint := white; +gddTailleLabel := 1; % Taille d'un label. +string gddPointeType; +gddPointeType := "pointe"; + + +def gddPointe(expr p) = + fill (fullcircle scaled gddTaillePoint) shifted (p gddEnPlace) + withcolor gddCouleurPoint; + draw (fullcircle scaled gddTaillePoint) shifted (p gddEnPlace) +enddef; + +def gddDisque(expr p) = + fill (fullcircle scaled gddTaillePoint) shifted (p gddEnPlace) +enddef; + +def gddCroix(expr p) = + draw (gdd_marque2 scaled (gddTaillePoint/7)) shifted (p gddEnPlace) +enddef; + +def pointe expr p = + if(gddPointeType="pointe"): + gddPointe(if pair p: p else: PointTOPair(p) fi) + elseif(gddPointeType="croix"): + gddCroix(if pair p: p else: PointTOPair(p) fi) + elseif(gddPointeType="disque"): + gddDisque(if pair p: p else: PointTOPair(p) fi) + fi +enddef; + + + +%%% -------------------------------------------------------------------------- +%%% Signes +%%% -------------------------------------------------------------------------- +def SigneOrtho(expr a,b,c,x) = + (Pt(b) + x * unitvector(Pt(a)-Pt(b))) + -- (Pt(b) + x * unitvector(Pt(a) - Pt(b)) + + x * unitvector(Pt(c) - Pt(b))) + -- (Pt(b) + x * unitvector(Pt(c) - Pt(b))) +enddef; + +picture gdd_marque[]; +gdd_marque1 = image(draw (-7,-7)--(7,7)); +gdd_marque2 = image(draw (-7,-7)--(7,7); draw (-7,7)--(7,-7)); +gdd_marque3 = image(draw (-9,-7)--(5,7); draw (-5,-7)--(9,7); + draw (-7,7)--(7,-7)); +gdd_marque4 = image(draw (-9,-7)--(5,7); draw (-5,-7)--(9,7); + draw (-9,7)--(5,-7); draw (-5,7)--(9,-7)); + +def Marque(expr a,b,n) = + gdd_marque[n] rotated angle(PairImp(b)-PairImp(a)) scaled (0.5/gddU) + shifted 0.5[PairImp(a),PairImp(b)] +enddef; + +vardef MarqueTrait(expr s,n) = + save chemin; + path chemin; + if path s: + chemin:=s; + elseif(numeric s): + chemin:= gddTraceObjet(s) + fi; + gdd_marque[n] scaled (0.5/gddU) + shifted _milieuChemin(chemin,0.5) +enddef; + +%%% -------------------------------------------------------------------------- +%%% Fenêtrage +%%% -------------------------------------------------------------------------- + +def Fenetre(expr xg,yg,xd,yd) = + gddXG := xg; + gddYB := yg; + gddXD := xd; + gddYH := yd; + extra_endfig := "gddFenetre;" & extra_endfig; +enddef; + +def gddFenetre = + clip currentpicture to + ((gddXG,gddYB)--(gddXG,gddYH)--(gddXD,gddYH)--(gddXD,gddYB)--cycle) + gddEnPlace; + draw ((gddXG,gddYB)--(gddXG,gddYH)--(gddXD,gddYH)--(gddXD,gddYB)--cycle) + gddEnPlace withpen pencircle scaled 1 withcolor background; +enddef; + +endinput diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-plt.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-plt.mp new file mode 100644 index 0000000000..6ab6ff7a35 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-plt.mp @@ -0,0 +1,97 @@ +% +% Courbe param�tr�e +% ------------------------------------------------------------------------------ +vardef Courbe(suffix fx)(suffix fy)(expr ti,tf,n) = + save fpas; fpas := (tf-ti)/n; + (fx(ti),fy(ti)) for i=1 upto n: ..(fx(ti+i*fpas),fy(ti+i*fpas)) endfor +enddef; + +% +% Repr�sentation de fonction +% ------------------------------------------------------------------------------ +vardef Representation(suffix f)(expr ti,tf,n) = + save fpas; + fpas := (tf-ti)/n; + (ti,f(ti)) for i=1 upto n: ..(ti+i*fpas,f(ti+i*fpas)) endfor +enddef; + +% +% Courbe en polaire +% ------------------------------------------------------------------------------ +vardef CourbeEnPolaires(suffix r)(expr ti,tf,n) = + save fpas,t; + fpas := (tf-ti)/n; + r(ti)*(cos(ti),sin(ti)) + for i=1 upto n: hide(t:=ti+i*fpas) .. r(t)*(cos(t),sin(t)) endfor +enddef; + +% +% Champs de vecteurs +% ------------------------------------------------------------------------------ +vardef ChampVecteurs(suffix f)(expr x,y,px,py,dx,couleur) = + for i = 0 upto (x - repXmin)/px: + for j = 0 upto (y - repYmin)/py: + drawarrow + (((0,0)--dx*unitvector((1,f(x-i*px,y-j*py)))) + shifted (x-i*px,y-j*py)) gddEnPlace + withcolor couleur; + endfor + for j = 0 upto (repYmax - y)/py: + drawarrow + (((0,0)--dx*unitvector((1,f(x-i*px,y+j*py)))) + shifted (x-i*px,y+j*py)) gddEnPlace + withcolor couleur; + endfor + endfor + for i = 0 upto (repXmax - x)/px: + for j = 0 upto (y - repYmin)/py: + drawarrow + (((0,0)--dx*unitvector((1,f(x+i*px,y-j*py)))) + shifted (x+i*px,y-j*px)) gddEnPlace + withcolor couleur; + endfor + for j = 0 upto (repYmax - y)/py: + drawarrow + (((0,0)--dx*unitvector((1,f(x+i*px,y+j*py)))) + shifted (x+i*px,y+j*py)) gddEnPlace + withcolor couleur; + endfor + endfor +enddef; + + +% +% Champs de vecteurs f R^2 -> R^2 +% ------------------------------------------------------------------------------ +vardef ChampVecteursDD(suffix f)(expr x,y,px,py,dx,couleur) = + for i = 0 upto (x - repXmin)/px: + for j = 0 upto (y - repYmin)/py: + drawarrow + (((0,0)--dx*unitvector(f(x-i*px,y-j*py))) + shifted (x-i*px,y-j*py)) gddEnPlace + withcolor couleur; + endfor + for j = 0 upto (repYmax - y)/py: + drawarrow + (((0,0)--dx*unitvector(f(x-i*px,y+j*py))) + shifted (x-i*px,y+j*py)) gddEnPlace + withcolor couleur; + endfor + endfor + for i = 0 upto (repXmax - x)/px: + for j = 0 upto (y - repYmin)/py: + drawarrow + (((0,0)--dx*unitvector(f(x+i*px,y-j*py))) + shifted (x+i*px,y-j*px)) gddEnPlace + withcolor couleur; + endfor + for j = 0 upto (repYmax - y)/py: + drawarrow + (((0,0)--dx*unitvector(f(x+i*px,y+j*py))) + shifted (x+i*px,y+j*py)) gddEnPlace + withcolor couleur; + endfor + endfor +enddef; + +endinput; diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-rep.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-rep.mp new file mode 100644 index 0000000000..299f3086a1 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-rep.mp @@ -0,0 +1,136 @@ +picture repSavePict; +string repSaveW; + +% x and y labels +string gddXlabel; +gddXlabel := "$x$"; +string gddYlabel; +gddYlabel := "$y$"; + +def Repere(expr l,h,ox,oy,ux,uy) = + repLargeur := l; repHauteur := h; + repOX := ox ; repOY := oy; + repXmin := - ox / ux; repXmax := repXmin + l / ux; + repYmin := - oy / uy; repYmax := repYmin + h / uy; + repUX := ux; repUY := uy; + repSaveW := gddW; + gddW := "xscaled repUX yscaled repUY shifted (repOX,repOY) scaled gddU"; +enddef; + +def RepereMinMax(expr xmin,xmax,ymin,ymax,ux,uy) = + repLargeur := (xmax-xmin)*ux; repHauteur := (ymax-ymin)*uy; + repOX := -xmin*ux ; repOY := -ymin*uy; + repXmin := xmin; repXmax := xmax; + repYmin := ymin; repYmax := ymax; + repUX := ux; repUY := uy; + repSaveW := gddW; + gddW := "xscaled repUX yscaled repUY shifted (repOX,repOY) scaled gddU"; +enddef; + +def Debut = + repSavePict := currentpicture; currentpicture := nullpicture; +enddef; + +def repClip = + clip currentpicture to (% + ((0,0)--(repLargeur,0)--(repLargeur,repHauteur)--(0,repHauteur)--cycle) + scaled gddU); +enddef; + +def repStroke (expr c) = + draw ((0,0)--(repLargeur,0)--(repLargeur,repHauteur)--(0,repHauteur)--cycle) + scaled gddU withcolor c; +enddef; + +def Fin = + repClip; + addto repSavePict also currentpicture; currentpicture := repSavePict; + gddW := repSaveW; +enddef; + +def Axes = + drawarrow ((repXmin,0)--(repXmax,0)) gddEnPlace; + drawarrow ((0,repYmin)--(0,repYmax)) gddEnPlace; + label.lrt(textext(gddXlabel),(repXmax,0) gddEnPlace); + label.ulft(textext(gddYlabel),(0,repYmax) gddEnPlace); +enddef; + +def AxesBords = + drawarrow ((repXmin,repYmin)--(repXmax,repYmin)) gddEnPlace; + drawarrow ((repXmin,repYmin)--(repXmin,repYmax)) gddEnPlace; + label.lrt(textext(gddXlabel),(repXmax,repYmin) gddEnPlace); + label.ulft(textext(gddYlabel),(repXmin,repYmax) gddEnPlace); +enddef; + + +vardef Graduations = + save xmin, xmax, ymin, ymax; + xmin = round(repXmin); xmax = round(repXmax) ; + ymin = round(repYmin); ymax = round(repYmax) ; + SequenceTirets((xmin,0),(1,0),(0,-4),xmax-xmin); + SequenceTirets((xmin+0.5,0),(1,0),(0,-2),xmax-xmin); + SequenceTirets((0,ymin),(0,1),(-4,0),ymax-ymin+1); + SequenceTirets((0,ymin+0.5),(0,1),(-2,0),ymax-ymin); +enddef; + + +vardef GraduationsBords = + save xmin, xmax, ymin, ymax; + xmin = round(repXmin); xmax = round(repXmax) ; + ymin = round(repYmin); ymax = round(repYmax) ; + SequenceTirets((xmin,repYmin),(1,0),(0,+4),xmax-xmin); + SequenceTirets((xmin+0.5,repYmin),(1,0),(0,+2),xmax-xmin); + SequenceTirets((repXmin,ymin),(0,1),(+4,0),ymax-ymin); + SequenceTirets((repXmin,ymin+0.5),(0,1),(+2,0),ymax-ymin); +enddef; + +def ClipRepere = + extra_endfig := extra_endfig & "repClip;"; +enddef; + +% +% SequenceTirets +% ------------------------------------------------------------------------------ +vardef SequenceTirets(expr o,p,t,n) text a= + save ot; pair ot; ot := o gddEnPlace; + for i:=1 upto n: + % tiret + draw ot -- (ot shifted t) a; + % avancement + ot := (o + i*p) gddEnPlace; + endfor +enddef; + +vardef Unites(expr t) = + label.bot(textext("$+"&decimal(t)&"$"),(t,-(3/gddU/repUY)) gddEnPlace); + label.lft(textext("$+"&decimal(t)&"$"),(-(3/gddU/repUX),t) gddEnPlace); +enddef; + +%vardef ValeursGraduations = +% label.bot(textext("$+"&decimal(t)&"$"),(t,-(3/gddU/repUY)) gddEnPlace); +% label.lft(textext("$+"&decimal(t)&"$"),(-(3/gddU/repUX),t) gddEnPlace); +%enddef; +%%% ---------------------------------------------------------------------------- +%%% Grille +%%% ---------------------------------------------------------------------------- + +def GrilleRepere = + save xmin, xmax, ymin, ymax; + xmin = floor(repXmin); xmax = floor(repXmax) ; + ymin = floor(repYmin); ymax = floor(repYmax) ; + for i:=xmin upto xmax: + draw ((i,ymin)--(i,ymax)) gddEnPlace; + endfor; + for i:=ymin upto ymax: + draw ((xmin,i)--(xmax,i)) gddEnPlace; + endfor; +enddef; + +%%% ---------------------------------------------------------------------------- +%%% CadreRepere +%%% ---------------------------------------------------------------------------- +def CadreRepere = + (repXmin,repYmin)--(repXmin,repYmax)--(repXmax,repYmax)--(repXmax,repYmin)--cycle +enddef; + +endinput diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-svgnames.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-svgnames.mp new file mode 100644 index 0000000000..3a871678df --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-svgnames.mp @@ -0,0 +1,152 @@ +color AliceBlue; AliceBlue = (.94,.972,1); +color AntiqueWhite; AntiqueWhite = (.98,.92,.844); +color Aqua; Aqua = (0,1,1); +color Aquamarine; Aquamarine = (.498,1,.83); +color Azure; Azure = (.94,1,1); +color Beige; Beige = (.96,.96,.864); +color Bisque; Bisque = (1,.894,.77); +color Black; Black = (0,0,0); +color BlanchedAlmond; BlanchedAlmond = (1,.92,.804); +color Blue; Blue = (0,0,1); +color BlueViolet; BlueViolet = (.54,.17,.888); +color Brown; Brown = (.648,.165,.165); +color BurlyWood; BurlyWood = (.87,.72,.53); +color CadetBlue; CadetBlue = (.372,.62,.628); +color Chartreuse; Chartreuse = (.498,1,0); +color Chocolate; Chocolate = (.824,.41,.116); +color Coral; Coral = (1,.498,.312); +color CornflowerBlue; CornflowerBlue = (.392,.585,.93); +color Cornsilk; Cornsilk = (1,.972,.864); +color Crimson; Crimson = (.864,.08,.235); +color Cyan; Cyan = (0,1,1); +color DarkBlue; DarkBlue = (0,0,.545); +color DarkCyan; DarkCyan = (0,.545,.545); +color DarkGoldenrod; DarkGoldenrod = (.72,.525,.044); +color DarkGray; DarkGray = (.664,.664,.664); +color DarkGreen; DarkGreen = (0,.392,0); +color DarkGrey; DarkGrey = (.664,.664,.664); +color DarkKhaki; DarkKhaki = (.74,.716,.42); +color DarkMagenta; DarkMagenta = (.545,0,.545); +color DarkOliveGreen; DarkOliveGreen = (.332,.42,.185); +color DarkOrange; DarkOrange = (1,.55,0); +color DarkOrchid; DarkOrchid = (.6,.196,.8); +color DarkRed; DarkRed = (.545,0,0); +color DarkSalmon; DarkSalmon = (.912,.59,.48); +color DarkSeaGreen; DarkSeaGreen = (.56,.736,.56); +color DarkSlateBlue; DarkSlateBlue = (.284,.24,.545); +color DarkSlateGray; DarkSlateGray = (.185,.31,.31); +color DarkSlateGrey; DarkSlateGrey = (.185,.31,.31); +color DarkTurquoise; DarkTurquoise = (0,.808,.82); +color DarkViolet; DarkViolet = (.58,0,.828); +color DeepPink; DeepPink = (1,.08,.576); +color DeepSkyBlue; DeepSkyBlue = (0,.75,1); +color DimGray; DimGray = (.41,.41,.41); +color DimGrey; DimGrey = (.41,.41,.41); +color DodgerBlue; DodgerBlue = (.116,.565,1); +color FireBrick; FireBrick = (.698,.132,.132); +color FloralWhite; FloralWhite = (1,.98,.94); +color ForestGreen; ForestGreen = (.132,.545,.132); +color Fuchsia; Fuchsia = (1,0,1); +color Gainsboro; Gainsboro = (.864,.864,.864); +color GhostWhite; GhostWhite = (.972,.972,1); +color Gold; Gold = (1,.844,0); +color Goldenrod; Goldenrod = (.855,.648,.125); +color Gray; Gray = (.5,.5,.5); +color Green; Green = (0,.5,0); +color GreenYellow; GreenYellow = (.68,1,.185); +color Grey; Grey = (.5,.5,.5); +color Honeydew; Honeydew = (.94,1,.94); +color HotPink; HotPink = (1,.41,.705); +color IndianRed; IndianRed = (.804,.36,.36); +color Indigo; Indigo = (.294,0,.51); +color Ivory; Ivory = (1,1,.94); +color Khaki; Khaki = (.94,.9,.55); +color Lavender; Lavender = (.9,.9,.98); +color LavenderBlush; LavenderBlush = (1,.94,.96); +color LawnGreen; LawnGreen = (.488,.99,0); +color LemonChiffon; LemonChiffon = (1,.98,.804); +color LightBlue; LightBlue = (.68,.848,.9); +color LightCoral; LightCoral = (.94,.5,.5); +color LightCyan; LightCyan = (.88,1,1); +color LightGoldenrod; LightGoldenrod = (.933,.867,.51); +color LightGoldenrodYellow; LightGoldenrodYellow = (.98,.98,.824); +color LightGray; LightGray = (.828,.828,.828); +color LightGreen; LightGreen = (.565,.932,.565); +color LightGrey; LightGrey = (.828,.828,.828); +color LightPink; LightPink = (1,.712,.756); +color LightSalmon; LightSalmon = (1,.628,.48); +color LightSeaGreen; LightSeaGreen = (.125,.698,.668); +color LightSkyBlue; LightSkyBlue = (.53,.808,.98); +color LightSlateBlue; LightSlateBlue = (.518,.44,1); +color LightSlateGray; LightSlateGray = (.468,.532,.6); +color LightSlateGrey; LightSlateGrey = (.468,.532,.6); +color LightSteelBlue; LightSteelBlue = (.69,.77,.87); +color LightYellow; LightYellow = (1,1,.88); +color Lime; Lime = (0,1,0); +color LimeGreen; LimeGreen = (.196,.804,.196); +color Linen; Linen = (.98,.94,.9); +color Magenta; Magenta = (1,0,1); +color Maroon; Maroon = (.5,0,0); +color MediumAquamarine; MediumAquamarine = (.4,.804,.668); +color MediumBlue; MediumBlue = (0,0,.804); +color MediumOrchid; MediumOrchid = (.73,.332,.828); +color MediumPurple; MediumPurple = (.576,.44,.86); +color MediumSeaGreen; MediumSeaGreen = (.235,.7,.444); +color MediumSlateBlue; MediumSlateBlue = (.484,.408,.932); +color MediumSpringGreen; MediumSpringGreen = (0,.98,.604); +color MediumTurquoise; MediumTurquoise = (.284,.82,.8); +color MediumVioletRed; MediumVioletRed = (.78,.084,.52); +color MidnightBlue; MidnightBlue = (.098,.098,.44); +color MintCream; MintCream = (.96,1,.98); +color MistyRose; MistyRose = (1,.894,.884); +color Moccasin; Moccasin = (1,.894,.71); +color NavajoWhite; NavajoWhite = (1,.87,.68); +color Navy; Navy = (0,0,.5); +color NavyBlue; NavyBlue = (0,0,.5); +color OldLace; OldLace = (.992,.96,.9); +color Olive; Olive = (.5,.5,0); +color OliveDrab; OliveDrab = (.42,.556,.136); +color Orange; Orange = (1,.648,0); +color OrangeRed; OrangeRed = (1,.27,0); +color Orchid; Orchid = (.855,.44,.84); +color PaleGoldenrod; PaleGoldenrod = (.932,.91,.668); +color PaleGreen; PaleGreen = (.596,.985,.596); +color PaleTurquoise; PaleTurquoise = (.688,.932,.932); +color PaleVioletRed; PaleVioletRed = (.86,.44,.576); +color PapayaWhip; PapayaWhip = (1,.936,.835); +color PeachPuff; PeachPuff = (1,.855,.725); +color Peru; Peru = (.804,.52,.248); +color Pink; Pink = (1,.752,.796); +color Plum; Plum = (.868,.628,.868); +color PowderBlue; PowderBlue = (.69,.88,.9); +color Purple; Purple = (.5,0,.5); +color Red; Red = (1,0,0); +color RosyBrown; RosyBrown = (.736,.56,.56); +color RoyalBlue; RoyalBlue = (.255,.41,.884); +color SaddleBrown; SaddleBrown = (.545,.27,.075); +color Salmon; Salmon = (.98,.5,.448); +color SandyBrown; SandyBrown = (.956,.644,.376); +color SeaGreen; SeaGreen = (.18,.545,.34); +color Seashell; Seashell = (1,.96,.932); +color Sienna; Sienna = (.628,.32,.176); +color Silver; Silver = (.752,.752,.752); +color SkyBlue; SkyBlue = (.53,.808,.92); +color SlateBlue; SlateBlue = (.415,.352,.804); +color SlateGray; SlateGray = (.44,.5,.565); +color SlateGrey; SlateGrey = (.44,.5,.565); +color Snow; Snow = (1,.98,.98); +color SpringGreen; SpringGreen = (0,1,.498); +color SteelBlue; SteelBlue = (.275,.51,.705); +color Tan; Tan = (.824,.705,.55); +color Teal; Teal = (0,.5,.5); +color Thistle; Thistle = (.848,.75,.848); +color Tomato; Tomato = (1,.39,.28); +color Turquoise; Turquoise = (.25,.88,.815); +color Violet; Violet = (.932,.51,.932); +color VioletRed; VioletRed = (.816,.125,.565); +color Wheat; Wheat = (.96,.87,.7); +color White; White = (1,1,1); +color WhiteSmoke; WhiteSmoke = (.96,.96,.96); +color Yellow; Yellow = (1,1,0); +color YellowGreen; YellowGreen = (.604,.804,.196); +endinput diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-tra.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-tra.mp new file mode 100644 index 0000000000..894dff145d --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d-tra.mp @@ -0,0 +1,44 @@ +%% === Pseudo-transparence ===================================================== +%% Code emprunté à Anthony Phan : +%% http://www-math.univ-poitiers.fr/~phan/metalpha.html + +color gdd_tc; +numeric gdd_ta; +picture gdd_ap; + +def gdd_AlphaFill expr c = + gdd_ap := nullpicture; + gdd_AlphaPicture(currentpicture,c); + addto currentpicture also gdd_ap; +enddef; + +vardef gdd_AlphaPicture(expr p,c) = + save p_; picture p_; + p_ := nullpicture; + addto p_ contour c withcolor gdd_ta[background,gdd_tc]; + for p__ within p: + if (not clipped p__) and (not bounded p__): + addto p_ also p__ withcolor + gdd_ta[(redpart p__,greenpart p__,bluepart p__), gdd_tc]; + else: + begingroup save gdd_ap; + picture gdd_ap; gdd_ap = nullpicture; + gdd_AlphaPicture(p__,pathpart p__); + addto p_ also gdd_ap; + endgroup; + fi + endfor; + clip p_ to c; + addto gdd_ap also p_; +enddef; + +vardef colorieAvecTransparence(expr p,c,a) = + gdd_tc := c; gdd_ta := a; + if path p: + gdd_AlphaFill (p gddEnPlace) + else: + gdd_AlphaFill ((gddTraceObjet p) gddEnPlace) + fi +enddef; + +endinput;
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d.mp b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d.mp new file mode 100644 index 0000000000..5861fd5df1 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-geom2d/metapost/geom2d.mp @@ -0,0 +1,14 @@ +% +if not known mplib: input latexmp fi; + + +input geom2d-arc; +input geom2d-c2d; +input geom2d-fct; +input geom2d-lbl; +input geom2d-plt; +input geom2d-rep; +input geom2d-tra; +input geom2d-svgnames; +input geom2d-main; +input graph;
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-neuralnetwork/LICENSE b/graphics/metapost/contrib/macros/mp-neuralnetwork/LICENSE new file mode 100644 index 0000000000..130ede1e51 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-neuralnetwork/LICENSE @@ -0,0 +1,11 @@ + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either version 1.3c +of this license or (at your option) any later version. +The latest version of this license is in + http://www.latex-project.org/lppl.txt +and version 1.3c or later is part of all distributions of LaTeX +version 2005/12/01 or later. + +This work has the LPPL maintenance status “maintained”. + diff --git a/graphics/metapost/contrib/macros/mp-neuralnetwork/README.md b/graphics/metapost/contrib/macros/mp-neuralnetwork/README.md new file mode 100644 index 0000000000..4a77cff637 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-neuralnetwork/README.md @@ -0,0 +1,16 @@ +# Neural Network with MetaPost + +This METAPOST package allows to draw artificial neural networks. It is +based on the METAOBJ package which provides many tools to draw and +arrange nodes. + +This package is in beta version—do not hesitate to report bugs, as well as +requests for improvement. + +## Contact + +Maxime Chupin, `notezik(at)gmail.com` + +## Licenses + +This projet is under LATEX Project Public License 1.3c.
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/ctan.bib b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/ctan.bib new file mode 100644 index 0000000000..5ad7b88ab0 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/ctan.bib @@ -0,0 +1,56 @@ + +@manual{ctan-metapost, + title = {The \texttt{metapost} package}, + subtitle = {A development of Metafont for creating graphics}, + author = {{The MetaPost Team} and John Hobby}, + date = {2021-08-26}, + license = {lgpl}, + url = {https://ctan.org/pkg/metapost}, + annotation = {MetaPost uses a language based on that of + to produce precise + technical illustrations. Its output is scalable PostScript or + SVG, rather than the bitmaps Metafont creates.}, +} + + +@manual{ctan-metaobj, + title = {The \texttt{metaobj} package}, + subtitle = {MetaPost package providing high-level objects}, + author = {Denis B. Roegel}, + date = {2016-06-24}, + version = {0.93}, + license = {lppl}, + mirror = {https://mirror.ctan.org/graphics/metapost/contrib/macros/metaobj}, + url = {https://ctan.org/pkg/metaobj}, +} + + +@manual{ctan-latexmp, + title = {The \texttt{latexMP} package}, + subtitle = {Interface for \LaTeX{}-based typesetting in MetaPost}, + author = {Jens-Uwe Morawski}, + date = {2020-06-21}, + version = {1.2.1}, + license = {pd}, + mirror = {https://mirror.ctan.org/graphics/metapost/contrib/macros/latexmp}, + url = {https://ctan.org/pkg/latexmp}, + annotation = {The MetaPost package latexMP implements a user-friendly + interface to access \LaTeX{}-based typesetting capabilities in + MetaPost. The text to be typeset is given as string. This + allows even dynamic text elements, for example counters, to be + used in labels. Compared to other implementations it is much + more flexible, since it can be used as direct replacement for + , and much faster, compared for example to the + solution provided by .}, +} + +@manual{ctan-metapost-colorbrewer, + title = {The \texttt{metapost-colorbrewer} package}, + subtitle = {An implementation of the colorbrewer2.org colours for MetaPost}, + author = {Toby Thurston}, + date = {2018-09-25}, + version = {}, + license = {gpl3+}, + mirror = {https://mirror.ctan.org/graphics/metapost/contrib/macros/metapost-colorbrewer}, + url = {https://ctan.org/pkg/metapost-colorbrewer}, +}
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/fond.pdf b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/fond.pdf Binary files differnew file mode 100644 index 0000000000..22218152cc --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/fond.pdf diff --git a/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/mp-neuralnetwork-doc-en.pdf b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/mp-neuralnetwork-doc-en.pdf Binary files differnew file mode 100644 index 0000000000..b54ddd0e6b --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/mp-neuralnetwork-doc-en.pdf diff --git a/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/mp-neuralnetwork-doc-en.tex b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/mp-neuralnetwork-doc-en.tex new file mode 100644 index 0000000000..9a789edfa6 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/mp-neuralnetwork-doc-en.tex @@ -0,0 +1,520 @@ + +% LTeX: language=en + +% huffman : draw binary huffman trees with MetaPost/MetaObj +% +% Originally written by Maxime Chupin <notezik@gmail.com>, +% 2023. +% +% Distributed under the terms of the GNU free documentation licence: +% http://www.gnu.org/licenses/fdl.html +% without any invariant section or cover text. + +\documentclass[english]{ltxdoc} + +\input{mp-neuralnetwork-preamble.tex} + +\usepackage[english]{babel} + +\makeindex[title=Command Index, columns=2] + + + +%\lstset{moredelim=*[s][\color{red}\rmfamily\itshape]{<}{>}} +%\lstset{moredelim=*[s][\color{blue}\rmfamily\itshape]{<<}{>>}} + +\begin{document} + +\title{{\mpneural} : drawing artificial neural networks with \MP and \MO/} +\author{Maxime Chupin, \url{notezik@gmail.com}} +\date{\today} + +%% === Page de garde =================================================== +\thispagestyle{empty} +\begin{tikzpicture}[remember picture, overlay] + \node[below right, shift={(-4pt,4pt)}] at (current page.north west) {% + \includegraphics{fond.pdf}% + }; +\end{tikzpicture}% + +\noindent +{\Huge \mpneural}\par\bigskip +\noindent +{\Large drawing artificial neural networks \\[0.2cm]with \hologo{METAPOST} and \MO/}\\[1cm] +\parbox{0.6\textwidth}{ + \begin{mplibcode}[mpneural] + input mp-neuralnetwork; + + +beginfig(1); +framed_output(false); +framed_input(false); +drawANN("x","n","a","p","b","q","y","m") "circmargin(3pt)"; +endfig; + \end{mplibcode} +}\hfill +\parbox{0.5\textwidth}{\Large\raggedleft + \textbf{Contributor}\\ + Maxime \textsc{Chupin}\\ + \url{notezik@gmail.com} +} +\vfill +\begin{center} + Version 0.1, 2025, January, 27th \\ + \url{https://gitlab.gutenberg-asso.fr/mchupin/mp-neuralnetwork} +\end{center} +%% == Page de garde ==================================================== +\newpage + +%\maketitle + +\begin{abstract} + This \hologo{METAPOST} package allows to draw artificial neural networks. + It is based on the \MO/ package which + provides many tools to draw and arrange nodes. +\end{abstract} + + +\begin{center} + \url{https://gitlab.gutenberg-asso.fr/mchupin/mp-neuralnetwork} +\end{center} + +\tableofcontents + + + +\bigskip + +\begin{tcolorbox}[ arc=0pt,outer arc=0pt, + colback=darkred!3, + colframe=darkred, + breakable, + boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = + 3pt, toptitle=3pt, + boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = + 0pt, bottomrule at break = 0pt,] + \itshape + This package is in beta version---do not hesitate to report bugs, as well as requests for improvement. +\end{tcolorbox} + +\section{Installation} + +\mpneural is on \ctan{} and can also be installed via the package manager of your +distribution. + +\begin{center} + \url{https://www.ctan.org/pkg/mp-neuralnetwork} +\end{center} + + +\subsection{With \TeX live under Linux or macOS} + +To install \mpneural with \TeX Live, you will have to create the directory +\lstinline+texmf+ in your \lstinline+home+. + +\begin{commandshell} +mkdir ~/texmf +\end{commandshell} + +Then, you will have to place the \lstinline+neuralnetwork.mp+ and +\lstinline+metaobj-patch.mp+\footnote{Thanks to Denis Roegel, this file define a +\texttt{Group} object to group different \MO/ objects. +} files in +\begin{center} + \lstinline+~/texmf/metapost/mp-neuralnetwork/+ +\end{center} + + +Once this is done, \mpneural will be loaded with the classic \MP{} +input code +\begin{mpcode} +input mp-neuralnetwork +\end{mpcode} + +\subsection{With Mik\TeX{} and Windows} + +These two systems are unknown to the author of \mpneural, so we +refer you to the Mik\TeX documentation concerning the addition of local packages: +\begin{center} + \url{http://docs.miktex.org/manual/localadditions.html} +\end{center} + + + +\subsection{Dependencies} + + +\mpneural depends: +\begin{itemize} +\item of course on \MP~\cite{ctan-metapost}; +\item on the package\package{metaobj}~\cite{ctan-metaobj}; +\item if \mpneural is not used with +\hologo{LuaLaTeX} and the \package{luamplib} package, on the \package{latexmp} +package\cite{ctan-latexmp}; +\item and on the package \package{colorbrewer-rgb}~\cite{ctan-metapost-colorbrewer}. +\end{itemize} +\section{Main Command} + +The package \mpneural provides one principal command that has two possible +invocations. + +\subsection{Finite network} + +\commande|drawANN(«name1»,«size1»,«name2»,«size2», etc.)|\smallskip\index{drawANN@\lstinline+drawANN+} + +Each layer of the network is described by a couple \meta{name} and \meta{size}, where: +\begin{description} + \item[\meta{name}:] is the names of the layers. It a + string, and this is the prefix of each node (for instance \lstinline+"x"+ will + produce nodes $x_i$). + \item[\meta{size}:] is the size (integer) of the layer (for instance if + \meta{size}$=4$, the layer will be composed by nodes $x_1$, $x_2$, $x_3$ and $x_4$). +\end{description} +Here, a simple example. +\begin{ExempleMP} +input mp-neuralnetwork + +beginfig(1); +drawANN("x",4,"y",5,"z",1); +endfig; +\end{ExempleMP} + + +\subsection{Abstract network} + +You can set variables for the size of each layers with the same command using +the string notation for the size instead of an integer. + +\commande|drawANN(«name1»,«size1»,«name2»,«size2», etc.)|\smallskip\index{drawANN@\lstinline+drawANN+} + +Each layer of the network is described by a couple \meta{name} and \meta{size}, where: +\begin{description} + \item[\meta{name}:] is the names of the layers. It a + string, and this is the prefix of each node (for instance \lstinline+"x"+ will + produce nodes $x_i$). + \item[\meta{size}:] is the notation for size (string) of the layer (for instance + \lstinline+"p"+, the layer will be composed by nodes $x_1$, $x_2$, $\dots$ and $x_p$). +\end{description} +Here, a simple example. +\begin{ExempleMP} +input mp-neuralnetwork + +beginfig(1); +drawANN("x","m","y","n","z","p"); +endfig; +\end{ExempleMP} + +The first and the last layers are composed with four nodes, and intern layers +with five nodes. + +\section{Options} + +\mpneural allows to customize the network representation. If you want to restore +default behaviour, you can use the following command. +\commande|mpneural_init_values|\smallskip\index{mpneural_init_values@\lstinline+mpneural_init_values+} + + +\subsection{Colors} + +We can see, in the previous examples, that the nodes are colored. If you do not +want them to be colored, use the following command. + +\commande|colored_layers(«boolean»)|\smallskip\index{colored_layers@\lstinline+colored_layers+} + +\begin{description} + \item[\meta{boolean}:] is a \MP{} boolean (true by default) to choose if we + want or not colored layers. +\end{description} + +If the layers are colored, \mpneural{} uses \lstinline+Spectral+ colors defined +in \package{colorbrewer-rgb}\footnote{Up to 11 colors. If there are more layers, +the colors cycle.}. + +You can also define colors for each layer using the following command. + + +\commande|set_layer_colors(«layer number1»,«color1»,«layer number 1»,«color1»,etc.)|\smallskip\index{set_layer_colors@\lstinline+set_layer_colors+} + +\begin{description} + \item[\meta{layer number 1}, \meta{color1}:] is a couple with the integer of + the layer we want to color with \meta{color1}. +\end{description} + +The rest of layers are set to white by default. + +For example: +\begin{ExempleMP} +input mp-neuralnetwork + +colored_layers(false); +beginfig(1); +drawANN("x",5,"y",1); +endfig; +\end{ExempleMP} + +and +\begin{ExempleMP} +input mp-neuralnetwork + +colored_layers(true); +set_layer_colors(1,red,3,(0.7,0.7,0.7)); + +beginfig(1); +drawANN("x",5,"y",1,"z",4); +endfig; +\end{ExempleMP} + +Connections are colored. The default color is gray (\lstinline+0.4*white+) but +you can modify that with the following command. + +\commande|set_connection_color(«color»)|\smallskip\index{set_connection_color@\lstinline+set_connection_color+} + +\begin{description} + \item[\meta{color}:] is the color for drawing the connections between layers + (default \lstinline+0.4*white+). +\end{description} + + +\subsection{Annotations} + +\mpneural provides some tools to annotate the network. However, because we use +\MO/ behind the scene, you can always use \MO/ tools to draw above the graph +build with \mpneural (see section~\ref{sec:mo}). + +\subsubsection{Frames} + +You can add frames around three different blocks: input, output and hidden +layers. + +To draw a frame around these three types of layers (or stop the drawing of theses frames), you +can use the following commands. + + +\commande|framed_input(«boolean»)|\smallskip\index{framed_input@\lstinline+framed_input+} + + +\commande|framed_output(«boolean»)|\smallskip\index{framed_output@\lstinline+framed_output+} + + +\commande|framed_hidden(«boolean»)|\smallskip\index{framed_hidden@\lstinline+framed_hidden+} +\begin{description} + \item[\meta{boolean}:] true or false (default). +\end{description} + +\subsubsection{Positioning nodes} + +We can adjust the vertical and horizontal distance between nodes with the +following commands. + +\commande|set_vspace(«distance»)|\smallskip\index{set_vspace@\lstinline+set_vspace+} + +\begin{description} + \item[\meta{distance}:] is a numeric (default \lstinline+1.5cm+). +\end{description} + + +\commande|set_hspace(«distance»)|\smallskip\index{set_hspace@\lstinline+set_hspace+} + +\begin{description} + \item[\meta{distance}:] is a numeric (default \lstinline+2.2cm+). +\end{description} + +\begin{ExempleMP} +input mp-neuralnetwork + +beginfig(1); +set_vspace(2cm); +set_hspace(3cm); +drawANN("x",5,"u",6,"v",3,"y",2); +endfig; +\end{ExempleMP} + +\subsubsection{Labels and sections} + + +First, if you do not want to label the nodes, use the following command to +deactivate the function. + +\commande|show_node_labels(«boolean»)|\smallskip\index{show_node_labels@\lstinline+show_node_labels+} + +You can also add legends to these part of the network (independently of the +frame draw). For that, you can use the following command. + +\commande|print_legends(«boolean»)|\smallskip\index{print_legends@\lstinline+print_legends+} +\begin{description} + \item[\meta{boolean}:] true or false (default). +\end{description} + +The default value for the legends of the three parts (input, output, and +hidden), are \lstinline+"Input layer"+, \lstinline+"Output layer"+, and +\lstinline+"Hidden layer(s)"+. You can modify these string with the following +commands. + + +\commande|set_input_legend(«string»)|\smallskip\index{set_input_legend@\lstinline+set_input_legend+} + +\commande|set_output_legend(«string»)|\smallskip\index{set_output_legend@\lstinline+set_output_legend+} + +\commande|set_hidden_legend(«string»)|\smallskip\index{set_hidden_legend@\lstinline+set_hidden_legend+} + + +\begin{description} + \item[\meta{string}:] is a string for the legend (default are \lstinline+"Input layer"+, \lstinline+"Output layer"+, and + \lstinline+"Hidden layer(s)"+). +\end{description} + + +\begin{ExempleMP} +input mp-neuralnetwork + +colored_layers(false); +beginfig(1); +print_legends(true); +set_input_legend("Entrées"); +set_output_legend("Sortie"); +framed_hidden(true); +drawANN("x",5,"u",6,"v",8,"y",2); +endfig; +\end{ExempleMP} + +You may also want to print the \emph{weights} on the network. To do that, use +the following commands. +\commande|print_weights(«boolean»)|\smallskip\index{print_weights@\lstinline+print_weights+} + +By default, weights are denoted by $w$, but you can change that with the +following command. + + +\commande|set_weights_notation(«string»)|\smallskip\index{set_weights_notation@\lstinline+set_weights_notation+} +\begin{description} + \item[\meta{string}:] is a string for the weights (default is + \lstinline+"w"+). + This is a prefix: for instance, with the default value, the weights are, in + math mode, $w_{ij}^{(k)}$ for the $k$-th layer. +\end{description} + + + +\begin{ExempleMP} +input mp-neuralnetwork + +colored_layers(false); +beginfig(1); +print_legends(false); +print_weights(true); +drawANN("x",4,"u",6,"v",5,"y",2); +endfig; +\end{ExempleMP} + +You can add labels positioning them with relative coordinates that is $(0,0)$ at +bottom left of the bounding box of the complete graph and $(1,1)$ at top right. +For that, you can use the following command. + +\commande|labelANN(«string»)(«xpart»,«ypart») «\MO/ options»|\smallskip\index{labelANN@\lstinline+labelANN+} +\begin{description} + \item[\meta{string}:] is a string for the label (process by + \lstinline+textext+ command). + \item[\meta{xpart},\meta{ypart}:] are numeric in the relative coordinates (but + can be lower or greater than 0 and 1.). +\end{description} + +This command build a \MO/ box. It is the center of the box that is put at the +relative coordinate. Moreover, you can add the \MO/ options at the end to +customize the box. + +\begin{ExempleMP} +input mp-neuralnetwork + +colored_layers(false); +beginfig(1); +print_legends(false); +print_weights(true); +drawANN("x",4,"u",6,"v",5,"y",2); +labelANN("My fabulous network")(0.5,-0.2) "filled(true)","fillcolor((0.8,0.5,0.5))"; +endfig; +\end{ExempleMP} + + + + +\section{With MetaObj}\label{sec:mo} + +Because \mpneural is built above \MO/~\cite{ctan-metaobj}, the tools of the +incredible package are available. + +The nodes of the network are \MO/ boxes, with names: +\begin{itemize} +\item with the prefix \texttt{ANN}; +\item the instance number of the network (useful if you draw +multiple networks); +\item an underscore \texttt{\_}; +\item the identifier of the layer (specified in the \lstinline+drawANN+ command); +\item the number of the node in the layer. +\end{itemize} + +The boxes of weights are named as follows: +\begin{itemize} +\item with the prefix \texttt{ANN}; +\item the instance number of the network (useful if you draw +multiple networks); +\item an underscore \texttt{\_}; +\item \texttt{weights}; +\item the number of the left layer. +\end{itemize} + +The boxes of label for input, output and hidden layers are named as follows: +\begin{itemize} +\item with the prefix \texttt{ANN}; +\item the instance number of the network (useful if you draw +multiple networks); +\item an underscore \texttt{\_}; +\item \texttt{input}, \texttt{output} or \texttt{hidden}. +\end{itemize} + + + + +Labels generated by \lstinline+labelANN+ are also \MO/ boxes named as follows: +\begin{itemize} +\item with the prefix \texttt{ANN}; +\item the instance number of the network (useful if you draw +multiple networks); +\item an underscore \texttt{\_}; +\item \texttt{label}; +\item then the number of the label. +\end{itemize} + +For example, if you draw the following network: +\begin{mpcode} +input mp-neuralnetwork + +beginfig(1); +drawANN("x",3,"y",2); +endfig; +\end{mpcode} + +The nodes will be named \texttt{ANN1\_x1}, \texttt{ANN1\_x2}, \texttt{ANN1\_x3}, +\texttt{ANN1\_y1}, and \texttt{ANN1\_y2}. The weights will be named +\texttt{ANN1\_weights1}. + +Here is a real example (this is the 10th instance of a network drawing in this +document). \lstinline+ncline+ is a \MO/ command. +\begin{ExempleMP} +input mp-neuralnetwork; + +beginfig(1); + print_legends(true); + show_node_labels(true); + drawANN("x","n","a","p","b","q","y","m") "circmargin(3pt)"; + labelANN("Test")(1.3,0.4); + labelANN("Test")(0.5,1.1) "framed(false)"; + ncline(ANN10_label2)(ANN10_x2)"doubleline(true)","coilwidth(2mm)", + "angleA(0)", + "linewidth(1pt)"; +endfig; +\end{ExempleMP} + + +\printbibliography +\printindex +\end{document} diff --git a/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/mp-neuralnetwork-preamble.tex b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/mp-neuralnetwork-preamble.tex new file mode 100644 index 0000000000..1d352763fb --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-neuralnetwork/doc/mp-neuralnetwork-preamble.tex @@ -0,0 +1,188 @@ +\usepackage{tcolorbox} +\tcbuselibrary{listings,breakable} +%\tcbuselibrary{documentation} +\usepackage{enumitem} +\usepackage[tikz]{bclogo} +\usepackage{mflogo} +\usepackage{hologo} +\usepackage{luamplib} +\mplibtextextlabel{enable} +\usepackage{biblatex} +\addbibresource{ctan.bib} +\usepackage{wrapfig} +\usepackage{accsupp} +\usepackage{siunitx} +\usepackage{imakeidx} +%\usepackage{csquotes} +\usepackage{fancyvrb,xparse,xargs} +\usepackage[sfdefault]{FiraSans} +\usepackage[mathrm=sym]{firamath-otf} +\setmonofont{Fira Mono} +%\setmonofont{FiraCode-Regular.ttf}[BoldFont= FiraCode-Bold.ttf,ItalicFont= FiraCode-RegularItalic.otf,BoldItalicFont= FiraCode-BoldItalic.otf,Ligatures={NoCommon, NoDiscretionary, NoHistoric, NoRequired, NoContextual}] + +\usepackage{xspace} +\usepackage{animate} +\newcommand{\ctan}{\textsc{ctan}} +\NewDocumentCommand{\package}{ m }{% + \href{https://ctan.org/pkg/#1}{#1}\xspace +} + +\definecolor{darkred}{rgb}{0.6,0.1,0.1} +\definecolor{vert}{rgb}{0.1,0.4,0.1} +\definecolor{bleu}{rgb}{0.2,0.2,0.6} +\definecolor{orange}{rgb}{0.6,0.4,0.} +\colorlet{code}{blue!80!black} + +\usepackage[colorlinks=true,urlcolor=orange,linkcolor=orange,menucolor=black,citecolor=orange]{hyperref} + +\newcommand \file {\nolinkurl} +\renewcommand \cmd {\texttt} +\renewcommand \code [1] {\texorpdfstring {\texttt{\color{code}#1}} {#1}} +\renewcommand*\cs [1] {\code{\textbackslash #1}} + + + +\newcommand*\commande{\par\bigskip\noindent\hspace{-30pt}% + \SaveVerb[aftersave={% + \UseVerb{Vitem}% + }% + ]{Vitem}% + } + \newcommand\vitem[1][]{\SaveVerb[% + aftersave={\item[\textnormal{\UseVerb[#1]{vsave}}]}]{vsave}} +\newcommand*\textme[1]{\textcolor{black}{\rmfamily\textit{#1}}} +%\renewcommand*\meta[1]{% % meta +% \textme{\ensuremath{\langle}#1\ensuremath{\rangle}}} +\newcommand*\optstar{% % optional star + \meta{\ensuremath{*}}\xspace} +\DefineShortVerb{\|} +\newcommand\R{\mathbf{R}} +\setlength{\fboxsep}{2pt} +\fvset{% + codes={\catcode`\«\active \catcode`\×\active }, + defineactive={\makefancyog\makefancytimes}, + formatcom=\color{darkred}, + frame=single +} +% rendre «...» équivalent à \meta{...} +{\catcode`\«\active + \newcommandx\makefancyog[0][addprefix=\global]{% + \def«##1»{\meta{##1}}}} +% rendre × équivalent à \optstar +{\catcode`\×\active + \newcommandx\makefancytimes[0][addprefix=\global]{% + \def×{\optstar{}}}} + + +\newcommand\mpneural{\texttt{mp-neuralnetwork}\xspace} +\usepackage{fetamont} +\def\MO/{\textffm{META\-OBJ}} + +%\addbibresource{biblio.bib} + + +\lstset{ + numberstyle=\footnotesize\color{vert}, + keywordstyle=\ttfamily\bfseries\color{bleu}, + basicstyle=\ttfamily, + commentstyle=\itshape\color{vert}, + stringstyle=\ttfamily\color{orange}, + showstringspaces=false, + language=MetaPost, + breaklines=true, + breakindent=30pt, + defaultdialect=MetaPost, + classoffset=1,% frame=tb + morekeywords={colored_layers, + print_weights, + drawANN, + set_connection_color, + set_hidden_legend, + set_hspace, + set_input_legend, + set_layer_colors, + set_output_legend, + set_vspace, + set_weights_notation, + show_node_labels, + framed_hidden, + framed_input, + framed_output, + labelANN, + mpneural_init_values, + print_legends, }, + keywordstyle=\color{darkred}, + classoffset=2,% frame=tb + morekeywords={}, + keywordstyle=\color{vert}, + classoffset=0,% frame=tb + morekeywords={ncline}, + keywordstyle=\color{bleu} +} + + +\extractcolorspecs{darkred!3}\modelcmd\colorcmd +\makeatletter +\tcbset{% + listing metapost/.code={% + \def\tcbuselistingtext@input{\begin{mplibcode}[mpneural] verbatimtex + \leavevmode etex;input mp-neuralnetwork;mpneural_init_values;background:=(\colorcmd); input \jobname.listing; + \end{mplibcode}}% + } +} +\makeatother +\newtcblisting[auto counter,]{ExempleMP}[1][]{% + arc=0pt,outer arc=0pt, + colback=darkred!3, + colframe=darkred, + breakable,fontupper=\small, + boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = + 3pt, toptitle=3pt, + boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = + 0pt, bottomrule at break = 0pt, + %listing side text, + listing metapost, + title=Exemple~\thetcbcounter, + listing options={breaklines},#1 +} + +\newtcblisting{commandshell}{colback=black,colupper=white,colframe=black, + arc=0pt, + listing only,boxsep=0pt,listing + options={style=tcblatex,language=sh}, + every listing line={\BeginAccSupp{ActualText={}}\textcolor{red}{\small\ttfamily\bfseries user \$> }}\EndAccSupp{}} + + + \newtcblisting{mpcode}[1][]{ + arc=0pt,outer arc=0pt, + colback=darkred!3, + colframe=darkred, + breakable, + boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = + 3pt, toptitle=3pt, + boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = + 0pt, bottomrule at break = 0pt, + listing only,boxsep=0pt,listing + options={breaklines},#1 +} + +\newtcblisting{latexcode}{ + arc=0pt,outer arc=0pt, + colback=darkred!3, + colframe=darkred, + breakable, + boxsep=0pt,left=5pt,right=5pt,top=5pt,bottom=5pt, bottomtitle = + 3pt, toptitle=3pt, + boxrule=0pt,bottomrule=0.5pt,toprule=0.5pt, toprule at break = + 0pt, bottomrule at break = 0pt, + listing only,boxsep=0pt,listing + options={breaklines,language={[LaTeX]TeX}} +} + + +\newcommand\pdf{\textsc{pdf}} + +\usepackage{array,booktabs} +\usepackage{collcell} + +\newcolumntype{H}{>{\collectcell\lstinline}l<{\endcollectcell}}
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-neuralnetwork/metapost/mp-neuralnetwork-metaobj-patch.mp b/graphics/metapost/contrib/macros/mp-neuralnetwork/metapost/mp-neuralnetwork-metaobj-patch.mp new file mode 100644 index 0000000000..5b07a8cd68 --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-neuralnetwork/metapost/mp-neuralnetwork-metaobj-patch.mp @@ -0,0 +1,74 @@ +%===================================================================== +% |Group| class (DR, 4 December 2024, after idea by Maximum Chupin) +% based on the |HBox| class + +% |Group|: Generic Group +% |@#| is a name for an object (must be a suffix) +% |@#| will be the number of the object, but will also be used +% as a prefix for other variables. +vardef newGroup@#(text sublist) text options = + ExecuteOptions(@#)(options); + assignObj(@#,"Group"); + StandardInterface; + save n,i,eq;numeric n,i;string eq; + n=0; + forsuffixes $:=sublist:n:=n+1;endfor; + ObjSubArray(sb)(n); % |n| is the number of elements + ObjNumeric nst,leftmax,rightmax,botmax,topmax; + setNumeric(nst)(n); + i=0; + forsuffixes $:=sublist:i:=i+1; + SubObjectOfArray(sb[i],$); + endfor; + setMaxBB@#; + % we now build the equations: + % horizontal equation: horizontal space at left and right + eq="xpart(obj(@#sb[@#leftmax]).w-@#w)" & + "=xpart(@#e-obj(@#sb[@#rightmax]).e)=" & + decimal(OptionValue@#("dx")) & ";"; + % vertical equation: vertical space at top and bottom + eq:= eq & "ypart(obj(@#sb[@#botmax]).s-@#s)" & + "=ypart(@#n-obj(@#sb[@#topmax]).n)=" & + decimal(OptionValue@#("dy")) & ";"; + ObjCode StandardEquations,eq; + StandardTies; +enddef; + +vardef setMaxBB@#= + @#leftmax:=1; % initialization of indexes + @#rightmax:=1; + @#botmax:=1; + @#topmax:=1; + for i:=2 upto @#nst: + if xpart(obj(@#sb[i]).w-obj(@#sb[@#leftmax]).w)<0:@#leftmax:=i;fi; + if xpart(obj(@#sb[i]).e-obj(@#sb[@#rightmax]).e)>0:@#rightmax:=i;fi; + if ypart(obj(@#sb[i]).s-obj(@#sb[@#botmax]).s)<0:@#botmax:=i;fi; + if ypart(obj(@#sb[i]).n-obj(@#sb[@#topmax]).n)>0:@#topmax:=i;fi; + endfor; +enddef; + +streamline("Group")("(text sublist)","suffixlist(sublist)"); + +def BpathGroup(suffix n)= StandardBpath(n) enddef; + +def drawGroup(suffix n)= + drawFramedOrFilledObject_(n); + drawObjArray(n)(sb); + drawMemorizedPaths_(n); +enddef; + +% Default values of |Group|: +setObjectDefaultOption("Group")("dx")(0mm); +setObjectDefaultOption("Group")("dy")(0mm); +setObjectDefaultOption("Group")("framed")(false); +setObjectDefaultOption("Group")("filled")(false); +setObjectDefaultOption("Group")("fillcolor")(black); +setObjectDefaultOption("Group")("framewidth")(.5bp); +setObjectDefaultOption("Group")("framecolor")(black); +setObjectDefaultOption("Group")("framestyle")(""); +setObjectDefaultOption("Group")("shadow")(false); % no shadow by default +setObjectDefaultOption("Group")("shadowcolor")(black); +%--------------------------------------------------------------------------- + + +endinput
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mp-neuralnetwork/metapost/mp-neuralnetwork.mp b/graphics/metapost/contrib/macros/mp-neuralnetwork/metapost/mp-neuralnetwork.mp new file mode 100644 index 0000000000..b57ef108de --- /dev/null +++ b/graphics/metapost/contrib/macros/mp-neuralnetwork/metapost/mp-neuralnetwork.mp @@ -0,0 +1,361 @@ +% Don't load this package twice: +if known neuralnetwork_version: expandafter endinput; fi; + +numeric neuralnetwork_version;string neuralnetwork_date; +neuralnetwork_version=0.1; +neuralnetwork_date="2025/01/27"; +% The banner: +message "******* mp-neuralnetwork " & decimal (neuralnetwork_version) & + " (c) Maxime Chupin (" & neuralnetwork_date & ") *******";message ""; + +input metaobj; +input mp-neuralnetwork-metaobj-patch; +if not known mplib: input latexmp fi; +input colorbrewer-rgb; + +interim ahangle := 40; +interim ahlength := 2; + +numeric _ANN_Vspace,_ANN_Hspace; +_ANN_Vspace:=1.5cm; +_ANN_Hspace:=2.2cm; + + + +boolean +_ANN_Hidden_b,_ANN_Input_b,_ANN_Output_b,_ANN_Legends_b,_ANN_show_node_labels_b,_ANN_weights_b,_ANN_abstract_b,_ANN_Legends_b,_ANN_colored_b,_ANN_user_color; + +string _ANN_input_legend,_ANN_output_legend, _ANN_hidden_legend; +string _ANN_weights; + +numeric _ANN_instance_nbr; +numeric _ANN_label_nbr; +color _ANN_colors[],_ANN_connect_color; + + + +% init of colors +for ii:=0 upto 30: + _ANN_colors[ii]:=white; +endfor; + +_ANN_connect_color := 0.4*white; + +_ANN_input_legend := "Input layer"; +_ANN_output_legend := "Output layer"; +_ANN_hidden_legend := "Hidden layer(s)"; + +_ANN_colored_b := true; +_ANN_Legends_b:=false; +_ANN_abstract_b:=false; +_ANN_Hidden_b := false; +_ANN_Input_b := false; +_ANN_Output_b := false; +_ANN_show_node_labels_b := true; +_ANN_weights_b := false; +_ANN_user_color:=false; +_ANN_weights := "w"; + +def mpneural_init_values= + _ANN_Vspace:=1.5cm; + _ANN_Hspace:=2.2cm; + _ANN_input_legend := "Input layer"; + _ANN_output_legend := "Output layer"; + _ANN_hidden_legend := "Hidden layer(s)"; + + _ANN_colored_b := true; + _ANN_Legends_b:=false; + _ANN_abstract_b:=false; + _ANN_Hidden_b := false; + _ANN_Input_b := false; + _ANN_Output_b := false; + _ANN_show_node_labels_b := true; + _ANN_weights_b := false; + _ANN_user_color:=false; + _ANN_weights := "w"; + _ANN_connect_color := 0.4*white; +enddef; + + + + +def set_vspace(expr d)= + _ANN_Vspace:=d; +enddef; + +def set_hspace(expr d)= + _ANN_Hspace:=d; +enddef; +def set_connection_color(expr c)= + _ANN_connect_color:=c; +enddef; + + +def show_node_labels(expr b)= + _ANN_show_node_labels_b:=b; +enddef; + +def framed_input(expr b)= + _ANN_Input_b:=b; +enddef; + +def framed_output(expr b)= + _ANN_Output_b:=b; +enddef; + +def framed_hidden(expr b)= + _ANN_Hidden_b:=b; +enddef; + +def print_legends(expr b)= + _ANN_Legends_b:=b; +enddef; + +def colored_layers(expr b)= + _ANN_colored_b:=b; +enddef; + +vardef set_layer_colors(text t)= + save ii,_i_layer; + % initialisation + % init of colors + for ii:=1 upto 30: + _ANN_colors[ii]:=(1,1,1); + endfor; + for c=t: + show(c); + if(numeric c): + _i_layer:=c; + elseif(color c): + _ANN_colors[_i_layer]:=c; + fi + endfor; + _ANN_user_color:=true; +enddef; + +def print_weights(expr b)= + _ANN_weights_b:=b; +enddef; + +def set_weights_notation(expr s)= + _ANN_weights:=s; +enddef; + + +def set_input_legend(expr s)= + _ANN_input_legend := s; +enddef; + +def set_output_legend(expr s)= + _ANN_output_legend := s; +enddef; + +def set_hidden_legend(expr s)= + _ANN_hidden_legend := s; +enddef; + + +_ANN_instance_nbr :=0; + +def drawANN(text t) text options= + % t : list of ("str1",int1,"str2",int2, etc.) + + save prefixANN,_ANN_i,_ANN_i_couple,_ANN_n,_ANN_lb,_ANN_lb_int; + string prefixANN; + + numeric _ANN_n[],_ANN_i,_ANN_i_couple; + string _ANN_lb[],_ANN_lb_int[]; + + _ANN_instance_nbr := _ANN_instance_nbr+1; + + prefixANN:="ANN"&decimal(_ANN_instance_nbr); + _ANN_abstract_b:=false; + _ANN_i:=1; + _ANN_i_couple:=1; + % parsing the list + for x=t: + if(odd _ANN_i): + _ANN_lb[_ANN_i_couple]:=prefixANN&"_"&x; + else: + if(numeric x): + _ANN_n[_ANN_i_couple]:=x; + _ANN_i_couple:=_ANN_i_couple+1; + else: + _ANN_abstract_b:=true; + _ANN_n[_ANN_i_couple]:=5; + _ANN_lb_int[_ANN_i_couple]:=x; + _ANN_i_couple:=_ANN_i_couple+1; + fi + fi + _ANN_i:=_ANN_i+1; + endfor + + % colors + if(_ANN_user_color=false): + for i:=1 upto _ANN_i_couple-1: + _ANN_colors[i]:=Spectral[min(11,_ANN_i_couple-1)][i mod 11]; + endfor + fi + + if(_ANN_abstract_b=true): % small size for input and output + _ANN_n[1]:=4; + _ANN_n[_ANN_i_couple-1]:=4; + fi + for i:=1 upto _ANN_i_couple -1: + for j:=1 upto _ANN_n[i]: + if( not _ANN_show_node_labels_b): + newCircle.scantokens(_ANN_lb[i])[j](textext("$\phantom{a}$")) + if(_ANN_colored_b): "filled(true)","fillcolor("&str _ANN_colors[i] &")", fi options; + elseif(_ANN_abstract_b): % abstract + + if(j<3): % for the two first ones + newCircle.scantokens(_ANN_lb[i])[j](textext("$"&substring + (4+length(decimal(_ANN_instance_nbr)),length _ANN_lb[i]) of + _ANN_lb[i]&"_{"&decimal(j)&"}$")) if(_ANN_colored_b): "filled(true)","fillcolor("&str _ANN_colors[i] &")", fi options; + elseif(j=3): % dots + newBox.scantokens(_ANN_lb[i])[j](image(drawoptions(withpen + pencircle scaled 1bp);drawdot (0,0);drawdot + (0,0.1cm);drawdot + (0,0.2cm);drawoptions();)) if(_ANN_colored_b): + "filled(true)","fillcolor("&str _ANN_colors[i] &")", fi ; + else: % lasts + + if((i=1) or (i=_ANN_i_couple-1)): %if input or output only last + newCircle.scantokens(_ANN_lb[i])[j](textext("$"&substring + (4+length(decimal(_ANN_instance_nbr)),length _ANN_lb[i]) of + _ANN_lb[i]&"_{"&_ANN_lb_int[i]&"}$")) if(_ANN_colored_b): "filled(true)","fillcolor("&str _ANN_colors[i] &")", fi options; + else: + if(j=4): + newBox.scantokens(_ANN_lb[i])[j](image(drawoptions(withpen + pencircle scaled 1bp);drawdot (0,0);drawdot + (0,0.1cm);drawdot (0,0.2cm);drawoptions();)) if(_ANN_colored_b): "filled(true)","fillcolor("&str _ANN_colors[i] &")", fi ; + else: + newCircle.scantokens(_ANN_lb[i])[j](textext("$"&substring + (4+length(decimal(_ANN_instance_nbr)),length _ANN_lb[i]) of + _ANN_lb[i]&"_{"&_ANN_lb_int[i]&"}$")) if(_ANN_colored_b): "filled(true)","fillcolor("&str _ANN_colors[i] &")", fi options; + fi + fi + fi + else: + newCircle.scantokens(_ANN_lb[i])[j](textext("$"&substring + (4+length(decimal(_ANN_instance_nbr)),length _ANN_lb[i]) of + _ANN_lb[i]&"_{"&decimal(j)&"}$")) if(_ANN_colored_b): + "filled(true)","fillcolor("&str _ANN_colors[i] &")", fi options; + fi + if(j=1): + if(i=1): + scantokens(_ANN_lb[i])[j].c = origin; + else: + scantokens(_ANN_lb[i])[j].c = scantokens(_ANN_lb[i-1])[j].c+(_ANN_Hspace,0)+(0,-(_ANN_n[i]-_ANN_n[i-1])/3.5*_ANN_Vspace); + fi + else: + scantokens(_ANN_lb[i])[j].n-scantokens(_ANN_lb[i])[j-1].s=(0,_ANN_Vspace); + fi + endfor + for j:=1 upto _ANN_n[i]: + drawObj(scantokens(_ANN_lb[i])[j]); + endfor + endfor + % group for hiddenlayer + + if(_ANN_i_couple-1>3): + newGroup.scantokens(prefixANN)_hidden( for i:=2 upto (_ANN_i_couple-2): for j:=1 upto _ANN_n[i]: + scantokens(_ANN_lb[i])[j] if((i<_ANN_i_couple-2)or(j<_ANN_n[i])): , fi + endfor endfor) "framed(true)","dx(3pt)","dy(3pt)"; + fi + if(_ANN_Hidden_b): + drawObj(scantokens(prefixANN)_hidden) ; + fi + % rectangle for inputlayer + + if(_ANN_n[1]>1): + newGroup.scantokens(prefixANN)_input(for j:=1 upto _ANN_n[1]: + scantokens(_ANN_lb[1])[j] if(j<_ANN_n[1]): , fi + endfor) + "framed(true)","dx(3pt)","dy(3pt)"; + else: + newBox.scantokens(prefixANN)_input(scantokens(_ANN_lb[1])[1]) "filled(false)","framed(true)","dx(3pt)","dy(3pt)"; + fi + if(_ANN_Input_b): + drawObj(scantokens(prefixANN)_input); + fi + + % rectangle for outputlayer + + if(_ANN_n[_ANN_i_couple-1]>1): + newGroup.scantokens(prefixANN)_output(for j:=1 upto _ANN_n[_ANN_i_couple-1]: + scantokens(_ANN_lb[_ANN_i_couple-1])[j] if(j<_ANN_n[_ANN_i_couple-1]): , fi + endfor) + "framed(true)","dx(3pt)","dy(3pt)"; + else: + newBox.scantokens(prefixANN)_output(scantokens(_ANN_lb[_ANN_i_couple-1])[1]) "filled(false)","framed(true)","dx(3pt)","dy(3pt)"; + fi + if(_ANN_Output_b): + drawObj(scantokens(prefixANN)_output); + fi + + % links + for i:=1 upto _ANN_i_couple-1: + if(i>1): + for j:=1 upto _ANN_n[i-1]: + for k:=1 upto _ANN_n[i]: + ncline(scantokens(_ANN_lb[i-1])[j])(scantokens(_ANN_lb[i])[k]) + "linecolor(_ANN_connect_color)" + ; + endfor + endfor + + fi + endfor + % weights + if(_ANN_weights_b): + for j:=1 upto _ANN_i_couple-2: + newBox.scantokens(prefixANN)_weights[j](textext("$"&_ANN_weights&"_{ij}^{("&decimal(j)&")}$")); + scantokens(prefixANN)_weights.[j].c=1/4*(scantokens(_ANN_lb[j])[1].c+scantokens(_ANN_lb[j])[_ANN_n[j]].c+scantokens(_ANN_lb[j+1])[1].c+scantokens(_ANN_lb[j+1])[_ANN_n[j+1]].c); + drawObj(scantokens(prefixANN)_weights[j]); + endfor; + fi + % labels + if(_ANN_Legends_b): + newBox.scantokens(prefixANN)_legend_input(textext(_ANN_input_legend)) "framed(false)"; + scantokens(prefixANN)_legend_input.n=scantokens(prefixANN)_input.s; + drawObj(scantokens(prefixANN)_legend_input); + newBox.scantokens(prefixANN)_legend_output(textext(_ANN_output_legend)) "framed(false)"; + scantokens(prefixANN)_legend_output.n=scantokens(prefixANN)_output.s; + drawObj(scantokens(prefixANN)_legend_output); + + if(_ANN_i_couple-1>3): + newBox.scantokens(prefixANN)_legend_hidden(textext(_ANN_hidden_legend)) "framed(false)"; + scantokens(prefixANN)_legend_hidden.n=scantokens(prefixANN)_hidden.s; + drawObj(scantokens(prefixANN)_legend_hidden); + fi + fi + % build global group + newGroup.scantokens(prefixANN)_global(for i:=1 upto (_ANN_i_couple-1): for j:=1 upto _ANN_n[i]: + scantokens(_ANN_lb[i])[j] if((i<_ANN_i_couple-1)or(j<_ANN_n[i])): , fi + endfor endfor); +enddef; + + +_ANN_label_nbr:=0; +vardef labelANN(expr s)(expr a,b) text options= + % s: string for the label + % (a,b): point at which put the label in relative coordinate, that is + % $(0,0)$ at bottom left of the bounding box of the complete graph and + % $(1,1)$ at top right. + + save _xmin, _xmax, _ymin,_ymax; + save prefixANN; + string prefixANN; + _ANN_label_nbr:=_ANN_label_nbr+1; + + prefixANN:="ANN"&decimal(_ANN_instance_nbr); + (_xmin,_ymin)=scantokens(prefixANN)_global.sw; + (_xmax,_ymax)=scantokens(prefixANN)_global.ne; + newBox.scantokens(prefixANN)_label scantokens(decimal(_ANN_label_nbr))(textext(s)) options; + scantokens(prefixANN)_label + scantokens(decimal(_ANN_label_nbr)).c=(_xmin+a*(_xmax-_xmin),_ymin+b*(_ymax-_ymin)); + drawObj(scantokens(prefixANN)_label scantokens(decimal(_ANN_label_nbr))); +enddef; + +endinput
\ No newline at end of file diff --git a/graphics/metapost/contrib/macros/mpchess/README.md b/graphics/metapost/contrib/macros/mpchess/README.md index 296db6d543..9156971db3 100644 --- a/graphics/metapost/contrib/macros/mpchess/README.md +++ b/graphics/metapost/contrib/macros/mpchess/README.md @@ -71,7 +71,7 @@ A piece set has been designed for this package. It has also be added to A dedicated git repository is available: [https://plmlab.math.cnrs.fr/mchupin/mpchess-pieces](https://plmlab.math.cnrs.fr/mchupin/mpchess-pieces) and -[https://github.com/chupinmaxime/mpchess](https://github.com/chupinmaxime/mpchess). +[https://github.com/chupinmaxime/mpchess-pieces](https://github.com/chupinmaxime/mpchess-pieces). A TrueType font is available. ## Contact diff --git a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-en.pdf b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-en.pdf Binary files differindex 741544029e..bfde99b627 100644 --- a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-en.pdf +++ b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-en.pdf diff --git a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-en.tex b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-en.tex index 5ad5abdb1a..e11a860be4 100644 --- a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-en.tex +++ b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-en.tex @@ -68,8 +68,8 @@ } \vfill \begin{center} - Version 0.7, 2023, July, 20th \\ - \url{https://plmlab.math.cnrs.fr/mchupin/mpchess} + Version 0.9, 2024, Decembre, 16th \\ + \url{https://gitlab.gutenberg-asso.fr/mchupin/mpchess} \end{center} %% == Page de garde ==================================================== \newpage @@ -86,7 +86,7 @@ \begin{center} - \url{https://plmlab.math.cnrs.fr/mchupin/mpchess} + \url{https://gitlab.gutenberg-asso.fr/mchupin/mpchess} \url{https://github.com/chupinmaxime/mpchess} \end{center} @@ -297,7 +297,9 @@ command: \item \lstinline+"GreenLichess"+; \item \lstinline+"PinkPyramidalLichess"+; \item \lstinline+"Wood"+; -\item or \lstinline+"Classical"+. +\item \lstinline+"Classical"+; +\item \lstinline+"Dotted"+; +\item or \lstinline+"User"+; \end{itemize} \end{description} @@ -359,11 +361,41 @@ The table~\ref{tab:color} shows the different results of the different themes. draw backboard; endfig; \end{mplibcode}\\ +\lstinline+"Dotted"+ theme& \\ +\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("Dotted"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode}&\\ \end{tabular} \caption{The different color themes provided by \mpchess.}\label{tab:color} \end{table} - +The use of \lstinline+"User"+ is a special case, as it allows you to +define black and white squares. For this to work +a another macro +\lstinline+buildUserSquare+\index{buildUserSquare@\lstinline+buildUserSquare+} +should be difined. It must build the +images (\lstinline+picture+) \lstinline+_blackSquarePic+\index{_blackSquarePic@\lstinline+_blackSquarePic+} and +\lstinline+_whiteSquarePic+\index{_whiteSquarePic@\lstinline+_whiteSquarePic+}. +Here is a prototype of such a command. +\begin{mpcode} + def buildUserSquare(expr _SquareUnit)= + _blackSquarePic:=image( + fill (unitsquare scaled _SquareUnit) withcolor red; + ); + _whiteSquarePic:=image( + fill unitsquare scaled _SquareUnit withcolor green; + ); + enddef; +\end{mpcode} +The macro takes a unit as argument, and must construct two squares with length +equal to this unit. \subsubsection{Configuring a Personal Color Theme} @@ -654,6 +686,64 @@ in version 0.6, \lstinline+set_whos_to_move+ and \commande|hide_whos_to_move|\index{hide_whos_to_move@\lstinline+hide_whos_to_move+}\smallskip +It is now possible to change the appearance of the marker (since +version 0.9\footnote{Thanks to Udi Fogiel for fixing a placement bug and +for suggesting improvements.}. For this purpose, \mpchess provides three styles: +\lstinline+"triangle"+ (default), \lstinline+"square"+ and \lstinline+"disk"+. +To select the marker type, use the following command: + +\commande|set_marker_type(«string»)|\index{set_marker_type@\lstinline+set_marker_type+}\smallskip + +\begin{description} + \item[\meta{string}] may be +\begin{itemize} + \item \lstinline+"triangle"+ (default value); + \item \lstinline+"square"+; +\item \lstinline+"disk"+; +\item \lstinline+"custom"+. +\end{itemize} +\end{description} + +You can adjust the size (by a factor of the unit dimension) with the following +command: + +\commande|set_marker_scale(«numeric»)|\index{set_marker_scale@\lstinline+set_marker_scale+}\smallskip + +\begin{description} + \item[\meta{numeric}:] is a unit dimension factor for enlarging or + shrink the mark (default value is \num{0.35}). +\end{description} + +The \lstinline+"custom"+ marker type value lets you define the marker's +appearance. When this option is called, a +macro \MP{} \lstinline+custom_maker(expr s,r)+ must be defined. The +\lstinline+s+ parameter is the scale factor setting: the markers supplied by +\mpchess are drawings contained in a square of side 1 (\MP{} unit) and scaled +by \lstinline+s*_chessSquareU+. The \lstinline+r+ parameter is a boolean that +handles the case where the marker is rotated 180 degrees +when placed at the top of the chessboard. + +For example, a \lstinline+custom_marker+ macro reproducing the triangle symbol might be as follows: +\begin{mpcode} +def custom_marker(expr s, r)= + ((0,0)--(1,0)--(0.5,0.5)--cycle) if r: rotatedaround((0.5, 0.5/3), 180) fi scaled (s*_chessSquareU) +enddef; +\end{mpcode} + +Only the outline is defined, which will be filled by either white or black. + + +\begin{ExempleMP} +input mpchess +beginfig(0); +set_marker_type("disk"); +set_marker_scale(0.5); +init_backboard; +draw backboard; +init_chessboard; +draw chessboard; +endfig; +\end{ExempleMP} \subsection{Draw a Position} The commands described below allow you to build a position in several ways @@ -1448,8 +1538,14 @@ endfig; \section{History} \begin{description} -\item[v0.7, juillet 2023:] Black knight adjustment, adding color board themes (\lstinline+GreenLichess+, \lstinline+PinkPyramidalLichess+, -\lstinline+Wood+ with color type (\lstinline+set_board_type+). +\item[v0.9, December 16, 2024:] Correction of a bug in the placement of the +trait marker (by Udi Fogiel), added different marker features (\lstinline ++"triangle"+, \lstinline+"square"+,\lstinline+"disk"+ and \lstinline+"custom"+). Filling of the white marker. +\item[v0.8, October 26, 2024:] Adding \lstinline+"Dotted"+ board theme, and +\lstinline+"User"+ board theme that allows user to define black and white +squares. +\item[v0.7, July, 2023:] Black knight adjustment, adding color board themes (\lstinline+GreenLichess+, \lstinline+PinkPyramidalLichess+, +\lstinline+Wood+ with color type (\lstinline+set_board_type+)). \item[v0.6, April 26, 2023:] Fixed bugs concerning castling management, and moves ambiguities in \textsc{pgn} format. Changed \lstinline+set_white_color+ to @@ -1461,8 +1557,6 @@ Changed \lstinline+set_white_color+ to \lstinline+hide_whos_to_move+. Change \lstinline+set_coords_inside+ and \lstinline+set_coords_outside+ to \lstinline+set_coordinates_position+. Change \lstinline+set_coords_font+ to \lstinline+set_coordinates_font+. - -Translated with www.DeepL.com/Translator (free version) \item[v0.5, April 20, 2023:] Bug fixed, \textbf{changing the default piece set} for the \lstinline+mpchess+ set (which has been added to Lichess), added TrueType font, and updated documentation. \item[v0.4, April 6, 2023:] Corrections in the documentation, especially the diff --git a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-fr.pdf b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-fr.pdf Binary files differindex bcca5a85f9..4f133242cc 100644 --- a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-fr.pdf +++ b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-fr.pdf diff --git a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-fr.tex b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-fr.tex index db6a5f8b86..5a5b0bdf6c 100644 --- a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-fr.tex +++ b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-doc-fr.tex @@ -71,8 +71,8 @@ } \vfill \begin{center} - Version 0.7, 20 juillet 2023 \\ - \url{https://plmlab.math.cnrs.fr/mchupin/mpchess} + Version 0.9, 16 décembre 2024 \\ + \url{https://gitlab.gutenberg-asso.fr/mchupin/mpchess} \end{center} %% == Page de garde ==================================================== \newpage @@ -89,7 +89,7 @@ excellent packages \LaTeX{}. \begin{center} - \url{https://plmlab.math.cnrs.fr/mchupin/mpchess} + \url{https://gitlab.gutenberg-asso.fr/mchupin/mpchess} \url{https://github.com/chupinmaxime/mpchess} \end{center} @@ -292,11 +292,13 @@ Plusieurs thèmes de couleurs sont accessibles. Pour choisir un thème de couleu \item \lstinline+"GreenLichess"+; \item \lstinline+"PinkPyramidalLichess"+; \item \lstinline+"Wood"+; -\item ou \lstinline+"Classical"+. +\item \lstinline+"Classical"+; +\item \lstinline+"Dotted"+; +\item ou \lstinline+"User"+. \end{itemize} \end{description} -Les exemples suivants montrent les résultats obtenus. +Les exemples suivants montrent les résultats obtenus pour les thèmes prédéfinis. \begin{ExempleMP} input mpchess beginfig(0); @@ -355,10 +357,40 @@ Thème \lstinline+"PinkPyramidalLichess"+&Thème \lstinline+"Wood"+\\ draw backboard; endfig; \end{mplibcode}\\ +Thème \lstinline+"Dotted"+&\\ +\begin{mplibcode} + input mpchess + beginfig(0); + init_chessboard; + set_backboard_width(4cm); + set_color_theme("Dotted"); + init_backboard; + draw backboard; + endfig; +\end{mplibcode}&\\ \end{tabular} \caption{Les différents thèmes de couleur fournis par \mpchess.}\label{tab:color} \end{table} +L’utilisation de \lstinline+"User"+ est un cas particulier, car il permet de +définir soit même les casses noires et blanches. Pour que cela fonctionne, il +faut définir en plus une macro \lstinline+buildUserSquare+\index{buildUserSquare@\lstinline+buildUserSquare+} qui construit les +images (\lstinline+picture+) internes \lstinline+_blackSquarePic+\index{_blackSquarePic@\lstinline+_blackSquarePic+} et +\lstinline+_whiteSquarePic+\index{_whiteSquarePic@\lstinline+_whiteSquarePic+} dont voici un prototype : +\begin{mpcode} +def buildUserSquare(expr _SquareUnit)= + _blackSquarePic:=image( + fill (unitsquare scaled _SquareUnit) withcolor red; + ); + _whiteSquarePic:=image( + fill unitsquare scaled _SquareUnit withcolor green; + ); +enddef; +\end{mpcode} +La macro prend en argument une unité, et doit construire deux carrés de côté +cette unité. + + \subsubsection{Configuration d’un thème personnel} \paragraph{Couleurs.} @@ -637,6 +669,67 @@ lors du passage à la version 0.6, \lstinline+set_whos_to_move+ et \commande|hide_whos_to_move|\index{hide_whos_to_move@\lstinline+hide_whos_to_move+}\smallskip +Il est désormais possible de changer l’apparence du marqueur de trait (depuis la +version 0.9\footnote{Merci à Udi Fogiel d’avoir corrigé un bug de placement et +d’avoir proposé des améliorations.}). Pour cela, \mpchess fournit trois styles: +\lstinline+"triangle"+ (par défaut), \lstinline+"square"+ et \lstinline+"disk"+. +Pour choisir le type de marquer, on utilisera la commande suivante: + + +\commande|set_marker_type(«string»)|\index{set_marker_type@\lstinline+set_marker_type+}\smallskip + +\begin{description} + \item[\meta{string}:] peut valoir: +\begin{itemize} + \item \lstinline+"triangle"+ (valeur par défaut) ; + \item \lstinline+"square"+; +\item \lstinline+"disk"+; +\item \lstinline+"custom"+. +\end{itemize} +\end{description} + +Vous pouvez ajuster la taille (par un facteur de la dimension d’unité) avec la +commande suivante: + +\commande|set_marker_scale(«numeric»)|\index{set_marker_scale@\lstinline+set_marker_scale+}\smallskip + +\begin{description} + \item[\meta{numeric}:] est un facteur de la dimension d’unité pour agrandir ou + rétrécir le marquer (la valeur par défaut est \num{0.35}). +\end{description} + +La valeur \lstinline+"custom"+ du type de marqueur permet de définir soi même +l’apparence du marqueur. Lorsque cette option est appelée, il faut définir une +macro \MP{} \lstinline+custom_maker(expr s,r)+. Le paramètre \lstinline+s+ est +le réglage du facteur d’échelle : pour les marqueurs fournis par \mpchess, ce +sont des dessins contenus dans un carré de côté 1 (unité \MP) est mis à +l’échelle par \lstinline+s*_chessSquareU+. Le paramètre \lstinline+r+ est un +booléen qui permet de traiter le cas où le marqueur est tourné de 180 degrés +lorsqu’il est placé en haut de l’échiquier. + +Par exemple, une macro \lstinline+custom_marker+ reproduisant le symbole en +triangle pourrait être la suivante: +\begin{mpcode} +def custom_marker(expr s, r)= + ((0,0)--(1,0)--(0.5,0.5)--cycle) if r: rotatedaround((0.5, 0.5/3), 180) fi scaled (s*_chessSquareU) +enddef; +\end{mpcode} + +On ne définit que le contour qui sera, suivant le cas, colorié en blanc ou en +noir. + +\begin{ExempleMP} +input mpchess +beginfig(0); +set_marker_type("disk"); +set_marker_scale(0.5); +init_backboard; +draw backboard; +init_chessboard; +draw chessboard; +endfig; +\end{ExempleMP} + \subsection{Dessiner une position} Les commandes décrites ci-dessous permet de construire une position de plusieurs @@ -1424,6 +1517,13 @@ endfig; \section{Historique} \begin{description} + \item[v0.9, 16 décembre 2024:] Correction d’un bug de placement de la marque + de trait (par Udi Fogiel), ajout de différents marqueur de traits (\lstinline"triangle", + \lstinline"square",\lstinline"disk" and \lstinline"custom"). Colloriage du + marqueur blanc. + \item[v0.8, 26 octobre 2024:] Ajout du thème d’échiquier \lstinline+"Dotted"+ + et ajout du thème d’échiquier \lstinline+"User"+ qui permet à l’utilisateur ou + l’utilisatrice de définir les casses blanches et noires. \item[v0.7, juillet 2023:] Ajustement du cavalier noir, ajout de thèmes d'échiquier (\lstinline+GreenLichess+, \lstinline+PinkPyramidalLichess+, \lstinline+Wood+ avec des types de coloriage (\lstinline+set_board_type+). diff --git a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-preamble.tex b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-preamble.tex index 6a7f11d747..01428cc16b 100644 --- a/graphics/metapost/contrib/macros/mpchess/doc/mpchess-preamble.tex +++ b/graphics/metapost/contrib/macros/mpchess/doc/mpchess-preamble.tex @@ -97,7 +97,7 @@ set_no_coords,set_white_view,set_black_view, set_white_player,set_black_player,set_pieces_theme,set_players_side,init_chessboard,set_empty_chessboard,add_white_pieces,add_black_pieces,clear_areas,clear_files,clear_ranks,clear_squares,build_chessboard_from_fen,build_chessboards_from_pgn,clear_chessboard, color_square,draw_arrows,draw_circles,draw_comment,draw_crosses,get_halfmove_number,get_totalmove_number, - reset_mpchess,set_black_to_move,set_last_move_color,set_comment_color,set_white_to_move,set_whos_to_move,show_last_move,unset_whos_to_move,set_arrow_width,clip_chessboard,build_chessboard_from_fen_file,build_chessboard_from_pgn_file,draw_black_main_lines,draw_black_main_lines_step,draw_white_main_lines,draw_white_main_lines_step,set_main_lines_color,set_possible_moves_color,show_possible_moves,show_possible_moves_step,hide_coordinates,hide_whos_to_move,set_black_squares_color,set_coordinates_font,set_coordinates_position,set_white_squares_color,show_coordinates,show_whos_to_move,set_board_type}, + reset_mpchess,set_black_to_move,set_last_move_color,set_comment_color,set_white_to_move,set_whos_to_move,show_last_move,unset_whos_to_move,set_arrow_width,clip_chessboard,build_chessboard_from_fen_file,build_chessboard_from_pgn_file,draw_black_main_lines,draw_black_main_lines_step,draw_white_main_lines,draw_white_main_lines_step,set_main_lines_color,set_possible_moves_color,show_possible_moves,show_possible_moves_step,hide_coordinates,hide_whos_to_move,set_black_squares_color,set_coordinates_font,set_coordinates_position,set_white_squares_color,show_coordinates,show_whos_to_move,set_board_type,buildUserSquare,_blackSquarePic,_whiteSquarePic,set_marker_scale,set_marker_type}, keywordstyle=\color{darkred}, classoffset=2,% frame=tb morekeywords={backboard,chessboard,chessboard_step}, diff --git a/graphics/metapost/contrib/macros/mpchess/metapost/mpchess.mp b/graphics/metapost/contrib/macros/mpchess/metapost/mpchess.mp index 3883ca0bc3..59cf31a8c5 100644 --- a/graphics/metapost/contrib/macros/mpchess/metapost/mpchess.mp +++ b/graphics/metapost/contrib/macros/mpchess/metapost/mpchess.mp @@ -2,7 +2,7 @@ %% mpchess.mp %% %% draw chessboards with metapost %% %% notezik@gmail.com %% -%% Version 0.7 (juillet 2023) %% +%% Version 0.9 (decembre 2024) %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This work may be distributed and/or modified under the conditions of @@ -12,9 +12,21 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Don't load this package twice: +if known mpchess_version: expandafter endinput; fi; + +numeric mpchess_version;string mpchess_date; +mpchess_version=0.9; +mpchess_date="2024/12/16"; +% The banner: +message "******* mpchess " & decimal (mpchess_version) & + " (c) Maxime Chupin (" & mpchess_date & ") *******";message ""; + %input format; input hatching; +%input minim-mp; +%input minim-hatching; input mpchess-pieces; % piece of mpchess package input mpchess-cburnett; % piece of lichess cburnett input mpchess-skak; % piece of skak package @@ -258,6 +270,27 @@ def _buildClassicalSquare(expr _SquareUnit)= ); enddef; +def _buildDottedSquare(expr _SquareUnit)= + _blackSquarePic:=image( + fill (unitsquare scaled _SquareUnit) withcolor white; + save N; + N:= 11; + for i:=0 upto N+1: + for j:=0 upto N+1: + fill (fullcircle shifted (1/N*i*_SquareUnit if odd(j): +1/(2*N)*_SquareUnit fi,1/N*j*_SquareUnit)) + ; + endfor; + endfor; + draw (unitsquare scaled _SquareUnit); + clip currentpicture to (unitsquare scaled _SquareUnit); + ); + _whiteSquarePic:=image( + fill unitsquare scaled _SquareUnit withcolor white; + draw (unitsquare scaled _SquareUnit); + clip currentpicture to (unitsquare scaled _SquareUnit); + ); +enddef; + % default theme lichess blue _blackSquarePic:=_blackSquareColoredPic; _whiteSquarePic:=_whiteSquareColoredPic; @@ -287,6 +320,9 @@ def set_color_theme(expr t)= elseif(t="Classical"): _blackColorSquare:=black; _whiteColorSquare:=black; + elseif(t="Dotted"): + _blackColorSquare:=black; + _whiteColorSquare:=black; fi enddef; @@ -561,6 +597,10 @@ _chessSquareU:=_chessWidth/_chessSize; _init_piece(_chessSquareU); if(_chessTheme="Classical"): _buildClassicalSquare(_chessSquareU); +elseif(_chessTheme="Dotted"): + _buildDottedSquare(_chessSquareU); +elseif(_chessTheme="User"): + buildUserSquare(_chessSquareU); else: % colored themes _buildColoredSquare(_chessSquareU,_blackColorSquare,_whiteColorSquare); fi @@ -704,9 +744,7 @@ def _int_to_piece(expr i)= fi enddef; -def _triangle(expr s)= - ((0,0)--(1,0)--(0.5,0.5)--cycle) scaled (s*_chessSquareU) -enddef; + color _chess_last_move_color; @@ -734,6 +772,72 @@ def show_last_move(expr k)= enddef; +%% markers + +numeric _marker_size; + +_marker_size := 0.35; + +def set_marker_scale(expr s)= + _marker_size:=s; +enddef; + +def _triangle_marker(expr s, r)= + ((0,0)--(1,0)--(0.5,0.5)--cycle) if r: rotatedaround((0.5, 0.5/3), 180) fi scaled (s*_chessSquareU) +enddef; + +def _square_marker(expr s, r)= + ((0,0)--(1,0)--(1,1)--(0,1)--cycle) scaled (s*_chessSquareU) +enddef; + + +def _disk_marker(expr s, r)= + (fullcircle shifted (0.5,0.5)) scaled (s*_chessSquareU) +enddef; + +string _marker_type; + +_marker_type := "triangle"; + +def _marker(expr s,r)= + if(_marker_type="square"): + _square_marker(s,r) + elseif(_marker_type="disk"): + _disk_marker(s,r) + elseif(_marker_type="custom"): + custom_marker(s,r) + else: + _triangle_marker(s,r) + fi +enddef; + +def set_marker_type(expr s)= + _marker_type:=s; +enddef; + + +vardef _draw_marker(expr c,b)= + % c : black or white (color) + % b : true or false for placing top (with rotation) or bottom + save _height,_width,_pic,_shifted,_margin; + picture _pic; + pair _shifted; + _pic := image(draw _marker(_marker_size,false);); + _height := abs(ulcorner _pic - llcorner _pic); + _width := abs(urcorner _pic-ulcorner _pic); + _margin:=0.01*_chessSquareU; + if(b): % top rotating + _shifted:= (_chessSquareU*_chessSize+_width/2.0+_margin,_chessSquareU*_chessSize); + else: + _shifted:= (_chessSquareU*_chessSize+_width/2.0+_margin,-_height); + fi + draw _marker(_marker_size,b) shifted _shifted ; + fill _marker(_marker_size,b) shifted _shifted withcolor c; +enddef; + +%%%% end markers + + vardef _chess_build_chessboard_pic(expr k)= save chessboard_pic; save shiftPiece; @@ -756,15 +860,15 @@ vardef _chess_build_chessboard_pic(expr k)= if(_show_whos_to_move): if(_chess_view_wb): %white side if(not _white_to_move): - fill _triangle(0.3) rotated 180 shifted (_chessSquareU*(_chessSize+0.35),_chessSquareU*(_chessSize)+0.3*_chessSquareU) + _draw_marker(black,true); else: - draw _triangle(0.35) shifted (_chessSquareU*(_chessSize+0.3),-0.3*_chessSquareU) ; + _draw_marker(white,false); fi else: % black side if(_white_to_move): - draw _triangle(0.3) rotated 180 shifted (_chessSquareU*(_chessSize+0.35),_chessSquareU*(_chessSize)+0.3*_chessSquareU) + _draw_marker(white,true); else: - fill _triangle(0.35) shifted (_chessSquareU*(_chessSize+0.3),-0.3*_chessSquareU) ; + _draw_marker(black,false); fi fi fi @@ -1067,4 +1171,4 @@ def draw_comment(expr ind, pos)= else: draw _img scaled (_commentScale*_chessSquareU/max(_width,_height)) shifted ((8+1-_letter)*_chessSquareU-0.15*(_chessSquareU-_width),(8+1-_nbr)*_chessSquareU-0.15*_chessSquareU); fi -enddef;
\ No newline at end of file +enddef; |