diff options
author | Norbert Preining <norbert@preining.info> | 2022-11-03 03:05:14 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-11-03 03:05:14 +0000 |
commit | c3c9975778ff2848e51f6debf733abe8ca930bd3 (patch) | |
tree | 034fcccacf40343842462b161df1764d3a7a41af /macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp | |
parent | 2281af8ba8fd52341e706f3979712f3280fcfdad (diff) |
CTAN sync 202211030305
Diffstat (limited to 'macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp')
-rw-r--r-- | macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp index f96556d032..f3acd75d3d 100644 --- a/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp +++ b/macros/latex/contrib/profcollege/metapost/PfCScratchpdf.mp @@ -3402,3 +3402,71 @@ vardef ListeLongueur(expr nbpas)= $ enddef; +vardef Boussole(expr nbpas)= + save $; picture $; + picture Bouss[]; + Bouss1=image( + draw Orienter("90"); + ); + Bouss2=image( + _coinprec:=(0,0); + draw Orienter("0"); + ); + Bouss3=image( + _coinprec:=(0,0); + draw Orienter("-90"); + ); + Bouss4=image( + _coinprec:=(0,0); + draw Orienter("180"); + ); + $=image( + draw Bouss1 rotatedabout(center Bouss1,-90) shifted ((2cm,0)-(center Bouss1)); + draw Bouss2 shifted ((0,2cm)-(center Bouss2)); + draw Bouss3 rotatedabout(center Bouss3,90) shifted((-2cm,0)-(center Bouss3)); + draw Bouss4 rotatedabout(center Bouss4,180) shifted((0,-2cm)-(center Bouss4)); + pair PtBous[]; + PtBous1=(-1.2cm,-1.2cm); + PtBous2-PtBous1=(2*1.2cm,0); + PtBous3-PtBous2=(0,2*1.2cm); + PtBous4-PtBous3=PtBous1-PtBous2; + path CadreBous; + CadreBous=(PtBous1+(0,eb)){dir-90}..{dir0}(PtBous1+(eb,0)) if nbpas="180":--0.4[PtBous1,PtBous2]--(1/2[PtBous1,PtBous2]+(0,-0.3cm))--0.6[PtBous1,PtBous2] fi--(PtBous2+(-eb,0)){dir 0}..{dir 90}(PtBous2+(0,eb)) if nbpas="90":--0.4[PtBous2,PtBous3]--(1/2[PtBous2,PtBous3]+(0.3cm,0))--0.6[PtBous2,PtBous3] fi--(PtBous3+(0,-eb)){dir90}..{dir180}(PtBous3+(-eb,0)) if nbpas="0":--0.4[PtBous3,PtBous4]--(1/2[PtBous3,PtBous4]+(0,0.3cm))--0.6[PtBous3,PtBous4] fi--(PtBous4+(eb,0)){dir 180}..{dir -90}(PtBous4-(0,eb)) if nbpas="-90":--0.4[PtBous4,PtBous1]--(1/2[PtBous4,PtBous1]+(-0.3cm,0))--0.6[PtBous4,PtBous1] fi + --cycle; + fill CadreBous withcolor BleuMouvTrois; + draw CadreBous; + path CercleBouss; + CercleBouss=fullcircle scaled (0.55*sqrt(2)*2.4cm); + fill CercleBouss withcolor 0.2[BleuMouvTrois,white]; + trace CercleBouss withcolor dBleuMouvTrois; + if nbpas="0": + fill ((0,0)--(subpath(0,2) of CercleBouss)--cycle) withcolor 0.4[BleuMouvTrois,white]; + draw (point(2) of CercleBouss)--(0,0)--(point(0) of CercleBouss) withpen pencircle scaled 1.25 withcolor white; + fi; + if nbpas="90": + draw (0,0)--(point(0) of CercleBouss) withpen pencircle scaled 1.25 withcolor white; + fi; + if nbpas="180": + fill ((0,0)--(subpath(6,8) of CercleBouss)--cycle) withcolor 0.4[BleuMouvTrois,white]; + draw (point(6) of CercleBouss)--(0,0)--(point(8) of CercleBouss) withpen pencircle scaled 1.25 withcolor white; + fi; + if nbpas="-90": + fill ((0,0)--(subpath(0,4) of CercleBouss)--cycle) withcolor 0.4[BleuMouvTrois,white]; + draw (point(0) of CercleBouss)--(0,0)--(point(4) of CercleBouss) withpen pencircle scaled 1.25 withcolor white; + fi; + for k=0 upto 17: + draw 0.6[(0,0),point ((k/18)*length CercleBouss) of CercleBouss]--0.8[(0,0),point ((k/18)*length CercleBouss) of CercleBouss] withcolor white; + endfor; + picture FlecheBouss; + FlecheBouss=image( + fill fullcircle scaled 4mm withcolor white; + draw fullcircle scaled 4mm; + drawarrow (-1mm,0)--(1mm,0) withpen pencircle scaled 2 withcolor BleuMouvTrois; + ); + draw FlecheBouss shifted (point(0) of CercleBouss); + draw (FlecheBouss rotated 90) shifted (point(2) of CercleBouss); + draw (FlecheBouss rotated 180) shifted (point(4) of CercleBouss); + draw (FlecheBouss rotated -90) shifted (point(6) of CercleBouss); + ); + $ +enddef; |