| 1 |
% Author.........: C. Pierquet |
| 2 |
% licence........: Released under the LaTeX Project Public License v1.3c or later, see http://www.latex-project.org/lppl.txt |
| 3 |
|
| 4 |
\NeedsTeXFormat{LaTeX2e} |
| 5 |
\ProvidesPackage{OutilsGeomTikz}[2026/03/12 v0.1.8 Outils geometriques en TikZ] |
| 6 |
% 0.1.8 Correction d'un dysfonctionnement avec la clé [Origine=...] |
| 7 |
% 0.1.7 Clé pour ne pas afficher les graduations (tks Cyril I. ^^ pour l'idée) |
| 8 |
% 0.1.6 Correction de bugs avec pdflatex + amélioration de la gestion des rotations/échelles des labels (tks Cyril I. ^^) |
| 9 |
% 0.1.5 Modification de la graduation intérieure pour les rapporteurs 180° |
| 10 |
% 0.1.4 Possibilité de positionner les outils avec deux points (angle calculé automatiquement) |
| 11 |
% 0.1.3 Ajout du pourcenteur |
| 12 |
% 0.1.2 Ajout de la règle-repère |
| 13 |
% 0.1.1 Correction d'un bug avec une ancienne syntaxe [join=...] |
| 14 |
% 0.1.0 Version initiale |
| 15 |
|
| 16 |
%------Packages utiles |
| 17 |
\RequirePackage{tikz,pgffor} |
| 18 |
\RequirePackage{simplekv} |
| 19 |
\RequirePackage{xstring} |
| 20 |
\RequirePackage{nicefrac} |
| 21 |
%librairies tikz |
| 22 |
\usetikzlibrary{calc,positioning} |
| 23 |
|
| 24 |
%--------Retire les parenthèses extérieures si présentes |
| 25 |
\ExplSyntaxOn |
| 26 |
\NewDocumentCommand\ogtcleanparen{ m m }{% |
| 27 |
\tl_set:Ne \l_tmpa_tl { #1 } |
| 28 |
\str_if_eq:eeTF { \tl_head:N \l_tmpa_tl } { ( } |
| 29 |
{ |
| 30 |
\tl_set:Nx \l_tmpa_tl { \tl_tail:N \l_tmpa_tl } |
| 31 |
\tl_reverse:N \l_tmpa_tl |
| 32 |
\tl_set:Nx \l_tmpa_tl { \tl_tail:N \l_tmpa_tl } |
| 33 |
\tl_reverse:N \l_tmpa_tl |
| 34 |
} |
| 35 |
{ } |
| 36 |
\xdef #2 { \tl_use:N \l_tmpa_tl } |
| 37 |
} |
| 38 |
\ExplSyntaxOff |
| 39 |
|
| 40 |
%--------Crayon |
| 41 |
% inspiration(s) de https://tex.stackexchange.com/questions/147389/symbols-of-pencil-ruler-and-compass |
| 42 |
\defKV[CrayonGeom]{% |
| 43 |
Echelle=\def\PENechelle{#1},% |
| 44 |
Longueur=\def\PENlongueur{#1},% |
| 45 |
Couleur=\def\PENcouleur{#1},% |
| 46 |
Origine=\def\PENposOrigin{#1},% |
| 47 |
Rotation=\def\PENangle{#1} |
| 48 |
} |
| 49 |
|
| 50 |
\setKVdefault[CrayonGeom]{% |
| 51 |
Echelle=1,% |
| 52 |
Couleur=red,% |
| 53 |
Longueur=5,% |
| 54 |
Origine={(0,0)},% |
| 55 |
Rotation=0 |
| 56 |
} |
| 57 |
|
| 58 |
\NewDocumentCommand\tkzCrayon{ O{} }{% |
| 59 |
\useKVdefault[CrayonGeom]% |
| 60 |
\setKV[CrayonGeom]{#1}% |
| 61 |
\ogtcleanparen{\PENposOrigin}{\PENposOriginClean}% |
| 62 |
\xdef\PENlongueur{\fpeval{max(2.5,\PENlongueur)}}%valeurs mini |
| 63 |
\begin{scope}[shift={(\PENposOriginClean)},rotate=\PENangle,scale=\PENechelle] |
| 64 |
\fill[\PENcouleur!75] (-0.2,{\PENlongueur-0.3}) -- (0.2,{\PENlongueur-0.3}) -- (0.2,0.8) --(0.1,0.65) -- (0,0.8) -- (-0.1,0.66) -- (-0.2,0.8) -- cycle; |
| 65 |
\draw[color=white,line width={\PENechelle*1pt}] (0,{\PENlongueur-0.3}) -- (0,0.6); |
| 66 |
\fill[black] (-0.2,{\PENlongueur-0.6}) -- (0,{\PENlongueur-0.65}) -- (0.2,{\PENlongueur-0.6}) -- (0.2,{\PENlongueur-0.12}) arc(30:150:0.23); |
| 67 |
\fill[brown!40] (-0.2,0.8) -- (0,0) node[coordinate,pos=0.7] (a) {} -- (0.2,0.8) node[coordinate,pos=0.3] (b) {} -- (0.1,0.65) -- (0,0.8) -- (-0.1,0.66) -- cycle; |
| 68 |
\fill[\PENcouleur] (a) -- (0,0) -- (b) -- cycle ; |
| 69 |
\end{scope} |
| 70 |
} |
| 71 |
|
| 72 |
%--------Règle (OK) |
| 73 |
\defKV[RegleGeom]{% |
| 74 |
Echelle=\def\REGLechelle{#1},% |
| 75 |
Longueur=\def\REGLlongueur{#1},% |
| 76 |
Largeur=\def\REGLlargeur{#1},% |
| 77 |
Couleur=\def\REGLcouleur{#1},% |
| 78 |
CouleurFond=\def\REGLcouleurfond{#1},% |
| 79 |
Origine=\xdef\REGLposOrigin{#1},% |
| 80 |
Rotation=\def\REGLangle{#1},% |
| 81 |
Opacite=\def\REGLopac{#1},% |
| 82 |
PosVal=\def\REGLposval{#1},% |
| 83 |
EchelleValeurs=\def\REGLechlabel{#1} |
| 84 |
} |
| 85 |
|
| 86 |
\setKVdefault[RegleGeom]{% |
| 87 |
Echelle=1,% |
| 88 |
Couleur=black,% |
| 89 |
CouleurFond=black,% |
| 90 |
Longueur=12,% |
| 91 |
Largeur=1.5,% |
| 92 |
Origine={(0,0)},% |
| 93 |
Rotation=0,% |
| 94 |
AfficheValeurs=true,% |
| 95 |
AfficheTraits=true,% |
| 96 |
Fond=false,% |
| 97 |
Opacite=0.5,% |
| 98 |
PosVal=m,% |
| 99 |
EchelleValeurs=0.8 |
| 100 |
} |
| 101 |
|
| 102 |
\NewDocumentCommand{\tkzRegle}{ O{} }{% |
| 103 |
\useKVdefault[RegleGeom]% |
| 104 |
\setKV[RegleGeom]{#1}% |
| 105 |
\ogtcleanparen{\REGLposOrigin}{\REGLposOriginClean}% |
| 106 |
%la clé [AfficheTraits]% |
| 107 |
\ifboolKV[RegleGeom]{AfficheTraits}% |
| 108 |
{}% |
| 109 |
{% |
| 110 |
\setKV[RegleGeom]{AfficheValeurs=false}% |
| 111 |
}% |
| 112 |
\IfSubStr{\REGLangle}{auto/}% |
| 113 |
{% |
| 114 |
\StrBehind{\REGLangle}{/}[\tmppointdeux]% |
| 115 |
\pgfmathanglebetweenpoints{\pgfpointanchor{\REGLposOrigin}{center}}{\pgfpointanchor{\tmppointdeux}{center}}% |
| 116 |
\edef\REGLangle{\pgfmathresult}% |
| 117 |
}{}% |
| 118 |
\xdef\REGLlongueur{\fpeval{max(3,\REGLlongueur)}}%valeurs mini |
| 119 |
\xdef\REGLlargeur{\fpeval{max(1.5,\REGLlargeur)}} |
| 120 |
\begin{scope}[shift={(\REGLposOriginClean)},rotate=\REGLangle,scale=\REGLechelle,transform shape] |
| 121 |
\ifboolKV[RegleGeom]{Fond} |
| 122 |
{% |
| 123 |
\begin{scope} |
| 124 |
\fill[draw=none,fill=\REGLcouleurfond!10!white,fill opacity=\REGLopac,even odd rule] (-0.375,0)--({\REGLlongueur+0.375},0) to[bend left=15] ({\REGLlongueur+0.375},{-\REGLlargeur}) -- (-0.375,{-\REGLlargeur}) to[bend left=15] (-0.375,0) (0.5,{-0.5*\REGLlargeur}) circle[radius={0.125*\REGLlargeur}] ; |
| 125 |
\end{scope} |
| 126 |
}% |
| 127 |
{} |
| 128 |
%bord et trou |
| 129 |
\draw[semithick,\REGLcouleur] (-0.375,0)--({\REGLlongueur+0.375},0) to[bend left=15] ({\REGLlongueur+0.375},{-\REGLlargeur}) -- (-0.375,{-\REGLlargeur}) to[bend left=15] (-0.375,0) (0.5,{-0.5*\REGLlargeur}) circle[radius={0.125*\REGLlargeur}] ; |
| 130 |
\ifboolKV[RegleGeom]{AfficheTraits}% |
| 131 |
{% |
| 132 |
\foreach \x in {0,0.1,...,\REGLlongueur} {\draw[\REGLcouleur] (\x,0)--++(0,-0.25) (\x,{-\REGLlargeur})--++(0,0.25) ;} |
| 133 |
\foreach \x in {0,0.5,...,\REGLlongueur} {\draw[\REGLcouleur] (\x,0)--++(0,-0.375) (\x,{-\REGLlargeur})--++(0,0.375) ;} |
| 134 |
\foreach \x in {0,1,...,\REGLlongueur} {\draw[\REGLcouleur] (\x,0)--++(0,-0.5) (\x,{-\REGLlargeur})--++(0,0.5) ;} |
| 135 |
}% |
| 136 |
{}% |
| 137 |
\ifboolKV[RegleGeom]{AfficheValeurs}% |
| 138 |
{% |
| 139 |
\IfSubStr{\REGLposval}{h} |
| 140 |
{\foreach \i in {0,1,...,\REGLlongueur} {\draw[\REGLcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLechlabel},font=\small,below] {$\i$} ;}} |
| 141 |
{} |
| 142 |
\IfSubStr{\REGLposval}{m} |
| 143 |
{\foreach \i in {0,1,...,\REGLlongueur} {\draw[\REGLcouleur] (\i,{-0.5*\REGLlargeur}) node[inner sep=1pt,outer sep=1pt,scale={\REGLechlabel},font=\small] {$\i$} ;}} |
| 144 |
{} |
| 145 |
\IfSubStr{\REGLposval}{b} |
| 146 |
{\foreach \i in {0,1,...,\REGLlongueur} {\draw[\REGLcouleur] (\i,{-\REGLlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLechlabel},font=\small,above] {\rotatebox{180}{$\fpeval{trunc(\REGLlongueur)-\i}$}} ;}} |
| 147 |
{} |
| 148 |
}% |
| 149 |
{}% |
| 150 |
\end{scope} |
| 151 |
} |
| 152 |
|
| 153 |
%--------Règle-Repère (OK) |
| 154 |
\defKV[RegleRepereGeom]{% |
| 155 |
Echelle=\def\REGLREPechelle{#1},% |
| 156 |
Longueur=\def\REGLREPlongueur{#1},% |
| 157 |
Largeur=\def\REGLREPlargeur{#1},% |
| 158 |
Couleur=\def\REGLREPcouleur{#1},% |
| 159 |
CouleurFond=\def\REGLREPcouleurfond{#1},% |
| 160 |
Origine=\def\REGLREPposOrigin{#1},% |
| 161 |
Rotation=\def\REGLREPangle{#1},% |
| 162 |
Opacite=\def\REGLREPopac{#1},% |
| 163 |
EchelleValeurs=\def\REGLREPechlabel{#1} |
| 164 |
} |
| 165 |
|
| 166 |
\setKVdefault[RegleRepereGeom]{% |
| 167 |
Echelle=1,% |
| 168 |
Couleur=black,% |
| 169 |
CouleurFond=black,% |
| 170 |
Longueur=12,% |
| 171 |
Largeur=4,% |
| 172 |
Origine={(0,0)},% |
| 173 |
Rotation=0,% |
| 174 |
AfficheValeurs=true,% |
| 175 |
AfficheTraits=true,% |
| 176 |
Fond=false,% |
| 177 |
Opacite=0.5,% |
| 178 |
Retourne=false,% |
| 179 |
EchelleValeurs=0.8 |
| 180 |
} |
| 181 |
|
| 182 |
\NewDocumentCommand{\tkzRegleRepere}{ O{} }{% |
| 183 |
\useKVdefault[RegleRepereGeom]% |
| 184 |
\setKV[RegleRepereGeom]{#1}% |
| 185 |
\ogtcleanparen{\REGLREPposOrigin}{\REGLREPposOriginClean}% |
| 186 |
%la clé [AfficheTraits]% |
| 187 |
\ifboolKV[RegleRepereGeom]{AfficheTraits}% |
| 188 |
{}% |
| 189 |
{% |
| 190 |
\setKV[RegleRepereGeom]{AfficheValeurs=false}% |
| 191 |
}% |
| 192 |
\xdef\REGLREPlongueur{\fpeval{max(4,2*round(0.5*\REGLREPlongueur,0))}}%valeurs mini |
| 193 |
\xdef\REGLREPlargeur{\fpeval{max(4,round(\REGLREPlargeur,0))}}% |
| 194 |
\IfSubStr{\REGLREPangle}{auto/}% |
| 195 |
{% |
| 196 |
\StrBehind{\REGLREPangle}{/}[\tmppointdeux]% |
| 197 |
\pgfmathanglebetweenpoints{\pgfpointanchor{\REGLREPposOrigin}{center}}{\pgfpointanchor{\tmppointdeux}{center}}% |
| 198 |
\edef\REGLREPangle{\pgfmathresult}% |
| 199 |
}{}% |
| 200 |
\begin{scope}[shift={(\REGLREPposOriginClean)},rotate=\REGLREPangle,scale=\REGLREPechelle,transform shape] |
| 201 |
%bases de la règle-repère |
| 202 |
\ifboolKV[RegleRepereGeom]{Fond}% |
| 203 |
{\draw[draw=none,fill=\REGLREPcouleurfond!10!white,fill opacity=\REGLREPopac,rounded corners] (-0.5,0) rectangle++ ({\REGLREPlongueur+1},{-\REGLREPlargeur}) ;}% |
| 204 |
{}% |
| 205 |
\draw[semithick,draw=\REGLREPcouleur,rounded corners] (-0.5,0) rectangle++ ({\REGLREPlongueur+1},{-\REGLREPlargeur}) ; |
| 206 |
\clip (-0.5,0) rectangle++ ({\REGLREPlongueur+1},{-\REGLREPlargeur}) ; |
| 207 |
\draw[\REGLREPcouleur,densely dotted,xstep=0.2,ystep=0.2] ({-0.5},{-\REGLREPlargeur+1}) grid ({\REGLREPlongueur+1},{-1}) ; |
| 208 |
\draw[\REGLREPcouleur] ({-0.5},{-\REGLREPlargeur+1}) grid ({\REGLREPlongueur+1},{-1}) ; |
| 209 |
%graduations |
| 210 |
\ifboolKV[RegleRepereGeom]{AfficheTraits}% |
| 211 |
{% |
| 212 |
\foreach \x in {0,0.1,...,\REGLREPlongueur} |
| 213 |
{\draw[\REGLREPcouleur] (\x,0)--++(0,-0.25) (\x,{-\REGLREPlargeur})--++(0,0.25) ;} |
| 214 |
\foreach \x in {0,0.5,...,\REGLREPlongueur} |
| 215 |
{\draw[\REGLREPcouleur] (\x,0)--++(0,-0.375) (\x,{-\REGLREPlargeur})--++(0,0.375) ;} |
| 216 |
\foreach \x in {0,1,...,\REGLREPlongueur} |
| 217 |
{\draw[\REGLREPcouleur] (\x,0)--++(0,-0.5) (\x,{-\REGLREPlargeur})--++(0,0.5) ;} |
| 218 |
}% |
| 219 |
{}% |
| 220 |
%valeurs |
| 221 |
\ifboolKV[RegleRepereGeom]{AfficheValeurs}% |
| 222 |
{% |
| 223 |
\ifboolKV[RegleRepereGeom]{Retourne}% |
| 224 |
{% |
| 225 |
{\foreach \i in {0,1,...,\REGLREPlongueur} {\draw[\REGLREPcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLREPechlabel},font=\small,below] {$\fpeval{-trunc(0.5*\REGLREPlongueur)+\i}$} ;}} |
| 226 |
{\foreach \i in {0,1,...,\REGLREPlongueur} {\draw[\REGLREPcouleur] (\i,{-\REGLREPlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLREPechlabel},font=\small,above] {\rotatebox{180}{$\inteval{\REGLREPlongueur-\i}$}} ;}} |
| 227 |
}% |
| 228 |
{% |
| 229 |
{\foreach \i in {0,1,...,\REGLREPlongueur} {\draw[\REGLREPcouleur] (\i,{-0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLREPechlabel},font=\small,below] {$\i$} ;}} |
| 230 |
{\foreach \i in {0,1,...,\REGLREPlongueur} {\draw[\REGLREPcouleur] (\i,{-\REGLREPlargeur+0.5}) node[inner sep=1pt,outer sep=1pt,scale={\REGLREPechlabel},font=\small,above] {\rotatebox{180}{$\fpeval{trunc(0.5*\REGLREPlongueur)-\i}$}} ;}} |
| 231 |
}% |
| 232 |
} |
| 233 |
{}% |
| 234 |
\end{scope} |
| 235 |
} |
| 236 |
|
| 237 |
%--------Réquerre (OK) |
| 238 |
\defKV[RequerreGeom]{% |
| 239 |
Echelle=\def\REQechelle{#1},% |
| 240 |
Longueur=\def\REQlongueur{#1},% |
| 241 |
Largeur=\def\REQlargeur{#1},% |
| 242 |
Couleur=\def\REQcouleur{#1},% |
| 243 |
CouleurFond=\def\REQcouleurfond{#1},% |
| 244 |
Origine=\def\REQposOrigin{#1},% |
| 245 |
Rotation=\def\REQangle{#1},% |
| 246 |
Opacite=\def\REQopac{#1},% |
| 247 |
EchelleValeurs=\def\REQechlabel{#1} |
| 248 |
} |
| 249 |
|
| 250 |
\setKVdefault[RequerreGeom]{% |
| 251 |
Echelle=1,% |
| 252 |
Couleur=black,% |
| 253 |
CouleurFond=black,% |
| 254 |
Longueur=12,% |
| 255 |
Largeur=3,% |
| 256 |
Origine={(0,0)},% |
| 257 |
Rotation=0,% |
| 258 |
AfficheValeurs=true,% |
| 259 |
AfficheTraits=true,% |
| 260 |
Fond=false,% |
| 261 |
Opacite=0.5,% |
| 262 |
EchelleValeurs=0.8 |
| 263 |
} |
| 264 |
|
| 265 |
\NewDocumentCommand{\tkzRequerre}{ O{} }{% |
| 266 |
\useKVdefault[RequerreGeom]% |
| 267 |
\setKV[RequerreGeom]{#1}% |
| 268 |
\ogtcleanparen{\REQposOrigin}{\REQposOriginClean}% |
| 269 |
%la clé [AfficheTraits]% |
| 270 |
\ifboolKV[RequerreGeom]{AfficheTraits}% |
| 271 |
{}% |
| 272 |
{% |
| 273 |
\setKV[RequerreGeom]{AfficheValeurs=false}% |
| 274 |
}% |
| 275 |
\xdef\REQlongueur{\fpeval{max(6,\REQlongueur)}}%valeurs mini |
| 276 |
\xdef\REQlargeur{\fpeval{max(1.5,\REQlargeur)}}% |
| 277 |
\IfSubStr{\REQangle}{auto/}% |
| 278 |
{% |
| 279 |
\StrBehind{\REQangle}{/}[\tmppointdeux]% |
| 280 |
\pgfmathanglebetweenpoints{\pgfpointanchor{\REQposOrigin}{center}}{\pgfpointanchor{\tmppointdeux}{center}}% |
| 281 |
\edef\REQangle{\pgfmathresult}% |
| 282 |
}{}% |
| 283 |
\begin{scope}[shift={(\REQposOriginClean)},rotate=\REQangle,scale=\REQechelle,transform shape] |
| 284 |
\ifboolKV[RequerreGeom]{Fond} |
| 285 |
{ |
| 286 |
\fill[draw=none,rounded corners,fill=\REQcouleurfond!10!white,fill opacity=\REQopac] ({-\REQlongueur*0.5},0) rectangle ({\REQlongueur*0.5},{-\REQlargeur}) ; |
| 287 |
} |
| 288 |
{} |
| 289 |
\draw[semithick,\REQcouleur,rounded corners] ({-\REQlongueur*0.5},0) rectangle ({\REQlongueur*0.5},{-\REQlargeur}) ; |
| 290 |
\draw[\REQcouleur] (0,-1)--(0,-\REQlargeur) ; |
| 291 |
\ifboolKV[RequerreGeom]{AfficheTraits}% |
| 292 |
{% |
| 293 |
\foreach \x in {0,0.1,...,\fpeval{0.5*\REQlongueur-0.5}} {\draw[\REQcouleur] (\x,0)--(\x,-0.25) (-\x,0)--(-\x,-0.25) ;} |
| 294 |
\foreach \x in {0,0.5,...,\fpeval{0.5*\REQlongueur-0.5}} {\draw[\REQcouleur] (\x,0)--(\x,-0.375) (-\x,0)--(-\x,-0.375) ;} |
| 295 |
\foreach \x in {0,1,...,\fpeval{0.5*\REQlongueur-0.5}} {\draw[\REQcouleur] (\x,0)--(\x,-0.5) (-\x,0)--(-\x,-0.5) ;} |
| 296 |
\foreach \x in {0.7,0.8,...,\REQlargeur} {\draw[\REQcouleur] (-2.65,-\x)--(-2.35,-\x) (2.65,-\x)--(2.35,-\x) ;} |
| 297 |
\foreach \x in {1,1.5,...,\REQlargeur} {\draw[\REQcouleur] (-2.8,-\x)--(-2.2,-\x) (2.2,-\x)--(2.8,-\x) ;} |
| 298 |
}% |
| 299 |
{}% |
| 300 |
\begin{scope} |
| 301 |
\clip ({-\REQlongueur*0.5},0) rectangle ({\REQlongueur*0.5},{-\REQlargeur}) ; |
| 302 |
\draw[\REQcouleur] (0,-1) rectangle++ (0.2,-0.2) (0,-2) rectangle++ (-0.2,0.2) ; |
| 303 |
\foreach \x in {1,2,...,\fpeval{\REQlargeur-0.25}} {\draw[\REQcouleur] ({-\REQlongueur*0.5},-\x)--({\REQlongueur*0.5},-\x) ;} |
| 304 |
\end{scope} |
| 305 |
\ifboolKV[RequerreGeom]{AfficheValeurs}% |
| 306 |
{% |
| 307 |
\draw[\REQcouleur] (0,-0.5) node[inner sep=1pt,outer sep=1pt,scale={\REQechlabel},font=\small,below] {$0$} ; |
| 308 |
\foreach \i in {1,2,...,\fpeval{0.5*\REQlongueur-0.5}}{% |
| 309 |
\draw[\REQcouleur] (\i,-0.5) node[inner sep=1pt,outer sep=1pt,scale={\REQechlabel},font=\small,below] {$\i$} ; |
| 310 |
\draw[\REQcouleur] (-\i,-0.5) node[inner sep=1pt,outer sep=1pt,scale={\REQechlabel},font=\small,below] {$-\i$} ;} |
| 311 |
}% |
| 312 |
{}% |
| 313 |
\end{scope} |
| 314 |
} |
| 315 |
|
| 316 |
%--------Équerre (OK) |
| 317 |
\defKV[EquerreGeom]{% |
| 318 |
Echelle=\def\EQechelle{#1},% |
| 319 |
Longueur=\def\EQlongueur{#1},% |
| 320 |
Couleur=\def\EQcouleur{#1},% |
| 321 |
CouleurFond=\def\EQcouleurfond{#1},% |
| 322 |
Origine=\def\EQposOrigin{#1},% |
| 323 |
Rotation=\def\EQangle{#1},% |
| 324 |
Opacite=\def\EQopac{#1},% |
| 325 |
LargeurBordure=\def\EQlargbord{#1},% |
| 326 |
EchelleValeurs=\def\EQechlabel{#1} |
| 327 |
} |
| 328 |
|
| 329 |
\setKVdefault[EquerreGeom]{% |
| 330 |
Echelle=1,% |
| 331 |
Couleur=black,% |
| 332 |
CouleurFond=black,% |
| 333 |
Longueur=10,% |
| 334 |
Origine={(0,0)},% |
| 335 |
Rotation=0,% |
| 336 |
AfficheValeurs=true,% |
| 337 |
AfficheTraits=true,% |
| 338 |
Fond=false,% |
| 339 |
Opacite=0.5,% |
| 340 |
LargeurBordure=1,% |
| 341 |
PetitCote=false,% |
| 342 |
EchelleValeurs=0.8 |
| 343 |
} |
| 344 |
|
| 345 |
\NewDocumentCommand{\tkzEquerre}{ O{} }{% |
| 346 |
\useKVdefault[EquerreGeom]% |
| 347 |
\setKV[EquerreGeom]{#1}% |
| 348 |
\ogtcleanparen{\EQposOrigin}{\EQposOriginClean}% |
| 349 |
\xdef\EQlongueur{\fpeval{max(4.5,\EQlongueur)}}%valeurs mini |
| 350 |
\def\EQlargeur{\fpeval{\EQlongueur*tand(30)}}% |
| 351 |
%la clé [AfficheTraits]% |
| 352 |
\ifboolKV[EquerreGeom]{AfficheTraits}% |
| 353 |
{}% |
| 354 |
{% |
| 355 |
\setKV[EquerreGeom]{AfficheValeurs=false}% |
| 356 |
\def\EQlargbord{\fpeval{1/5*(\EQlargeur)}}% |
| 357 |
}% |
| 358 |
\IfSubStr{\EQangle}{auto/}% |
| 359 |
{% |
| 360 |
\StrBehind{\EQangle}{/}[\tmppointdeux]% |
| 361 |
\pgfmathanglebetweenpoints{\pgfpointanchor{\EQposOrigin}{center}}{\pgfpointanchor{\tmppointdeux}{center}}% |
| 362 |
\ifboolKV[EquerreGeom]{PetitCote}% |
| 363 |
{% |
| 364 |
\edef\EQangle{\pgfmathresult}% |
| 365 |
}% |
| 366 |
{% |
| 367 |
\edef\EQangle{\fpeval{\pgfmathresult-90}}% |
| 368 |
}% |
| 369 |
}{}% |
| 370 |
\begin{scope}[shift={(\EQposOriginClean)},rotate=\EQangle,scale=\EQechelle,transform shape] |
| 371 |
%--- |
| 372 |
\ifboolKV[EquerreGeom]{Fond} |
| 373 |
{% |
| 374 |
\begin{scope} %diff extérieur-intérieur |
| 375 |
\ifboolKV[EquerreGeom]{AfficheTraits}% |
| 376 |
{% |
| 377 |
\fill[draw=none,fill=\EQcouleurfond!10!white,fill opacity=\EQopac,even odd rule] |
| 378 |
(0,0) -- ({\EQlargeur},0) -- (0,{\EQlongueur}) -- cycle |
| 379 |
({\EQlargbord},{\EQlargbord}) -- ({\EQlargeur-\EQlargbord*sqrt(3)},{\EQlargbord}) -- ({\EQlargbord},{\EQlongueur-\EQlargbord*(2+sqrt(3))}) -- cycle ; |
| 380 |
}% |
| 381 |
{% |
| 382 |
\fill[draw=none,fill=\EQcouleurfond!10!white,fill opacity=\EQopac,even odd rule] |
| 383 |
(0,0) -- ({\EQlargeur},0) -- (0,{\EQlongueur}) -- cycle |
| 384 |
({\EQlargbord},{\EQlargbord}) -- ({\EQlargeur-\EQlargbord*sqrt(3)},{\EQlargbord}) -- ({\EQlargbord},{\EQlongueur-\EQlargbord*(2+sqrt(3))}) -- cycle ; |
| 385 |
}% |
| 386 |
\end{scope} |
| 387 |
}% |
| 388 |
{} |
| 389 |
\draw[semithick,\EQcouleur] (0,0) -- ({\EQlargeur},0) -- (0,{\EQlongueur}) -- cycle ; %contour extérieur |
| 390 |
\ifboolKV[EquerreGeom]{AfficheTraits}% |
| 391 |
{% |
| 392 |
\draw[semithick,\EQcouleur] ({\EQlargbord},{\EQlargbord}) -- ({\EQlargeur-\EQlargbord*sqrt(3)},{\EQlargbord}) -- ({\EQlargbord},{\EQlongueur-\EQlargbord*(2+sqrt(3))}) -- cycle ; %contour intérieur |
| 393 |
}% |
| 394 |
{% |
| 395 |
\draw[semithick,\EQcouleur] ({\EQlargbord},{\EQlargbord}) -- ({\EQlargeur-\EQlargbord*sqrt(3)},{\EQlargbord}) -- ({\EQlargbord},{\EQlongueur-\EQlargbord*(2+sqrt(3))}) -- cycle ; %contour intérieur |
| 396 |
}% |
| 397 |
%graduations |
| 398 |
\begin{scope} |
| 399 |
\clip (0,0) -- ({\EQlargeur},0) -- (0,{\EQlongueur}) -- cycle ; |
| 400 |
\ifboolKV[EquerreGeom]{AfficheTraits}% |
| 401 |
{% |
| 402 |
\draw[\EQcouleur] (0.1,0)--(0.1,0.075) (0.2,0)--(0.2,0.15) ; |
| 403 |
\foreach \x in {0.3,0.4,...,\fpeval{0.925*\EQlargeur}} {\draw[\EQcouleur] (\x,0)--(\x,0.2) ;} |
| 404 |
\foreach \x in {0.5,1,...,\fpeval{0.925*\EQlargeur}} {\draw[\EQcouleur] (\x,0)--(\x,0.3) ;} |
| 405 |
\foreach \x in {0,1,...,\fpeval{0.925*\EQlargeur}} {\draw[\EQcouleur] (\x,0)--(\x,0.4) ;} |
| 406 |
\draw[\EQcouleur] (0,0.1)--(0.075,0.1) (0,0.2)--(0.15,0.2) ; |
| 407 |
\foreach \y in {0.3,0.4,...,\fpeval{0.925*\EQlongueur}} {\draw[\EQcouleur] (0,\y)--(0.2,\y) ;} |
| 408 |
\foreach \y in {0.5,1,...,\fpeval{0.925*\EQlongueur}} {\draw[\EQcouleur] (0,\y)--(0.3,\y) ;} |
| 409 |
\foreach \y in {0,1,...,\fpeval{0.925*\EQlongueur}} {\draw[\EQcouleur] (0,\y)--(0.4,\y) ;} |
| 410 |
}% |
| 411 |
{}% |
| 412 |
\ifboolKV[EquerreGeom]{AfficheValeurs}% |
| 413 |
{% |
| 414 |
\foreach \i in {1,2,...,\fpeval{0.9*\EQlongueur-1}}{% |
| 415 |
\draw[\EQcouleur] (0.4,\i) node[inner sep=1pt,outer sep=1pt,scale={\EQechlabel},font=\small,right] {\rotatebox{90}{$\i$}} ; |
| 416 |
}% |
| 417 |
\foreach \i in {1,2,...,\fpeval{0.9*\EQlargeur-0.5}}{% |
| 418 |
\draw[\EQcouleur] (\i,0.4) node[inner sep=1pt,outer sep=1pt,scale={\EQechlabel},font=\small,above] {\rotatebox{180}{$\i$}} ; |
| 419 |
}% |
| 420 |
}% |
| 421 |
{}% |
| 422 |
\end{scope} |
| 423 |
\end{scope} |
| 424 |
} |
| 425 |
|
| 426 |
%--------Rapporteur (OK) |
| 427 |
\defKV[RapporteurGeom]{% |
| 428 |
Echelle=\def\RAPPechelle{#1},% |
| 429 |
EchelleAngle=\def\RAPPechangle{#1},% |
| 430 |
Couleur=\def\RAPPcouleur{#1},% |
| 431 |
CouleurFond=\def\RAPPcouleurfond{#1},% |
| 432 |
Origine=\def\RAPPposOrigin{#1},% |
| 433 |
Rotation=\def\RAPPangle{#1},% |
| 434 |
Opacite=\def\RAPPopac{#1},% |
| 435 |
EchelleValeurs=\def\RAPPechlabel{#1} |
| 436 |
} |
| 437 |
|
| 438 |
\setKVdefault[RapporteurGeom]{% |
| 439 |
Echelle=1,% |
| 440 |
EchelleAngle=1,% |
| 441 |
Couleur=black,% |
| 442 |
CouleurFond=black,% |
| 443 |
Origine={(0,0)},% |
| 444 |
Rotation=0,% |
| 445 |
AfficheAngles=true,% |
| 446 |
AfficheTraits=true,% |
| 447 |
Fond=false,% |
| 448 |
Opacite=0.5,% |
| 449 |
Complet=false,% |
| 450 |
GraduationsInt=false,% |
| 451 |
EchelleValeurs=0.8 |
| 452 |
} |
| 453 |
|
| 454 |
\NewDocumentCommand{\tkzRapporteur}{ O{} }{% |
| 455 |
\useKVdefault[RapporteurGeom]% |
| 456 |
\setKV[RapporteurGeom]{#1}% |
| 457 |
\ogtcleanparen{\RAPPposOrigin}{\RAPPposOriginClean}% |
| 458 |
%la clé [AfficheTraits]% |
| 459 |
\ifboolKV[RapporteurGeom]{AfficheTraits}% |
| 460 |
{}% |
| 461 |
{% |
| 462 |
\setKV[RapporteurGeom]{AfficheAngles=false}% |
| 463 |
}% |
| 464 |
\begin{scope}[shift={(\RAPPposOriginClean)},rotate=\RAPPangle,scale=\RAPPechelle,transform shape] |
| 465 |
\ifboolKV[RapporteurGeom]{Complet} |
| 466 |
{ |
| 467 |
%fond |
| 468 |
\ifboolKV[RapporteurGeom]{Fond} |
| 469 |
{% |
| 470 |
\fill[draw=none,fill=\RAPPcouleurfond!10!white,fill opacity=\RAPPopac] (0,0) circle[radius=3.75] ; |
| 471 |
}% |
| 472 |
{} |
| 473 |
%rectangles |
| 474 |
\foreach \i in {30,45,60} |
| 475 |
{\draw[densely dotted,\RAPPcouleur] (\i:2.5) rectangle ({180+\i}:2.5) ;} |
| 476 |
%extérieur et intérieur |
| 477 |
\draw[semithick,\RAPPcouleur] (0,0) circle[radius=3.75] ; |
| 478 |
\draw[semithick,\RAPPcouleur] (0,0) circle[radius=2.5] ; |
| 479 |
\draw[semithick,\RAPPcouleur] (-2.5,0) -- (2.5,0) ; |
| 480 |
\draw[semithick,\RAPPcouleur] (0,-2.5) -- (0,2.5) ; |
| 481 |
%grad degrés |
| 482 |
\ifboolKV[RapporteurGeom]{AfficheTraits}% |
| 483 |
{% |
| 484 |
\foreach \i in {0,1,...,360} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.55) ;} |
| 485 |
\foreach \i in {0,5,...,360} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.45) ;} |
| 486 |
\foreach \i in {0,10,...,360} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.35) ;} |
| 487 |
%grad radians |
| 488 |
\foreach \i in {0,30,45,60,90,120,135,150,180,210,225,240,270,300,315,330} {\draw[\RAPPcouleur] (\i:2.5)--(\i:2.65) (\i:2.9)--(\i:3.1) ;} |
| 489 |
}% |
| 490 |
{}% |
| 491 |
%valeurs si booléen |
| 492 |
\ifboolKV[RapporteurGeom]{AfficheAngles} |
| 493 |
{% |
| 494 |
\draw[\RAPPcouleur] (0:2.75) node[rotate=90,scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$0$} ; |
| 495 |
\draw[\RAPPcouleur] (180:3.25) node[rotate=90,scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\pm 180$} ; |
| 496 |
\draw[\RAPPcouleur] (180:2.75) node[rotate=90,scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\pm \pi$} ; |
| 497 |
\foreach \i in {0,10,...,170} |
| 498 |
{\draw[\RAPPcouleur] (\i:3.25) node[rotate={\i-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\i$} ;} |
| 499 |
\draw[\RAPPcouleur] (30:2.75) node[rotate={30-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{6}$} ; |
| 500 |
\draw[\RAPPcouleur] (45:2.75) node[rotate={45-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{4}$} ; |
| 501 |
\draw[\RAPPcouleur] (60:2.75) node[rotate={60-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{3}$} ; |
| 502 |
\draw[\RAPPcouleur] (90:2.75) node[rotate={90-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{\pi}{2}$} ; |
| 503 |
\draw[\RAPPcouleur] (120:2.75) node[rotate={120-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{2\pi}{3}$} ; |
| 504 |
\draw[\RAPPcouleur] (135:2.75) node[rotate={135-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{3\pi}{4}$} ; |
| 505 |
\draw[\RAPPcouleur] (150:2.75) node[rotate={150-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{5\pi}{6}$} ; |
| 506 |
\foreach \i in {10,20,...,170} |
| 507 |
{\draw[\RAPPcouleur] ({-\i}:3.25) node[rotate={270-\i},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$-\i$} ;} |
| 508 |
\draw[\RAPPcouleur] (-30:2.75) node[rotate={270-30},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{6}$} ; |
| 509 |
\draw[\RAPPcouleur] (-45:2.75) node[rotate={270-45},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{4}$} ; |
| 510 |
\draw[\RAPPcouleur] (-60:2.75) node[rotate={270-60},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{3}$} ; |
| 511 |
\draw[\RAPPcouleur] (-90:2.75) node[rotate={270-90},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-\pi}{2}$} ; |
| 512 |
\draw[\RAPPcouleur] (-120:2.75) node[rotate={270-120},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-2\pi}{3}$} ; |
| 513 |
\draw[\RAPPcouleur] (-135:2.75) node[rotate={270-135},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-3\pi}{4}$} ; |
| 514 |
\draw[\RAPPcouleur] (-150:2.75) node[rotate={270-150},scale=\fpeval{\RAPPechlabel*\RAPPechangle},font=\tiny] {$\nicefrac{-5\pi}{6}$} ; |
| 515 |
}{} |
| 516 |
} |
| 517 |
{ |
| 518 |
%fond |
| 519 |
\ifboolKV[RapporteurGeom]{Fond} |
| 520 |
{% |
| 521 |
\begin{scope} |
| 522 |
\fill[draw=none,fill=\RAPPcouleurfond!10!white,fill opacity=\RAPPopac,even odd rule] |
| 523 |
(-3.75,-0.75) -- (3.75,-0.75) -- (3.75,0) arc (0:180:3.75) -- cycle |
| 524 |
(0.5,0) arc (0:180:0.5) -- (-2.25,0) arc (180:0:2.25) -- cycle ; |
| 525 |
\end{scope} |
| 526 |
}% |
| 527 |
{} |
| 528 |
%extérieur et intérieur |
| 529 |
\draw[semithick,\RAPPcouleur] (-3.75,-0.75) -- (3.75,-0.75) -- (3.75,0) arc (0:180:3.75) -- cycle ; |
| 530 |
\draw[semithick,\RAPPcouleur] (0.5,0) arc (0:180:0.5) -- (-2.25,0) arc (180:0:2.25) -- cycle ; |
| 531 |
%croix |
| 532 |
\draw[semithick,\RAPPcouleur] (-0.2,0)--(0.2,0) (0,-0.2)--(0,0.2) ; |
| 533 |
\ifboolKV[RapporteurGeom]{AfficheTraits}% |
| 534 |
{% |
| 535 |
%grad ext |
| 536 |
\foreach \i in {0,1,...,180} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.55) ;} |
| 537 |
\foreach \i in {0,5,...,180} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.45) ;} |
| 538 |
\foreach \i in {0,10,...,180} {\draw[\RAPPcouleur] (\i:3.75)--(\i:3.35) ;} |
| 539 |
%grad int |
| 540 |
\ifboolKV[RapporteurGeom]{GraduationsInt}% |
| 541 |
{% |
| 542 |
\foreach \i in {0,1,...,180} {\draw[\RAPPcouleur] (\i:2.25)--(\i:2.4) ;} |
| 543 |
\foreach \i in {0,5,...,180} {\draw[\RAPPcouleur] (\i:2.25)--(\i:2.475) ;} |
| 544 |
\foreach \i in {0,10,...,180} {\draw[\RAPPcouleur] (\i:2.25)--(\i:2.55) ;} |
| 545 |
}% |
| 546 |
{% |
| 547 |
\foreach \i in {0,5,...,180} {\draw[\RAPPcouleur] (\i:2.25)--(\i:2.45) ;} |
| 548 |
\foreach \i in {0,10,...,180} {\draw[\RAPPcouleur] (\i:2.25)--(\i:2.55) ;} |
| 549 |
}% |
| 550 |
}% |
| 551 |
{}% |
| 552 |
%valeurs si booléen |
| 553 |
\ifboolKV[RapporteurGeom]{AfficheAngles} |
| 554 |
{% |
| 555 |
\foreach \i in {0,10,...,180} |
| 556 |
{\draw[\RAPPcouleur] (\i:3.2) node[rotate={\i-90},scale=\fpeval{\RAPPechangle},font=\tiny] {\i} ;} |
| 557 |
\foreach \i in {0,10,...,180} |
| 558 |
{\draw[\RAPPcouleur] (\i:2.7) node[rotate={\i-90},scale=\fpeval{\RAPPechangle},font=\tiny] {\inteval{180-\i}} ;} |
| 559 |
}{} |
| 560 |
} |
| 561 |
\end{scope} |
| 562 |
} |
| 563 |
|
| 564 |
\defKV[Pourcenteur]{% |
| 565 |
Echelle=\def\POURCechelle{#1},% |
| 566 |
EchelleAngle=\def\POURCechangle{#1},% |
| 567 |
Couleur=\def\POURCcouleur{#1},% |
| 568 |
CouleurFond=\def\POURCcouleurfond{#1},% |
| 569 |
Origine=\def\POURCposOrigin{#1},% |
| 570 |
Rotation=\def\POURCangle{#1},% |
| 571 |
Opacite=\def\POURCopac{#1},% |
| 572 |
EchelleValeurs=\def\POURCechlabel{#1} |
| 573 |
} |
| 574 |
|
| 575 |
\setKVdefault[Pourcenteur]{% |
| 576 |
Echelle=1,% |
| 577 |
EchelleAngle=1,% |
| 578 |
Couleur=black,% |
| 579 |
CouleurFond=black,% |
| 580 |
Origine={(0,0)},% |
| 581 |
Rotation=0,% |
| 582 |
AfficheValeurs=true,% |
| 583 |
Fond=false,% |
| 584 |
Opacite=0.5,% |
| 585 |
Decoration=true,% |
| 586 |
EchelleValeurs=0.8 |
| 587 |
} |
| 588 |
|
| 589 |
\NewDocumentCommand{\tkzPourcenteur}{ O{} }{% |
| 590 |
\useKVdefault[Pourcenteur]% |
| 591 |
\setKV[Pourcenteur]{#1}% |
| 592 |
\ogtcleanparen{\POURCposOrigin}{\POURCposOriginClean}% |
| 593 |
\begin{scope}[shift={(\POURCposOriginClean)},rotate=\POURCangle,scale=\POURCechelle,transform shape] |
| 594 |
\ifboolKV[Pourcenteur]{Fond} |
| 595 |
{% |
| 596 |
\fill[draw=none,fill=\POURCcouleurfond!10!white,fill opacity=\POURCopac] (0,0) circle[radius=3] ; |
| 597 |
}% |
| 598 |
{}% |
| 599 |
\draw[\POURCcouleur,semithick] (0,0) circle[radius=3] ; |
| 600 |
\draw[\POURCcouleur,semithick] ({-0.15*3},0)--({0.15*3},0) (0,{-0.15*3})--(0,{0.15*3}) ; |
| 601 |
\foreach \pct in {0,1,...,199} |
| 602 |
{\draw[\POURCcouleur,thin] ({0.5*\pct*3.6}:{3})--({0.5*\pct*3.6}:{3-0.2}) ;} |
| 603 |
\foreach \pct in {0,10,...,90}{% |
| 604 |
\draw[\POURCcouleur,thin] ({(\pct+1)*3.6}:{3})--({(\pct+1)*3.6}:{3-0.35}) ; |
| 605 |
\filldraw[\POURCcouleur] ({(\pct+1)*3.6}:{3-0.35}) circle[fill=\POURCcouleur,radius=0.75pt] ; |
| 606 |
\draw[\POURCcouleur,thin] ({(\pct+2)*3.6}:{3})--({(\pct+2)*3.6}:{3-0.35}) ; |
| 607 |
\filldraw[\POURCcouleur] ({(\pct+2)*3.6}:{3-0.35}) circle[fill=\POURCcouleur,radius=0.75pt] ; |
| 608 |
\draw[\POURCcouleur,thin] ({(\pct+3)*3.6}:{3})--({(\pct+3)*3.6}:{3-0.35}) ; |
| 609 |
\filldraw[\POURCcouleur] ({(\pct+3)*3.6}:{3-0.35}) circle[fill=\POURCcouleur,radius=0.75pt] ; |
| 610 |
\draw[\POURCcouleur,thin] ({(\pct+4)*3.6}:{3})--({(\pct+4)*3.6}:{3-0.35}) ; |
| 611 |
\filldraw[\POURCcouleur] ({(\pct+4)*3.6}:{3-0.35}) circle[fill=\POURCcouleur,radius=0.75pt] ; |
| 612 |
\draw[\POURCcouleur,thin] ({(\pct+6)*3.6}:{3})--({(\pct+6)*3.6}:{3-0.35}) ; |
| 613 |
\filldraw[\POURCcouleur] ({(\pct+6)*3.6}:{3-0.35}) circle[fill=\POURCcouleur,radius=0.75pt] ; |
| 614 |
\draw[\POURCcouleur,thin] ({(\pct+7)*3.6}:{3})--({(\pct+7)*3.6}:{3-0.35}) ; |
| 615 |
\filldraw[\POURCcouleur] ({(\pct+7)*3.6}:{3-0.35}) circle[fill=\POURCcouleur,radius=0.75pt] ; |
| 616 |
\draw[\POURCcouleur,thin] ({(\pct+8)*3.6}:{3})--({(\pct+8)*3.6}:{3-0.35}) ; |
| 617 |
\filldraw[\POURCcouleur] ({(\pct+8)*3.6}:{3-0.35}) circle[fill=\POURCcouleur,radius=0.75pt] ; |
| 618 |
\draw[\POURCcouleur,thin] ({(\pct+9)*3.6}:{3})--({(\pct+9)*3.6}:{3-0.35}) ; |
| 619 |
\filldraw[\POURCcouleur] ({(\pct+9)*3.6}:{3-0.35}) circle[fill=\POURCcouleur,radius=0.75pt] ; |
| 620 |
} |
| 621 |
\foreach \pct in {5,10,15,20,30,35,40,45,55,60,65,70,80,85,90,95}{% |
| 622 |
\draw[\POURCcouleur,semithick] ({\pct*3.6}:{3})--({\pct*3.6}:{3-0.5}) ; |
| 623 |
\ifboolKV[Pourcenteur]{AfficheValeurs} |
| 624 |
{\draw ({-\pct*3.6+90}:{3-0.6}) node[\POURCcouleur,rotate={-3.6*\pct},scale=\fpeval{\POURCechlabel*\POURCechangle},font=\tiny] {\pct\,\%} ;}{} |
| 625 |
} |
| 626 |
\foreach \pct in {0,25,50,75}{% |
| 627 |
\draw[\POURCcouleur,semithick] ({\pct*3.6}:{3})--({\pct*3.6}:{3-0.5}) ; |
| 628 |
\ifboolKV[Pourcenteur]{AfficheValeurs} |
| 629 |
{% |
| 630 |
\draw ({-\pct*3.6+90}:{3-0.61}) node[\POURCcouleur,rotate={-3.6*\pct},scale=\fpeval{\POURCechlabel*\POURCechangle},font=\scriptsize\bfseries] {\pct\,\%} ; |
| 631 |
\draw ({-\pct*3.6+90}:{2+0.15}) node[\POURCcouleur,rotate={-3.6*\pct},scale=\fpeval{\POURCechlabel*\POURCechangle},font=\tiny\bfseries] {\pct\,\%} ; |
| 632 |
}{}% |
| 633 |
} |
| 634 |
\draw[\POURCcouleur,semithick] (0,1)--(0,2) (1.6,0)--(2,0) (0,-1.6)--(0,-2) (-1.6,0)--(-2,0) ; |
| 635 |
\ifboolKV[Pourcenteur]{Decoration} |
| 636 |
{% |
| 637 |
\foreach \arccc in {0.8,0.9,...,1.9} {\draw[\POURCcouleur] (0,\arccc) arc (90:47:\arccc) ;} |
| 638 |
}% |
| 639 |
{}% |
| 640 |
\end{scope} |
| 641 |
} |
| 642 |
|
| 643 |
%--------RappÉquerre (OK) |
| 644 |
\defKV[RapporteurEquerreGeom]{% |
| 645 |
Echelle=\def\RAPPEQechelle{#1},% |
| 646 |
Largeur=\def\RAPPEQlargeur{#1},% |
| 647 |
EchelleValeurs=\def\RAPPEQechangle{#1},% |
| 648 |
Couleur=\def\RAPPEQcouleur{#1},% |
| 649 |
CouleurFond=\def\RAPPEQcouleurfond{#1},% |
| 650 |
Origine=\def\RAPPEQposOrigin{#1},% |
| 651 |
Rotation=\def\RAPPEQangle{#1},% |
| 652 |
Opacite=\def\RAPPEQopac{#1},% |
| 653 |
} |
| 654 |
|
| 655 |
\setKVdefault[RapporteurEquerreGeom]{% |
| 656 |
Echelle=1,% |
| 657 |
Largeur=6,% |
| 658 |
EchelleValeurs=1,% |
| 659 |
Couleur=black,% |
| 660 |
CouleurFond=black,% |
| 661 |
Origine={(0,0)},% |
| 662 |
Rotation=0,% |
| 663 |
AfficheAngles=true,% |
| 664 |
AfficheValeurs=true,% |
| 665 |
Ombre=false,% |
| 666 |
Fond=false,% |
| 667 |
Opacite=0.5 |
| 668 |
} |
| 669 |
|
| 670 |
\NewDocumentCommand{\tkzRappEquerre}{ O{} }{% |
| 671 |
\useKVdefault[RapporteurEquerreGeom]% |
| 672 |
\setKV[RapporteurEquerreGeom]{#1}% |
| 673 |
\ogtcleanparen{\RAPPEQposOrigin}{\RAPPEQposOriginClean}% |
| 674 |
\xdef\RAPPEQlargeur{\fpeval{max(3,\RAPPEQlargeur)}}%valeurs mini |
| 675 |
\IfSubStr{\RAPPEQangle}{auto/}% |
| 676 |
{% |
| 677 |
\StrBehind{\RAPPEQangle}{/}[\tmppointdeux]% |
| 678 |
\pgfmathanglebetweenpoints{\pgfpointanchor{\RAPPEQposOrigin}{center}}{\pgfpointanchor{\tmppointdeux}{center}}% |
| 679 |
\edef\RAPPEQangle{\pgfmathresult}% |
| 680 |
}{}% |
| 681 |
\begin{scope}[shift={(\RAPPEQposOriginClean)},rotate=\RAPPEQangle,scale=\RAPPEQechelle,transform shape] |
| 682 |
%fond |
| 683 |
\ifboolKV[RapporteurEquerreGeom]{Fond} |
| 684 |
{% |
| 685 |
\begin{scope} |
| 686 |
\fill[draw=none,fill=\RAPPEQcouleurfond!10!white,fill opacity=\RAPPopac,even odd rule] (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; |
| 687 |
\end{scope} |
| 688 |
}% |
| 689 |
{} |
| 690 |
\ifboolKV[RapporteurEquerreGeom]{Ombre}% |
| 691 |
{% |
| 692 |
\filldraw[draw=none,fill=\RAPPEQcouleur!25,opacity=\RAPPopac] (-175:{0.65*\RAPPEQlargeur}) arc (-175:-5:{0.65*\RAPPEQlargeur}) -- (-5:{0.625*\RAPPEQlargeur}) arc (-5:-175:{0.625*\RAPPEQlargeur}) -- cycle ;% |
| 693 |
}{}% |
| 694 |
%extérieur |
| 695 |
\draw[semithick,\RAPPEQcouleur] (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; |
| 696 |
\foreach \x in {0,0.1,...,\fpeval{\RAPPEQlargeur-1}} |
| 697 |
{\draw[\RAPPEQcouleur] ({\x},0)--({\x},-0.125) ({-\x},0)--({-\x},-0.125) ;} |
| 698 |
\foreach \x in {0,0.5,...,\fpeval{\RAPPEQlargeur-1}} |
| 699 |
{\draw[\RAPPEQcouleur] ({\x},0)--({\x},-0.1875) ({-\x},0)--({-\x},-0.1875) ;} |
| 700 |
\foreach \x in {0,1,...,\fpeval{\RAPPEQlargeur-1}} |
| 701 |
{\draw[\RAPPEQcouleur] ({\x},0)--({\x},-0.25) ({-\x},0)--({-\x},-0.25) ;} |
| 702 |
%grad ext |
| 703 |
\foreach \i in {5,6,...,175} |
| 704 |
{\draw[\RAPPEQcouleur] ({-\i}:{0.5625*\RAPPEQlargeur})--++({-\i}:{0.02*\RAPPEQlargeur}) ;} |
| 705 |
\foreach \i in {5,10,...,175} |
| 706 |
{\draw[\RAPPEQcouleur] ({-\i}:{0.5625*\RAPPEQlargeur})--++({-\i}:{0.035*\RAPPEQlargeur}) ;} |
| 707 |
%angles intérieurs |
| 708 |
\ifboolKV[RapporteurEquerreGeom]{AfficheAngles} |
| 709 |
{% |
| 710 |
\foreach \i in {10,20,...,170} |
| 711 |
{\draw[\RAPPEQcouleur] ({-\i}:{0.6125*\RAPPEQlargeur}) node[rotate={90-\i},scale=\fpeval{\RAPPEQlargeur/8*\RAPPEQechangle},font=\tiny] {\i} ;} |
| 712 |
%angles "extérieurs" |
| 713 |
\foreach \i in {10,20,...,170} |
| 714 |
{\draw[\RAPPEQcouleur] ({-\i}:{0.6375*\RAPPEQlargeur}) node[rotate={90-\i},scale=\fpeval{\RAPPEQlargeur/8*\RAPPEQechangle},font=\tiny] {\inteval{180-\i}} ;} |
| 715 |
}% |
| 716 |
{}% |
| 717 |
\ifboolKV[RapporteurEquerreGeom]{AfficheValeurs} |
| 718 |
{% |
| 719 |
\foreach \i in {-1,0,1} |
| 720 |
{\draw[\RAPPEQcouleur] ({\i},-0.375) node[scale=\fpeval{\RAPPEQechangle},font=\tiny] {$\i$} ;} |
| 721 |
}% |
| 722 |
{}% |
| 723 |
%tracés intérieurs |
| 724 |
\draw[\RAPPEQcouleur,dash pattern=on 15 off 4] (0,0)--(-135:{0.5625*\RAPPEQlargeur}) ; |
| 725 |
\draw[\RAPPEQcouleur,dash pattern=on 15 off 4] (0,0)--(-45:{0.5625*\RAPPEQlargeur}) ; |
| 726 |
\draw[\RAPPEQcouleur] (0,-0.5)--(0,{-0.51*\RAPPEQlargeur}) ; |
| 727 |
\foreach \i in {0.4,0.5,...,\fpeval{0.51*\RAPPEQlargeur-0.5}} |
| 728 |
{\draw[\RAPPEQcouleur] ({0.2625*\RAPPEQlargeur},{-\i})--++(0.2,0) ;} |
| 729 |
\foreach \i in {0.4,0.5,...,\fpeval{0.51*\RAPPEQlargeur-0.5}} |
| 730 |
{\draw[\RAPPEQcouleur] ({-0.2625*\RAPPEQlargeur},{-\i})--++(-0.2,0) ;} |
| 731 |
\begin{scope} |
| 732 |
\clip (-180:{0.55*\RAPPEQlargeur}) arc (-180:0:{0.55*\RAPPEQlargeur}) -- cycle ; |
| 733 |
\foreach \i in {-0.5,-1,...,\fpeval{-0.55*\RAPPEQlargeur}} |
| 734 |
{\draw[\RAPPEQcouleur] (0.2,\i)--({0.2375*\RAPPEQlargeur},\i) ({0.3125*\RAPPEQlargeur},\i)--({0.55*\RAPPEQlargeur},\i) ;} |
| 735 |
\foreach \i in {-0.5,-1,...,\fpeval{-0.55*\RAPPEQlargeur}} |
| 736 |
{\draw[\RAPPEQcouleur] (-0.2,\i)--({-0.2375*\RAPPEQlargeur},\i) ({-0.3125*\RAPPEQlargeur},\i)--({-0.55*\RAPPEQlargeur},\i) ;} |
| 737 |
\end{scope} |
| 738 |
%traits obliques extérieurs |
| 739 |
\begin{scope} |
| 740 |
\clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; |
| 741 |
\foreach \i in {10,20,...,170} |
| 742 |
{\draw[\RAPPEQcouleur] ({-\i}:{0.65*\RAPPEQlargeur})--++({-\i}:3) ;} |
| 743 |
\foreach \i in {10,20,...,170} |
| 744 |
{\draw[\RAPPEQcouleur] ({-\i}:{0.65*\RAPPEQlargeur})--++({-\i}:3) ;} |
| 745 |
\end{scope} |
| 746 |
\begin{scope} |
| 747 |
\clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; |
| 748 |
\def\cliptmp{\fpeval{min(0.15,0.0571*\RAPPEQlargeur)}} |
| 749 |
\clip (0,-\RAPPEQlargeur)--++(135:\cliptmp)--++(\RAPPEQlargeur,\RAPPEQlargeur)--++(-45:\cliptmp)--cycle ; |
| 750 |
\foreach \i in {1,2,...,89} |
| 751 |
{\draw[\RAPPEQcouleur] ({\RAPPEQlargeur/(1+tan(\i))},{-\RAPPEQlargeur*tan(\i)/(1+tan(\i))}) --++ ({180-\i}:{abs(-0.3*\i/90+0.15)+0.15}) ;} |
| 752 |
\end{scope} |
| 753 |
\begin{scope} |
| 754 |
\clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; |
| 755 |
\def\cliptmp{\fpeval{min(0.25,0.0571*\RAPPEQlargeur)}} |
| 756 |
\clip (0,-\RAPPEQlargeur)--++(135:\cliptmp)--++(\RAPPEQlargeur,\RAPPEQlargeur)--++(-45:\cliptmp)--cycle ; |
| 757 |
\foreach \i in {5,10,...,85} |
| 758 |
{\draw[\RAPPEQcouleur] ({\RAPPEQlargeur/(1+tan(\i))},{-\RAPPEQlargeur*tan(\i)/(1+tan(\i))}) --++ ({180-\i}:{abs(-0.5*\i/90+0.25)+0.25}) ;} |
| 759 |
\end{scope} |
| 760 |
\begin{scope} |
| 761 |
\clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; |
| 762 |
\def\cliptmp{\fpeval{min(0.15,0.0571*\RAPPEQlargeur)}} |
| 763 |
\clip (0,-\RAPPEQlargeur)--++(45:\cliptmp)--++(-\RAPPEQlargeur,\RAPPEQlargeur)--++(-135:\cliptmp)--cycle ; |
| 764 |
\foreach \i in {1,2,...,89} |
| 765 |
{\draw[\RAPPEQcouleur] ({-\RAPPEQlargeur/(1+tan(\i))},{-\RAPPEQlargeur*tan(\i)/(1+tan(\i))}) --++ ({\i}:{abs(-0.3*\i/90+0.15)+0.15}) ;} |
| 766 |
\end{scope} |
| 767 |
\begin{scope} |
| 768 |
\clip (-\RAPPEQlargeur,0) -- (\RAPPEQlargeur,0) -- (0,-\RAPPEQlargeur) -- cycle ; |
| 769 |
\def\cliptmp{\fpeval{min(0.25,0.0571*\RAPPEQlargeur)}} |
| 770 |
\clip (0,-\RAPPEQlargeur)--++(45:\cliptmp)--++(-\RAPPEQlargeur,\RAPPEQlargeur)--++(-135:\cliptmp)--cycle ; |
| 771 |
\foreach \i in {5,10,...,85} |
| 772 |
{\draw[\RAPPEQcouleur] ({-\RAPPEQlargeur/(1+tan(\i))},{-\RAPPEQlargeur*tan(\i)/(1+tan(\i))}) --++ ({\i}:{abs(-0.5*\i/90+0.25)+0.25}) ;} |
| 773 |
\end{scope} |
| 774 |
\end{scope} |
| 775 |
} |
| 776 |
|
| 777 |
%--------Compas |
| 778 |
% inspiration(s) de https://tex.stackexchange.com/questions/147389/symbols-of-pencil-ruler-and-compass |
| 779 |
% Angle entre l'horizontale et 2 noeuds (#1 & #2), résultat dans \MonAngleTmp |
| 780 |
\newcommand{\NodeTmpAngle}[2]{% |
| 781 |
\pgfmathanglebetweenpoints% |
| 782 |
{\pgfpointanchor{#1}{center}}% |
| 783 |
{\pgfpointanchor{#2}{center}}% |
| 784 |
\global\let\MonAngleTmp\pgfmathresult% |
| 785 |
} |
| 786 |
% Distance entre 2 noeuds (#1 & #2), résultat dans \MaLongueurTmp |
| 787 |
\makeatletter |
| 788 |
\newcommand{\NodeTmpDist}[2]{% |
| 789 |
\pgfpointdiff{\pgfpointanchor{#1}{center}}{\pgfpointanchor{#2}{center}}% |
| 790 |
\pgf@xa=\pgf@x |
| 791 |
\pgf@ya=\pgf@y |
| 792 |
% to convert from pt to cm |
| 793 |
\pgfmathparse{veclen(\pgf@xa,\pgf@ya)/28.45274}% |
| 794 |
\global\let\MaLongueurTmp\pgfmathresult% |
| 795 |
} |
| 796 |
\makeatother |
| 797 |
% Récupération de l'unité x (cf https://tex.stackexchange.com/questions/424785/tikz-get-current-unit-length-of-x-coordinate) |
| 798 |
\def\recupunitexencm{ |
| 799 |
\path let \p{x}=(1,0), \n{xlencm}={scalar(veclen(\x{x},\y{x})/1cm)} |
| 800 |
in \pgfextra{\xdef\TmpUniteX{\n{xlencm}}}; |
| 801 |
} |
| 802 |
|
| 803 |
\defKV[CompasGeom]{% |
| 804 |
Echelle=\def\COMPASechelle{#1},% |
| 805 |
EchelleCrayon=\def\COMPASechellecrayon{#1},% |
| 806 |
LongueurBranches=\def\COMPASLLB{#1},% |
| 807 |
LongueurCrayon=\def\COMPASLLC{#1},% |
| 808 |
CouleurCompas=\def\COMPAScouleur{#1},% |
| 809 |
CouleurCrayon=\def\COMPAScouleurcrayon{#1},% |
| 810 |
UniteTikz=\def\COMPASunittikz{#1} |
| 811 |
} |
| 812 |
|
| 813 |
\setKVdefault[CompasGeom]{% |
| 814 |
Echelle=1,% |
| 815 |
EchelleCrayon=1,% |
| 816 |
LongueurBranches=6,% |
| 817 |
LongueurCrayon=5,% |
| 818 |
CouleurCrayon=red,% |
| 819 |
CouleurCompas=gray,% |
| 820 |
UniteTikz=\TmpUniteX,% |
| 821 |
AfficheCrayon=true,% |
| 822 |
Retourne=false |
| 823 |
} |
| 824 |
|
| 825 |
\NewDocumentCommand{\tkzCompas}{ s O{} m m }{%étoilée en gardant la distance entre extrémités |
| 826 |
\IfBooleanTF{#1}{}{\NodeTmpDist{#3}{#4}}% |
| 827 |
\useKVdefault[CompasGeom]% |
| 828 |
\setKV[CompasGeom]{#2}% |
| 829 |
%calculs intermédiaires |
| 830 |
\recupunitexencm |
| 831 |
\NodeTmpAngle{#3}{#4}% |
| 832 |
\pgfmathsetmacro{\AngleCP}{asin(\MaLongueurTmp/(\COMPASunittikz*\COMPASechelle*2*\COMPASLLB))} |
| 833 |
%retour aux affaires |
| 834 |
\ifboolKV[CompasGeom]{Retourne} |
| 835 |
{\def\CoeffYscale{-1}}{\def\CoeffYscale{1}} |
| 836 |
\begin{scope}[shift=(#3),scale=\COMPASechelle] |
| 837 |
\begin{scope}[line join=round,rotate=\MonAngleTmp,yscale=\CoeffYscale,shift=(270-\AngleCP:-\COMPASLLB)] |
| 838 |
% branche pointe sèche |
| 839 |
\draw[rotate=-\AngleCP,fill=\COMPAScouleur!80] (0,0)--(0,-\COMPASLLB)--(-.2,-\COMPASLLB+.8)--(-.2,0)--cycle ; |
| 840 |
\draw[rotate=-\AngleCP,fill=\COMPAScouleur!05] (0,-\COMPASLLB+.8)--(0,-\COMPASLLB)--(-.2,-\COMPASLLB+.8)--cycle ; |
| 841 |
% branche crayon |
| 842 |
\draw[rotate=\AngleCP,fill=\COMPAScouleur!80] (0,0)--(0,-\COMPASLLB)--(.2,-\COMPASLLB+.8)--(.2,0)--cycle ; |
| 843 |
\begin{scope}[rotate=\AngleCP,shift={(0,-\COMPASLLB)}] |
| 844 |
\ifboolKV[CompasGeom]{AfficheCrayon} |
| 845 |
{\tkzCrayon[Echelle={\COMPASechellecrayon*0.75},Longueur={\COMPASLLC/0.75},Rotation=-15,Couleur=\COMPAScouleurcrayon]}{} |
| 846 |
\draw[fill=gray!25] (\COMPASLLB/30,\COMPASLLB/5) circle (\COMPASLLB/36) ; |
| 847 |
\fill[\COMPAScouleur!5] (\COMPASLLB/30,\COMPASLLB/5) -- ++(30:\COMPASLLB/36) arc (30:45:\COMPASLLB/36) -- cycle ; |
| 848 |
\fill[\COMPAScouleur!5] (\COMPASLLB/30,\COMPASLLB/5) -- ++(210:\COMPASLLB/36) arc (210:225:\COMPASLLB/36) ; |
| 849 |
\draw (\COMPASLLB/30,\COMPASLLB/5) circle (\COMPASLLB/36) ; |
| 850 |
\filldraw (\COMPASLLB/30,\COMPASLLB/5) circle (.02) ; |
| 851 |
\end{scope} |
| 852 |
% haut du compas |
| 853 |
\draw[fill=\COMPAScouleur!80] (-.1,0) rectangle (.1,.85) ; |
| 854 |
\draw[fill=gray!25] (0,0) circle (.25) ; |
| 855 |
\fill[gray!5] (0,0) -- (30:.25) arc (30:45:.25) -- cycle ; |
| 856 |
\fill[gray!5,rotate=180] (0,0) -- (30:.25) arc (30:45:.25) -- cycle ; |
| 857 |
\draw (0,0) circle (.25) ; |
| 858 |
\filldraw (0,0) circle (.05) ; |
| 859 |
\end{scope} |
| 860 |
\end{scope} |
| 861 |
} |
| 862 |
|
| 863 |
%--------MiniÉquerre |
| 864 |
\defKV[MiniEquerreGeom]{% |
| 865 |
Echelle=\def\MiniEQechelle{#1},% |
| 866 |
Couleur=\def\MiniEQcouleur{#1},% |
| 867 |
Origine=\def\MiniEQposOrigin{#1},% |
| 868 |
Rotation=\def\MiniEQangle{#1} |
| 869 |
} |
| 870 |
|
| 871 |
\setKVdefault[MiniEquerreGeom]{% |
| 872 |
Echelle=1,% |
| 873 |
Couleur=black,% |
| 874 |
Origine={(0,0)},% |
| 875 |
Rotation=0,% |
| 876 |
Ombre=true |
| 877 |
} |
| 878 |
|
| 879 |
\NewDocumentCommand{\tkzMiniEquerre}{ O{} }{% |
| 880 |
\useKVdefault[MiniEquerreGeom]% |
| 881 |
\setKV[MiniEquerreGeom]{#1}% |
| 882 |
\ogtcleanparen{\MiniEQposOrigin}{\MiniEQposOriginClean}% |
| 883 |
\begin{scope}[shift={(\MiniEQposOriginClean)},rotate=\MiniEQangle,scale=\MiniEQechelle] |
| 884 |
\ifboolKV[MiniEquerreGeom]{Ombre}% |
| 885 |
{% |
| 886 |
\begin{scope} |
| 887 |
\clip (0,0)--(1,0)--(0,1.8)--cycle; |
| 888 |
\filldraw[draw=none,fill=\MiniEQcouleur!10] (0,0) rectangle (1,2.5pt); |
| 889 |
\filldraw[draw=none,fill=\MiniEQcouleur!10] (0,0) rectangle (2.5pt,2); |
| 890 |
\end{scope} |
| 891 |
}{}% |
| 892 |
\draw[semithick,\MiniEQcouleur] (0,0)--(1,0)--(0,1.8)--cycle; |
| 893 |
\draw[semithick,\MiniEQcouleur] (0.2,0.2)--(0.65,0.2)--(0.2,1)--cycle; |
| 894 |
\foreach \x in {0,0.1,...,1} {\draw[\MiniEQcouleur] (\x,0)--++(0,1.5pt) ;} |
| 895 |
\foreach \x in {0,0.5} {\draw[\MiniEQcouleur] (\x,0)--++(0,2pt) ;} |
| 896 |
\foreach \y in {0,0.1,...,1.7} {\draw[\MiniEQcouleur] (0,\y)--++(1.5pt,0) ;} |
| 897 |
\foreach \y in {0,0.5,1,1.5} {\draw[\MiniEQcouleur] (0,\y)--++(2pt,0) ;} |
| 898 |
\end{scope} |
| 899 |
} |
| 900 |
|
| 901 |
%--------MiniRègle |
| 902 |
\defKV[MiniRegleGeom]{% |
| 903 |
Echelle=\def\MiniREGLechelle{#1},% |
| 904 |
Couleur=\def\MiniREGLcouleur{#1},% |
| 905 |
Origine=\def\MiniREGLposOrigin{#1},% |
| 906 |
Rotation=\def\MiniREGLangle{#1} |
| 907 |
} |
| 908 |
|
| 909 |
\setKVdefault[MiniRegleGeom]{% |
| 910 |
Echelle=1,% |
| 911 |
Couleur=black,% |
| 912 |
Origine={(0,0)},% |
| 913 |
Rotation=0,% |
| 914 |
Ombre=true |
| 915 |
} |
| 916 |
|
| 917 |
\NewDocumentCommand{\tkzMiniRegle}{ O{} }{% |
| 918 |
\useKVdefault[MiniRegleGeom]% |
| 919 |
\setKV[MiniRegleGeom]{#1}% |
| 920 |
\ogtcleanparen{\MiniREGLposOrigin}{\MiniREGLposOriginClean}% |
| 921 |
\begin{scope}[shift={(\MiniREGLposOriginClean)},rotate=\MiniREGLangle,scale=\MiniREGLechelle] |
| 922 |
\ifboolKV[MiniRegleGeom]{Ombre}% |
| 923 |
{\filldraw[draw=none,fill=\MiniREGLcouleur!10] (0,0) rectangle (2,-2.5pt) ;}{}% |
| 924 |
\draw[semithick,\MiniREGLcouleur] (0,0)--(2,0)--(2,-0.3)--(0,-0.3)--cycle ; |
| 925 |
\draw[semithick,\MiniREGLcouleur] (0.35,-0.185) circle[radius=0.05] ; |
| 926 |
\foreach \y in {0,0.1,...,2} {\draw[\MiniREGLcouleur] (\y,0)--++(0,-1.5pt) ;} |
| 927 |
\foreach \y in {0,0.5,...,2} {\draw[\MiniREGLcouleur] (\y,0)--++(0,-2pt) ;} |
| 928 |
\end{scope} |
| 929 |
} |
| 930 |
|
| 931 |
\endinput |