diff options
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua')
5 files changed, 1878 insertions, 0 deletions
diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-circles.tex new file mode 100644 index 0000000000..9be8dd8be7 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-circles.tex @@ -0,0 +1,223 @@ +% tkz-obj-lua-circles.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-lua-circles.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% tkzCircle center and one point +%<--------------------------------------------------------------------------–> +% attention radius circle is defined by center and a point on the circle +% R defined by center and the value of the radius +% no need to define a circle with R tikz uses this method. +% through instead of radius +\def\tkz@numc{0} +\pgfkeys{/tkzcircle/.cd, + R/.code = \def\tkz@numc{0}, + diameter/.code = \def\tkz@numc{1}, + circum/.code = \def\tkz@numc{2}, + in/.code = \def\tkz@numc{3}, + ex/.code = \def\tkz@numc{4}, + euler/.code = \def\tkz@numc{5}, + nine/.code = \def\tkz@numc{5}, + apollonius/.code = \def\tkz@numc{6}, + spieker/.code = \def\tkz@numc{7}, + orthogonal from/.code args = {#1}{\gdef\tkz@numc{8} + \def\tkz@ptfrom{#1}}, + orthogonal through/.code args = {#1 and #2}{\gdef\tkz@numc{9} + \def\tkz@ptone{#1} + \def\tkz@pttwo{#2}}, + K/.code = \def\tkz@koeff{#1}, + K = 1, + circum + } +\def\tkzDefCircle{\pgfutil@ifnextchar[{\tkz@DefCircle}{\tkz@DefCircle[]}} +\def\tkz@DefCircle[#1](#2){% +\begingroup +\pgfqkeys{/tkzcircle}{#1} +\ifcase\tkz@numc% + \tkzDefCircleR(#2) + \or% 1 + \tkzDefCircleD(#2) + \or% 2 + \tkzDefCircumCircle(#2) + \or% 3 + \tkzDefInCircle(#2) + \or% 4 + \tkzDefExCircle(#2) + \or% 5 + \tkzDefEulerCircle(#2) + \or% 6 + \tkzDefApolloniusCircle(#2) + \or% 7 + \tkzDefSpiekerCircle(#2) + \or% 8 + \tkzDefOrthogonalCircle(#2,\tkz@ptfrom) + \or% 9 + \tkzDefOrthoThroughCircle(#2,\tkz@ptone,\tkz@pttwo) + \fi +\endgroup +} +%for compatibility +%<--------------------------------------------------------------------------–> +% R +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleR(#1,#2){% +\begingroup + \edef\tkzLengthResult{\fpeval{round(#2,5)}} + \global\let\tkzLengthResult\tkzLengthResult + \path (#1)--++(\tkzLengthResult,0) coordinate (tkzSecondPointResult); + \tkzRenamePoint(tkzSecondPointResult){tkzPointResult} +\endgroup +} + +%<--------------------------------------------------------------------------–> +% Diameter Circle +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleD(#1,#2){% +\begingroup + \tkzDefMidPoint(#1,#2) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \pgfnodealias{tkzSecondPointResult}{#2} + \tkz@@CalcLengthcm(#1,tkzPointResult){tkzLengthResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Circum Circle +%<--------------------------------------------------------------------------–> +\def\tkzDefCircumCircle(#1,#2,#3){% +\begingroup + \tkzCircumCenter(#1,#2,#3) + \tkzRenamePoint(tkzPointResult){tkzFirstPointResult} + \tkzRenamePoint(#1){tkzSecondPointResult} + \tkz@@CalcLengthcm(#1,tkzPointResult){tkzLengthResult}%3.06 add [cm] +\endgroup +} +%<--------------------------------------------------------------------------–> +% In(scribe) Circle +%<--------------------------------------------------------------------------–> +\def\tkzDefInCircle(#1,#2,#3){% +\begingroup + \tkzInCenter(#1,#2,#3) + \pgfnodealias{tkz@incenter}{tkzPointResult} + \tkzUProjection(#1,#3)(tkz@incenter) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \tkz@@CalcLengthcm(tkzPointResult,tkz@incenter){tkzLengthResult} + \pgfnodealias{tkzPointResult}{tkz@incenter} + \pgfnodealias{tkzFirstPointResult}{tkz@incenter} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Ex(scribe) Circle +%<--------------------------------------------------------------------------–> +\def\tkzDefExCircle(#1,#2,#3){% +\begingroup + \tkzExCenter(#1,#2,#3) + \pgfnodealias{tkz@excenter}{tkzPointResult} + \tkzUProjection(#1,#3)(tkz@excenter) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \tkz@@CalcLengthcm(tkzPointResult,tkz@excenter){tkzLengthResult}% for tkzGetLength + \pgfnodealias{tkzPointResult}{tkz@excenter} + \pgfnodealias{tkzFirstPointResult}{tkz@excenter} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Radius Ex Circle +%<--------------------------------------------------------------------------–> +\def\tkzDefExRadius(#1,#2,#3){% +\begingroup + \tkzExCenter(#1,#2,#3) + \tkzUProjection(#1,#3)(tkzPointResult) +\endgroup +} +%<--------------------------------------------------------------------------–> +% The nine-point circle, also called Euler's circle or the Feuerbach circle +% best way Ma,Mb,Mc circum center 2020 +%<--------------------------------------------------------------------------–> +\def\tkzDefEulerCircle(#1,#2,#3){% +\begingroup + \tkzDefMidPoint(#1,#2) \pgfnodealias{tkz@e1}{tkzPointResult} + \tkzDefMidPoint(#2,#3) \pgfnodealias{tkz@e2}{tkzPointResult} + \tkzDefMidPoint(#1,#3) \pgfnodealias{tkz@e3}{tkzPointResult} + \tkzCircumCenter(tkz@e1,tkz@e2,tkz@e3) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzRenamePoint(tkz@e1){tkzSecondPointResult} + \tkz@@CalcLengthcm(tkzPointResult,tkz@e1){tkzLengthResult} +\endgroup +} +\let\tkzDefNinePointsCircle\tkzEulerCircle% +\let\tkzFeuerBachCircle\tkzEulerCircle% + +\def\tkzDefEulerRadius(#1,#2,#3){% +\begingroup + \tkzEulerCenter(#1,#2,#3) + \pgfnodealias{eur@pta}{tkzPointResult} + \tkzDefMidPoint(#1,#2) + \tkz@@CalcLengthcm(eur@pta,tkzPointResult){tkzLengthResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Apollonius circle +%<--------------------------------------------------------------------------–> +\def\tkzDefApolloniusCircle(#1,#2){% +\begingroup + \tkzDefBarycentricPointTwo(#1,1,#2,\tkz@koeff) + \pgfnodealias{apo@pta}{tkzPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \tkzDefBarycentricPointTwo(#1,1,#2,-\tkz@koeff) + \pgfnodealias{apo@ptb}{tkzPointResult} + \tkzDefMidPoint(apo@pta,apo@ptb) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkz@@CalcLengthcm(tkzFirstPointResult,apo@pta){tkzLengthResult} + \pgfnodealias{tkzThirdPointResult}{apo@ptb} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefOrthogonalCircle(#1,#2,#3){% +\begingroup + \tkzTgtFromP(#1,#2)(#3) + \tkz@@CalcLengthcm(#1,tkzFirstPointResult){tkzLengthResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefOrthoThroughCircle(#1,#2,#3,#4){% +\begingroup + \tkz@@CalcLengthcm(#1,#3){tkz@lnb}% + \edef\tkz@lnc{\fpeval{1/\tkz@lnb}} + \tkzVecKNorm[\tkz@lnc](#1,#3) + \pgfnodealias{tkz@PointResult}{tkzPointResult} + \tkzCircumCenter(tkz@PointResult,#3,#4) + \tkz@@CalcLengthcm(tkzPointResult,#3){tkzLengthResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \pgfnodealias{tkzSecondPointResult}{#3} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Spieker Circle +%<--------------------------------------------------------------------------–> +\def\tkzDefSpiekerCircle(#1,#2,#3){% +\begingroup + \tkzSpiekerCenter(#1,#2,#3) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzUProjection(tkz@m1,tkz@m2)(tkzPointResult) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \tkz@@CalcLength(tkzSecondPointResult,tkzFirstPointResult){tkzLengthResult} +\endgroup +} +%<--------------------------------------------------------------------------–> + +%<--------------------------------------------------------------------------–> +% End Def Circle +%<--------------------------------------------------------------------------–> +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-by.tex new file mode 100644 index 0000000000..1db32f48bf --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-by.tex @@ -0,0 +1,522 @@ +% tkz-tools-lua-points-by.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-tools-lua-points-by.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% Transformations Géométriques +%<--------------------------------------------------------------------------–> +\def\tkz@numtrsf{0} +\pgfkeys{/tkzDefPointBy/.cd, + translation/.code args={from #1 to #2}{ \def\tkzfrom{#1}% + \def\tkzto{#2}% + \def\tkz@numtrsf{0}}, + homothety/.code args={center #1 ratio #2}{ \def\tkzcenter{#1}% + \def\tkzratio{#2}% + \def\tkz@numtrsf{1}}, + reflection/.code args={over #1--#2}{ \def\tkzdeb{#1}% + \def\tkzfin{#2}% + \def\tkz@numtrsf{2}}, + symmetry/.code args={center #1}{ \def\tkzcenter{#1}% + \def\tkz@numtrsf{3}}, + projection/.code args={onto #1--#2}{ \def\tkzdeb{#1}% + \def\tkzfin{#2}% + \def\tkz@numtrsf{4}}, + rotation/.code args={center #1 angle #2}{ \def\tkzcenter{#1}% + \def\tkzangle{#2}% + \def\tkz@numtrsf{5}}, + rotation in rad/.code args={center #1 angle #2}{ \def\tkzcenter{#1}% + \def\tkzangle{#2}% + \def\tkz@numtrsf{6}}, + inversion/.code args={center #1 through #2}{ \def\tkzcenter{#1}% + \def\tkzpoint{#2}% + \def\tkz@numtrsf{7}}, + inversion negative/.code args={center #1 through #2}{ \def\tkzcenter{#1}% + \def\tkzpoint{#2}% + \def\tkz@numtrsf{8}}, + rotation with nodes/.code args={center #1 from #2 to #3}{ \def\tkzcenter{#1}% + \def\tkzfrom{#2}% + \def\tkzto{#3}% + \def\tkz@numtrsf{9}} +} +%<--------------------------------------------------------------------------–> +\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) +\or% 8 + \tkzUInverseNegativePoint(\tkzcenter,\tkzpoint)(#2) +\or% 9 + \tkzURotateWithNodes(\tkzcenter,\tkzfrom,\tkzto)(#2) +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +\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} + \or% 8 + \tkzInverseNegativePoint(\tkzcenter,\tkzpoint)(#2){#3} + \or% 9 + \tkzRotateWithNodes(\tkzcenter,\tkzfrom,\tkzto)(#2){#3} +\fi +\endgroup +} + +%<--------------------------------------------------------------------------–> + +\def\ExtractPoint#1,#2\@nil{% +\xdef\tkz@LastList{#2} +\xdef\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 +\gdef\tkz@LastList{#4} +\foreach\PT in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \def\tkz@pointtsf{\PT '} + \else + \def\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkz@VecCoLinear(#1,#2,\PT) + \pgfnodealias{\tkz@pointtsf}{tkzPointResult} + } +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzUTranslation(#1,#2)(#3){% +\begingroup + \tkz@VecCoLinear(#1,#2,#3)% +\endgroup +} + +%<--------------------------------------------------------------------------–> +% Symétrie par rapport à un point Homo with (-1) +% #2 le centre #3 l'antécédent +%<--------------------------------------------------------------------------–> +\def\tkzCSym(#1)(#2)#3{% +\begingroup +\gdef\tkz@LastList{#3} + \foreach\PointCS in {#2}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \xdef\tkz@pointtsf{\PointCS '} + \else + \xdef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{\PointCS}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% + \pgfinterruptboundingbox + \path(#1)--++(-\tkz@ax,-\tkz@ay)coordinate (\tkz@pointtsf); + \endpgfinterruptboundingbox +} +\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 +\gdef\tkz@LastList{#4} + \foreach\PointSO in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \def\tkz@pointtsf{\PointSO '} + \else + \def\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkzUSymOrth(#1,#2)(\PointSO) + \pgfnodealias{\tkz@pointtsf}{tkzPointResult} + } +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzUSymOrth(#1,#2)(#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \pgfinterruptboundingbox + \path[coordinate] (#3)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \endpgfinterruptboundingbox + \tkzInterLL(#1,#2)(#3,tkz@point) + \pgfnodealias{tkzPointofSym}{tkzPointResult} + \tkz@VecK[2](#3,tkzPointofSym) +\endgroup +} + +%<--------------------------------------------------------------------------–> +% Projection orthogonale sur une droite +%<--------------------------------------------------------------------------–> +\def\tkzProjection(#1,#2)(#3)#4{% +\begingroup +\gdef\tkz@LastList{#4} + \foreach\PointPJ in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \def\tkz@pointtsf{\PointPJ '} + \else + \def\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkzUProjection(#1,#2)(\PointPJ) + \pgfnodealias{\tkz@pointtsf}{tkzPointResult} + } +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzUProjection(#1,#2)(#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \pgfinterruptboundingbox + \path[coordinate](#3)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \tkzInterLL(#1,#2)(#3,tkz@point)% définit tkzPointResult + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkz@Projection(#1,#2)(#3)#4{% +\begingroup + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \tkz@ax =\pgf@y% + \tkz@ay =\pgf@x% + \pgfinterruptboundingbox + \path[coordinate](#3)--++(-\tkz@ax,\tkz@ay) coordinate (tkz@point); + \endpgfinterruptboundingbox + \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 +\gdef\tkz@LastList{#4} +\foreach\PointHO in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \xdef\tkz@pointtsf{\PointHO '} + \else + \xdef\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}% + \pgfinterruptboundingbox + \path[coordinate](#1)--++(\tkz@coeff\pgf@xa,\tkz@coeff\pgf@ya)% + coordinate(\tkz@pointtsf); + \endpgfinterruptboundingbox + } +\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}% + \pgfinterruptboundingbox + \path[coordinate](#1)--++(\tkz@coeff\pgf@xa,\tkz@coeff\pgf@ya)% + coordinate(tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% rotation en degré +%<--------------------------------------------------------------------------–> +\def\tkzRotateAngle(#1,#2)(#3)#4{% +\begingroup +\gdef\tkz@LastList{#4} +\foreach\PointRot in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \def\tkz@pointtsf{\PointRot '} + \else + \def\tkz@pointtsf{\tkz@FirstPoint} + \fi + \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}}% + {#2} + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \pgfinterruptboundingbox + \path[coordinate](\tkz@bx,\tkz@by)coordinate(\tkz@pointtsf);% + \endpgfinterruptboundingbox +} + \endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzURotateAngle(#1,#2)(#3){% +\begingroup + \pgf@process{\pgfpointanchor{#3}{center}}% + \tkz@ax\pgf@x% + \tkz@ay\pgf@y% + \pgf@process{\pgfpointanchor{#1}{center}}% + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \tkzmathrotatepointaround{\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\pgfpoint{\tkz@bx}{\tkz@by}}% + {#2} + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \pgfinterruptboundingbox + \path (\tkz@bx,\tkz@by) coordinate (tkzPointResult);% + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% % rotation en radian +% %<--------------------------------------------------------------------------–> +\def\tkzRotateInRad(#1,#2)(#3)#4{% +\begingroup +\gdef\tkz@LastList{#4} + \foreach\PointRot in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \xdef\tkz@pointtsf{\PointRot '} + \else + \xdef\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% + \pgfinterruptboundingbox + \path[coordinate](\tkz@bx,\tkz@by)coordinate(\tkz@pointtsf); + \endpgfinterruptboundingbox +} +\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% + \pgfinterruptboundingbox + \path[coordinate](\tkz@bx,\tkz@by)coordinate(tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% Inverse of a point +%<--------------------------------------------------------------------------–> +\def\tkzInversePoint(#1,#2)(#3)#4{% +\begingroup +\gdef\tkz@LastList{#4} + \foreach\PointIP in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \xdef\tkz@pointtsf{\PointIP '} + \else + \xdef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkz@@CalcLengthcm(#1,#2){tkz@lna} + \tkz@@CalcLengthcm(#1,\PointIP){tkz@lnb} + \edef\tkz@lnc{\fpeval{\tkz@lna/\tkz@lnb*\tkz@lna}} + \tkzVecKNorm[\tkz@lnc](#1,\PointIP) + \pgfnodealias{\tkz@pointtsf}{tkzPointResult} + } +\endgroup +} +\def\tkzUInversePoint(#1,#2)(#3){% +\begingroup + \tkz@@CalcLengthcm(#1,#2){tkz@lna}% + \tkz@@CalcLengthcm(#1,#3){tkz@lnb}% + \edef\tkz@lnc{\fpeval{\tkz@lna/\tkz@lnb*\tkz@lna}} + \tkzVecKNorm[\tkz@lnc](#1,#3) +\endgroup +} +% possible +% \tkzDefLine[tangent from =#3](#1,#2) +% \tkzTgtFromP(#1,#2)(#3) +% \tkzInterLL(tkzFirstPointResult,tkzSecondPointResult)(#1,#2) +%<--------------------------------------------------------------------------–> +% Inverse negative of a point +%<--------------------------------------------------------------------------–> +\def\tkzInverseNegativePoint(#1,#2)(#3)#4{% +\begingroup +\gdef\tkz@LastList{#4} + \foreach\PointIP in {#3}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \xdef\tkz@pointtsf{\PointIP '} + \else + \xdef\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkz@@CalcLengthcm(#1,#2){tkz@lna} + \tkz@@CalcLengthcm(#1,\PointIP){tkz@lnb} + \edef\tkz@lnc{\fpeval{\tkz@lna/\tkz@lnb*\tkz@lna}} + \tkzVecKNorm[\tkz@lnc](#1,\PointIP) + \tkzUCSym(#1)(tkzPointResult) + \pgfnodealias{\tkz@pointtsf}{tkzPointResult} + } +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzUInverseNegativePoint(#1,#2)(#3){% +\begingroup + \tkz@@CalcLengthcm(#1,#2){tkz@lna}% + \tkz@@CalcLengthcm(#1,#3){tkz@lnb}% + \edef\tkz@lnc{\fpeval{\tkz@lna/\tkz@lnb*\tkz@lna}} + \tkzVecKNorm[\tkz@lnc](#1,#3) + \tkzUCSym(#1)(tkzPointResult) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------- rotate with nodes ------------------------–> +%<--------------------------------------------------------------------------–> +\def\tkzRotateWithNodes(#1,#2,#3)(#4)#5{% +\begingroup +\gdef\tkz@LastList{#5} + \foreach\PointRotWN in {#4}{% + \FirstPointInList\tkz@LastList + \ifx\tkz@FirstPoint\tkzutil@empty + \def\tkz@pointtsf{\PointRotWN '} + \else + \def\tkz@pointtsf{\tkz@FirstPoint} + \fi + \tkzFindAngle(#2,#1,#3) + \tkz@@extractxy{\PointRotWN} + \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}}% + {\tkzAngleResult} + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \pgfinterruptboundingbox + \path[coordinate](\tkz@bx,\tkz@by) coordinate (\tkz@pointtsf);% + \endpgfinterruptboundingbox +} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzURotateWithNodes(#1,#2,#3)(#4){% +\begingroup + \tkzFindAngle(#2,#1,#3) + \pgf@process{\pgfpointanchor{#4}{center}}% + \tkz@ax\pgf@x% + \tkz@ay\pgf@y% + \pgf@process{\pgfpointanchor{#1}{center}}% + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \tkzmathrotatepointaround{\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\pgfpoint{\tkz@bx}{\tkz@by}}% + {\tkzAngleResult} + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \pgfinterruptboundingbox + \path (\tkz@bx,\tkz@by) coordinate (tkzPointResult);% + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% Fin des transformations +%<--------------------------------------------------------------------------–> +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-spc.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-spc.tex new file mode 100644 index 0000000000..9ed94b26e0 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-spc.tex @@ -0,0 +1,695 @@ +% tkz-obj-lua-points.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-lua-points.tex} +\makeatletter +%add ExCenter +%<--------------------------------------------------------------------------–> +% Specific points +%<--------------------------------------------------------------------------–> +% barycentre +%<--------------------------------------------------------------------------–> +\def\tkzDefBarycentricPoint(#1){% +\begingroup + \path[coordinate] (barycentric cs:#1) coordinate (tkzPointResult); +\endgroup +} +\let\tkzDefBCPoint\tkzDefBarycentricPoint + +\def\tkzDefBarycentricPointTwo(#1,#2,#3,#4){% +\begingroup +\pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}} +\tkz@ax\pgf@x % +\tkz@ay\pgf@y % +\edef\tkzcax{\strip@pt\tkz@ax}% +\edef\tkzcay{\strip@pt\tkz@ay}% +\pgfextractx{\pgf@x}{\pgfpointanchor{#3}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#4}{center}} +\tkz@bx\pgf@x % +\tkz@by\pgf@y % +\edef\tkzcbx{\strip@pt\tkz@bx}% +\edef\tkzcby{\strip@pt\tkz@by}% +\edef\tkztpmx{\tkz@Dec{(\tkzcax*(#2) + \tkzcbx*(#4))/(#2 + #4 )}} +\edef\tkztpmy{\tkz@Dec{(\tkzcay*(#2) + \tkzcby*(#2))/(#2 + #4 )}} +\pgfcoordinate{tkzPointResult}{\pgfqpoint{\tkztpmx pt}{\tkztpmy pt}} +\endgroup +} + +% \def\tkzDefCentroid(#1){% +% \begingroup +% \xdef\tkz@arg{} +% \foreach \X in {#1} +% {% +% \ifx\tkzutil@empty\tkz@arg% +% \xdef\tkz@arg{\X=1} +% \else +% \xdef\tkz@arg{\tkz@arg,\X=1} +% \fi +% } +% \path[coordinate] (barycentric cs:\tkz@arg) coordinate (tkzPointResult); +% \endgroup +% } + +%<--------------------------------------------------------------------------–> +% milieu de deux points +%<--------------------------------------------------------------------------–> +% possible \coordinate (#3) at ($(#1)!0.5!(#2)$); +%<--------------------------------------------------------------------------–> +% \def\tkzDefMidPoint(#1,#2){% +% \begingroup +% \path (#1) -- (#2) coordinate[pos=.5](tkzPointResult); +% \endgroup +% } +\def\tkzDefMidPoint(#1,#2){% +\begingroup + \pgf@process{\pgfpointanchor{#1}{center}}% + \tkz@ax\pgf@x% + \tkz@ay\pgf@y% + \pgf@process{\pgfpointanchor{#2}{center}}% + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \advance\tkz@bx by\tkz@ax\relax% + \advance\tkz@by by\tkz@ay\relax% + \divide\tkz@bx by2\relax% + \divide\tkz@by by2\relax + \pgfcoordinate{tkzPointResult}{\pgfqpoint{\tkz@bx}{\tkz@by}} +\endgroup +} +\def\tkz@DefMidPoint(#1,#2,#3,#4){% +\begingroup + \tkz@ax#1% + \tkz@ay#2% + \tkz@bx#3% + \tkz@by#4% + \advance\tkz@bx by\tkz@ax\relax% + \advance\tkz@by by\tkz@ay\relax% + \divide\tkz@bx by2\relax% + \divide\tkz@by by2\relax + \pgfcoordinate{tkzPointResult}{\pgfqpoint{\tkz@bx}{\tkz@by}} +\endgroup +} + +%<--------------------------------------------------------------------------–> +\def\tkz@simicenter{0} +\pgfkeys{/tkzsimicenter/.cd, + ext/.code = \def\tkz@simicenter{0}, + int/.code = \def\tkz@simicenter{1}, + ext +}% + +\def\tkzDefSimilitudeCenter{\pgfutil@ifnextchar[{\tkz@DefSimilitudeCenter}% + {\tkz@DefSimilitudeCenter[]}} +\def\tkz@DefSimilitudeCenter[#1](#2,#3)(#4,#5){% +\pgfqkeys{/tkzsimicenter}{#1} +\begingroup +\ifcase\tkz@simicenter% + \tkzDefExtSimilitudeCenter[#1](#2,#3)(#4,#5) + \or% 1 + \tkzDefIntSimilitudeCenter[#1](#2,#3)(#4,#5) +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% Internal Similitude center +% Two circles have two similitude centers namely the internal center of +% similitude Si and the external similitude center Se. +%<--------------------------------------------------------------------------–> +\def\tkz@numhomo{0} +\pgfkeys{ +/tkzSimilitudeCenter/.cd, + node/.code = \def\tkz@numhomo{0}, + R/.code = \def\tkz@numhomo{1}, + node, + /tkzSimilitudeCenter/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, /tikz/\searchname/.retry=#1}} +} +\def\tkzDefIntSimilitudeCenter{\pgfutil@ifnextchar[{\tkz@DefIntSimilitudeCenter}{\tkz@DefIntSimilitudeCenter[]}} +\def\tkz@DefIntSimilitudeCenter[#1](#2,#3)(#4,#5){% +\begingroup +\pgfqkeys{/tkzSimilitudeCenter}{#1} +\ifcase\tkz@numhomo% + \tkz@@CalcLengthcm(#2,#3){tkz@rt}% + \tkz@@CalcLengthcm(#4,#5){tkz@rf}% + \or% 1 + \def\tkz@rt{#3}% + \def\tkz@rf{#5}% +\fi +\pgfinterruptboundingbox +\pgfextractx{\pgf@x}{\pgfpointanchor{#2}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#2}{center}} +\tkz@ax\pgf@x % +\tkz@ay\pgf@y % +\edef\tkzcax{\strip@pt\tkz@ax}% +\edef\tkzcay{\strip@pt\tkz@ay}% +\pgfextractx{\pgf@x}{\pgfpointanchor{#4}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#4}{center}} +\tkz@bx\pgf@x % +\tkz@by\pgf@y % +\edef\tkzcbx{\strip@pt\tkz@bx}% +\edef\tkzcby{\strip@pt\tkz@by}% +\edef\tkztpmx{\tkz@Dec{(\tkzcax*\tkz@rf + \tkzcbx*\tkz@rt)/(\tkz@rf + \tkz@rt )}} +\edef\tkztpmy{\tkz@Dec{(\tkzcay*\tkz@rf + \tkzcby*\tkz@rt)/(\tkz@rf + \tkz@rt )}} + \pgfcoordinate{tkzPointResult}{\pgfqpoint{\tkztpmx pt}{\tkztpmy pt}} +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzDefIntHomotheticCenter\tkzDefIntSimilitudeCenter +%<--------------------------------------------------------------------------–> +% External Similitude center +%<--------------------------------------------------------------------------–> +\def\tkzDefExtSimilitudeCenter{\pgfutil@ifnextchar[{\tkz@DefExtSimilitudeCenter}{% +\tkz@DefExtSimilitudeCenter[]}} + +\def\tkz@DefExtSimilitudeCenter[#1](#2,#3)(#4,#5){% +\begingroup +\pgfqkeys{/tkzSimilitudeCenter}{#1} +\ifcase\tkz@numhomo% + \tkz@@CalcLengthcm(#2,#3){tkz@rt}% + \tkz@@CalcLengthcm(#4,#5){tkz@rf}% + \or% 1 + \def\tkz@rt{#3}% + \def\tkz@rf{#5}% +\fi +\pgfinterruptboundingbox +\pgfextractx{\pgf@x}{\pgfpointanchor{#2}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#2}{center}} +\tkz@ax\pgf@x % +\tkz@ay\pgf@y % +\edef\tkzcax{\strip@pt\tkz@ax}% +\edef\tkzcay{\strip@pt\tkz@ay}% +\pgfextractx{\pgf@x}{\pgfpointanchor{#4}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#4}{center}} +\tkz@bx\pgf@x % +\tkz@by\pgf@y % +\edef\tkzcbx{\strip@pt\tkz@bx}% +\edef\tkzcby{\strip@pt\tkz@by}% +\edef\tkztpmx{\tkz@Dec{(\tkzcax*(-\tkz@rf) + \tkzcbx*\tkz@rt)/(\tkz@rt - (\tkz@rf))}} +\edef\tkztpmy{\tkz@Dec{(\tkzcay*(-\tkz@rf) + \tkzcby*\tkz@rt)/(\tkz@rt - (\tkz@rf))}} + \pgfcoordinate{tkzPointResult}{\pgfqpoint{\tkztpmx pt}{\tkztpmy pt}} + \endpgfinterruptboundingbox +\endgroup +} + +\let\tkzDefExtHomotheticCenter\tkzDefExtSimilitudeCenter +%<--------------------------------------------------------------------------–> +% Harmonic Division +%<--------------------------------------------------------------------------–> +% A , B , C ,D CA/CB = DA/DB +%<--------------------------------------------------------------------------–> +\def\tkz@numdha{0} +\pgfkeys{/tkzharmonic/.cd, + ext/.code = \def\tkz@numdha{0}, + int/.code = \def\tkz@numdha{1}, + both/.code = \def\tkz@numdha{2}, + both, +}% + +\def\tkzDivHarmonic{\pgfutil@ifnextchar[{\tkz@DivHarmonic}{\tkz@DivHarmonic[]}} +\def\tkz@DivHarmonic[#1](#2){% +\begingroup +\pgfqkeys{/tkzharmonic}{#1} + \ifcase\tkz@numdha% + \tkzDefDivHarmonicExt(#2) + \or% + \tkzDefDivHarmonicInt(#2) + \or% + \tkzDefDivHarmonicBoth(#2) + \fi +\endgroup +} + +\def\tkzDefDivHarmonicExt(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox + \tkz@VecKOrth[](#1,#2) \tkzGetPoint{tkz@px} + \tkzDefMidPoint(tkz@px,#2) \tkzGetPoint{tkz@py} + \tkzInterLL(tkz@px,#3)(#1,tkz@py) \tkzGetPoint{tkz@pz} + \tkzInterLL(#2,tkz@pz)(#1,tkz@px) \tkzGetPoint{tkz@px} + \tkzInterLL(tkz@py,tkz@px)(#1,#2) \tkzGetPoint{tkzPointResult} +\endpgfinterruptboundingbox +\endgroup +} + +\def\tkzDefDivHarmonicInt(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox + \tkz@VecKOrth[1](#1,#2) \tkzGetPoint{tkz@px} + \tkzDefMidPoint(tkz@px,#2) \tkzGetPoint{tkz@py} + \tkzInterLL(tkz@py,#3)(#1,tkz@px) \tkzGetPoint{tkz@pz} + \tkzInterLL(#2,tkz@pz)(#1,tkz@py) \tkzGetPoint{tkz@py} + \tkzInterLL(tkz@py,tkz@px)(#1,#2) \tkzGetPoint{tkzPointResult} +\endpgfinterruptboundingbox +\endgroup +} + +\def\tkzDefDivHarmonicBoth(#1,#2,#3){% +\begingroup +\edef\tkz@k{\fpeval{#3}} + \path[coordinate] (barycentric cs:#1=1,#2={\tkz@k}) coordinate (tkzFirstPointResult); + \path[coordinate] (barycentric cs:#1=1,#2={-\tkz@k}) coordinate (tkzSecondPointResult); +\endgroup +} + +\let\tkzDefHarmonic\tkzDivHarmonic +%<--------------------------------------------------------------------------–> +% golden ratio +%<--------------------------------------------------------------------------–> +\def\tkzDefGoldenRatio(#1,#2){% +\begingroup +\tkzDefPointWith[linear,K=\tkzInvPhi](#1,#2) +\endgroup +} +%<--------------------------------------------------------------------------–> +% triangle center +%<--------------------------------------------------------------------------–> + +\def\tkz@numtc{0} +\pgfkeys{/tkzDefTriangleCenter/.cd, + ortho/.code = \def\tkz@numtc{0}, + orthic/.code = \def\tkz@numtc{0}, + centroid/.code = \def\tkz@numtc{1}, + median/.code = \def\tkz@numtc{1}, + circum/.code = \def\tkz@numtc{2}, + in/.code = \def\tkz@numtc{3}, + ex/.code = \def\tkz@numtc{4}, + euler/.code = \def\tkz@numtc{5}, + symmedian/.code = \def\tkz@numtc{6}, + lemoine/.code = \def\tkz@numtc{6}, + grebe/.code = \def\tkz@numtc{6}, + spieker/.code = \def\tkz@numtc{7}, + gergonne/.code = \def\tkz@numtc{8}, + nagel/.code = \def\tkz@numtc{9}, + mittenpunkt/.code = \def\tkz@numtc{10}, + feuerbach/.code = \def\tkz@numtc{11}, + circum +} +\def\tkzDefTriangleCenter{\pgfutil@ifnextchar[{\tkz@DefTriangleCenter}{\tkz@DefTriangleCenter[]}} +\def\tkz@DefTriangleCenter[#1](#2){% +\begingroup +\pgfqkeys{/tkzDefTriangleCenter}{#1} +\ifcase\tkz@numtc% + \tkzOrthoCenter(#2) + \or% 1 + \tkzCentroid(#2) + \or% 2 + \tkzCircumCenter(#2) + \or% 3 + \tkzInCenter(#2) + \or% 4 + \tkzExCenter(#2) + \or% 5 + \tkzEulerCenter(#2) + \or% 6 + \tkzSymmedianCenter(#2) + \or% 7 + \tkzSpiekerCenter(#2) + \or% 8 + \tkzGergonneCenter(#2) + \or%9 + \tkzNagelCenter(#2) + \or%10 + \tkzMittenpunktCenter(#2) + \or%11 + \tkzFeuerbachCenter(#2) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% OrthoCenter +%<--------------------------------------------------------------------------–> +\def\tkzOrthoCenter(#1,#2,#3){% +\begingroup + \pgfinterruptboundingbox + \tkzUProjection(#1,#2)(#3) + \pgfnodealias{ort@pta}{tkzPointResult} + \tkzUProjection(#1,#3)(#2) + \pgfnodealias{ort@ptb}{tkzPointResult} + \tkzInterLL(#2,ort@ptb)(#3,ort@pta) + \endpgfinterruptboundingbox +\endgroup +} +\let\tkzDefOrthoCenter\tkzOrthoCenter +%<--------------------------------------------------------------------------–> +% GravityCenter modif 3.03 +%<--------------------------------------------------------------------------–> +\def\tkzCentroid(#1,#2,#3){% +\begingroup + \pgf@process{\pgfpointanchor{#1}{center}}% + \tkz@ax\pgf@x% + \tkz@ay\pgf@y% + \pgf@process{\pgfpointanchor{#2}{center}}% + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \pgf@process{\pgfpointanchor{#3}{center}}% + \tkz@cx\pgf@x% + \tkz@cy\pgf@y% + \edef\tkzcax{\strip@pt\tkz@ax}% + \edef\tkzcay{\strip@pt\tkz@ay}% + \edef\tkzcbx{\strip@pt\tkz@bx}% + \edef\tkzcby{\strip@pt\tkz@by}% + \edef\tkzccx{\strip@pt\tkz@cx}% + \edef\tkzccy{\strip@pt\tkz@cy}% + \edef\tkztpmx{\tkz@Dec{(\tkzcax + \tkzcbx + \tkzccx)/3}} + \edef\tkztpmy{\tkz@Dec{(\tkzcay + \tkzcby + \tkzccy)/3}} + \pgfinterruptboundingbox + \pgfcoordinate{tkzPointResult}{\pgfqpoint{\tkztpmx pt}{\tkztpmy pt}} + \endpgfinterruptboundingbox +\endgroup +} +\let\tkzBaryCenter\tkzCentroid + +%<--------------------------------------------------------------------------–> +% CircumCenter +%<--------------------------------------------------------------------------–> +\def\tkzCircumCenter(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox + \tkzDefMediatorLine(#1,#2) + \pgf@process{\pgfpointanchor{tkzFirstPointResult}{center}}% + \tkz@ax\pgf@x% + \tkz@ay\pgf@y% + \pgf@process{\pgfpointanchor{tkzSecondPointResult}{center}}% + \tkz@bx\pgf@x% + \tkz@by\pgf@y% + \tkzDefMediatorLine(#1,#3) + \pgf@process{\pgfpointanchor{tkzFirstPointResult}{center}}% + \tkz@cx\pgf@x% + \tkz@cy\pgf@y% + \pgf@process{\pgfpointanchor{tkzSecondPointResult}{center}}% + \tkz@dx\pgf@x% + \tkz@dy\pgf@y% +\tkzInterLLxy(\tkz@ax,\tkz@ay,\tkz@bx,\tkz@by)(\tkz@cx,\tkz@cy,\tkz@dx,\tkz@dy)% +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzDefCircumCenter\tkzCircumCenter +%<--------------------------------------------------------------------------–> +% InCenter +%<--------------------------------------------------------------------------–> +\def\tkzInCenter(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox +\tkzDefBisectorLine(#3,#1,#2) +\pgf@process{\pgfpointanchor{tkzPointResult}{center}}% +\tkz@bx\pgf@x% +\tkz@by\pgf@y% +\tkzDefBisectorLine(#3,#2,#1) +\pgf@process{\pgfpointanchor{tkzPointResult}{center}}% +\tkz@dx\pgf@x% +\tkz@dy\pgf@y% +\pgf@process{\pgfpointanchor{#1}{center}}% +\tkz@ax\pgf@x% +\tkz@ay\pgf@y% +\pgf@process{\pgfpointanchor{#2}{center}}% +\tkz@cx\pgf@x% +\tkz@cy\pgf@y% +\tkzInterLLxy(\tkz@ax,\tkz@ay,\tkz@bx,\tkz@by)(\tkz@cx,\tkz@cy,\tkz@dx,\tkz@dy)% +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzDefInCenter\tkzInCenter +%<--------------------------------------------------------------------------–> +% ExCenter +%<--------------------------------------------------------------------------–> +\def\tkzExCenter(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox +\tkzDefBisectorOutLine(#2,#1,#3) +\pgf@process{\pgfpointanchor{tkzPointResult}{center}}% +\tkz@bx\pgf@x% +\tkz@by\pgf@y% +\tkzDefBisectorOutLine(#2,#3,#1) +\pgf@process{\pgfpointanchor{tkzPointResult}{center}}% +\tkz@dx\pgf@x% +\tkz@dy\pgf@y% +\pgf@process{\pgfpointanchor{#1}{center}}% +\tkz@ax\pgf@x% +\tkz@ay\pgf@y% +\pgf@process{\pgfpointanchor{#3}{center}}% +\tkz@cx\pgf@x% +\tkz@cy\pgf@y% +\tkzInterLLxy(\tkz@ax,\tkz@ay,\tkz@bx,\tkz@by)(\tkz@cx,\tkz@cy,\tkz@dx,\tkz@dy)% +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzDefExCenter\tkzExCenter +%<--------------------------------------------------------------------------–> +% EulerCenter neuf points +%<--------------------------------------------------------------------------–> +\def\tkzEulerCenter(#1,#2,#3){% +% mileu de orthocentre et centre cercle circonscrit +% passe par les midpoints par les pieds des hauteurs +\begingroup +\pgfinterruptboundingbox +\tkzDefMidPoint(#1,#2) +\pgfnodealias{eu@mic}{tkzPointResult} +\tkzDefMidPoint(#1,#3) +\pgfnodealias{eu@mib}{tkzPointResult} +\tkzDefMidPoint(#2,#3) +\pgfnodealias{eu@mia}{tkzPointResult} +\tkzCircumCenter(eu@mia,eu@mib,eu@mic) +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzNinePointCenter\tkzEulerCenter +\let\tkzDefEulerCenter\tkzEulerCenter +%<--------------------------------------------------------------------------–> +%Symmedian center Lemoine point Grebe point K +%<--------------------------------------------------------------------------–> +\def\tkzSymmedianCenter(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox +\tkzDefMidPoint(#2,#3) +\pgfnodealias{eu@mic}{tkzPointResult} +\tkzDefMidPoint(#1,#3) +\pgfnodealias{eu@mib}{tkzPointResult} +\tkzUProjection(#2,#3)(#1) +\pgfnodealias{ort@pta}{tkzPointResult} +\tkzDefMidPoint(#1,ort@pta) +\pgfnodealias{eu@mid}{tkzPointResult} +\tkzUProjection(#1,#3)(#2) +\pgfnodealias{ort@ptb}{tkzPointResult} +\tkzDefMidPoint(#2,ort@ptb) +\pgfnodealias{eu@mie}{tkzPointResult} +\tkzInterLL(eu@mic,eu@mid)(eu@mib,eu@mie) +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzLemoinePoint\tkzSymmedianCenter +\let\tkzGrebePoint\tkzSymmedianCenter +\let\tkzDefLemoinePoint\tkzLemoinePoint +%<--------------------------------------------------------------------------–> +% Spieker center +%<--------------------------------------------------------------------------–> +\def\tkzSpiekerCenter(#1,#2,#3){% +\begingroup +% we need to get the midpoints +\pgfcoordinate{tkz@m3}{% + \pgfpointscale{0.5}{% + \pgfpointadd{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}}}% +\pgfcoordinate{tkz@m2}{% + \pgfpointscale{0.5}{% + \pgfpointadd{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#3}{center}}}}% +\pgfcoordinate{tkz@m1}{% + \pgfpointscale{0.5}{% + \pgfpointadd{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}}}% +\tkzInCenter(tkz@m1,tkz@m2,tkz@m3) +\endgroup +} +\let\tkzDefSpiekerCenter\tkzSpiekerCenter +%<--------------------------------------------------------------------------–> +% Gergonne center Ge +%<--------------------------------------------------------------------------–> +\def\tkzGergonneCenter(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox +\tkzInCenter(#1,#2,#3) +\pgfnodealias{tkz@ptin}{tkzPointResult} +\tkzUProjection(#2,#3)(tkz@ptin) +\pgfnodealias{tkz@oca}{tkzPointResult} +\tkzUProjection(#1,#3)(tkz@ptin) +\pgfnodealias{tkz@ocb}{tkzPointResult} +\tkzInterLL(#1,tkz@oca)(#2,tkz@ocb) +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzDefGergonneCenter\tkzGergonneCenter +%<--------------------------------------------------------------------------–> +% Nagel center Na +%<--------------------------------------------------------------------------–> +% INa = 3 IG. Nagel point % correction 02/02/20 +\def\tkzNagelCenter(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox +\tkzDefExcentralTriangle(#1,#2,#3){tkz@a,tkz@b,tkz@c} +\tkzUProjection(#2,#3)(tkz@a) +\pgfnodealias{tkz@tgta}{tkzPointResult} +\tkzUProjection(#1,#2)(tkz@c) +\pgfnodealias{tkz@tgtc}{tkzPointResult} +\tkzInterLL(#1,tkz@tgta)(#3,tkz@tgtc) +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzDefNagelCenter\tkzNagelCenter +%<--------------------------------------------------------------------------–> +% Mittenpunkt +%<--------------------------------------------------------------------------–> +\def\tkzMittenpunktCenter(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox +\tkzExCenter(#2,#3,#1) +\pgfnodealias{tkz@a}{tkzPointResult} +\tkzExCenter(#3,#1,#2) +\pgfnodealias{tkz@b}{tkzPointResult} +\pgfcoordinate{tkz@ma}{% +\pgfpointscale{0.5}{% +\pgfpointadd{\pgfpointanchor{#1}{center}}{\pgfpointanchor{#2}{center}}}}% +\pgfcoordinate{tkz@mb}{% +\pgfpointscale{0.5}{% +\pgfpointadd{\pgfpointanchor{#2}{center}}{\pgfpointanchor{#3}{center}}}}% +\tkzInterLL(tkz@a,tkz@ma)(tkz@b,tkz@mb) +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzDefMittenpunktCenter\tkzMittenpunktCenter +\let\tkzDefMiddlespoint\tkzMittenpunktCenter +%<--------------------------------------------------------------------------–> +% Feuerbach point +%<--------------------------------------------------------------------------–> +\def\tkzFeuerbachCenter(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox +\tkzEulerCenter(#1,#2,#3) +\pgfnodealias{tkz@euler}{tkzPointResult} +\tkzInCenter(#1,#2,#3) +\pgfnodealias{tkz@in}{tkzPointResult} +\tkzUProjection(#2,#3)(tkzPointResult) +\tkzInterLC(tkz@in,tkz@euler)(tkz@in,tkzPointResult)\tkzGetFirstPoint{tkz@fe} +\tkzRenamePoint(tkz@fe){tkzPointResult} +\endpgfinterruptboundingbox +\endgroup +} +\let\tkzDefFeuerbachCenter\tkzFeuerbachCenter +%<--------------------------------------------------------------------------–> +% Orthogonal center +%<--------------------------------------------------------------------------–> +\def\tkzOrthogonalCenter(#1,#2){% +\begingroup +\pgfinterruptboundingbox +\tkz@VecK[\tkz@koeff/(1+\tkz@koeff)](#1,#2) +\pgfnodealias{tkzFirstPointResult}{tkzPointResult} +\tkz@VecK[\tkz@koeff/(\tkz@koeff-1)](#1,#2) +\pgfnodealias{tkzSecondPointResult}{tkzPointResult} +\tkzDefMidPoint(tkzFirstPointResult,tkzSecondPointResult) +\endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% End Triangle center +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% Projection center of excircles +%<--------------------------------------------------------------------------–> +\def\tkzDefProjExcenter{\pgfutil@ifnextchar[{% + \tkz@DefProjExcenter}{% + \tkz@DefProjExcenter[]} + } +\def\tkz@DefProjExcenter[#1](#2,#3,#4)(#5)#6{ +\begingroup + \SetUpPTTR{#1} + \foreach \name [count=\i] in {#5} {% + \global\expandafter\edef\csname tkz@pt\i\endcsname{\name} + } + \foreach \name [count=\i] in {#6} {% + \global\expandafter\edef\csname tkz@ppt\i\endcsname{\name} + } +\tkzDefPointBy[projection=onto #3--#4 ](\tkz@pttr@name \csname tkz@pt1\endcsname) +\pgfnodealias{\csname tkz@ppt1\endcsname\csname tkz@pt1\endcsname}{tkzPointResult} +\tkzDefPointBy[projection=onto #3--#4 ](\tkz@pttr@name \csname tkz@pt2\endcsname) +\pgfnodealias{\csname tkz@ppt1\endcsname\csname tkz@pt2\endcsname}{tkzPointResult} +\tkzDefPointBy[projection=onto #3--#4 ](\tkz@pttr@name \csname tkz@pt3\endcsname) +\pgfnodealias{\csname tkz@ppt1\endcsname\csname tkz@pt3\endcsname}{tkzPointResult} +\tkzDefPointBy[projection=onto #2--#4 ](\tkz@pttr@name \csname tkz@pt1\endcsname) +\pgfnodealias{\csname tkz@ppt2\endcsname\csname tkz@pt1\endcsname}{tkzPointResult} +\tkzDefPointBy[projection=onto #2--#4 ](\tkz@pttr@name \csname tkz@pt2\endcsname) +\pgfnodealias{\csname tkz@ppt2\endcsname\csname tkz@pt2\endcsname}{tkzPointResult} +\tkzDefPointBy[projection=onto #2--#4 ](\tkz@pttr@name \csname tkz@pt3\endcsname) +\pgfnodealias{\csname tkz@ppt2\endcsname\csname tkz@pt3\endcsname}{tkzPointResult} +\tkzDefPointBy[projection=onto #3--#2 ](\tkz@pttr@name \csname tkz@pt1\endcsname) +\pgfnodealias{\csname tkz@ppt3\endcsname\csname tkz@pt1\endcsname}{tkzPointResult} +\tkzDefPointBy[projection=onto #3--#2 ](\tkz@pttr@name \csname tkz@pt2\endcsname) +\pgfnodealias{\csname tkz@ppt3\endcsname\csname tkz@pt2\endcsname}{tkzPointResult} +\tkzDefPointBy[projection=onto #3--#2 ](\tkz@pttr@name \csname tkz@pt3\endcsname) +\pgfnodealias{\csname tkz@ppt3\endcsname\csname tkz@pt3\endcsname}{tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Point on circle +%<--------------------------------------------------------------------------–> +\def\tkz@numptcirc{0} +\pgfkeys{/tkzptcircle/.cd, +through/.code args = {center #1 angle #2 point #3} { \def\tkz@center{#1}% + \def\tkz@angle{#2}% + \def\tkz@through{#3}% + \def\tkz@numptcirc{0}}, +R/.code args = {center #1 angle #2 radius #3} { \def\tkz@center{#1}% + \def\tkz@angle{#2}% + \def\tkz@radius{#3}% + \def\tkz@numptcirc{1}}, +through in rad/.code args = {center #1 angle #2 point #3} { \def\tkz@center{#1}% + \def\tkz@angle{#2}% + \def\tkz@through{#3}% + \def\tkz@numptcirc{2}}, +R in rad/.code args = {center #1 angle #2 radius #3} { \def\tkz@center{#1}% + \def\tkz@angle{#2}% + \def\tkz@radius{#3}% + \def\tkz@numptcirc{3}} +} + +\def\tkzDefPointOnCircle{\pgfutil@ifnextchar[{\tkz@DefPointOnCircle}{% + \tkz@DefPointOnCircle[]}} +\def\tkz@DefPointOnCircle[#1]{% +\begingroup +\pgfqkeys{/tkzptcircle}{#1} + \ifcase\tkz@numptcirc% + \tkz@@CalcLengthcm(\tkz@center,\tkz@through){tkz@radius} + \or% 1 + \relax% + \or% 2 + \pgfmathparse{\tkz@angle\space r} + \let\tkz@angle\pgfmathresult + \tkz@@CalcLengthcm(\tkz@center,\tkz@through){tkz@radius} + \or% 3 + \pgfmathparse{\tkz@angle\space r} + \let\tkz@angle\pgfmathresult +\fi +\path (\tkz@center) --++(\tkz@angle:\tkz@radius) coordinate(tkzPointResult); +\endgroup +} +%<--------------------------------------------------------------------------–> +% Point on line +%<--------------------------------------------------------------------------–> +\def\tkzDefPointOnLine{\pgfutil@ifnextchar[{\tkz@DefPointOnLine}{\tkz@DefPointOnLine[]}} +\def\tkz@DefPointOnLine[#1](#2,#3){% +\begingroup +\path (#2) to [#1] coordinate (tkzPointResult) (#3); +\endgroup +} + +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-with.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-with.tex new file mode 100644 index 0000000000..73a3d9799f --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-with.tex @@ -0,0 +1,269 @@ +% tkz-obj-lua-points-with.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-lua-points-with.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% Vectors +%<--------------------------------------------------------------------------–> +% Objet : outils mathématiques pour la géométrie euclideienne avec pgf/tikz +% utilisable de préférence avec un repère orthonormé et le cm comme unité +% utile pour la compatibilité avec pgf 2 +%<--------------------------------------------------------------------------–> +% Duplicate Length à revoir pas de pt pas de global +% ||v(CN)||= ||v(AB)|| et v(CN) colineaire à v(CD) +% A-->#1 B-->#2 C-->#3 D-->#4 N-->#5 ????? +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% Outils pour les vecteurs +%<--------------------------------------------------------------------------–> +% ce sont des outils élémentaires qui à partir de deux points en définissent +% un troisième +% #1 si c'est une option alors c'est un nombre réel +% #2 et #3 sont deux points +% #4 est le nom du point qui résulte de la transformation +% exemple : \tkzVecKNorm (A,B){C} définit un point C tel que AC = 1 et C est % % un point de la droite (AC). #1 peut être négatif + +\def\tkzDuplicateSegment(#1,#2)(#3,#4){% +\begingroup + \tkz@@CalcLength(#1,#2){tkz@firstlen}% + \tkz@@CalcLength(#3,#4){tkz@secondlen}% + \edef\tkz@ratio{\tkz@Dec{\tkz@firstlen/\tkz@secondlen}} + \tkz@VecKCoLinear[\tkz@ratio](#3,#4,#3)% +\endgroup +} +\let\tkzDuplicateLength\tkzDuplicateSegment +%<--------------------------------------------------------------------------–> +% Coordonnées d'un vecteur (couple de points) +% Deux points A et B donc un vecteur on récupère les coordonnées de v(AB) +% en cm +% tkzGetVecCoord en cm ou en pt ??? +%<--------------------------------------------------------------------------–> +%result in #3x et #3y #1 et #2 sont les points +% passage en cm avec fp ? +% 28.45274 =1 cm +\def\tkzGetVectxy(#1,#2)#3{% +\begingroup +\pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% +\pgfmathparse{\pgf@sys@tonumber{\pgf@x}/1cm}% +\let\tkzresultx\pgfmathresult +\pgfmathparse{\pgf@sys@tonumber{\pgf@y}/1cm}% +\let\tkzresulty\pgfmathresult +\global\expandafter\edef\csname #3x\endcsname{\tkzresultx}% +\global\expandafter\edef\csname #3y\endcsname{\tkzresulty}% +\endgroup +} +%<--------------------------------------------------------------------------–> +% options #1 two points #2,#3 result in #4 +% +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% tkzDefPointWith +%<--------------------------------------------------------------------------–> +\def\tkz@numv{0} +\pgfkeys{/@pointwith/.cd, + colinear/.code args = {at #1}{\def\tkz@numv{0}\def\tkz@frompoint{#1}}, + orthogonal/.code = {\def\tkz@numv{1}}, + linear/.code = {\def\tkz@numv{2}}, + orthogonal normed/.code = {\def\tkz@numv{3}}, + linear normed/.code = {\def\tkz@numv{4}}, + colinear normed/.code args = {at #1}{\def\tkz@numv{5}\def\tkz@frompoint{#1}}, + K/.code = {\edef\tkz@coeff{\fpeval{#1}}}, + K = 1, + normed/.is if = tkz@line@normed, + normed/.default = true, + normed = false, + orthogonal +} +\def\tkzDefPointWith{\pgfutil@ifnextchar[{\tkz@DefPointWith}{\tkz@DefPointWith[]}} + +\def\tkz@DefPointWith[#1](#2,#3){% +\begingroup +\pgfkeys{/@pointwith/.cd,K=1} +\pgfqkeys{/@pointwith}{#1} +\ifcase\tkz@numv% + % first case 0 + \tkz@DefVectorColinearat[\tkz@coeff](#2,#3) + \or% 1 + \tkz@VecKOrth[\tkz@coeff](#2,#3) + \or% 2 + \tkz@VecK[\tkz@coeff](#2,#3) + \or% 3 + \tkz@VecKOrthNorm[\tkz@coeff](#2,#3) + \or% 4 + \tkz@VecKNorm[\tkz@coeff](#2,#3) + \or% 5 + \tkz@VecKColinearNorm[\tkz@coeff](#2,#3) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% tkzDefVectorfrom +%<--------------------------------------------------------------------------–> +% tkz@numv 0 +\def\tkz@DefVectorColinearat[#1](#2,#3){% +\iftkz@line@normed + \tkz@VecKColinearNorm[#1](#2,#3) +\else +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}{\pgfpointanchor{#3}{center}}% + \pgf@xa=\pgf@x\relax% + \pgf@ya=\pgf@y\relax% + \pgfinterruptboundingbox + \path (\tkz@frompoint)--++(\tkz@coeff\pgf@xa,\tkz@coeff\pgf@ya) coordinate (tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +\fi +} +%<--------------------------------------------------------------------------–> +% tkzVector K Orth coeff dans #1 +% v(AN) perp v(AB) (v(AB) , v(AN) ) sens direct cercle trigo +% ||v(AN)||=||v(AB)|| +%<--------------------------------------------------------------------------–> +% tkz@numv 1 +\def\tkzVecKOrth{\pgfutil@ifnextchar[{\tkz@VecKOrth}{\tkz@VecKOrth[1]}} +\def\tkz@VecKOrth[#1](#2,#3){% +\iftkz@line@normed + \tkz@VecKOrthNorm[#1](#2,#3) +\else +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}{\pgfpointanchor{#3}{center}}% + \pgf@xa=-\pgf@y% + \pgf@ya=\pgf@x% + \pgfinterruptboundingbox + \path (#2)--++(\tkz@coeff\pgf@xa,\tkz@coeff\pgf@ya) coordinate (tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +\fi +}% + +%<--------------------------------------------------------------------------–> +% v(AN)=#1 x v(AB) +% #1 le coeff; #2--> A #3--> B #4-->N tq #4-#2 = #1*(#3-#2) +%<--------------------------------------------------------------------------–> +% tkz@numv 2 +\def\tkzVecK{\pgfutil@ifnextchar[{\tkz@VecK}{\tkz@VecK[1]}} +\def\tkz@VecK[#1](#2,#3){% +\iftkz@line@normed + \tkz@VecKNorm[#1](#2,#3) +\else +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \pgf@xa=\pgf@x\relax% + \pgf@ya=\pgf@y\relax% + \pgfmathparse{#1} + \let\tkz@coeff\pgfmathresult + \pgfinterruptboundingbox + \path (#2)--++(\tkz@coeff\pgf@xa,\tkz@coeff\pgf@ya) coordinate (tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +\fi +}% +%<--------------------------------------------------------------------------–> +% tkzVecKOrthNorm coeff dans #1 +% v(AN) perp v(AB) v(AB) v(AN) sens direct cercle trigo +% ||v(AN||=1 si #1 est vide ou =1 sinon ||v(AN||=K +%<--------------------------------------------------------------------------–> +% tkz@numv 3 +\def\tkzVecKOrthNorm{\pgfutil@ifnextchar[{\tkz@VecKOrthNorm}% + {\tkz@VecKOrthNorm[1]}} +\def\tkz@VecKOrthNorm[#1](#2,#3){% +\begingroup + \tkzpointnormalised{\pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}} + \pgf@xa=-\pgf@y\relax% + \pgf@ya=\pgf@x\relax% + \pgfmathparse{#1} + \let\tkz@tmp\pgfmathresult + \edef\tkz@x{\tkz@Dec{28.45274*\tkz@tmp*\strip@pt\pgf@xa}} + \edef\tkz@y{\tkz@Dec{28.45274*\tkz@tmp*\strip@pt\pgf@ya}} + \pgfinterruptboundingbox + \path (#2)--++(\tkz@x pt,\tkz@y pt) coordinate (tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +}% +%<--------------------------------------------------------------------------–> +% VectorNormalised ou K*VectorNormalised +% A-->#2 B-->#3 N-->#4 v(AB) devient v(AN) tq ||v(AN)||=1 si #1=1 +% sinon ||v(AN)||=#1 +%<--------------------------------------------------------------------------–> +% tkz@numv 4 +\def\tkzVecKNorm{\pgfutil@ifnextchar[{\tkz@VecKNorm}{\tkz@VecKNorm[1]}} +\def\tkz@VecKNorm[#1](#2,#3){% +\begingroup + \tkzpointnormalised{% + \pgfpointdiff{\pgfpointanchor{#2}{center}} + {\pgfpointanchor{#3}{center}}} + \pgf@xa=\pgf@x\relax% + \pgf@ya=\pgf@y\relax% + \pgfmathparse{#1} + \let\tkz@tmp\pgfmathresult + \edef\tkz@x{\tkz@Dec{28.45274*\tkz@tmp*\strip@pt\pgf@xa}} + \edef\tkz@y{\tkz@Dec{28.45274*\tkz@tmp*\strip@pt\pgf@ya}} + \pgfinterruptboundingbox + \path (#2)--++(\tkz@x pt,\tkz@y pt) coordinate (tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +}% +%<--------------------------------------------------------------------------–> +% \tkz@VecKColinearNorm +%<--------------------------------------------------------------------------–> +%% tkz@numv 5 +\def\tkz@VecKColinearNorm[#1](#2,#3){% +\begingroup + \tkzpointnormalised{% + \pgfpointdiff{\pgfpointanchor{#2}{center}} + {\pgfpointanchor{#3}{center}}} + \pgf@xa=\pgf@x\relax% + \pgf@ya=\pgf@y\relax% + \edef\tkz@x{\tkz@Dec{28.45274*(\tkz@coeff)*\strip@pt\pgf@xa}} + \edef\tkz@y{\tkz@Dec{28.45274*(\tkz@coeff)*\strip@pt\pgf@ya}} + \pgfinterruptboundingbox + \path (\tkz@frompoint)--++(\tkz@x pt,\tkz@y pt) coordinate (tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +}% +%<--------------------------------------------------------------------------–> +% VecKCoLinear CN = K x AB #1 pt #2 pt #3 pt #4 nb #5 pt result +% il faut modifier cette macro : on supprime #3 pour la colinéarité +% Il suffit d'utiliser Replicate ou Duplicate coeff dans #1 +% v(CD)=#1 x v(AB) #1 le coeff; #2-->A #3-->B #4-->C +%<--------------------------------------------------------------------------–> +\def\tkz@VecKCoLinear[#1](#2,#3,#4){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \pgf@xa=\pgf@x\relax% + \pgf@ya=\pgf@y\relax% + \edef\tkz@coeff{\fpeval{#1}} + \pgfinterruptboundingbox + \path (#4)--+(\tkz@coeff\pgf@xa,\tkz@coeff\pgf@ya) coordinate (tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +}% +\def\tkz@VecCoLinear(#1,#2,#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% + \pgf@xa=\pgf@x\relax% + \pgf@ya=\pgf@y\relax% + \pgfinterruptboundingbox + \path (#3)--+(\pgf@xa,\pgf@ya) coordinate (tkzPointResult); + \endpgfinterruptboundingbox +\endgroup +}% +\makeatother +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points.tex new file mode 100644 index 0000000000..4a81392c5d --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points.tex @@ -0,0 +1,169 @@ + % tkz-obj-lua-points.tex +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-obj-lua-points.tex} +\makeatletter +%<---------------------------------------------------------------------------> +% init def point +%<---------------------------------------------------------------------------> +% tkzDefPoint +%<---------------------------------------------------------------------------> +% macros complémentaires pour def point +%<---------------------------------------------------------------------------> +\def\tkz@parsecoordinate#1{% +\tkz@getseparator#1,\@nil +\iftkz@polar + \tkz@getfrompolar#1\@nil +\else + \tkz@getfromcart#1\@nil +\fi +} +\def\tkz@getseparator#1,#2\@nil{% +\ifx\tkzempty#2\tkzempty% + \tkz@polartrue +\else + \tkz@polarfalse +\fi +} +\def\tkz@getfrompolar#1:#2\@nil{% +\edef\tkz@a{\fpeval{#1}} +\edef\tkz@r{\fpeval{#2}} +\xdef\tkz@polarrad{\tkz@r} +\xdef\tkz@polarangle{\tkz@a} +} +\def\tkz@getfromcart#1,#2\@nil{% +\edef\tkz@x{\fpeval{#1}} +\edef\tkz@y{\fpeval{#2}} +\xdef\tkz@absc{\tkz@x} +\xdef\tkz@ord{\tkz@y} +} +%<---------------------------------------------------------------------------> +% options pour point definition +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzPt/.cd, + polar/.is if = tkz@pt@polar, + polar/.default = true, + polar = false +} +%<---------------------------------------------------------------------------> +% tkz@ptStar +%<---------------------------------------------------------------------------> +\def\tkz@ptStar[#1](#2,#3)#{% +\pgfkeys{/tkzPt/.cd, polar = false} +\pgfqkeys{/tkzPt}{#1} +\iftkz@pt@polar% + \edef\tkz@x{\fpeval{#3*cosd(#2)}} + \edef\tkz@y{\fpeval{#3*sind(#2)}} +\else + \edef\tkz@x{\fpeval{#2}} + \edef\tkz@y{\fpeval{#3}} +\fi +\edef\tkzpt@xa{\tkz@Dec{(\tkz@x-(\tkz@init@xorigine))/\tkz@init@xstep}} +\edef\tkzpt@ya{\tkz@Dec{(\tkz@y-(\tkz@init@yorigine))/\tkz@init@ystep}} +\tkz@node +} +%<---------------------------------------------------------------------------> +% la macro defpoint les coordonnées cartésiennes ou polaires sont traitées +% afin de pouvoir être adaptées avec les unités choisies +%<---------------------------------------------------------------------------> +\def\tkzDefPoint{\pgfutil@ifnextchar[{\tkz@DefPoint}{\tkz@DefPoint[]}} + +\def\tkz@DefPoint[#1](#2)#{% +\tkz@parsecoordinate{#2} +\iftkz@polar + \tkz@ptStar[polar](\tkz@polarangle,\tkz@polarrad){tkz@coord@temp} +\else + \tkz@ptStar[](#2){tkz@coord@temp} +\fi +\tkz@DefPointEnd[#1] +}% +\def\tkz@DefPointEnd[#1]#2{\coordinate[#1] (#2) at (tkz@coord@temp);} +%<---------------------------------------------------------------------------> +% tkzDefPoints +%<---------------------------------------------------------------------------> +\def\tkzDefPoints{\pgfutil@ifnextchar[{\tkz@DefPoints}{\tkz@DefPoints[]}} +\def\tkz@DefPoints[#1]#2{% + \begingroup + \def\tkz@parenthesis@for@err{(}% + \def\tkz@maybe@parenthesis{#2}% + \ifx\tkz@maybe@parenthesis\tkz@parenthesis@for@err + \PackageError{tkz-base}{Syntax error use {} instead of ()}{You need to use {} instead of ()}% + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + {\tkz@absorb@bad@arg}% + {\foreach \ptx/\pty/\name in {#2}{\tkzDefPoint[#1](\ptx,\pty){\name}}% + \endgroup}% +} +\def\tkz@absorb@bad@arg#1){\endgroup} +%<---------------------------------------------------------------------------> +\def\tkz@node#1{ \pgfinterruptboundingbox +\path[coordinate](\tkzpt@xa,\tkzpt@ya) coordinate(#1); + \endpgfinterruptboundingbox} +%<---------------------------------------------------------------------------> +\def\tkzRenamePoint(#1)#2{\coordinate (#2) at (#1);} +\def\tkz@RenamePointEnd[#1]#2{\coordinate[#1] (#2) at (\tkz@ax,\tkz@ay);} +\def\tkzGetPoint#1{\coordinate (#1) at (tkzPointResult);} +\def\tkzGetPoints#1#2{\coordinate (#1) at (tkzFirstPointResult); + \coordinate (#2) at (tkzSecondPointResult);} +\def\tkzGetFirstPoint#1{\coordinate (#1) at (tkzFirstPointResult);} +\def\tkzGetSecondPoint#1{\coordinate (#1) at (tkzSecondPointResult);} +\def\tkzGetThirdPoint#1{\coordinate (#1) at (tkzThirdPointResult);} +\def\tkzDefShiftPointCoord[#1](#2)#3{% + \begin{scope}[shift={(#1)}] + \coordinate (#3) at (#2); + \end{scope} + }% +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> + +%<---------------------------------------------------------------------------> +% tkzDefShiftPoint +%<---------------------------------------------------------------------------> +\def\tkzDefShiftPoint[#1](#2)#3{% + \tkz@@extractxy{#1} + \tkz@ax\pgf@x % + \tkz@ay\pgf@y % +\begin{scope}[shift={(\tkz@ax,\tkz@ay)}] + \coordinate (#3) at (#2); +\end{scope} +} +%<---------------------------------------------------------------------------> +% Coordonnées d'un point +% result in #2x et #2y #1 est le point et on récupère ses coordonnées +% usage soit A un point \tkzGetPointCoord(A){V} alors \Vx = xA et \Vy = yA +% en cm +% tkzGetPointCoord avec [#1] cm ou bien pt ?? todo +%<---------------------------------------------------------------------------> +\def\tkzGetPointCoord(#1)#2{% +\begingroup + \pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}} + \pgfmathparse{\pgf@sys@tonumber{\pgf@x}/28.45274} + \global\let\tkzresultx\pgfmathresult + \global\expandafter\edef\csname #2x\endcsname{\tkzresultx}% + \pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}} + \pgfmathparse{\pgf@sys@tonumber{\pgf@y}/28.45274} + \global\let\tkzresulty\pgfmathresult + \global\expandafter\edef\csname #2y\endcsname{\tkzresulty} +\endgroup +} +\def\tkz@@extractxy#1{% +\pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}} +} +\let\tkzGetPointxy\tkzGetPointCoord +\makeatother +\endinput
\ No newline at end of file |