diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-compass.tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-compass.tex | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-compass.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-compass.tex new file mode 100644 index 00000000000..e0f00f678da --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-eu-compass.tex @@ -0,0 +1,105 @@ +% tkz-obj-eu-compass.tex +% Copyright 2011 by Alain Matthes +% This file may be distributed and/or modified +% 1. under the LaTeX Project Public License and/or +% 2. under the GNU Public License. +\def\fileversion{3.01c} +\def\filedate{2020/01/23} +\typeout{2020/01/23 3.01c tkz-obj-eu-compass.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% Author Alain Matthes +% idea from Y. Combe +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% Utilisation du Compas : Compass +%<--------------------------------------------------------------------------–> +% Setup Compass +%<--------------------------------------------------------------------------–> +\pgfkeys{% + setupcompass/.cd, + line width/.code = {\global\edef\tkz@compass@lw{#1}}, + color/.code = {\global\edef\tkz@compass@color{#1}}, + style/.code = {\global\edef\tkz@compass@style{#1}}, + } +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzSetUpCompass{\pgfutil@ifnextchar[{\tkzActivOff\tkz@SetUpCompass}{% + \tkzActivOff\tkz@SetUpCompass[]}} +%<--------------------------------------------------------------------------–> +\def\tkz@SetUpCompass[#1]{% +\pgfkeys{% + setupcompass/.cd, + line width = \tkz@euc@compasswidth, + color = \tkz@euc@compasscolor, + style = \tkz@euc@compassstyle + } +\pgfqkeys{/setupcompass}{#1} +\tikzset{compass style/.style={color = \tkz@compass@color, + line width = \tkz@compass@lw, + style = \tkz@compass@style + }} +} +%<--------------------------------------------------------------------------–> +% \tkzCompass(A, B) +% +% Marque de compas auto-ajustée en longueur +% #2 center #3 le point +% Par défaut: +% longueur : 1cm, mais avec un maximum d'un angle de 180° +% angle calculé pour la longueur +% style traits pleins + +%<--------------------------------------------------------------------------–> + \pgfkeys{ + /compass/delta/.code = {\def\tkz@delta{#1}}, + /compass/length/.code = {\def\tkz@length{#1}}, + /compass/ratio/.code = {\def\tkz@ratio{#1}}, + /compass/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}} +} + +\def\tkzCompass{\pgfutil@ifnextchar[{\tkz@Compass}{\tkz@Compass[]}} +\def\tkz@Compass[#1](#2,#3){% +\begingroup +\pgfkeys{% + compass/.cd, + length = 1, + delta = 0, + ratio = .5 + } +\pgfkeys{compass/.cd,#1} + \tkzCalcLength(#2,#3)\tkzGetLength{tkz@tempLen} +\ifnum\tkz@delta=0 % + \pgfmathsetmacro{\tkz@delta}{min(deg(\tkz@length cm/ \tkz@tempLen pt),180)/2} +\fi + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@angle}% + \draw[shift ={(#2)},/compass/.cd,compass style,#1]% + (\tkz@angle-\tkz@delta:\tkz@tempLen pt)% + arc (\tkz@angle-\tkz@delta:\tkz@angle+\tkz@delta:\tkz@tempLen pt); + %}; +\endgroup} +%<--------------------------------------------------------------------------–> +\def\tkz@multiCompass#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzCompass[\tkz@optcompass](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +\def\tkzCompasss{\pgfutil@ifnextchar[{\tkz@Compasss}{\tkz@Compasss[]}} + +\def\tkz@Compasss[#1](#2){% +\global\edef\tkz@optcompass{#1} +\begingroup + \let\next\tkz@multiCompass + \next#2 \@nil % +\endgroup +}% + +\makeatother +\endinput +
\ No newline at end of file |