From 1116c441adede647c4931c6553046c8d9eb53e0c Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 6 Jun 2011 17:17:55 +0000 Subject: new graphics package tkz-euclide (5jun11) git-svn-id: svn://tug.org/texlive/trunk@22830 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/latex/tkz-euclide/tkz-euclide.sty | 20 + .../tex/latex/tkz-euclide/tkz-lib-symbols.tex | 108 +++++ .../tex/latex/tkz-euclide/tkz-obj-addpoints.tex | 159 +++++++ .../tex/latex/tkz-euclide/tkz-obj-angles.tex | 332 +++++++++++++ .../tex/latex/tkz-euclide/tkz-obj-arcs.tex | 272 +++++++++++ .../tex/latex/tkz-euclide/tkz-obj-circles.tex | 259 ++++++++++ .../tex/latex/tkz-euclide/tkz-obj-lines.tex | 342 ++++++++++++++ .../tex/latex/tkz-euclide/tkz-obj-polygons.tex | 278 +++++++++++ .../tex/latex/tkz-euclide/tkz-obj-protractor.tex | 203 ++++++++ .../tex/latex/tkz-euclide/tkz-obj-sectors.tex | 351 ++++++++++++++ .../tex/latex/tkz-euclide/tkz-obj-vectors.tex | 119 +++++ .../latex/tkz-euclide/tkz-tools-intersections.tex | 416 ++++++++++++++++ .../tkz-euclide/tkz-tools-transformations.tex | 525 +++++++++++++++++++++ 13 files changed, 3384 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-euclide.sty create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-lib-symbols.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-addpoints.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-angles.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-arcs.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-circles.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-lines.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-polygons.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-protractor.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-sectors.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-vectors.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-intersections.tex create mode 100644 Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-transformations.tex (limited to 'Master/texmf-dist/tex') diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-euclide.sty b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-euclide.sty new file mode 100644 index 00000000000..29111bf7c4c --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-euclide.sty @@ -0,0 +1,20 @@ +% 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. +%<--------------------------------------------------------------------------–> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{tkz-euclide}[2011/06/01 1.16 c for plots 2d ] +\RequirePackage{tkz-base} +%<--------------------------------------------------------------------------–> +% Initialisation +%<--------------------------------------------------------------------------–> +\input{tkz-tools-intersections} +\input{tkz-tools-transformations} +\input{tkz-obj-lines} +\input{tkz-lib-symbols} +\input{tkz-obj-circles} +\input{tkz-obj-addpoints} +\endinput diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-lib-symbols.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-lib-symbols.tex new file mode 100644 index 00000000000..bb8e29f8fad --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-lib-symbols.tex @@ -0,0 +1,108 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + + +%<--------------------------------------------------------------------------–> +% Création des symboles +%<--------------------------------------------------------------------------–> +\def\tkz@undefined{none} +% double bar +\pgfdeclareplotmark{||} +{% + \pgfpathmoveto{\pgfqpoint{2\pgflinewidth}{\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{2\pgflinewidth}{-\pgfplotmarksize}} + \pgfpathmoveto{\pgfqpoint{-2\pgflinewidth}{\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{-2\pgflinewidth}{-\pgfplotmarksize}} + \pgfusepathqstroke +} +%triple bar +\pgfdeclareplotmark{|||} +{% + \pgfpathmoveto{\pgfqpoint{0 pt}{\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{0 pt}{-\pgfplotmarksize}} + \pgfpathmoveto{\pgfqpoint{-3\pgflinewidth}{\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{-3\pgflinewidth}{-\pgfplotmarksize}} + \pgfpathmoveto{\pgfqpoint{3\pgflinewidth}{\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{3\pgflinewidth}{-\pgfplotmarksize}} + \pgfusepathqstroke +} +% An bar slant + +\pgfdeclareplotmark{s|} +{% + \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}% + {-.70710678\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}% + {.70710678\pgfplotmarksize}} + \pgfusepathqstroke +} + +% An double bar slant + +\pgfdeclareplotmark{s||} +{% + \pgfpathmoveto{\pgfqpoint{-0.75\pgfplotmarksize}{-\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{0.25\pgfplotmarksize}{\pgfplotmarksize}} + \pgfpathmoveto{\pgfqpoint{0\pgfplotmarksize}{-\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{1\pgfplotmarksize}{\pgfplotmarksize}} + \pgfusepathqstroke +} + +% z +\pgfdeclareplotmark{z} +{% + \pgfpathmoveto{\pgfqpoint{0.75\pgfplotmarksize}{-\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{-0.75\pgfplotmarksize}{-\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{0.75\pgfplotmarksize}{\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{-0.75\pgfplotmarksize}{\pgfplotmarksize}} + \pgfusepathqstroke +} +% s +\pgfdeclareplotmark{s} +{% + \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} + \pgfpathcurveto + {\pgfpoint{0pt}{0pt}} + {\pgfpoint{-\pgfplotmarksize}{\pgfplotmarksize}} + {\pgfpoint{\pgfplotmarksize}{\pgfplotmarksize}} + \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} + \pgfpathcurveto + {\pgfpoint{0pt}{0pt}} + {\pgfpoint{\pgfplotmarksize}{-\pgfplotmarksize}} + {\pgfpoint{-\pgfplotmarksize}{-\pgfplotmarksize}} + \pgfusepathqstroke +} +% infinity +\pgfdeclareplotmark{oo} +{% + \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} + \pgfpathcurveto + {\pgfpoint{0pt}{0pt}} + {\pgfpoint{.5\pgfplotmarksize}{1\pgfplotmarksize}} + {\pgfpoint{\pgfplotmarksize}{0pt}} + \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} + \pgfpathcurveto + {\pgfpoint{0pt}{0pt}} + {\pgfpoint{-.5\pgfplotmarksize}{1\pgfplotmarksize}} + {\pgfpoint{-\pgfplotmarksize}{0pt}} + \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} + \pgfpathcurveto + {\pgfpoint{0pt}{0pt}} + {\pgfpoint{.5\pgfplotmarksize}{-1\pgfplotmarksize}} + {\pgfpoint{\pgfplotmarksize}{0pt}} + \pgfpathmoveto{\pgfqpoint{0pt}{0pt}} + \pgfpathcurveto + {\pgfpoint{0pt}{0pt}} + {\pgfpoint{-.5\pgfplotmarksize}{-1\pgfplotmarksize}} + {\pgfpoint{-\pgfplotmarksize}{0pt}} + \pgfusepathqstroke +} +\endinput \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-addpoints.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-addpoints.tex new file mode 100644 index 00000000000..529040ecaf6 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-addpoints.tex @@ -0,0 +1,159 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + + +%<--------------------------------------------------------------------------–> +% Specific points +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% barycentre +%<--------------------------------------------------------------------------–> +\def\tkzDefBarycentricPoint(#1){% + \path[coordinate] (barycentric cs:#1) coordinate (tkzPointResult); +} +\let\tkzDefBCPoint\tkzDefBarycentricPoint +%<--------------------------------------------------------------------------–> +% milieu de deux points %<--------------------------------------------------------------------------–> +% possible \coordinate (#3) at ($(#1)!0.5!(#2)$); +%<--------------------------------------------------------------------------–> +\def\tkzDefMidPoint(#1,#2){\path (#1) -- (#2) coordinate[pos=.5](tkzPointResult);}% +%<--------------------------------------------------------------------------–> + +%<--------------------------------------------------------------------------–> +% OrthoCenter +%<--------------------------------------------------------------------------–> +\def\tkzOrthoCenter(#1,#2,#3){% + \begingroup + \tkzUProjection(#1,#2)(#3)\tkzGetPoint{tkz@oca} + \tkzUProjection(#1,#3)(#2)\tkzGetPoint{tkz@ocb} + \tkzInterLL(#2,tkz@ocb)(#3,tkz@oca) + \endgroup +} +%<--------------------------------------------------------------------------–> +% GravityCenter +%<--------------------------------------------------------------------------–> +\def\tkzCentroid(#1,#2,#3){% + \begingroup + \tkzDefMidPoint(#3,#2)\tkzGetPoint{tkz@mida} + \tkzDefMidPoint(#1,#2)\tkzGetPoint{tkz@midb} + \tkzInterLL(#1,tkz@mida)(#3,tkz@midb)% + \endgroup +} +%<--------------------------------------------------------------------------–> +% CircumCenter +%<--------------------------------------------------------------------------–> +\def\tkzCircumCenter(#1,#2,#3){% + \begingroup + \tkzDefMediatorLine(#1,#2) + \tkzGetPoints{tkz@dir}{tkz@dil} + \tkzDefMediatorLine(#1,#3) + \tkzGetPoints{tkz@diir}{tkz@diil} + \tkzInterLL(tkz@dir,tkz@dil)(tkz@diir,tkz@diil)% + \endgroup +} +%<--------------------------------------------------------------------------–> +% InCenter +%<--------------------------------------------------------------------------–> +\def\tkzInCenter(#1,#2,#3){% +\begingroup + \tkzDefBisectorLine(#3,#1,#2) \tkzGetPoint{tkz@ia} + \tkzDefBisectorLine(#3,#2,#1)\tkzGetPoint{tkz@ib} + \tkzInterLL(#1,tkz@ia)(#2,tkz@ib) +\endgroup +} + +%<--------------------------------------------------------------------------–> +% EulerCenter +%<--------------------------------------------------------------------------–> +\def\tkzEulerCenter(#1,#2,#3){% +\begingroup + \tkzCircumCenter(#1,#2,#3) + \tkzGetPoint{tkz@ca} + \tkzOrthoCenter(#1,#2,#3) + \tkzGetPoint{tkz@cb} + \tkzDefMidPoint(tkz@ca,tkz@cb) + \tkzDrawPoint(tkzPointResult) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Apollonius center +%<--------------------------------------------------------------------------–> +\def\tkzApolloniusCenter(#1,#2){% +\begingroup + \tkz@VecK[\tkz@koeff/(1+\tkz@koeff)](#1,#2){tkzFirstPointResult} + \tkz@VecK[\tkz@koeff/(\tkz@koeff-1)](#1,#2){tkzSecondPointResult} + \tkzDefMidPoint(tkzFirstPointResult,tkzSecondPointResult) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Orthogonal center +%<--------------------------------------------------------------------------–> +\def\tkzOrthogonalCenter(#1,#2){% +\begingroup + \tkz@VecK[\tkz@koeff/(1+\tkz@koeff)](#1,#2){tkzFirstPointResult} + \tkz@VecK[\tkz@koeff/(\tkz@koeff-1)](#1,#2){tkzSecondPointResult} + \tkzDefMidPoint(tkzFirstPointResult,tkzSecondPointResult) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Internal Similitude center +%<--------------------------------------------------------------------------–> +\def\tkzIntSimilitudeCenter(#1,#2)(#3,#4){% +\begingroup +\path[coordinate] (barycentric cs:#1=#4,#3=#2) coordinate (tkzPointResult); +\endgroup +} +%<--------------------------------------------------------------------------–> +% External Similitude center +%<--------------------------------------------------------------------------–> +\def\tkzExtSimilitudeCenter(#1,#2)(#3,#4){% +\begingroup + \path[coordinate] (barycentric cs:#1=-#4,#3=#2) coordinate (tkzPointResult); +\endgroup +} +%<--------------------------------------------------------------------------–> +% equi points +%<--------------------------------------------------------------------------–> +% draw ? show ? + + +\pgfkeys{ + /tkzEquiPt/.cd, + from/.code = {\def\tkz@frompoint{#1}}, + dist/.code = {\def\tkz@equ@dist{#1}}, + show/.is if = tkz@equi@show, + show/.default = true, + /tkzEquiPt/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /compass/\searchname/.retry=#1, + /tikz/\searchname/.retry=#1}} + } + +\def\tkzDefEquiPoints{\pgfutil@ifnextchar[{\tkz@DefEquiPoints}{% + \tkz@DefEquiPoints[]}} +\def\tkz@DefEquiPoints[#1](#2,#3){% +\pgfkeys{/tkzEquiPt/.cd,dist = 2,show=false} +\pgfqkeys{/tkzEquiPt}{#1} +\begingroup + \tkzProjection(#2,#3)(\tkz@frompoint){tkzEQpoint} + \tkzVecKNorm[\tkz@equ@dist](tkzEQpoint,#2){tkzFirstPointResult} + \tkzVecKNorm[-\tkz@equ@dist](tkzEQpoint,#2){tkzSecondPointResult} + \iftkz@equi@show + \tkzCompass[#1](\tkz@frompoint,tkzFirstPointResult) + \tkzCompass[#1](\tkz@frompoint,tkzSecondPointResult) + \fi +\endgroup +} + +\endinput + + +% tkz@equi@show \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-angles.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-angles.tex new file mode 100644 index 00000000000..a5acdd76c11 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-angles.tex @@ -0,0 +1,332 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + + %<-------------------------------------------------------------------------–> +\def\tkzGetAngle#1{% +\global\expandafter\edef\csname #1\endcsname{\tkzAngleResult}} + +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> + +%<--------------------------------------------------------------------------–> +% Angle +% Recherche l'angle formé par #1 et #2 par rapport à l'horizontale +%<--------------------------------------------------------------------------–> +\def\tkzFindSlopeAngle(#1,#2){% +\begingroup +\tkzmathanglebetweenpoints{\pgfpointanchor{#1}{center}}{% + \pgfpointanchor{#2}{center}} +\global\let\tkzAngleResult\pgfmathresult +\endgroup +} +%<--------------------------------------------------------------------------–> +% Angle avec trois nodes +%<--------------------------------------------------------------------------–> +\def\tkzFindAngle(#1,#2,#3){% +\begingroup + \tkzFindSlopeAngle(#2,#1)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@SecondAngle} + \FPadd\tkz@Angle{\tkz@SecondAngle}{-\tkz@FirstAngle} + \global\let\tkzAngleResult\tkz@Angle +\endgroup +} +%<--------------------------------------------------------------------------–> +% Find angle +%<--------------------------------------------------------------------------–> +\def\tkzGetAngle#1{% +\global\expandafter\edef\csname #1\endcsname{\tkzAngleResult}} + +%<--------------------------------------------------------------------------–> +% FillAngle +%<--------------------------------------------------------------------------–> +\pgfkeys{/tkzFill/.cd, + size/.code = \global\def\tkz@size{#1}, + /tkzFill/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}}} +%<--------------------------------------------------------------------------–> +\def\tkzFillAngle{\pgfutil@ifnextchar[{\tkz@FillAngle}{\tkz@FillAngle[]}} +\def\tkz@FillAngle[#1](#2,#3,#4){% +\begingroup +\pgfkeys{tkzFill/.cd,size=0.4 cm} +\pgfqkeys{/tkzFill}{#1} +\tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} +\tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} +\pgfmathgreaterthan{\tkz@dirOne}{\tkz@dirTwo} + \ifdim\pgfmathresult pt=1 pt\relax% + \pgfmathsubtract{\tkz@dirOne}{360} + \edef\tkz@dirOne{\pgfmathresult}% + \fi + + \path[shift = {(#3)},/tkzFill/.cd,#1]% + (#3) -- (\tkz@dirOne:\tkz@size) arc% + (\tkz@dirOne:\tkz@dirTwo:\tkz@size)--cycle; +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcRAN[#1](#2,#3)(#4,#5){% + \begingroup + \pgfmathparse{#4}\edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathparse{#5}\edef\tkz@SecondAngle{\pgfmathresult}% + \pgfmathgreaterthan{\tkz@FirstAngle}{0} + \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 + \else + \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} + \ifdim\pgfmathresult pt=1 pt\relax% + \pgfmathadd{\tkz@SecondAngle}{360} + \edef\tkz@SecondAngle{\pgfmathresult}% + \fi + \fi + \draw[shift = {(#2)},/drawarc/.cd,#1]% + (\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3); +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzMarkAngle(B, A, C) +% +% Marque d'angle +% arc de cercle (simple/double/triple) et marque d'églité. +% +% Par défaut: +% arc = simple +% longueur = 1cm (rayon de l'arc) +% style traits pleins +% position: 0.5 (position de la marque) +% mark rien du tout (ignoré si type est utilisé) +% +% Paramètres (optionnels) +% arc : l, ll, lll +% length : 1cm +% gap : 2pt +% style : type de traits +% type : none, |, ||,|||, z, s, x, o, oo +% position: 0.5 +% mark : none , |, ||,|||, z, s, x, o, oo mais tous les +% % symboles de tikz sont permis +%<--------------------------------------------------------------------------–> +\edef\tkz@arcsimple{l} +\edef\tkz@arctriple{lll} +\edef\tkz@arcdouble{ll} +\tikzset{lbstyle/.style ={color=\tkz@mainlinecolor}} + +\pgfkeys{/tkzmkangle/.cd, +mark/.code = {\global\def\tkz@mark{#1}}, +size/.code = {\global\def\tkz@size{#1}}, +mkpos/.code = {\global\edef\tkz@mkpos{#1}}, +mksize/.code = {\global\def\tkz@mksize{#1}}, +mkcolor/.code = {\global\def\tkz@mkcolor{#1}}, +label/.code = {\global\def\tkz@mklabel{#1}}, +arc/.code = {\global\def\tkz@arc{#1}}, +dist/.code = {\global\def\tkz@dist{#1}}, +label style/.code = {\tikzset{lbstyle/.append style ={#1}}}, +/tkzmkangle/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1} + } +} \def\tkzMarkAngle{\pgfutil@ifnextchar[{\tkz@MarkAngle}{\tkz@MarkAngle[]}} +\def\tkz@MarkAngle[#1](#2,#3,#4){% +\begingroup +\pgfkeys{tkzmkangle/.cd, + arc = l, + size = 1, + mksize = 4pt, + mkcolor = \tkz@mainlinecolor, + mkpos = 0.5, + mark = none, + dist = 1, + label = {} + } + +\pgfqkeys{/tkzmkangle}{#1} +%<--------------------------------------------------------------------------–> +\tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} +\tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} +\begin{scope} + \ifx\tkz@arc\tkz@arcsimple + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size)(\tkz@dirOne,\tkz@dirTwo) + \else + \ifx\tkz@arc\tkz@arcdouble + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size-1.5\pgflinewidth)% + (\tkz@dirOne,\tkz@dirTwo) + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size+1.5\pgflinewidth)% + (\tkz@dirOne,\tkz@dirTwo) + \else + \ifx\tkz@arc\tkz@arctriple + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size)(\tkz@dirOne,\tkz@dirTwo) + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size-2\pgflinewidth)% + (\tkz@dirOne,\tkz@dirTwo) + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size+2\pgflinewidth)% + (\tkz@dirOne,\tkz@dirTwo) + \fi + \fi + \fi +\end{scope} +\FPeval\labelangle{(\tkz@dirTwo + \tkz@dirOne)/2} +\tkz@@extractxy{#3} + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% +\begin{scope} + \node[lbstyle,shift={(\tkz@ax,\tkz@ay)}] at (\labelangle:\tkz@dist ){\tkz@mklabel}; +\end{scope} + +%<--------------------------------------------------------------------------–> +% les marques, aucune si mktype = none +\global\def\tkz@mymark{% + \pgfsetplotmarksize{\tkz@mksize} + \pgfuseplotmark{\tkz@mark} +} +\begin{scope}[decoration={markings,mark=at position \tkz@mkpos with {\tkz@mymark}}] + \pgfmathgreaterthan{\tkz@dirOne}{\tkz@dirTwo} + \ifdim\pgfmathresult pt=1 pt\relax% + \pgfmathsubtract{\tkz@dirOne}{360} + \edef\tkz@dirOne{\pgfmathresult}% + \fi + \path [\tkz@mkcolor,postaction={decorate},/tkzmkangle/.cd,#1]% +(#3)--++(\tkz@dirOne:\tkz@size) arc(\tkz@dirOne:\tkz@dirTwo:\tkz@size)--cycle; +\end{scope} +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% multiple +\def\tkz@multiMA#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzMarkAngle[\tkz@optma](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<--------------------------------------------------------------------------–> +\def\tkzMarkAngles{\pgfutil@ifnextchar[{\tkz@MarkAngles}{\tkz@MarkAngles[]}} +\def\tkz@MarkAngles[#1](#2){% +\global\edef\tkz@optma{#1} + \begingroup + \let\next\tkz@multiMA + \next#2 \@nil % +\endgroup +} +%<--------------------------------------------------------------------------–> +% % % fin de \tkzMarkAngle +% %<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +%<------------------------- Label on angle -------------------------------–> +%<--------------------------------------------------------------------------–> +\pgfkeys{tkzlabelangle/.cd, +dist/.code = {\global\def\labeldist{#1}}, +/tkzlabelangle/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1} + } +} +\def\tkzLabelAngle{\pgfutil@ifnextchar[{\tkz@LabelAngle}{% + \tkz@LabelAngle[]}} +\def\tkz@LabelAngle[#1](#2,#3,#4)#5{% +\begingroup +\pgfkeys{tkzlabelangle/.cd, + dist = 1} +\pgfqkeys{/tkzlabelangle}{#1} +\tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} +\tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} +\FPeval\labelAngle{( \tkz@dirOne +\tkz@dirTwo)/2} +\path (#3) --+(\labelAngle:\labeldist) node[/tkzmkangle/.cd,#1] {#5}; +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% multiple labels +\def\tkz@multiLBA#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzLabelAngle[\tkz@optlba](#1){\tkz@labelangle}}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +% %<--------------------------------------------------------------------------–> +\def\tkzLabelAngles{\pgfutil@ifnextchar[{\tkz@LabelAngles}{% + \tkz@LabelAngles[]}} +\def\tkz@LabelAngles[#1](#2)#3{% + \global\edef\tkz@optlba{#1} + \global\def\tkz@labelangle{#3} + \begingroup + \let\next\tkz@multiLBA + \next#2 \@nil % + \endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% Symbole droites perpendiculaires MAUVAIS +%<--------------------------------------------------------------------------–> + \pgfkeys{tkzright/.cd, + size/.code = {\global\def\tkz@ra@size{#1}}, + /tkzright/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1} + } +} + +\newcommand*{\tkzMarkRightAngle}[1][]{\tkz@RightAngle[#1]} +\def\tkz@RightAngle[#1](#2,#3,#4){% +\begingroup +\pgfkeys{tkzright/.cd, + size = .22} +\pgfqkeys{/tkzright}{#1} + \tkzpointnormalised{\pgfpointdiff{\pgfpointanchor{#3}{center}}{% + \pgfpointanchor{#2}{center}}} + \tkz@ax=\pgf@x\relax% + \tkz@ay=\pgf@y\relax% + + \tkzpointnormalised{\pgfpointdiff{\pgfpointanchor{#3}{center}}{% + \pgfpointanchor{#4}{center}}} + \tkz@bx=\pgf@x\relax% + \tkz@by=\pgf@y\relax% + \path[]% + (#3)--++% + ( 28.45274*\tkz@ra@size\tkz@ax , 28.45274*\tkz@ra@size\tkz@ay)% + coordinate (tkz@ra1)--++% + ( 28.45274*\tkz@ra@size\tkz@bx ,28.45274*\tkz@ra@size\tkz@by) + coordinate (tkz@ra2)--++% + (-28.45274*\tkz@ra@size\tkz@ax ,-28.45274*\tkz@ra@size\tkz@ay) + coordinate (tkz@ra3);% + \draw[/tkzright/.cd,#1] (#3)--(tkz@ra1)--(tkz@ra2)--(tkz@ra3)--cycle; +\endgroup +} + +\def\tkz@multiRA#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzMarkRightAngle[\tkz@optRA](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +\def\tkzMarkRightAngles{\pgfutil@ifnextchar[{\tkz@RightAngles}{% + \tkz@RightAngles[]}} +\def\tkz@RightAngles[#1](#2){% +\global\edef\tkz@optRA{#1} + \begingroup + \let\next\tkz@multiRA + \next#2 \@nil % +\endgroup +} +\endinput + \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-arcs.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-arcs.tex new file mode 100644 index 00000000000..fef8c6e81e1 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-arcs.tex @@ -0,0 +1,272 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + + %<--------------------------------------------------------------------------–> +%<------------------------------ Arcs -------------------------------------–> +%<--------------------------------------------------------------------------–> +% options : delta +\def\tkz@delta{0} +\tikzset{arc style/.style={#1}} +\pgfkeys{/tikz/.cd,delta/.code={\def\tkz@delta{#1}}} + +\global\def\tkz@numa{0} +\pgfkeys{/drawarc/.cd, +towards/.code = {\global\def\tkz@numa{0}}, +rotate/.code = {\global\def\tkz@numa{1}}, +angles/.code = {\global\def\tkz@numa{2}}, +R/.code = {\global\def\tkz@numa{3}}, +R with nodes/.code = {\global\def\tkz@numa{4}}, +/drawarc/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1,% + /pgf/\searchname/.retry=#1}} +} + +\def\tkzDrawArc{\pgfutil@ifnextchar[{\tkz@DrawArc}{\tkz@DrawArc[]}} +\def\tkz@DrawArc[#1](#2,#3)(#4){% +\begingroup +\pgfkeys{/drawarc/.cd,towards,delta=0} +\pgfqkeys{/drawarc}{#1} +\ifcase\tkz@numa% + \tkzDrawArcN[#1](#2,#3)(#4) +\or% 1 + \tkzDrawArcRotate[#1](#2,#3)(#4) +\or% 2 + \tkzDrawArcAngles[#1](#2,#3)(#4) + \or% 3 + \tkzDrawArcRAngles[#1](#2,#3)(#4) + \or% 4 + \tkzDrawArcR[#1](#2,#3)(#4) +\fi +\endgroup +} + +%<--------------------------------------------------------------------------–> +% #1 center #2 radius #4 first angle (degree) #5 second angle (degree) +% angles 0 .. 180 or -180 .. 0 +%<--------------------------------------------------------------------------–> +% example : \tkzDrawArc(A,2 cm)(30,90) +\def\tkzDrawArcRAngles{\pgfutil@ifnextchar[{\tkz@DrawArcRAngles}{% + \tkz@DrawArcRAngles[]}} +\def\tkz@DrawArcRAngles[#1](#2,#3)(#4,#5){% + \begingroup + \pgfmathparse{#4}\edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathparse{#5}\edef\tkz@SecondAngle{\pgfmathresult}% + \pgfmathgreaterthan{\tkz@FirstAngle}{0} + \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 + \else + \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} + \ifdim\pgfmathresult pt=1 pt\relax% + \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,/drawarc/.cd,#1]% + (\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3); +\endgroup +} +%<--------------------------------------------------------------------------–> +% ARC nodes #2 center #3 first point last point #4 +% delta un peu plus à chaque extrémité +% example : \tkzDrawArc(A,B)(C) +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcN{\pgfutil@ifnextchar[{\tkz@DrawArcN}{\tkz@DrawArcN[]}} +\def\tkz@DrawArcN[#1](#2,#3)(#4){% +\begingroup + \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) +\endgroup +} +%<--------------------------------------------------------------------------–> +% nodes #2 center #3 first point rotate #3 with Angle +% delta un peu plus à chaque extrémité +% tkzDrawArcRotate(O,A)(60) +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcRotate{\pgfutil@ifnextchar[{\tkz@DrawArcRotate}{% + \tkz@DrawArcRotate[]}} +\def\tkz@DrawArcRotate[#1](#2,#3)(#4){% +\begingroup + \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) + \else + \tkz@DrawArcRAngles[#1](#2,\tkz@radius pt)(\tkz@SecondA,\tkz@FirstA) + \fi + \endgroup +} +%<--------------------------------------------------------------------------–> +% deux angles +% \tkzDrawArcAngles(O,A)(0,60) +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcAngles{\pgfutil@ifnextchar[{\tkz@DrawArcAngles}{% + \tkz@DrawArcAngles[]}} +\def\tkz@DrawArcAngles[#1](#2,#3)(#4,#5){% +\begingroup + \tkzCalcLength(#2,#3) + \tkz@DrawArcRAngles[#1](#2,\tkzLengthResult pt)(#4,#5) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Degree #2 center #4 - #3 radius from #5 (degree) to #6(degree) +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcRwithNodesAngles{\pgfutil@ifnextchar[{% + \tkz@DrawArcRwithNodesAngles}{% + \tkz@DrawArcRwithNodesAngles[]}} \def\tkz@DrawArcRwithNodesAngles[#1](#2,#3,#4)(#5,#6){% +\begingroup + \tkzCalcLength(#3,#4) + \tkz@DrawArcRAngles[#1](#2,\tkzLengthResult pt)(#5,#6) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\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 +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% 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]{% +\tkzActivOff +\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 +% +% Paramètres (optionnels, gérés par xkeyval) +% length : longueur de l'arc (ignoré si delta est différent de 0) +% delta : angle sous-tendant l'arc + +%<--------------------------------------------------------------------------–> + \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\tkz@length{2} +% \pgfkeys{/tikz/.cd,length/.code={\def\tkz@length{#1}}} + +\def\tkzCompass{\pgfutil@ifnextchar[{\tkz@Compass}{\tkz@Compass[]}} +\def\tkz@Compass[#1](#2,#3){% +\begingroup +\pgfkeys{% + compass/.cd, + length = 0.75, + 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 +}% + +%<--------------------------------------------------------------------------–> +% fin de \tkzCompass +%<--------------------------------------------------------------------------–>\endinput + \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-circles.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-circles.tex new file mode 100644 index 00000000000..c29b965c16e --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-circles.tex @@ -0,0 +1,259 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + + +%<--------------------------------------------------------------------------–> +% tkzCircle center and one point +%<--------------------------------------------------------------------------–> + +\def\tkz@numc{0} +\pgfkeys{/tkzDefCircle/.cd, +radius/.code = \def\tkz@numc{0}, +diameter/.code = \def\tkz@numc{1}, +circum/.code = \def\tkz@numc{2}, +in/.code = \def\tkz@numc{3}, +euler/.code = \def\tkz@numc{4}, +apollonius/.code = \def\tkz@numc{5}, +orthogonal from/.code args = {#1}{\global\def\tkz@ptfrom{#1}, + \global\def\tkz@numc{6}}, +orthogonal through/.code args ={#1 and #2}{\global\def\tkz@ptone{#1} + \global\def\tkz@pttwo{#2} + \global\def\tkz@numc{7}}, +K/.code = \def\tkz@koeff{#1} +} + +\def\tkzDefCircle{\pgfutil@ifnextchar[{\tkz@DefCircle}{% + \tkz@DefCircle[]}} +\def\tkz@DefCircle[#1](#2){% +\begingroup +\pgfkeys{/tkzDefCircle/.cd,radius,K=2} +\pgfqkeys{/tkzDefCircle}{#1} +\ifcase\tkz@numc% + \tkzDefCircleRadius(#2) + \or% 1 + \tkzDefCircleD(#2) + \or% 2 + \tkzDefCircumCircle(#2) + \or% 3 + \tkzDefInCircle(#2) + \or% 4 + \tkzDefEulerCircle(#2) + \or% 5 + \tkzDefApolloniusCircle(#2) + \or% 6 + \tkzDefOrthogonalCircle(#2,\tkz@ptfrom) + \or% 7 + \tkzDefOrthoThroughCircle(#2,\tkz@ptone,\tkz@pttwo) \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefCircumCircle(#1,#2,#3){% +\begingroup + \tkzCircumCenter(#1,#2,#3) + \tkzCalcLength(#1,tkzPointResult) +\endgroup +} +\def\tkzDefInCircle(#1,#2,#3){% +\begingroup + \tkzInCenter(#1,#2,#3) \tkzGetPoint{tkz@ia} + \tkzUProjection(#2,#3)(tkzPointResult) + \tkzCalcLength(tkzPointResult,tkz@ia) + \tkzRenamePoint(tkz@ia){tkzPointResult} +\endgroup +} +\def\tkzDefEulerCircle(#1,#2,#3){% +\begingroup + \tkzDefMidPoint(#2,#3) \tkzGetPoint{tkz@e} + \tkzEulerCenter(#1,#2,#3) + \tkzCalcLength(tkz@e,tkzPointResult) +\endgroup +} +\def\tkzDefApolloniusCircle(#1,#2){% +\begingroup + \tkzApolloniusCenter(#1,#2) + \tkzCalcLength(tkzPointResult,tkzFirstPointResult) +\endgroup +} +\def\tkzDefOrthogonalCircle(#1,#2,#3){% +\begingroup + \tkzTgtFromP(#1,#2)(#3) + \tkzCalcLength[cm](#1,tkzFirstPointResult) +\endgroup +} +\def\tkzDefOrthoThroughCircle(#1,#2,#3,#4){% +\begingroup + \tkzCalcLength[cm](#1,#2)\tkzGetLength{tkz@lna}% + \tkzCalcLength[cm](#1,#3)\tkzGetLength{tkz@lnb}% + \FPeval\tkz@lnc{\tkz@lna/\tkz@lnb*\tkz@lna} + \tkzVecKNorm[\tkz@lnc](#1,#3){tkz@PointResult} + \tkzCircumCenter(tkz@PointResult,#3,#4) + \tkzCalcLength(tkzPointResult,#3) +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkz@numdc{0} +\pgfkeys{ +/DrawCircle/.cd, + radius/.code =\def\tkz@numdc{0}, + R/.code =\def\tkz@numdc{1}, + diameter/.code =\def\tkz@numdc{2}, + circum/.code =\def\tkz@numdc{3}, + in/.code =\def\tkz@numdc{4}, + euler/.code =\def\tkz@numdc{5}, + apollonius/.code =\def\tkz@numdc{6}, + orthogonal from/.code args= {#1}{\global\def\tkz@ptfrom{#1}, + \global\def\tkz@numdc{7}}, + orthogonal through/.code args={#1 and #2}{\global\def\tkz@ptone{#1} + \global\def\tkz@pttwo{#2} + \global\def\tkz@numdc{8}}, + K/.code =\def\tkz@koeff{#1}, + /DrawCircle/.unknown/.code ={\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}} +} +%<--------------------------------------------------------------------------–> +\def\tkzDrawCircle{\pgfutil@ifnextchar[{\tkz@DrawCircle}{\tkz@DrawCircle[]}} +\def\tkz@DrawCircle[#1](#2){% +\begingroup +\pgfkeys{/DrawCircle/.cd,radius,K=2} +\pgfqkeys{/DrawCircle}{#1} +\ifcase\tkz@numdc% + \tkzDefCircleRadius(#2) + \or% 1 + \tkzDefCircleR(#2) + \or% 2 + \tkzDefCircleD(#2) + \or% 3 + \tkzDefCircumCircle(#2) + \or% 4 + \tkzDefInCircle(#2) + \or% 5 + \tkzDefEulerCircle(#2) + \or% 6 + \tkzDefApolloniusCircle(#2) + \or% 7 + \tkzDefOrthogonalCircle(#2,\tkz@ptfrom) + \or% 8 + \tkzDefOrthoThroughCircle(#2,\tkz@ptone,\tkz@pttwo) + \fi +\draw[/DrawCircle/.cd,line style,#1]% + (tkzPointResult) circle (\tkzLengthResult pt);% +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleRadius(#1,#2){% +\begingroup + \tkzCalcLength(#1,#2) + \tkzRenamePoint(#1){tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleR(#1,#2){% + \begingroup + \tkz@radi=#2 % + \FPeval\tkzLengthResult{\pgf@sys@tonumber{\tkz@radi}}% + \FPround\tkzLengthResult\tkzLengthResult5\relax% + \global\let\tkzLengthResult\tkzLengthResult + \tkzRenamePoint(#1){tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleD(#1,#2){% +\begingroup + \tkzDefMidPoint(#1,#2) + \tkzCalcLength(#1,tkzPointResult) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<---------------------------- Fill Circle --------------------------------–> +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkz@numfc{0} +\pgfkeys{ +/fillcircle/.cd, + radius/.code =\def\tkz@numfc{0}, + R/.code =\def\tkz@numfc{1}, +/fillcircle/.unknown/.code ={\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}} +} + +\def\tkzFillCircle{\pgfutil@ifnextchar[{\tkz@FillCircle}{\tkz@FillCircle[]}} +\def\tkz@FillCircle[#1](#2,#3){% +\begingroup +\pgfkeys{/fillcircle/.cd,radius} +\pgfqkeys{/fillcircle}{#1} +\ifcase\tkz@numfc% + % first case 0 + \tkzCalcLength(#2,#3) + \fill[/fillcircle/.cd,#1] (#2) circle (\tkzLengthResult pt);% + \or% 1 + \fill[/fillcircle/.cd,#1] (#2) circle (#3);% + \fi +\endgroup +} +%<--------------------------- Clip Circle ---------------------------------–> +% %<--------------------------------------------------------------------------–> +\def\tkz@numcc{0} +\pgfkeys{ +/clipcircle/.cd, + radius/.code =\def\tkz@numcc{0}, + R/.code =\def\tkz@numcc{1} +} +%<--------------------------------------------------------------------------–> +\def\tkzClipCircle{\pgfutil@ifnextchar[{\tkz@ClipCircle}{% + \tkz@ClipCircle[]}} + +\def\tkz@ClipCircle[#1](#2,#3){% +\pgfkeys{/clipcircle/.cd,radius} +\pgfqkeys{/clipcircle}{#1} +\ifcase\tkz@numcc + \tkzCalcLength(#2,#3) + \clip (#2) circle (\tkzLengthResult pt); + \or% 1 + \clip (#2) circle (#3); + \fi +} +%<--------------------------- Label Circle --------------------------------–> +%<--------------------------------------------------------------------------–> +% %<--------------------------------------------------------------------------–> +\def\tkz@numlc{0} +\pgfkeys{ +/labelcircle/.cd, + radius/.code =\def\tkz@numlc{0}, + R/.code =\def\tkz@numlc{1}, + /labelcircle/.unknown/.code ={\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}} +} + +\def\tkzLabelCircle{\pgfutil@ifnextchar[{\tkz@LabelCircle}{% + \tkz@LabelCircle[]}} + +\def\tkz@LabelCircle[#1](#2,#3)(#4)#5{% +\begingroup +\pgfkeys{/labelcircle/.cd,radius} +\pgfqkeys{/labelcircle}{#1} +\ifcase\tkz@numlc + \tkzURotateAngle(#2,#4)(#3) + \node[/labelcircle/.cd,#1] at (tkzPointResult) {#5}; + \or% 1 + \path (#2)--++(#3,0) coordinate (tkzPointResult); + \tkzURotateAngle(#2,#4)(tkzPointResult) + \node[/labelcircle/.cd,#1] at (tkzPointResult) {#5}; + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> + +\endinput \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-lines.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-lines.tex new file mode 100644 index 00000000000..6532c7f92bd --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-lines.tex @@ -0,0 +1,342 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + + +%<--------------------------------------------------------------------------–> + +%<--------------------------------------------------------------------------–> +% les lignes +%<--------------------------------------------------------------------------–> +\def\tkz@numl{0} +\pgfkeys{/tkzDefLine/.cd, + mediator/.code ={\global\def\tkz@numl{0}}, + perpendicular/.code args={through #1} {\global\def\tkz@numl{1}% + \global\def\tkz@through{#1}}, + orthogonal/.code args={through #1} {\global\def\tkz@numl{1}% + \global\def\tkz@through{#1}}, + parallel/.code args={through #1}{\global\def\tkz@numl{2}% + \global\def\tkz@through{#1}}, + bisector/.code ={\global\def\tkz@numl{3}}, + bisector out/.code ={\global\def\tkz@numl{4}}, + K/.code =\def\tkz@koeff{#1} +} + +\def\tkzDefLine{\pgfutil@ifnextchar[{\tkz@DefLine}{% + \tkz@DefLine[]}} +\def\tkz@DefLine[#1](#2){% +\begingroup +\pgfkeys{/tkzDefLine/.cd,K=1} +\pgfqkeys{/tkzDefLine}{#1} +\ifcase\tkz@numl% + % first case 0 + \tkzDefMediatorLine(#2) + \or% 1 + \tkzDefOrthLine[\tkz@koeff](#2) + \or% 2 + \tkzDefLineLL(#2) + \or% 3 + \tkzDefBisectorLine(#2) + \or% 4 + \tkzDefBisectorOutLine(#2) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% tkzLineLL revoir out !! +%<--------------------------------------------------------------------------–> +\def\tkzDefLineLL(#1,#2){% +\begingroup% recherche d'un vecteur tq #2#3=#4tkz@point + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \path[coordinate](\tkz@through)--+(\pgf@xa,\pgf@ya)% + coordinate (tkzPointResult); +\endgroup}% +%<--------------------------------------------------------------------------–> +% tkzOrthLine +%<--------------------------------------------------------------------------–> +\def\tkzDefOrthLine{\pgfutil@ifnextchar[{\tkz@DefOrthLine}{% + \tkz@DefOrthLine[1]}} + \def\tkz@DefOrthLine[#1](#2,#3){% +\begingroup + \tkzVecKOrth(#2,#3){tkz@OLtmp} + \tkz@VecKCoLinear[#1](#2,tkz@OLtmp,\tkz@through){tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% tkzMediatorLine +%<--------------------------------------------------------------------------–> +\def\tkzDefMediatorLine(#1,#2){% +\begingroup + \path (#1) -- (#2) coordinate[pos=.5](tkzPointResult); + \tkzURotateAngle(#1,60)(#2) \tkzGetPoint{tkzFirstPointResult} + \tkzURotateAngle(#2,60)(#1) \tkzGetPoint{tkzSecondPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% BisectorLine % pb avec un angle plat +%<--------------------------------------------------------------------------–> +\def\tkzDefBisectorLine(#1,#2,#3){% +\begingroup + \tkzDuplicateLen(#2,#1)(#2,#3) \tkzGetPoint{tkz@tmp} + \tkzURotateAngle(tkz@tmp,60)(#1) \tkzGetPoint{tkzPointResult} + % \tkzVecKNorm[5](#2,#1){tkz@pt1} + % \tkzVecKNorm[5](#2,#3){tkz@pt2} + % \tkzDefEquilateral(tkz@pt2,tkz@pt1) + % \tkzVecKNorm(#2,tkzPointResult){tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Out BisectorLine +%<--------------------------------------------------------------------------–> +\def\tkzDefBisectorOutLine(#1,#2,#3){% +\begingroup + \tkzVecKNorm(#2,#1){tkz@pt1} + \tkzVecKNorm[-1](#2,#3){tkz@pt2} + \tkzDefEquilateral(tkz@pt2,tkz@pt1)\tkzGetPoint{tkz@pt3} + \tkzVecKNorm(#2,tkz@pt3){tkzPointResult} +\endgroup +} +%<-------------------------------------------------------------------------–> +\def\tkzLabelLine{\pgfutil@ifnextchar[{\tkz@AddLabelLine}{% + \tkz@AddLabelLine[]}} +\def\tkz@AddLabelLine[#1](#2,#3)#4{ + \path (#2) to node[#1]{#4}(#3); +} +%<--------------------------------------------------------------------------–> +% Setup Line +%<--------------------------------------------------------------------------–> + +\tikzset{line style/.style={% + line width = \tkz@euc@linewidth, + color = \tkz@euc@linecolor, + style = \tkz@euc@linestyle, + add = {\tkz@euc@lineleft} and {\tkz@euc@lineright}}} +\pgfkeys{% +setupline/.cd, +line width/.code = {\global\edef\tkz@line@lw{#1}}, +color/.code = {\global\edef\tkz@line@color{#1}}, +style/.code = {\global\edef\tkz@line@style{#1}}, +add/.code args = {#1 and #2} {\global\edef\tkz@line@left{#1}% + \global\edef\tkz@line@right{#2} } +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzSetUpLine{\pgfutil@ifnextchar[{\tkzActivOff\tkz@SetUpLine}{% + \tkzActivOff\tkz@SetUpLine[]}} +%<--------------------------------------------------------------------------–> +\def\tkz@SetUpLine[#1]{% +\tkzActivOff +\pgfkeys{% +setupline/.cd, +line width = \tkz@euc@linewidth, +color = \tkz@euc@linecolor, +style = \tkz@euc@linestyle, +add = {\tkz@euc@lineleft} and {\tkz@euc@lineright}} +\pgfqkeys{/setupline}{#1} +\tikzset{line style/.style={% + color = \tkz@line@color, + line width = \tkz@line@lw, + style = \tkz@line@style, + add = {\tkz@line@left} and {\tkz@line@right} + }} +}% +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% Draw line +%<--------------------------------------------------------------------------–> +\pgfkeys{% +tkzdrawline/.cd, +start/.code = {\def\tkz@line@start{#1}},% +end/.code = {\def\tkz@line@end{#1}}, +start style/.code ={\tikzset{tkzstartstyle/.style={#1}}}, +end style/.code ={\tikzset{tkzendstyle/.style={#1}}}, + /tkzdrawline/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}} + } + +\def\tkzDrawLine{\pgfutil@ifnextchar[{\tkz@DrawLine}{% + \tkz@DrawLine[]}} +\def\tkz@DrawLine[#1](#2,#3){% +\begingroup +\pgfkeys{% +tkzdrawline/.cd, +start = {} , +end = {} , +start style={}, +end style={},} +\pgfqkeys{/tkzdrawline}{#1} +\draw[ line style,/tkzdrawline/.cd,#1] (#2) to% + node [at start,left,/tkzdrawline/.cd,tkzstartstyle] {\tkz@line@start}% + node [at end,right,/tkzdrawline/.cd,tkzendstyle] {\tkz@line@end} (#3); +\endgroup +}% +%<--------------------------------------------------------------------------–> +\def\tkz@multiLines#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzDrawLine[\tkz@optline](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<--------------------------------------------------------------------------–> +\def\tkzDrawLines{\pgfutil@ifnextchar[{\tkz@DrawLines}{% + \tkz@DrawLines[]}} +\def\tkz@DrawLines[#1](#2){% +\global\edef\tkz@optline{#1} +\begingroup + \let\next\tkz@multiLines + \next#2 \@nil % +\endgroup +}% + + %<--------------------------------------------------------------------------–> +%<--------------------------- The SHOW --------------------------------–> +%<--------------------------------------------------------------------------–> +\global\def\tkz@numsh{0} +\pgfkeys{/show/.cd, + mediator/.code =\global\def\tkz@numsh{0}, + perpendicular/.code args={through #1} {\global\def\tkz@numsh{1}% + \global\def\tkz@through{#1}}, + orthogonal/.code args={through #1} {\global\def\tkz@numsh{1}% + \global\def\tkz@through{#1}}, + parallel/.code args={through #1}{\global\def\tkz@numsh{2}% + \global\def\tkz@through{#1}}, + bisector/.code = \global\def\tkz@numsh{3}, + K/.code = \def\tkz@koeff{#1}, + length/.code = \def\tkz@show@length{#1}, + ratio/.code = \def\tkz@show@ratio{#1}, + gap/.code = \def\tkz@show@gap{#1}, + size/.code = \def\tkz@show@size{#1}, + /show/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /compass/\searchname/.retry=#1, + /tikz/\searchname/.retry=#1}} + } + +\def\tkzShowLine{\pgfutil@ifnextchar[{\tkz@ShowLine}{% + \tkz@ShowLine[]}} +\def\tkz@ShowLine[#1](#2){% +\begingroup +\pgfqkeys{/show}{K=1,gap=2,ratio=.5,length=1,size=1} +\pgfqkeys{/show}{#1} +\ifcase\tkz@numsh% + % first case 0 + \tkzShowMediatorLine[#1](#2) + \or% 1 + \tkzShowOrthLine[#1](#2)(\tkz@through) + \or% 2 + \tkzShowLLLine[#1](#2)(\tkz@through) + \or% 3 + \tkzShowBisectorLine[#1](#2) +\fi +\endgroup +} + +\def\tkzShowMediatorLine{\pgfutil@ifnextchar[{\tkz@ShowMediatorLine}{% + \tkz@ShowMediatorLine[]}} +\def\tkz@ShowMediatorLine[#1](#2,#3){% +\begingroup +\pgfkeys{% +show/.cd, +gap = 2, +ratio = .5, +length = 1 +} +\pgfkeys{show/.cd,#1} + \path (#2) -- (#3) coordinate[pos=.5](tkzmidpoint); + \tkzURotateAngle(#2,60)(#3)\tkzGetPoint{tkzFirstPointResult} + \tkzURotateAngle(#3,60)(#2)\tkzGetPoint{tkzSecondPointResult} + \tkz@VecKOrthNorm[1](tkzmidpoint,#2){MED@tmp1} + \tkz@VecKOrthNorm[1](tkzmidpoint,#3){MED@tmp2} + \tkz@VecKNorm[\tkz@show@gap](tkzmidpoint,MED@tmp1){MED@1} + \tkz@VecKNorm[\tkz@show@gap](tkzmidpoint,MED@tmp2){MED@2} + \tkzCompass[#1,length=\tkz@show@ratio*\tkz@show@length](#2,MED@1) + \tkzCompass[#1](#3,MED@1) + \tkzCompass[#1,length=\tkz@show@ratio*\tkz@show@length](#2,MED@2) + \tkzCompass[#1](#3,MED@2) +\endgroup +} +\def\tkzShowLLLine{\pgfutil@ifnextchar[{\tkz@ShowLLLine}{% + \tkz@ShowLLLine[]}} +\def\tkz@ShowLLLine[#1](#2,#3)(#4){% +\begingroup +\pgfkeys{show/.cd,gap=2,ratio=.75,length=1} +\pgfkeys{show/.cd,#1} + \tkz@VecKCoLinear[1](#2,#3,#4){tkz@lltmp} + \tkzCompass[#1](#4,tkz@lltmp) + \tkzCompass[#1,length=\tkz@show@ratio*\tkz@show@length](#3,tkz@lltmp) +\endgroup +} + +%<--------------------------------------------------------------------------–> +% tkzLineOrth +%<--------------------------------------------------------------------------–> +% pas de projection ortho car le point peut être sur la droite. +% manque les tests . Il faudrait voir si on peut projeter et choisir +\def\tkzShowOrthLine{\pgfutil@ifnextchar[{\tkz@ShowOrthLine}{% + \tkz@ShowOrthLine[]}} +\def\tkz@ShowOrthLine[#1](#2,#3)(#4){% + \begingroup +\pgfkeys{show/.cd,ratio=.75,length=1,gap=-1} % ???? +\pgfkeys{show/.cd,#1} %???? + \tkzVecKOrth(#2,#3){tkz@OLtmp} + \tkz@VecKCoLinear[1](#2,tkz@OLtmp,#4){tkzPointCo} + \tkzInterLL(#2,#3)(#4,tkzPointCo)\tkzGetPoint{tkzPOpoint} + \tkzCalcLength(#4,tkzPOpoint)\tkzGetLength{tkz@mathLen} + \tkz@VecKNorm[1](#2,#3){PO@tmp} + \tkz@VecKCoLinear[1](#2,PO@tmp,tkzPOpoint){PO@tmp2} + \tkz@VecKCoLinear[-1](#2,PO@tmp,tkzPOpoint){PO@tmp1} + \tkz@VecKCoLinear[2](tkzPOpoint,PO@tmp1,tkzPOpoint){PO@1} + \tkz@VecKCoLinear[2](tkzPOpoint,PO@tmp2,tkzPOpoint){PO@2} + \ifdim\tkz@mathLen pt>10 pt\relax + \tkz@VecKNorm[1](#4,tkzPOpoint){PO@tmp1} + \else + \tkz@VecKOrthNorm[1](tkzPOpoint,PO@2){PO@tmp1} + \fi + \tkz@VecKCoLinear[-\tkz@show@gap](PO@tmp1,tkzPOpoint,tkzPOpoint){PO@3} + \tkzCompass[#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@1) + \tkzCompass[#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@2) + \tkzCompass[#1,length=\tkz@show@ratio *\tkz@show@length](PO@1,PO@3) + \tkzCompass[#1,length=\tkz@show@length](PO@2,PO@3) + \endgroup + } +%<-------------------------------------------------------------------------–> +% bisector Line +%<-------------------------------------------------------------------------–> +\def\tkzShowBisectorLine{\pgfutil@ifnextchar[{\tkz@ShowBisectorLine}{% + \tkz@ShowBisectorLine[]}} +\def\tkz@ShowBisectorLine[#1](#2,#3,#4){% +\begingroup +\pgfkeys{show/.cd,gap=2,ratio=.5,length=1,size=1} +\pgfkeys{show/.cd,#1} + \tkzVecKNorm(#3,#2){tkz@pt1} + \tkzVecKNorm(#3,#4){tkz@pt2} + \tkzDefEquilateral(tkz@pt2,tkz@pt1)\tkzGetPoint{tkz@pt3} + \tkzVecKNorm(#3,tkz@pt3){tkzBisPoint} + \tkzVecKNorm[\tkz@show@size](#3,#2){BI@1} + \tkzVecKNorm[\tkz@show@size](#3,#4){BI@2} + \tkzVecK[\tkz@show@gap](#3,tkzBisPoint){tkzBisPoint} + \tkzCompass[#1,length=\tkz@show@ratio *\tkz@show@length](#3,BI@1) + \tkzCompass[#1,length=\tkz@show@ratio *\tkz@show@length](#3,BI@2) + \tkzCompass[#1,length=\tkz@show@length](BI@1,tkzBisPoint) + \tkzCompass[#1,length=\tkz@show@ratio *\tkz@show@length](BI@2,tkzBisPoint) + \endgroup +} + +%<-------------------------------------------------------------------------–> +%<-------------------------------------------------------------------------–> + +\endinput diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-polygons.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-polygons.tex new file mode 100644 index 00000000000..6f7f5441bff --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-polygons.tex @@ -0,0 +1,278 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + + +%<--------------------------------------------------------------------------–> +% Polygon +%<--------------------------------------------------------------------------–> +\def\tkzDrawPolygon{\pgfutil@ifnextchar[{\tkz@DrawPolygon}{% + \tkz@DrawPolygon[]}} +\def\tkz@DrawPolygon[#1](#2,#3){% +\begingroup +\draw[line style,#1] (#2) + \foreach \tkz@pt in {#3}{--(\tkz@pt)}--cycle;% +\endgroup +} +%<---------------------------- CLIP --------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzClipPolygon(#1,#2){\path[clip] (#1) + \foreach \pt in {#2}{--(\pt)}--cycle; +} +%<---------------------------- FILL --------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzFillPolygon{\pgfutil@ifnextchar[{\tkz@FillPolygon}{% + \tkz@FillPolygon[]}} +\def\tkz@FillPolygon[#1](#2,#3){% + \begingroup + \fill[#1] (#2) +\foreach \tkz@pt in {#3}{--(\tkz@pt)}--cycle;% +\endgroup +} + +%<--------------------------------------------------------------------------–> +% Triangle Equilateral +%<--------------------------------------------------------------------------–> +\def\tkzDefEquilateral(#1,#2){ +\begingroup + \tkzURotateAngle(#1,60)(#2) +\endgroup +} +%<--------------------------------------------------------------------------–> + +\def\tkzDrawEquilateral{\pgfutil@ifnextchar[{\tkz@Equilateral}{% + \tkz@Equilateral[]}} + +\def\tkz@Equilateral[#1](#2,#3){% +\begingroup + \tkzURotateAngle(#2,60)(#3) + \tkzDrawPolygon[#1](#2,#3,tkzPointResult) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Triangle OneTwo +%<--------------------------------------------------------------------------–> +\def\tkzPhi{1.618034} +\def\tkzInvPhi{0.618034} +\def\tkzSqrtPhi{1.27202} + +\def\tkzDefTwoOne(#1,#2){ +\begingroup + \tkzVecKOrth[-.5](#2,#1){tkzPointResult} +\endgroup +} +\def\tkzDefPythagore(#1,#2){ +\begingroup + \tkzVecKOrth[-0.75](#2,#1){tkzPointResult} +\endgroup +} +\def\tkzDefSchoolTriangle(#1,#2){ +\begingroup + \tkzURotateAngle(#1,30)(#2) + \tkzVecKOrth[-1](#2,#1){tkz@a} + \tkzInterLL(#1,tkzPointResult)(#2,tkz@a) +\endgroup +} +\def\tkzDefGoldTriangle(#1,#2){ +\begingroup + \tkzURotateAngle(#1,36)(#2) +\endgroup +} +\def\tkzDefEuclideTriangle(#1,#2){ +\begingroup + \tkzURotateAngle(#1,72)(#2) + \tkzUHomo(#1,\tkzPhi)(tkzPointResult) +\endgroup +} +\def\tkzDefGoldenTriangle(#1,#2){ +\begingroup + \tkzVecKOrth[-\tkzInvPhi](#2,#1){tkzPointResult} +\endgroup +} +\def\tkzDefCheopsTriangle(#1,#2){ +\begingroup +\tkzDefMidPoint(#1,#2) + \tkzVecKOrth[-\tkzSqrtPhi](tkzPointResult,#1){tkzPointResult} +\endgroup +} +\def\tkzDefTwoAnglesTriangle(#1,#2){ +\begingroup + \tkzURotateAngle(#1,\tkz@alpha)(#2) \tkzGetPoint{tkz@pta} + \tkzURotateAngle(#2,-\tkz@beta)(#1) \tkzGetPoint{tkz@ptb} + \tkzInterLL(#1,tkz@pta)(#2,tkz@ptb) +\endgroup +} +\def\tkz@numtr{0} +\pgfkeys{/deftriangle/.cd, +equilateral/.code = \global\def\tkz@numtr{0}, +half/.code = \global\def\tkz@numtr{1}, +pythagore/.code = \global\def\tkz@numtr{2}, +school/.code = \global\def\tkz@numtr{3}, +golden/.code = \global\def\tkz@numtr{4}, +euclide/.code = \global\def\tkz@numtr{5}, +gold/.code = \global\def\tkz@numtr{6}, +cheops/.code = \global\def\tkz@numtr{7}, +two angles/.code args={#1 and #2} { \global\def\tkz@numtr{8}% + \global\def\tkz@alpha{#1}% + \global\def\tkz@beta{#2}} +} + +\def\tkzDefTriangle{\pgfutil@ifnextchar[{\tkz@DefTriangle}{% + \tkz@DefTriangle[]}} +\def\tkz@DefTriangle[#1](#2,#3){% +\begingroup +\pgfkeys{/deftriangle/.cd,equilateral} +\pgfqkeys{/deftriangle}{#1} +\ifcase\tkz@numtr% + \tkzDefEquilateral(#2,#3) + \or% 1 + \tkzDefTwoOne(#2,#3) + \or% 2 + \tkzDefPythagore(#2,#3) + \or% 3 + \tkzDefSchoolTriangle(#2,#3) + \or% 4 + \tkzDefGoldenTriangle(#2,#3) + \or% 5 + \tkzDefEuclideTriangle(#2,#3) + \or% 6 + \tkzDefGoldTriangle(#2,#3) + \or% 7 + \tkzDefCheopsTriangle(#2,#3) + \or% 8 + \tkzDefTwoAnglesTriangle(#2,#3) \fi +\endgroup +} + +\def\tkz@numdtr{0} +\pgfkeys{/drawtriangle/.cd, +equilateral/.code = {\global\def\tkz@numdtr{0}}, +half/.code = {\global\def\tkz@numdtr{1}}, +pythagore/.code = {\global\def\tkz@numdtr{2}}, +school/.code = {\global\def\tkz@numdtr{3}}, +golden/.code = {\global\def\tkz@numdtr{4}}, +euclide/.code = {\global\def\tkz@numdtr{5}}, +gold/.code = {\global\def\tkz@numdtr{6}}, +cheops/.code = {\global\def\tkz@numdtr{7}}, +two angles/.code args={#1 and #2} { \global\def\tkz@numdtr{8}% + \global\def\tkz@alpha{#1}% + \global\def\tkz@beta{#2}}, +/drawtriangle/.unknown/.code ={\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}} +} + +\def\tkzDrawTriangle{\pgfutil@ifnextchar[{\tkz@DrawTriangle}{% + \tkz@DrawTriangle[]}} +\def\tkz@DrawTriangle[#1](#2,#3){% +\begingroup +\pgfkeys{/drawtriangle/.cd,equilateral} +\pgfqkeys{/drawtriangle}{#1} +\ifcase\tkz@numdtr% +\tkzDefEquilateral(#2,#3) +\or% 1 +\tkzDefTwoOne(#2,#3) +\or% 2 +\tkzDefPythagore(#2,#3) +\or% 3 +\tkzDefSchoolTriangle(#2,#3) +\or% 4 +\tkzDefGoldenTriangle(#2,#3) +\or% 5 +\tkzDefEuclideTriangle(#2,#3) +\or% 6 +\tkzDefGoldTriangle(#2,#3) +\or% 7 +\tkzDefCheopsTriangle(#2,#3) +\or% 8 +\tkzDefTwoAnglesTriangle(#2,#3) +\fi + \draw[/drawtriangle/.cd,line style,#1] (#2)--(#3)--(tkzPointResult)--cycle;% +\endgroup +} + +%<--------------------------------------------------------------------------–> +% Droites particulières d'un triangle +%<--------------------------------------------------------------------------–> +% median +%<--------------------------------------------------------------------------–> +\def\tkzDrawMedian{\pgfutil@ifnextchar[{\tkz@Median}{\tkz@Median[]}} +\def\tkz@Median[#1](#2,#3)(#4){% +\begingroup + \tkzDefMidPoint(#3,#2) + \tkzDrawLine[add= 0 and 0,#1](#4,tkzPointResult) +\endgroup +} + +%<--------------------------------------------------------------------------–> +% altitude +%<--------------------------------------------------------------------------–> +\def\tkzDrawAltitude{\pgfutil@ifnextchar[{\tkz@Altitude}{\tkz@Altitude[]}} +\def\tkz@Altitude[#1](#2,#3)(#4){% +\begingroup + \tkzUProjection(#2,#3)(#4) + \tkzDrawLine[add= 0 and 0,#1](#4,tkzPointResult) +\endgroup +} +%<--------------------------------------------------------------------------–> +% bisector +%<--------------------------------------------------------------------------–> +\def\tkzDrawBisector{\pgfutil@ifnextchar[{\tkz@Bisector}{\tkz@Bisector[]}} +\def\tkz@Bisector[#1](#2,#3,#4){% +\begingroup + \tkzDefBisectorLine(#2,#3,#4) + \tkzInterLL(#2,#4)(#3,tkzPointResult) + \tkzDrawLine[add= 0 and 0,#1](#3,tkzPointResult) +\endgroup +} + + +%<--------------------------- square ---------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzDefSquare(#1,#2){ +\begingroup + \tkzURotateAngle(#2,-90)(#1)\tkzGetPoint{tkzFirstPointResult} + \tkzURotateAngle(#1, 90)(#2)\tkzGetPoint{tkzSecondPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDrawSquare{\pgfutil@ifnextchar[{\tkz@DrawSquare}{% + \tkz@DrawSquare[]}} + +\def\tkz@DrawSquare[#1](#2,#3){% +\begingroup + \tkzDefSquare(#2,#3) + \tkzDrawPolygon[#1](#2,#3,tkzFirstPointResult,tkzSecondPointResult) +\endgroup +} +%<--------------------------- gold rectangle -------------------------------–> +% +%<--------------------------------------------------------------------------–> + +\def\tkzDefGoldRectangle(#1,#2){ +\begingroup + \tkzVecKOrth[-\tkzInvPhi](#2,#1){tkzFirstPointResult} + \tkzVecKOrth[\tkzInvPhi](#1,#2){tkzSecondPointResult} +\endgroup +} +\def\tkzDrawGoldRectangle{\pgfutil@ifnextchar[{\tkz@DrawGoldRectangle}{% + \tkz@DrawGoldRectangle[]}} + +\def\tkz@DrawGoldRectangle[#1](#2,#3){ +\begingroup + \tkzDefGoldRectangle(#2,#3) + \tkzDrawPolygon[#1](#2,#3,tkzFirstPointResult,tkzSecondPointResult) +\endgroup +} + +\endinput \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-protractor.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-protractor.tex new file mode 100644 index 00000000000..04d4e3b3b95 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-protractor.tex @@ -0,0 +1,203 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + +%<--------------------------------------------------------------------------–> +% !!! idea from Y. Combe !!! +%<--------------------------------------------------------------------------–> +% +% \tkzProtractor Protractor +% +% Rapporteur ajustable et positionable +% +% Par défaut: +% centre en (0,0) +% rayon de 5 cm +% ligne de base horizontale. +% épaisseur de ligne 0.4 pt +% +% Paramètres (optionnels, gérés par xkeyval) +% shift : coordonées (n'importe quelle forme +% acceptée par tikz). +% scale : facteur d'échelle +% rotate : rotation +% lw : line width (épaisseur des lignes) +% ce paramètre subit le facteur d'échelle. +%<--------------------------------------------------------------------------–> +\def\HalfProtractor{% +\tkzActivOff + \draw [fill=black!50!blue!20!,even odd rule,semitransparent](-160:5cm) -- (-20:5cm) arc (-20:200:5cm) -- cycle % + (-180:3.5cm) -- (0:3.5cm) arc (0:180:3.5cm) -- cycle;% + + \draw (-90:0.3cm) -- (0,0) + (-135:0.3cm) -- (0,0) + (-45:0.3cm) -- (0,0); +\foreach \MO@i in {0,1,...,180} +\pgfmathparse{ 4.8 * (mod(\MO@i ,5)==0) + 4.9 * (mod(\MO@i ,5)>0) } +\draw (\MO@i:\pgfmathresult cm)--(\MO@i:5cm); + + \foreach \d in {0,1,...,180} + \pgfmathparse{3.7 * (mod(\d,5)==0) + 3.6 * (mod(\d,5)>0)} + \draw (\d:\pgfmathresult cm)--(\d:3.5cm); + +\draw (0: 4.6cm) node[font=\small] {0} + (0: 4cm) node[font=\small] {180}; + +\foreach \d in {10,20,...,80} + \pgfmathtruncatemacro{\rang}{180 - \d } + \draw (\d:3.9 cm) node[font=\tiny] {\rang} + (\d:4.6 cm) node[font=\tiny] {\d}; + +\draw (90: 4.25cm) node[font=\small] {90}; +\draw (90: 4.6 cm) -- (90:5cm) + (90: 3.9 cm) -- (90:3.5cm) ; + +\foreach \d in {100,110,...,170} + \pgfmathtruncatemacro{\rang}{180 - \d } + \draw (\d:3.9 cm) node[font=\tiny] {\rang} + (\d:4.6 cm) node[font=\tiny] {\d}; + + \draw (180: 4.5cm) node[font=\small] {180} + (180: 3.9cm) node[font=\small] {0}; +\tkzActivOn +} + +\def\FullProtractor{% +\tkzActivOff +\draw[fill=black!50!yellow!20!,even odd rule,semitransparent]% + (0,0) circle (4cm); +\draw (0,0) circle (3.3cm);\draw (0,0) circle (4cm); +\draw[fill=black] (0,0) circle (.08mm); +\node[draw, circle, inner sep=.2mm] (a) at (0,0) {}; +\foreach \x in {0, 90, ..., 360}{% + \draw[very thin, gray!40] (a) -- (\x:4cm);} +\foreach \x in {0,...,359} {\draw (\x:3.8cm) -- (\x:4cm);} +\foreach \x in {0,5,...,355} {\draw (\x:3.725cm) -- (\x:4cm);} +\foreach \x in {0,10,...,350}{% + \node[rotate=(\x-90)] at (\x:3.6cm) {\tiny\x}; +} + \draw [>=stealth',->, thick,black] (0:2.5) arc(0:32:2.5); + \draw [>=stealth',->, thick,black] (0:2) arc(0:32:2); + \draw [>=stealth',->, thick,black] (0:1.5) arc(0:32:1.5); +\tkzActivOn +} + +\def\FullProtractorReturn{% +\tkzActivOff +\draw[fill=black!50!yellow!20!,even odd rule,semitransparent]% + (0,0) circle (4cm); +\draw (0,0) circle (3.3cm);\draw (0,0) circle (4cm); +\draw[fill=black] (0,0) circle (.08mm); +\node[draw, circle, inner sep=.2mm] (a) at (0,0) {}; +\foreach \x in {0, 90, ..., 360}{% + \draw[very thin, gray!40] (a) -- (\x:4cm);} +\foreach \x in {0,...,359} {\draw (\x:3.8cm) -- (\x:4cm);} +\foreach \x in {0,5,...,355} {\draw (\x:3.725cm) -- (\x:4cm);} +\begin{scope} + \foreach \x in {0,10,...,350}{% + \node[rotate=(-\x-90)] at (-\x:3.6cm) {\tiny\x}; +} + \end{scope} + \draw [>=stealth',->, thick,black] (0:2.5) arc(0:-32:2.5); + \draw [>=stealth',->, thick,black] (0:2) arc(0:-32:2); + \draw [>=stealth',->, thick,black] (0:1.5) arc(0:-32:1.5); +\tkzActivOn +} + +\newif\iftkz@RappReturn +\newif\iftkz@RappFull +\pgfkeys{ + protractor/.cd, + with/.is choice, + with/full/.code = {\global\let\tkz@@Protractor\FullProtractor + \tkz@RappFulltrue}, + with/half/.code = {\global\let\tkz@@Protractor\HalfProtractor + \tkz@RappFullfalse}, + with/.default = full, + lw/.code = {\def\cmdMO@Rap@lw{#1}}, + shift/.code = {\def\cmdMO@Rap@shift{#1}}, + rotate/.code = {\def\cmdMO@Rap@rotate{#1}}, + scale/.code = {\def\cmdMO@Rap@scale{#1}}, + return/.is if = tkz@RappReturn, + return/.default = true + } +\def\tkzOriProtractor{\pgfutil@ifnextchar[{\tkz@OriProtractor}{% + \tkz@OriProtractor[]}} +\def\tkz@OriProtractor[#1]{ + \pgfkeys{/protractor/.cd, + with=full, + shift={(0,0)}, + rotate=0, + lw=0.4pt, + scale =1, + return=false + } + \pgfqkeys{/protractor}{#1} + \pgfmathsetlengthmacro{\MO@lw}{\cmdMO@Rap@lw * \cmdMO@Rap@scale} + \begin{scope}[shift = \cmdMO@Rap@shift,% + scale = \cmdMO@Rap@scale,% + rotate = \cmdMO@Rap@rotate,% + every node/.style = {scale =\cmdMO@Rap@scale, + rotate =\cmdMO@Rap@rotate},% + line width=\MO@lw + ]% + \tkz@@Protractor +\end{scope} +} +\def\tkzProtractor{\pgfutil@ifnextchar[{\tkz@Protractor}{\tkz@Protractor[]}} +\def\tkz@Protractor[#1](#2,#3){ + \pgfkeys{/protractor/.cd, + with=full, + shift={(0,0)}, + rotate=0, + lw=0.4pt, + scale =1, + return=false + } +\pgfqkeys{/protractor}{#1} + \tkz@@extractxy{#2} + \global\tkz@ax\pgf@x + \global\tkz@ay\pgf@y + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{cmdMO@Rap@rotate}% +\iftkz@RappFull +\iftkz@RappReturn + \global\let\tkz@@Protractor\FullProtractorReturn + \fi + \pgfmathsetlengthmacro{\MO@lw}{\cmdMO@Rap@lw * \cmdMO@Rap@scale} + \begin{scope}[shift = {(\tkz@ax,\tkz@ay)},% + scale = \cmdMO@Rap@scale,% + rotate = \cmdMO@Rap@rotate,% + every node/.style = {scale =\cmdMO@Rap@scale, + rotate =\cmdMO@Rap@rotate},% + line width=\MO@lw]% + \tkz@@Protractor +\end{scope} +\else + \iftkz@RappReturn% + \pgfmathsubtract{\cmdMO@Rap@rotate}{180} + \let\cmdMO@Rap@rotate\pgfmathresult + \fi +\pgfmathsetlengthmacro{\MO@lw}{\cmdMO@Rap@lw * \cmdMO@Rap@scale} + \begin{scope}[shift = {(\tkz@ax,\tkz@ay)},% + scale = \cmdMO@Rap@scale,% + rotate = \cmdMO@Rap@rotate,% + every node/.style = {scale =\cmdMO@Rap@scale, + rotate =\cmdMO@Rap@rotate},% + line width=\MO@lw]% + \tkz@@Protractor +\end{scope} +\fi +} + +%<--------------------------------------------------------------------------–> +% fin de \tkzProtractor +%<--------------------------------------------------------------------------–> +\endinput + diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-sectors.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-sectors.tex new file mode 100644 index 00000000000..9934a6e3975 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-sectors.tex @@ -0,0 +1,351 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + +%<--------------------------------------------------------------------------–> +%<----------------------- Sectors ------------------------------–> +%<--------------------------------------------------------------------------–> +\tikzset{sstyle/.style={#1}} + + +\global\def\tkz@nums{0} +\pgfkeys{/drawsector/.cd, +towards/.code = {\global\def\tkz@nums{0}}, +rotate/.code = {\global\def\tkz@nums{1}}, +R/.code = {\global\def\tkz@nums{2}}, +R with nodes/.code = {\global\def\tkz@nums{3}}, +/drawsector/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}} +} + +\def\tkzDrawSector{\pgfutil@ifnextchar[{\tkz@DrawSector}{\tkz@DrawSector[]}} +\def\tkz@DrawSector[#1](#2,#3)(#4){% +\begingroup +\pgfkeys{/drawsector/.cd,towards} +\pgfqkeys{/drawsector}{#1} +\ifcase\tkz@nums% + \tkzDrawSectorN[#1](#2,#3)(#4) +\or% 1 + \tkzDrawSectorRotate[#1](#2,#3)(#4) +\or% 2 + \tkzDrawSectorRAngles[#1](#2,#3)(#4) +\or% 3 + \tkzDrawSectorR[#1](#2,#3)(#4) +\fi +\endgroup +} + + +\def\tkzDrawSectorRAngles{\pgfutil@ifnextchar[{\tkz@DrawSectorRAngles}{% + \tkz@DrawSectorRAngles[]}} +\def\tkz@DrawSectorRAngles[#1](#2,#3)(#4,#5){% +\begingroup + \pgfmathparse{#4}\edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathparse{#5}\edef\tkz@SecondAngle{\pgfmathresult}% + \pgfmathgreaterthan{\tkz@FirstAngle}{0} + \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 + \else + \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} + \ifdim\pgfmathresult pt=1 pt\relax% + \pgfmathadd{\tkz@SecondAngle}{360} + \edef\tkz@SecondAngle{\pgfmathresult}% + \fi + \fi + \draw[shift = {(#2)},/drawsector/.cd,#1]% + (#2) --(\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3)--cycle; + \endgroup + } % revoir il y a plus simple que ce shift !!! + %<--------------------------------------------------------------------------–> +% \tkzDrawSectorN(O,A)(B) +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorN{\pgfutil@ifnextchar[{\tkz@DrawSectorN}{% + \tkz@DrawSectorN[]}} +\def\tkz@DrawSectorN[#1](#2,#3)(#4){% +\begingroup + \tkzCalcLength(#2,#3)\tkzGetLength{tkz@radius} + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstAngle,% + \tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzDrawSectorRotate(O,A)(angle de rotation) ??? pb avec angle negatif +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorRotate{\pgfutil@ifnextchar[{\tkz@DrawSectorRotate}{% + \tkz@DrawSectorRotate[]}} +\def\tkz@DrawSectorRotate[#1](#2,#3)(#4){% +\begingroup + \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@DrawSectorRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstA,\tkz@SecondA) + \else + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius pt)(\tkz@SecondA,\tkz@FirstA) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzDrawSectorAngles(O,A)(ang1,ang2) +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorAngles{\pgfutil@ifnextchar[{\tkz@DrawSectorAngles}{% + \tkz@DrawSectorAngles[]}} +\def\tkz@DrawSectorAngles[#1](#2,#3)(#4,#5){% +\begingroup + \tkzCalcLength(#2,#3)\tkzGetLength{tkz@radius} + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius pt)(#4,#5) +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzDrawSectorRwithNodesAngles(O,A,B)(ang1,ang2) +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorRwithNodesAngles{\pgfutil@ifnextchar[{% + \tkz@DrawSectorRwithNodesAngles}{% + \tkz@DrawSectorRwithNodesAngles[]}} +\def\tkz@DrawSectorRwithNodesAngles[#1](#2,#3,#4)(#5,#6){% +\begingroup + \tkzCalcLength(#3,#4)\tkzGetLength{tkz@radius} + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius pt)(#5,#6) +\endgroup +} +% %<--------------------------------------------------------------------------–> +% % \tkzDrawSectorRwithNodes(O,A,B)(C,D) center O radius AB from C to D +% %<--------------------------------------------------------------------------–> +% \def\tkzDrawSectorRwithNodes{\pgfutil@ifnextchar[{% +% \tkz@DrawSectorRwithNodes}{% +% \tkz@DrawSectorRwithNodes[]}} +% \def\tkz@DrawSectorRwithNodes[#1](#2,#3,#4)(#5,#6){% +% \begingroup +% \tkzCalcLength(#3,#4){tkz@rad} +% \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@FirstAngle} +% \tkzFindSlopeAngle(#2,#6)\tkzGetAngle{tkz@SecondAngle} +% \tkz@DrawSectorRAngles[#1](#2,\tkz@rad)(\tkz@FirstAngle,\tkz@SecondAngle) +% \endgroup +% } +%<--------------------------------------------------------------------------–> +% \tkzDrawSectorR(O, rad)(A,B) +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorR{\pgfutil@ifnextchar[{\tkz@DrawSectorR}{% + \tkz@DrawSectorR[]}} +\def\tkz@DrawSectorR[#1](#2,#3)(#4,#5){% +\begingroup + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@SecondAngle} + \tkz@DrawSectorRAngles[#1](#2,#3)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% Fill +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\global\def\tkz@nums{0} +\pgfkeys{/fillsector/.cd, +towards/.code = {\global\def\tkz@nums{0}}, +rotate/.code = {\global\def\tkz@nums{1}}, +R/.code = {\global\def\tkz@nums{2}}, +R with nodes/.code = {\global\def\tkz@nums{3}}, +color/.code = {\global\def\tkz@fillcolor{#1}}, +/fillsector/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}} +} + +\def\tkzFillSector{\pgfutil@ifnextchar[{\tkz@FillSector}{\tkz@FillSector[]}} +\def\tkz@FillSector[#1](#2,#3)(#4){% +\begingroup +\pgfkeys{/fillsector/.cd,towards} +\pgfqkeys{/fillsector}{#1} +\ifcase\tkz@nums% + \tkzFillSectorN[#1](#2,#3)(#4) +\or% 1 + \tkzFillSectorRotate[#1](#2,#3)(#4) +\or% 2 + \tkzFillSectorRAngles[#1](#2,#3)(#4) +\or% 3 + \tkzFillSectorR[#1](#2,#3)(#4) +\fi +\endgroup +} + + +\def\tkzFillSectorRAngles{\pgfutil@ifnextchar[{\tkz@FillSectorRAngles}{% + \tkz@FillSectorRAngles[]}} +\def\tkz@FillSectorRAngles[#1](#2,#3)(#4,#5){% +\begingroup + \pgfmathparse{#4}\edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathparse{#5}\edef\tkz@SecondAngle{\pgfmathresult}% + \pgfmathgreaterthan{\tkz@FirstAngle}{0} + \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 + \else + \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} + \ifdim\pgfmathresult pt=1 pt\relax% + \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} + \path[shift = {(#2)},/fillsector/.cd,fill=\tkz@fillcolor,#1] (#2) -- % + (\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3)--cycle; +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzFillSectorN(O,A)(B) +%<--------------------------------------------------------------------------–> +\def\tkzFillSectorN{\pgfutil@ifnextchar[{\tkz@FillSectorN}{\tkz@FillSectorN[]}} +\def\tkz@FillSectorN[#1](#2,#3)(#4){% +\begingroup + \tkzCalcLength(#2,#3)\tkzGetLength{tkz@radius} + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} + \tkz@FillSectorRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstAngle,% + \tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzFillSectorRotate(O,A)(angle de rotation) ??? pb avec angle negatif +%<--------------------------------------------------------------------------–> +\def\tkzFillSectorRotate{\pgfutil@ifnextchar[{\tkz@FillSectorRotate}{% + \tkz@FillSectorRotate[]}} +\def\tkz@FillSectorRotate[#1](#2,#3)(#4){% +\begingroup + \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@FillSectorRAngles[#1](#2,\tkz@radius pt)(\tkz@FirstA,\tkz@SecondA) + \else + \tkz@FillSectorRAngles[#1](#2,\tkz@radius pt)(\tkz@SecondA,\tkz@FirstA) + \fi + \endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzFillSectorAngles(O,A)(ang1,ang2) +%<--------------------------------------------------------------------------–> +\def\tkzDrawSectorAngles{\pgfutil@ifnextchar[{\tkz@illSectorAngles}{% + \tkz@illSectorAngles[]}} +\def\tkz@illSectorAngles[#1](#2,#3)(#4,#5){% +\begingroup + \tkzCalcLength(#2,#3)\tkzGetLength{tkz@radius} + \tkz@FillSectorRAngles[#1](#2,\tkz@radius pt)(#4,#5) +\endgroup +} +%<--------------------------------------------------------------------------–> +% \tkzFillSectorR(O, rad)(A,B) +%<--------------------------------------------------------------------------–> +\def\tkzFillSectorR{\pgfutil@ifnextchar[{\tkz@FillSectorR}{% + \tkz@FillSectorR[]}} +\def\tkz@FillSectorR[#1](#2,#3)(#4,#5){% +\begingroup + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@SecondAngle} + \tkz@FillSectorRAngles[#1](#2,#3)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------- Clip Sector ----------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkz@ClipSectorRAngles(#1,#2)(#3,#4){% +\begingroup + \pgfmathparse{#3}\edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathparse{#4}\edef\tkz@SecondAngle{\pgfmathresult}% + \pgfmathgreaterthan{\tkz@FirstAngle}{0} + \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 + \else + \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} + \ifdim\pgfmathresult pt=1 pt\relax% + \pgfmathadd{\tkz@SecondAngle}{360} + \edef\tkz@SecondAngle{\pgfmathresult}% + \fi + \fi + \clip[shift = {(#1)}] (#1) --(\tkz@FirstAngle:#2)% + arc(\tkz@FirstAngle:\tkz@SecondAngle:#2) -- cycle; + \endgroup + } % revoir il y a plus simple que ce shift !!! +%<--------------------------------------------------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkz@ClipSectorRotate(#1,#2)(#3){% +\begingroup + \tkzCalcLength(#1,#2)\tkzGetLength{tkz@radius} + \tkzFindSlopeAngle(#1,#2)\tkzGetAngle{tkz@FirstA} + \pgfmathadd{\tkz@FirstA}{#3} + \edef\tkz@SecondA{\pgfmathresult} + \pgfmathgreaterthan{#3}{0} + \ifdim\pgfmathresult pt=1 pt\relax% + \tkz@ClipSectorRAngles(#1,\tkz@radius pt)(\tkz@FirstA,\tkz@SecondA) + \else + \tkz@ClipSectorRAngles(#1,\tkz@radius pt)(\tkz@SecondA,\tkz@FirstA) + \fi + \endgroup +} +%<--------------------------------------------------------------------------–> +% +%<--------------------------------------------------------------------------–> + +\def\tkz@ClipSectorN(#1,#2)(#3){% +\begingroup + \tkzCalcLength(#1,#2)\tkzGetLength{tkz@radius} + \tkzFindSlopeAngle(#1,#2)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#1,#3)\tkzGetAngle{tkz@SecondAngle} + \tkz@ClipSectorRAngles(#1,\tkz@radius pt)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkz@numcs{0} +\pgfkeys{ +/clipsector/.cd, +towards/.code = {\global\def\tkz@numcs{0}}, +rotate/.code = {\global\def\tkz@numcs{1}}, +R/.code = {\global\def\tkz@numcs{2}}, +} +%<--------------------------------------------------------------------------–> +\def\tkzClipSector{\pgfutil@ifnextchar[{\tkz@ClipSector}{% + \tkz@ClipSector[]}} + +\def\tkz@ClipSector[#1](#2,#3)(#4){% +\begingroup +\pgfkeys{/clipsector/.cd} +\pgfqkeys{/clipsector}{#1} +\ifcase\tkz@numcs% + \tkz@ClipSectorN(#2,#3)(#4) + \or% 1 + \tkz@ClipSectorRotate(#2,#3)(#4) + \or% 2 + \tkz@ClipSectorRAngles(#2,#3)(#4) + \fi +\endgroup +} +\endinput + \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-vectors.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-vectors.tex new file mode 100644 index 00000000000..15637a8e975 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-obj-vectors.tex @@ -0,0 +1,119 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + + %<--------------------------------------------------------------------------–> +% Vectors +%<--------------------------------------------------------------------------–> + +%<-------------------------------------------------------------------------–> +%<-------------------------------------------------------------------------–> +\def\tkzAddVectors(#1,#2)(#3,#4)#5{% + \begingroup + \pgfpointdiff{\pgfpointanchor{#3}{center}}% + {\pgfpointanchor{#4}{center}}% + \pgf@xb=\pgf@x% + \pgf@yb=\pgf@y% + \path[coordinate] (#2)--+(\pgf@xb,\pgf@yb) coordinate (#5); + \endgroup + } +%<--------------------------------------------------------------------------–> +% Draw vector +%<--------------------------------------------------------------------------–> +\tikzset{vector style/.style={>=latex,->}} +\pgfkeys{ +/tkzvec/.cd, +mark options/.code =\tikzset{mkstyle/.style={#1}}% + \global\edef\tkz@mk@arg{#1}, +label options/.code =\tikzset{lbstyle/.style={#1}}% + \global\edef\tkz@lb@arg{#1}, + /tkzvec/.unknown/.code ={\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /tikz/\searchname/.retry=#1}} +} +\def\tkzDrawVector{\pgfutil@ifnextchar[{\tkz@DrawVector}{% + \tkz@DrawVector[]}} + \def\tkz@DrawVector[#1](#2,#3){% +\begingroup +\pgfkeys{/tkzvec/.cd,mark options={},label options={}} +\pgfqkeys{/tkzvec}{#1} +% \ifx\tkzutil@empty\tkz@line@symbol + \draw[vector style,#1] (#2) to (#3); +% \else +% \draw[vector style,line style,add=0 and 0,#1](#2) to node[sloped] +% {\textcolor{\tkz@line@colorsymbol}{\tkz@line@symbol}}(#3); +% \fi +% \ifx\tkzutil@empty\tkz@line@label +% \else +% \path (#2) to node[above=\tkz@line@poslabel]% +% {\textcolor{\tkz@line@colorlabel}{\tkz@line@label}}(#3); +% \fi\fi + \endgroup +} +%<-------------------------------------------------------------------------–> +%<-------------------------------------------------------------------------–> + +\def\tkzLabelVector{\pgfutil@ifnextchar[{\tkz@LabelVector}{% + \tkz@LabelVector[]}} +\def\tkz@LabelVector[#1](#2,#3)#4{% +\begingroup +\path (#2) to node[above,#1]{#4} (#3) ; +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% multiple +\def\tkz@multiLV#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzLabelVector[\tkz@optlv](#1){\tkz@labelvec}}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<--------------------------------------------------------------------------–> +% correction 09/12/2010 +\def\tkzLabelVectors{\pgfutil@ifnextchar[{\tkz@LabelVectors}{% + \tkz@LabelVectors[]}} +\def\tkz@LabelVectors[#1](#2)#3{% +\global\edef\tkz@optlv{#1} +\global\def\tkz@labelvec{#3} + \begingroup + \let\next\tkz@multiLV + \next#2 \@nil % +\endgroup +} +%<-------------------------------------------------------------------------–> +%<-------------------------------------------------------------------------–> + + \def\tkz@multiVec#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzDrawVector[\tkz@optvec](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil + } + +\def\tkzDrawVectors{\pgfutil@ifnextchar[{\tkz@DrawVectors}{% + \tkz@DrawVectors[]}} +\def\tkz@DrawVectors[#1](#2){% +\global\edef\tkz@optvec{#1} + \begingroup + \let\next\tkz@multiVec + \next#2 \@nil % + \endgroup + } + + +%<-------------------------------------------------------------------------–> +\endinput \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-intersections.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-intersections.tex new file mode 100644 index 00000000000..94c65930a41 --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-intersections.tex @@ -0,0 +1,416 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + +%<--------------------------------------------------------------------------–> +% intersection de deux lignes +%<--------------------------------------------------------------------------–> +\def\tkzInterLL(#1,#2)(#3,#4){% méthode avec FP +\tkz@InterLL(#1,#2)(#3,#4){tkzPointResult} +} +% méthode with tikz +\def\tkz@InterLL(#1,#2)(#3,#4)#5{% +%\path (intersection of #1--#2 and #3--#4) coordinate(#5);% +\pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}} +\tkz@ax\pgf@x % +\tkz@ay\pgf@y % +\pgfextractx{\pgf@x}{\pgfpointanchor{#2}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#2}{center}} +\tkz@bx\pgf@x % +\tkz@by\pgf@y % +\pgfextractx{\pgf@x}{\pgfpointanchor{#3}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#3}{center}} +\tkz@cx\pgf@x % +\tkz@cy\pgf@y % +\pgfextractx{\pgf@x}{\pgfpointanchor{#4}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#4}{center}} +\tkz@dx\pgf@x % +\tkz@dy\pgf@y % +\FPeval\tkz@deltax{\pgf@sys@tonumber{\tkz@ax}-\pgf@sys@tonumber{\tkz@bx}} +\FPdiv\tkz@deltax{\tkz@deltax}{28.45274} +\FPeval\tkz@deltaxx{\pgf@sys@tonumber{\tkz@cx}-\pgf@sys@tonumber{\tkz@dx}} +\FPdiv\tkz@deltaxx{\tkz@deltaxx}{28.45274} +\FPeval\tkz@deltay{\pgf@sys@tonumber{\tkz@ay}-\pgf@sys@tonumber{\tkz@by}} +\FPdiv\tkz@deltay{\tkz@deltay}{28.45274} +\FPeval\tkz@deltayy{\pgf@sys@tonumber{\tkz@cy}-\pgf@sys@tonumber{\tkz@dy}} +\FPdiv\tkz@deltayy{\tkz@deltayy}{28.45274} +\FPeval\tkz@deltaxy{(\pgf@sys@tonumber{\tkz@ax}*\pgf@sys@tonumber{\tkz@by})-(\pgf@sys@tonumber{\tkz@ay}*\pgf@sys@tonumber{\tkz@bx})} +\FPdiv\tkz@deltaxy{\tkz@deltaxy}{28.45274} +\FPdiv\tkz@deltaxy{\tkz@deltaxy}{28.45274} +\FPeval\tkz@deltaxxyy{(\pgf@sys@tonumber{\tkz@cx}*\pgf@sys@tonumber{\tkz@dy})-(\pgf@sys@tonumber{\tkz@cy}*\pgf@sys@tonumber{\tkz@dx})} +\FPdiv\tkz@deltaxxyy{\tkz@deltaxxyy}{28.45274} +\FPdiv\tkz@deltaxxyy{\tkz@deltaxxyy}{28.45274} +\FPeval\tkz@div{(\tkz@deltax*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxx)} +\FPeval\tkz@numx{(\tkz@deltaxy*\tkz@deltaxx)-(\tkz@deltax*\tkz@deltaxxyy)} +\FPeval\tkz@numy{(\tkz@deltaxy*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxxyy)} +\FPdiv\tkz@xs{\tkz@numx}{\tkz@div} +\FPdiv\tkz@ys{\tkz@numy}{\tkz@div} +\FPround\tkz@xs{\tkz@xs}{5} +\FPround\tkz@ys{\tkz@ys}{5} +\path[coordinate](\tkz@xs,\tkz@ys) coordinate (#5); +} +%<--------------------------------------------------------------------------–> +% intersection de Ligne Cercle rayon connu +%<--------------------------------------------------------------------------–> +% /* +% Calculate the intersection of a ray and a sphere +% The line segment is defined from p1 to p2 +% The sphere is of radius r and centered at sc +% There are potentially two points of intersection given by +% p = p1 + mu1 (p2 - p1) +% p = p1 + mu2 (p2 - p1) +% Return FALSE if the ray doesn't intersect the sphere. +% */ +% int RaySphere(XYZ p1,XYZ p2,XYZ sc,double r,double *mu1,double *mu2) +% { +% double a,b,c; +% double bb4ac; +% XYZ dp; +% +% dp.x = p2.x - p1.x; +% dp.y = p2.y - p1.y; +% dp.z = p2.z - p1.z; +% a = dp.x * dp.x + dp.y * dp.y + dp.z * dp.z; +% b = 2 * (dp.x * (p1.x - sc.x) + dp.y * (p1.y - sc.y) + dp.z * (p1.z - sc.z)); +% c = sc.x * sc.x + sc.y * sc.y + sc.z * sc.z; +% c += p1.x * p1.x + p1.y * p1.y + p1.z * p1.z; +% c -= 2 * (sc.x * p1.x + sc.y * p1.y + sc.z * p1.z); +% c -= r * r; +% bb4ac = b * b - 4 * a * c; +% if (ABS(a) < EPS || bb4ac < 0) { +% *mu1 = 0; +% *mu2 = 0; +% return(FALSE); +% } +% +% *mu1 = (-b + sqrt(bb4ac)) / (2 * a); +% *mu2 = (-b - sqrt(bb4ac)) / (2 * a); +% +% return(TRUE); +% } +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkz@numlc{0} +\pgfkeys{ +/linecircle/.cd, + node/.code = \def\tkz@numlc{0}, + R/.code = \def\tkz@numlc{1}, + with nodes/.code = \def\tkz@numlc{2} + } +%<--------------------------------------------------------------------------–> +\def\tkzInterLC{\pgfutil@ifnextchar[{\tkz@InterLC}{% + \tkz@InterLC[]}} +\def\tkz@InterLC[#1](#2,#3)(#4,#5){% +\begingroup +\pgfkeys{/linecircle/.cd,node} +\pgfqkeys{/linecircle}{#1} +\ifcase\tkz@numlc% + % first case 0 +\tkzCalcLength(#4,#5) +\tkzInterLCR(#2,#3)(#4,\tkzLengthResult pt){% + tkzFirstPointResult}{tkzSecondPointResult} + \or% 1 +\tkzInterLCR(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}% + \or% 2 +\tkzInterLCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}% +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzInterLCR(#1,#2)(#3,#4)#5#6{% +\begingroup + \tkz@radi=#4% + \tkz@@extractxy{#3} + \tkz@bx =\pgf@x\relax% + \tkz@by =\pgf@y\relax% + \tkz@Projection(#1,#2)(#3){tkz@pth} + \tkz@@CalcLength(#3,tkz@pth){tkz@mathLen} + \ifdim\tkz@mathLen pt<0.05pt\relax% + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% + \tkzpointborderellipse{\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\pgfpoint{\tkz@radi}{\tkz@radi}} + \tkz@ax=\pgf@x\relax% + \tkz@ay=\pgf@y\relax% + \advance\tkz@bx by\tkz@ax\relax% + \advance\tkz@by by\tkz@ay\relax% + \path[coordinate] (\tkz@bx,\tkz@by) coordinate (#6); + \tkzCSym(#3)(#6){#5} + \else + \FPdiv\pgfmathresult{\tkz@mathLen}{\pgfmath@tonumber{\tkz@radi}} + %\pgfmathparse{\tkz@mathLen / \tkz@radi} + \pgfmathacos@{\pgfmathresult}% + \let\tkz@angle\pgfmathresult% + \pgfpointdiff{\pgfpointanchor{#3}{center}}% + {\pgfpointanchor{tkz@pth}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% + \tkzpointborderellipse{\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\pgfpoint{\tkz@radi}{\tkz@radi}} + \tkz@ax =\pgf@x\relax% + \tkz@ay =\pgf@y\relax% + \advance\tkz@bx by\tkz@ax\relax% + \advance\tkz@by by\tkz@ay\relax% + \tkz@@extractxy{#3} + \tkz@ax =\pgf@x\relax% + \tkz@ay =\pgf@y\relax% + \tkz@@extractxy{tkz@pth} + %\ifdim\pgf@y<\tkz@ay \edef\tkz@angle{-\tkz@angle}% + % \fi + \tkzmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}% + {\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\tkz@angle} + \path[coordinate] (\pgf@x,\pgf@y) coordinate (#5); + \tkzmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}% + {\pgfpoint{\tkz@ax}{\tkz@ay}}% + {-\tkz@angle} + \path[coordinate] (\pgf@x,\pgf@y) coordinate (#6); + \fi + \endgroup +} +%<--------------------------------------------------------------------------–> +% intersection de Ligne Cercle +% #4 center #5 point sur le cercle +%<--------------------------------------------------------------------------–> +% \def\tkzInterLC(#1,#2)(#3,#4)#5#6{% +% \begingroup +% \tkzCalcLength(#3,#4)\tkzGetLength{tkz@rad} +% \tkzInterLCR(#1,#2)(#3,\tkz@rad pt){#5}{#6} +% \endgroup +% } +%<--------------------------------------------------------------------------–> +% intersection de Ligne Cercle rayon inconnu +%<--------------------------------------------------------------------------–> +\def\tkzInterLCWithNodes(#1,#2)(#3,#4,#5)#6#7{% +\begingroup + \tkzCalcLength(#4,#5)\tkzGetLength{tkz@radius} + \tkzInterLCR(#1,#2)(#3,\tkz@radius pt){#6}{#7} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Intersection de deux cercles +%<--------------------------------------------------------------------------–> +\def\tkz@numcc{0} +\pgfkeys{ +/circlecircle/.cd, + node/.code = {\global\def\tkz@numcc{0}}, + R/.code = {\global\def\tkz@numcc{1}}, + with nodes/.code = {\global\def\tkz@numcc{2}} +} +%<--------------------------------------------------------------------------–> +\def\tkzInterCC{\pgfutil@ifnextchar[{\tkz@InterCC}{% + \tkz@InterCC[]}} +\def\tkz@InterCC[#1](#2,#3)(#4,#5){% +\begingroup +\pgfkeys{/circlecircle/.cd,node} +\pgfqkeys{/circlecircle}{#1} +\ifcase\tkz@numcc% + % first case 0 +\tkz@save@length + \tkzCalcLength(#2,#3)\tkzGetLength{tkz@rayA} + \tkzCalcLength(#4,#5)\tkzGetLength{tkz@rayB} +\tkz@restore@length + \tkzInterCCR(#2,\tkz@rayA pt)(#4,\tkz@rayB pt){tkzFirstPointResult}{% + tkzSecondPointResult} + \or% 1 + \tkzInterCCR(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}% + \or%2 +\tkzInterCCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult} + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> + +% méthode +% /* circle_circle_intersection() * +% * Determine the points where 2 circles in a common plane intersect. +% * +% * int circle_circle_intersection( +% * // center and radius of 1st circle +% * double x0, double y0, double r0, +% * // center and radius of 2nd circle +% * double x1, double y1, double r1, +% * // 1st intersection point +% * // 2nd intersection point +% * +% * This is a public domain work. 3/26/2005 Tim Voght +% * +% int circle_circle_intersection(double x0, double y0, double r0, +% double x1, double y1, double r1, +% double *xi, double *yi, +% double *xi_prime, double *yi_prime) +% { +% double a, dx, dy, d, h, rx, ry; +% double x2, y2; +% +% /* dx and dy are the vertical and horizontal distances between +% * the circle centers. +% */ +% dx = x1 - x0; +% dy = y1 - y0; +% +% /* Determine the straight-line distance between the centers. */ +% //d = sqrt((dy*dy) + (dx*dx)); +% d = hypot(dx,dy); // Suggested by Keith Briggs +% +% /* Check for solvability. */ +% if (d > (r0 + r1)) +% { +% /* no solution. circles do not intersect. */ +% return 0; +% } +% if (d < fabs(r0 - r1)) +% { +% /* no solution. one circle is contained in the other */ +% return 0; +% } +% +% /* 'point 2' is the point where the line through the circle +% * intersection points crosses the line between the circle +% * centers. +% */ +% +% /* Determine the distance from point 0 to point 2. */ +% a = ((r0*r0) - (r1*r1) + (d*d)) / (2.0 * d) ; +% +% /* Determine the coordinates of point 2. */ +% x2 = x0 + (dx * a/d); +% y2 = y0 + (dy * a/d); +% +% /* Determine the distance from point 2 to either of the +% * intersection points. +% */ +% h = sqrt((r0*r0) - (a*a)); +% +% /* Now determine the offsets of the intersection points from +% * point 2. +% */ +% rx = -dy * (h/d); +% ry = dx * (h/d); +% +% /* Determine the absolute intersection points. */ +% *xi = x2 + rx; +% *xi_prime = x2 - rx; +% *yi = y2 + ry; +% *yi_prime = y2 - ry; +% +% return 1; +% } + +\def\tkzInterCCR(#1,#2)(#3,#4)#5#6{% +\begingroup +\tkz@save@length +\tkzCalcLength(#1,#3)\tkzGetLength{tkz@dd} +\tkz@restore@length +\pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}} +\tkz@ax\pgf@x % +\tkz@ay\pgf@y % +\pgfextractx{\pgf@x}{\pgfpointanchor{#3}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#3}{center}} +\tkz@bx\pgf@x % +\tkz@by\pgf@y % +\tkz@cx#2 % +\tkz@cy#4 % +\FPeval\tkz@aa{((\pgf@sys@tonumber{\tkz@cx}+\pgf@sys@tonumber{\tkz@cy})/(2*\tkz@dd))*(\pgf@sys@tonumber{\tkz@cx}-\pgf@sys@tonumber{\tkz@cy})+\tkz@dd/2} + +\FPeval\tkz@xx{\pgf@sys@tonumber{\tkz@ax}+\tkz@aa/\tkz@dd*(\pgf@sys@tonumber{\tkz@bx} - \pgf@sys@tonumber{\tkz@ax})} +\FPeval\tkz@yy{\pgf@sys@tonumber{\tkz@ay}+\tkz@aa/\tkz@dd*(\pgf@sys@tonumber{\tkz@by} - \pgf@sys@tonumber{\tkz@ay})} +\path[coordinate](\tkz@xx pt,\tkz@yy pt) coordinate (tkzRadialCenter); +\FPeval\tkz@hh{(\pgf@sys@tonumber{\tkz@cx}+\tkz@aa)*(\pgf@sys@tonumber{\tkz@cx}-\tkz@aa)} +\FPpow\tkz@hh{\tkz@hh}{0.5} +\FPeval\tkz@rx{\tkz@hh / \tkz@dd * (\pgf@sys@tonumber{\tkz@ay} - \pgf@sys@tonumber{\tkz@by}) } +\FPeval\tkz@ry{\tkz@hh / \tkz@dd * (\pgf@sys@tonumber{\tkz@bx} - \pgf@sys@tonumber{\tkz@ax}) } +\FPadd\tkz@xs{\tkz@xx}{\tkz@rx } +\FPadd\tkz@ys{\tkz@yy}{\tkz@ry } +\path[coordinate](\tkz@xs pt,\tkz@ys pt) coordinate (#5); +\FPadd\tkz@xss{\tkz@xx}{-\tkz@rx } +\FPadd\tkz@yss{\tkz@yy}{-\tkz@ry } +\path[coordinate](\tkz@xss pt,\tkz@yss pt) coordinate (#6); +\endgroup +} +%<--------------------------------------------------------------------------–> +% #2 node #3 node #4 node #5 node +% \def\tkzInterCC(#1,#2)(#3,#4)#5#6{% +% \begingroup +% \tkzCalcLength(#1,#2)\tkzGetLength{tkz@rayA} +% \tkzCalcLength(#3,#4)\tkzGetLength{tkz@rayB} +% \tkzInterCCR(#1,\tkz@rayA pt)(#3,\tkz@rayB pt){#5}{#6} +% \endgroup +% } +%<--------------------------------------------------------------------------–> +% Intersection de deux cercles Avec deux points +%<--------------------------------------------------------------------------–> +% la première variante devrait être #2 #3 avec #4 #5 +\def\tkzInterCCWithNodes(#1,#2,#3)(#4,#5,#6)#7#8{% +\begingroup + \tkzCalcLength(#2,#3)\tkzGetLength{tkz@rayA} + \tkzCalcLength(#5,#6)\tkzGetLength{tkz@rayB} + \tkzInterCCR(#1,\tkz@rayA pt)(#4,\tkz@rayB pt){#7}{#8} +\endgroup +} + +%<--------------------------------------------------------------------------–> +% tangente à cercle passant par un point donné +%<--------------------------------------------------------------------------–> +\def\tkzTgtFromPR(#1,#2)(#3){% + \begingroup + \tkzDefMidPoint(#1,#3) + \tkzCalcLength(tkzPointResult,#1) + \tkzInterCCR(#1,#2)(tkzPointResult,\tkzLengthResult pt){% + tkzFirstPointResult}{% + tkzSecondPointResult}% + \endgroup +} + +\def\tkzTgtFromP(#1,#2)(#3){% + \begingroup + \tkzDefMidPoint(#1,#3) + \tkzCalcLength(#1,#2)\tkzGetLength{tkz@radone}% + \tkzCalcLength(tkzPointResult,#1)\tkzGetLength{tkz@radtwo}% + \tkzInterCCR(#1,\tkz@radone pt)(tkzPointResult,\tkz@radtwo pt){% + tkzFirstPointResult}{% + tkzSecondPointResult}% + \endgroup +} +\def\tkzTgtAt(#1)(#2){% +\begingroup + \tkz@VecKOrthNorm[-1](#2,#1){tkzPointResult} + \endgroup +} %<--------------------------------------------------------------------------–> %<--------------------------------------------------------------------------–> +\def\tkz@numtang{0} +\pgfkeys{ +/tang/.cd, +at/.code = {\global\def\tkz@numtang{0}\global\def\tkz@ptat{#1}}, +from/.code = {\global\def\tkz@numtang{1}\global\def\tkz@ptfrom{#1}}, +from with R/.code = {\global\def\tkz@numtang{2}\global\def\tkz@ptfrom{#1}}} +%<--------------------------------------------------------------------------–> +\def\tkzTangent{\pgfutil@ifnextchar[{\tkz@Tangent}{\tkz@Tangent[]}} + +\def\tkz@Tangent[#1](#2){% +\begingroup +\pgfkeys{tang/.cd} +\pgfqkeys{/tang}{#1} +\ifcase\tkz@numtang + \tkzTgtAt(#2)(\tkz@ptat) +\or + \tkzTgtFromP(#2)(\tkz@ptfrom) + \or + \tkzTgtFromPR(#2)(\tkz@ptfrom) +\fi +\endgroup +} + +\endinput \ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-transformations.tex b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-transformations.tex new file mode 100644 index 00000000000..fd7b14f112c --- /dev/null +++ b/Master/texmf-dist/tex/latex/tkz-euclide/tkz-tools-transformations.tex @@ -0,0 +1,525 @@ +% 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{1.16 c} +\def\filedate{2011/06/01} + + +%<--------------------------------------------------------------------------–> +% Transformations Géométriques +%<--------------------------------------------------------------------------–> +\def\tkz@numtrsf{0} +\pgfkeys{/tkzDefPointBy/.cd, +translation/.code args={from #1 to #2}{% + \global\def\tkzfrom{#1}% + \global\def\tkzto{#2}% + \global\def\tkz@numtrsf{0}}, + homothety/.code args={center #1 ratio #2}{% + \global\def\tkzcenter{#1}% + \global\def\tkzratio{#2}% + \global\def\tkz@numtrsf{1}}, + reflection/.code args={over #1--#2}{% + \global\def\tkzdeb{#1}% + \global\def\tkzfin{#2}% + \global\def\tkz@numtrsf{2}}, + symmetry/.code args={center #1}{% + \global\def\tkzcenter{#1}% + \global\def\tkz@numtrsf{3}}, + projection/.code args={onto #1--#2}{% + \global\def\tkzdeb{#1}% + \global\def\tkzfin{#2}% + \global\def\tkz@numtrsf{4}}, + rotation/.code args={center #1 angle #2}{% + \global\def\tkzcenter{#1}% + \global\def\tkzangle{#2}% + \global\def\tkz@numtrsf{5}}, + rotation in rad/.code args={center #1 angle #2}{% + \global\def\tkzcenter{#1}% + \global\def\tkzangle{#2}% + \global\def\tkz@numtrsf{6}}, +inversion/.code args={center #1 through #2}{% + \global\def\tkzcenter{#1}% + \global\def\tkzpoint{#2}% + \global\def\tkz@numtrsf{7}} +} +%<--------------------------------------------------------------------------–> +\def\tkzDefPointsBy{\pgfutil@ifnextchar[{\tkz@DefPointsBy}{% + \tkz@DefPointsBy[]}} +\def\tkz@DefPointsBy[#1](#2)#3{% +\begingroup +\pgfqkeys{/tkzDefPointBy}{#1} +\ifcase\tkz@numtrsf% + % first case 0 + \tkzTranslation(\tkzfrom,\tkzto)(#2){#3} + \or% 1 + \tkzHomo(\tkzcenter,\tkzratio)(#2){#3} + \or% 2 + \tkzSymOrth(\tkzdeb,\tkzfin)(#2){#3} + \or% 3 + \tkzCSym(\tkzcenter)(#2){#3} + \or% 4 + \tkzProjection(\tkzdeb,\tkzfin)(#2){#3} + \or% 5 + \tkzRotateAngle(\tkzcenter,\tkzangle)(#2){#3} + \or% 6 + \tkzRotateInRad(\tkzcenter,\tkzangle)(#2){#3} + \or% 7 + \tkzInversePoint(\tkzcenter,\tkzpoint)(#2){#3} +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzDefPointBy{\pgfutil@ifnextchar[{\tkz@DefPointBy}{% + \tkz@DefPointBy[]}} +\def\tkz@DefPointBy[#1](#2){% +\begingroup +\pgfqkeys{/tkzDefPointBy}{#1} + \ifcase\tkz@numtrsf% +% % first case 0 + \tkzUTranslation(\tkzfrom,\tkzto)(#2) + \or% 1 + \tkzUHomo(\tkzcenter,\tkzratio)(#2) +\or% 2 +\tkzUSymOrth(\tkzdeb,\tkzfin)(#2) +\or% 3 +\tkzUCSym(\tkzcenter)(#2) +\or% 4 +\tkzUProjection(\tkzdeb,\tkzfin)(#2) +\or% 5 +\tkzURotateAngle(\tkzcenter,\tkzangle)(#2) + \or% 6 +\tkzURotateInRad(\tkzcenter,\tkzangle)(#2) + \or% 7 +\tkzUInversePoint(\tkzcenter,\tkzpoint)(#2) +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\ExtractPoint#1,#2\@nil{% +\global\edef\tkz@LastList{#2} +\global\edef\tkz@FirstPoint{#1} +} +\def\FirstPointInList#1{% +\edef\tkz@templist{#1,} +\expandafter\ExtractPoint\tkz@templist\@nil +} +%<--------------------------------------------------------------------------–> +% Translation par rapport à un point +%<--------------------------------------------------------------------------–> +\def\tkzTranslation(#1,#2)(#3)#4{% +\begingroup +\global\def\tkz@LastList{#4} + \foreach\PointTR in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \global\edef\tkz@pointtsf{\PointTR '} + \else + \global\edef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkzVecKCoLinear(#1,#2,\PointTR){\tkz@pointtsf}% +} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzUTranslation(#1,#2)(#3){% +\begingroup + \tkzVecKCoLinear(#1,#2,#3){tkzPointResult}% +\endgroup +} + +%<--------------------------------------------------------------------------–> +% Symétrie par rapport à un point Homo with (-1) +% #2 le centre #3 l'antécédent +%<--------------------------------------------------------------------------–> +\def\tkzCSym(#1)(#2)#3{% +\begingroup +\global\def\tkz@LastList{#3} + \foreach\PointCS in {#2}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \global\edef\tkz@pointtsf{\PointCS '} + \else + \global\edef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{\PointCS}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% + \path(#1)--++(-\tkz@ax,-\tkz@ay)coordinate (\tkz@pointtsf); +} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzUCSym(#1)(#2){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% + \path(#1)--++(-\tkz@ax,-\tkz@ay)coordinate (tkzPointResult); +\endgroup +} +%<--------------------------------------------------------------------------–> +% Symétrie orthogonale par rapport à une droite +%<--------------------------------------------------------------------------–> +\def\tkzSymOrth(#1,#2)(#3)#4{% +\begingroup +\global\def\tkz@LastList{#4} + \foreach\PointSO in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \global\edef\tkz@pointtsf{\PointSO '} + \else + \global\edef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \path[coordinate]% + (\PointSO)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \tkzInterLL(#1,#2)(\PointSO,tkz@point)\tkzGetPoint{tkzPointofSym} + \tkz@VecK[2](\PointSO,tkzPointofSym){\tkz@pointtsf} +} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzUSymOrth(#1,#2)(#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \path[coordinate]% + (#3)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \tkzInterLL(#1,#2)(#3,tkz@point)\tkzGetPoint{tkzPointofSym} + \tkz@VecK[2](#3,tkzPointofSym){tkzPointResult} +\endgroup +} + +%<--------------------------------------------------------------------------–> +% Projection orthogonale sur une droite +%<--------------------------------------------------------------------------–> +\def\tkzProjection(#1,#2)(#3)#4{% +\begingroup +\global\def\tkz@LastList{#4} + \foreach\PointPJ in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \global\edef\tkz@pointtsf{\PointPJ '} + \else + \global\edef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkzUProjection(#1,#2)(\PointPJ) + \tkzGetPoint{\tkz@pointtsf} + } +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzUProjection(#1,#2)(#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \path[coordinate](#3)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \tkzInterLL(#1,#2)(#3,tkz@point)% définit tkzPointResult +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkz@Projection(#1,#2)(#3)#4{% +\begingroup + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \path[coordinate](#3)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \tkz@InterLL(#1,#2)(#3,tkz@point){#4}% définit tkzPointResult +\endgroup +} +%<--------------------------------------------------------------------------–> +% Homothétie par rapport à un point +%<--------------------------------------------------------------------------–> +\def\tkzHomo(#1,#2)(#3)#4{% +\begingroup +\global\def\tkz@LastList{#4} + \foreach\PointHO in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \global\edef\tkz@pointtsf{\PointHO '} + \else + \global\edef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{\PointHO}{center}}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgfmathparse{#2}\edef\tkz@coeff{\pgfmathresult}% + \path[coordinate](#1)--++(\tkz@coeff\pgf@xa,\tkz@coeff\pgf@ya)% + coordinate(\tkz@pointtsf); + } +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzUHomo(#1,#2)(#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#3}{center}}% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \pgfmathparse{#2}\edef\tkz@coeff{\pgfmathresult}% + \path[coordinate](#1)--++(\tkz@coeff\pgf@xa,\tkz@coeff\pgf@ya)% + coordinate(tkzPointResult); +\endgroup +} +%<--------------------------------------------------------------------------–> +% rotation en degré +%<--------------------------------------------------------------------------–> +\def\tkzRotateAngle(#1,#2)(#3)#4{% +\begingroup +\global\def\tkz@LastList{#4} + \foreach\PointRot in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \global\edef\tkz@pointtsf{\PointRot '} + \else + \global\edef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkz@@extractxy{\PointRot} + \global\tkz@ax\pgf@x% + \global\tkz@ay\pgf@y% + \tkz@@extractxy{#1} + \global\tkz@bx\pgf@x% + \global\tkz@by\pgf@y% + \tkzmathrotatepointaround{\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\pgfpoint{\tkz@bx}{\tkz@by}}% + {#2} + \global\tkz@bx\pgf@x% + \global\tkz@by\pgf@y% + \path[coordinate](\tkz@bx,\tkz@by)coordinate(\tkz@pointtsf);% + } + \endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzURotateAngle(#1,#2)(#3){% +\begingroup + \tkz@@extractxy{#3} + \global\tkz@ax\pgf@x% + \global\tkz@ay\pgf@y% + \tkz@@extractxy{#1} + \global\tkz@bx\pgf@x% + \global\tkz@by\pgf@y% + \tkzmathrotatepointaround{\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\pgfpoint{\tkz@bx}{\tkz@by}}% + {#2} + \global\tkz@bx\pgf@x% + \global\tkz@by\pgf@y% + \path[coordinate](\tkz@bx,\tkz@by)coordinate(tkzPointResult);% + \endgroup +} +%<--------------------------------------------------------------------------–> +% % rotation en radian +% %<--------------------------------------------------------------------------–> +\def\tkzRotateInRad(#1,#2)(#3)#4{% +\begingroup +\global\def\tkz@LastList{#4} + \foreach\PointRot in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \global\edef\tkz@pointtsf{\PointRot '} + \else + \global\edef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \pgfmathparse{#2 r} + \let\tkz@Angle\pgfmathresult + \tkz@@extractxy{\PointRot} + \tkz@ax\pgf@x% + \tkz@ay\pgf@y% + \tkz@@extractxy{#1} + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \tkzmathrotatepointaround{\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\pgfpoint{\tkz@bx}{\tkz@by}}% + {\tkz@Angle} + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \path[coordinate](\tkz@bx,\tkz@by)coordinate(\tkz@pointtsf); +} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzURotateInRad(#1,#2)(#3){% +\begingroup + \pgfmathparse{#2 r} + \let\tkz@Angle\pgfmathresult + \tkz@@extractxy{#3} + \tkz@ax\pgf@x% + \tkz@ay\pgf@y% + \tkz@@extractxy{#1} + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \tkzmathrotatepointaround{\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\pgfpoint{\tkz@bx}{\tkz@by}}% + {\tkz@Angle} + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \path[coordinate](\tkz@bx,\tkz@by)coordinate(tkzPointResult); +\endgroup +} +%<--------------------------------------------------------------------------–> +% Inverse of a point +%<--------------------------------------------------------------------------–> +\def\tkzInversePoint(#1,#2)(#3)#4{% +\begingroup +\global\def\tkz@LastList{#4} + \foreach\PointIP in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \global\edef\tkz@pointtsf{\PointIP '} + \else + \global\edef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkzCalcLength[cm](#1,#2)\tkzGetLength{tkz@lna}% + \tkzCalcLength[cm](#1,\PointIP)\tkzGetLength{tkz@lnb}% + \FPeval\tkz@lnc{\tkz@lna/\tkz@lnb*\tkz@lna} + \tkzVecKNorm[\tkz@lnc](#1,\PointIP){tkzPointResult} + } +\endgroup +} \def\tkzUInversePoint(#1,#2)(#3){% +\begingroup + \tkzCalcLength[cm](#1,#2)\tkzGetLength{tkz@lna}% + \tkzCalcLength[cm](#1,#3)\tkzGetLength{tkz@lnb}% + \FPeval\tkz@lnc{\tkz@lna/\tkz@lnb*\tkz@lna} + \tkzVecKNorm[\tkz@lnc](#1,#3){tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Fin des transformations +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% The SHOW +%<--------------------------------------------------------------------------–> +\def\tkz@numst{0} +\pgfkeys{/showtsf/.cd, + reflection/.code args={over #1--#2}{% + \def\tkzdeb{#1} + \def\tkzfin{#2} + \def\tkz@numst{0}}, + symmetry/.code args={center #1}{% + \def\tkzcenter{#1} + \def\tkz@numst{1}}, + projection/.code args={onto #1--#2}{% + \def\tkzdeb{#1} + \def\tkzfin{#2} + \def\tkz@numst{2}}, +translation/.code args={from #1 to #2}{% + \def\tkzfrom{#1}% + \def\tkzto{#2}% + \def\tkz@numst{3}}, + K/.code = \def\tkz@koeff{#1}, + length/.code = \def\tkz@show@length{#1}, + ratio/.code = \def\tkz@show@ratio{#1}, + gap/.code = \def\tkz@show@gap{#1}, + size/.code = \def\tkz@show@size{#1}, +/showtsf/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, + /compass/\searchname/.retry=#1, + /tikz/\searchname/.retry=#1}} +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzShowTransformation{\pgfutil@ifnextchar[{\tkz@ShowTransformation}{% + \tkz@ShowTransformation[]}} +\def\tkz@ShowTransformation[#1](#2){% +\begingroup + \pgfqkeys{/showtsf}{K=1,gap=2,size=1,ratio=.5,length=1} + \pgfqkeys{/showtsf}{#1} +\ifcase\tkz@numst% + % first case 0 + \tkzShowSymOrth[#1](\tkzdeb,\tkzfin)(#2) + \or% 1 + \tkzShowCSym[#1](\tkzcenter)(#2) + \or% 2 + \tkzShowProjection[#1](\tkzdeb,\tkzfin)(#2) + \or% 3 + \tkzShowTranslation[#1](\tkzfrom,\tkzto)(#2) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzShowTranslation{\pgfutil@ifnextchar[{\tkz@ShowTranslation}{% + \tkz@ShowTranslation[]}} + +\def\tkz@ShowTranslation[#1](#2,#3)(#4){% +\begingroup +\tkz@VecKCoLinear[1](#2,#3,#4){tkz@lltmp} +\tkzCompass[#1](#4,tkz@lltmp) +\tkzCompass[#1,length=\tkz@show@ratio*\tkz@show@length](#3,tkz@lltmp) +\endgroup} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzShowSymOrth{\pgfutil@ifnextchar[{\tkz@ShowSymOrth}{% + \tkz@ShowSymOrth[]}} +\def\tkz@ShowSymOrth[#1](#2,#3)(#4){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \path[coordinate](#4)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \tkzInterLL(#2,#3)(#4,tkz@point) \tkzGetPoint{tkzPointofSym} + \tkz@VecK[2](#4,tkzPointofSym){tkz@pointtsf} + \tkzCompass[#1](#2,#4) + \tkzCompass[#1,length=\tkz@show@ratio*\tkz@show@length](#3,#4) + \tkzCompass[#1](#2,tkz@pointtsf) + \tkzCompass[#1,length=\tkz@show@ratio*\tkz@show@length](#3,tkz@pointtsf) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzShowCSym{\pgfutil@ifnextchar[{\tkz@ShowCSym}{\tkz@ShowCSym[]}} + +\def\tkz@ShowCSym[#1](#2)(#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% +\path[coordinate](#2)--++(-\tkz@ax,-\tkz@ay) coordinate (tkz@pointtsf); + \tkzCompass[#1](#2,tkz@pointtsf) + \tkzCompass[#1](#2,#3) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzShowProjection{\pgfutil@ifnextchar[{\tkz@ShowProjection}{% + \tkz@ShowProjection[]}} +\def\tkz@ShowProjection[#1](#2,#3)(#4){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \path[coordinate](#4)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \tkzInterLL(#2,#3)(#4,tkz@point)\tkzGetPoint{tkz@pointtsf} + \tkz@VecKCoLinear[1](#2,#3,tkz@pointtsf){SO@tmp1} + \tkz@VecKCoLinear[-1](#2,#3,tkz@pointtsf){SO@tmp2} + \tkz@VecKNorm[\tkz@show@size](tkz@pointtsf,SO@tmp1){SO@1} + \tkz@VecKNorm[\tkz@show@size](tkz@pointtsf,SO@tmp2){SO@2} + \tkz@VecKNorm[-\tkz@show@gap](tkz@pointtsf,#4){SO@3} + \tkzCompass[#1](#4,SO@1) + \tkzCompass[#1](#4,SO@2) + \tkzCompass[#1](SO@1,SO@3) + \tkzCompass[#1,length=\tkz@show@ratio*\tkz@show@length](SO@2,SO@3) +\endgroup +} + +\endinput \ No newline at end of file -- cgit v1.2.3