diff options
author | Norbert Preining <norbert@preining.info> | 2020-03-09 03:01:39 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-03-09 03:01:39 +0000 |
commit | 0561778af6f8fde0a3a1c334e2aab9a4f1142d6e (patch) | |
tree | c19fe45e4101aed56e7fb3602174c6a5e335d7d1 /macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-arcs.tex | |
parent | a8880a5ee484845d9a526c5ca8d21d31214af22b (diff) |
CTAN sync 202003090301
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-arcs.tex')
-rw-r--r-- | macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-arcs.tex | 148 |
1 files changed, 80 insertions, 68 deletions
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-arcs.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-arcs.tex index c8ef72c3e6..e58b01e25a 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-arcs.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-arcs.tex @@ -1,42 +1,53 @@ % tkz-obj-eu-arcs.tex -% Copyright 2020 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.02c} -\def\filedate{2020/01/24} -\typeout{2020/01/24 3.02c tkz-obj-eu-arcs.tex} +% Copyright 2020 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% 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.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% +% This work has the LPPL maintenance status “maintained”. +% +% The Current Maintainer of this work is Alain Matthes. + + +% utf8 encoding +\def\fileversion{3.05c} +\def\filedate{2020/03/23} +\typeout{2020/03/23 3.05c tkz-obj-eu-arcs.tex} \makeatletter %<------------------------------ Arcs -------------------------------------– % options : delta % \def\tkz@delta{0} % \tikzset{arc style/.style={#1}} % \pgfkeys{/tikz/.cd,delta/.code={\def\tkz@delta{#1}}} - +\tikzset{arc style/.style={gray,thin}} \gdef\tkz@numa{0} \pgfkeys{/tkzdrawarc/.cd, - type/.is choice, - type/towards/.code = \def\tkz@numa{0}, - type/rotate/.code = \def\tkz@numa{1}, - type/angles/.code = \def\tkz@numa{2}, - type/R/.code = \def\tkz@numa{3}, - type/R with nodes/.code = \def\tkz@numa{4}, - towards/.style = {type=towards}, - rotate/.style = {type=rotate}, - R/.style = {type=R}, - angles/.style = {type=angles}, - R with nodes/.style = {type=R with nodes}, - diameter/.code = {}, - arc/.code = {}, - size/.code = {}, - mark/.code = {}, - mkpos/.code = {}, - mksize/.code = {}, - mkcolor/.code = {}, - type/.default = towards, - delta/.store in = \tkz@delta, - delta = 0, - /tkzdrawarc/.search also = {/tikz} + type/.is choice, + type/towards/.code = \def\tkz@numa{0}, + type/rotate/.code = \def\tkz@numa{1}, + type/angles/.code = \def\tkz@numa{2}, + type/R/.code = \def\tkz@numa{3}, + type/R with nodes/.code = \def\tkz@numa{4}, + towards/.style = {type=towards}, + rotate/.style = {type=rotate}, + R/.style = {type=R}, + angles/.style = {type=angles}, + R with nodes/.style = {type=R with nodes}, + diameter/.code = {}, + arc/.code = {}, + size/.code = {}, + mark/.code = {}, + mkpos/.code = {}, + mksize/.code = {}, + mkcolor/.code = {}, + type/.default = towards, + delta/.store in = \tkz@delta, + delta = 0, + /tkzdrawarc/.search also = {/tikz} } \def\tkzDrawArc{\pgfutil@ifnextchar[{\tkz@DrawArc}{\tkz@DrawArc[]}} \def\tkz@DrawArc[#1](#2,#3)(#4){% @@ -66,7 +77,7 @@ \tkzCalcLength(#2,#3)\tkzGetLength{tkz@radius} \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} - \tkz@DrawArcRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstAngle,\tkz@SecondAngle) + \tkz@DrawArcRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstAngle,\tkz@SecondAngle) \endgroup } %<--------------------------------------------------------------------------–> @@ -78,15 +89,15 @@ \tkz@DrawArcRotate[]}} \def\tkz@DrawArcRotate[#1](#2,#3)(#4){% \begingroup - \tkzCalcLength(#2,#3) \tkzGetLength{tkz@radius} - \tkzFindSlopeAngle(#2,#3) \tkzGetAngle{tkz@FirstA} + \tkzCalcLength(#2,#3) \tkzGetLength{tkz@radius} + \tkzFindSlopeAngle(#2,#3) \tkzGetAngle{tkz@FirstA} \pgfmathadd{\tkz@FirstA}{#4} \edef\tkz@SecondA{\pgfmathresult} \pgfmathgreaterthan{#4}{0} \ifdim\pgfmathresult pt=1 pt\relax% - \tkz@DrawArcRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstA,\tkz@SecondA) + \tkz@DrawArcRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstA,\tkz@SecondA) \else - \tkz@DrawArcRAngles[#1](#2,\tkz@radius pt)(\tkz@SecondA,\tkz@FirstA) + \tkz@DrawArcRAngles[#1](#2,\tkz@radius pt)(\tkz@SecondA,\tkz@FirstA) \fi \endgroup } @@ -103,6 +114,32 @@ \endgroup } %<--------------------------------------------------------------------------–> +% Degree #2 center #4 - #3 radius from #5 (degree) to #6(degree) +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcRwithNodes{\pgfutil@ifnextchar[{\tkz@DrawArcRwithNodes}{% + \tkz@DrawArcRwithNodes[]}} +\def\tkz@DrawArcRwithNodes[#1](#2,#3,#4)(#5,#6){% +\begingroup + \tkzCalcLength(#3,#4) + \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#6)\tkzGetAngle{tkz@SecondAngle} + \tkz@DrawArcRAngles[#1](#2,\tkzLengthResult)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Nodes R #2 center #3 radius en cm from #4(node) to #5(node) +% \tkzDrawArcR(O,2 cm)(A,B) +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcR{\pgfutil@ifnextchar[{\tkz@DrawArcR}{\tkz@DrawArcR[]}} +\def\tkz@DrawArcR[#1](#2,#3)(#4,#5){% +\begingroup + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@SecondAngle} + \tkz@DrawArcRAngles[#1](#2,#3)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> % #1 center #2 radius #4 first angle (degree) #5 second angle (degree) % angles 0 .. 180 or -180 .. 0 %<--------------------------------------------------------------------------–> @@ -117,51 +154,26 @@ \ifdim\pgfmathresult pt=1 pt\relax% \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} \ifdim\pgfmathresult pt=1 pt\relax% - \pgfmathsubtract{\tkz@FirstAngle}{360} - \edef\tkz@FirstAngle{\pgfmathresult}% - \fi + \pgfmathsubtract{\tkz@FirstAngle}{360} + \edef\tkz@FirstAngle{\pgfmathresult}% + \fi \else \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} \ifdim\pgfmathresult pt=1 pt\relax% - \pgfmathadd{\tkz@SecondAngle}{360} - \edef\tkz@SecondAngle{\pgfmathresult}% - \fi + \pgfmathadd{\tkz@SecondAngle}{360} + \edef\tkz@SecondAngle{\pgfmathresult}% + \fi \fi \pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} \edef\tkz@FirstAngle{\pgfmathresult}% \pgfmathadd{\tkz@SecondAngle}{\tkz@delta} \edef\tkz@SecondAngle{\pgfmathresult} - \draw[shift = {(#2)},compass style,/tkzdrawarc/.cd,#1]% + \draw[shift = {(#2)},arc style,/tkzdrawarc/.cd,#1]% (\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3); \endgroup } %<--------------------------------------------------------------------------–> -% Degree #2 center #4 - #3 radius from #5 (degree) to #6(degree) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcRwithNodes{\pgfutil@ifnextchar[{\tkz@DrawArcRwithNodes}{% - \tkz@DrawArcRwithNodes[]}} -\def\tkz@DrawArcRwithNodes[#1](#2,#3,#4)(#5,#6){% -\begingroup - \tkzCalcLength(#3,#4) - \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@FirstAngle} - \tkzFindSlopeAngle(#2,#6)\tkzGetAngle{tkz@SecondAngle} - \tkz@DrawArcRAngles[#1](#2,\tkzLengthResult)% - (\tkz@FirstAngle,\tkz@SecondAngle) -\endgroup -} -%<--------------------------------------------------------------------------–> -% Nodes R #2 center #3 radius en cm from #4(node) to #5(node) -% \tkzDrawArcR(O,2 cm)(A,B) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcR{\pgfutil@ifnextchar[{\tkz@DrawArcR}{\tkz@DrawArcR[]}} -\def\tkz@DrawArcR[#1](#2,#3)(#4,#5){% -\begingroup - \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@FirstAngle} - \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@SecondAngle} - \tkz@DrawArcRAngles[#1](#2,#3)(\tkz@FirstAngle,\tkz@SecondAngle) -\endgroup -} -%<--------------------------------------------------------------------------–> + \makeatother \endinput
\ No newline at end of file |