From b06c6695162b493aeec3b594c6beb518c15c98ba Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Tue, 24 Jan 2023 03:02:57 +0000 Subject: CTAN sync 202301240302 --- macros/latex/contrib/tkz/tkz-euclide/README.md | 10 +- .../tkz-euclide/doc/latex/TKZdoc-euclide-FAQ.tex | 2 +- .../doc/latex/TKZdoc-euclide-angles.tex | 2 +- .../doc/latex/TKZdoc-euclide-examples.tex | 36 +- .../doc/latex/TKZdoc-euclide-labelling.tex | 2 +- .../tkz-euclide/doc/latex/TKZdoc-euclide-lua.tex | 22 + .../tkz-euclide/doc/latex/TKZdoc-euclide-main.tex | 17 +- .../doc/latex/TKZdoc-euclide-marking.tex | 140 +---- .../tkz-euclide/doc/latex/TKZdoc-euclide-news.tex | 13 +- .../doc/latex/TKZdoc-euclide-others.tex | 5 +- .../doc/latex/TKZdoc-euclide-presentation.tex | 12 +- .../tkz-euclide/doc/latex/TKZdoc-euclide-tools.tex | 7 +- .../contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf | Bin 1109639 -> 1115481 bytes .../latex/drawings/tkz-draw-eu-angles.tex | 538 ++++++++++++++++ .../latex/drawings/tkz-draw-eu-circles.tex | 165 +++++ .../latex/drawings/tkz-draw-eu-compass.tex | 100 +++ .../latex/drawings/tkz-draw-eu-lines.tex | 281 +++++++++ .../latex/drawings/tkz-draw-eu-points.tex | 171 +++++ .../latex/drawings/tkz-draw-eu-polygons.tex | 106 ++++ .../latex/drawings/tkz-draw-eu-protractor.tex | 121 ++++ .../latex/drawings/tkz-draw-eu-sectors.tex | 326 ++++++++++ .../latex/drawings/tkz-draw-eu-show.tex | 347 ++++++++++ .../tkz-euclide/latex/libs/tkz-lib-eu-marks.tex | 122 ++++ .../tkz-euclide/latex/libs/tkz-lib-eu-shape.tex | 49 ++ .../latex/obj-lua/tkz-obj-lua-circles.tex | 223 +++++++ .../latex/obj-lua/tkz-obj-lua-points-by.tex | 522 ++++++++++++++++ .../latex/obj-lua/tkz-obj-lua-points-spc.tex | 695 +++++++++++++++++++++ .../latex/obj-lua/tkz-obj-lua-points-with.tex | 269 ++++++++ .../latex/obj-lua/tkz-obj-lua-points.tex | 169 +++++ .../tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex | 171 +++++ .../latex/obj/tkz-obj-eu-circles-by.tex | 157 +++++ .../tkz-euclide/latex/obj/tkz-obj-eu-circles.tex | 223 +++++++ .../tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex | 83 +++ .../tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex | 293 +++++++++ .../tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex | 520 +++++++++++++++ .../latex/obj/tkz-obj-eu-points-rnd.tex | 119 ++++ .../latex/obj/tkz-obj-eu-points-with.tex | 265 ++++++++ .../tkz-euclide/latex/obj/tkz-obj-eu-points.tex | 173 +++++ .../tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex | 113 ++++ .../tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex | 500 +++++++++++++++ .../contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg | 10 +- .../contrib/tkz/tkz-euclide/latex/tkz-euclide.sty | 82 ++- .../tkz/tkz-euclide/latex/tkz-lib-eu-marks.tex | 122 ---- .../tkz/tkz-euclide/latex/tkz-lib-eu-shape.tex | 51 -- .../tkz/tkz-euclide/latex/tkz-obj-eu-axesmin.tex | 171 ----- .../tkz-euclide/latex/tkz-obj-eu-circles-by.tex | 158 ----- .../tkz/tkz-euclide/latex/tkz-obj-eu-circles.tex | 233 ------- .../tkz/tkz-euclide/latex/tkz-obj-eu-compass.tex | 100 --- .../tkz-euclide/latex/tkz-obj-eu-draw-angles.tex | 534 ---------------- .../tkz-euclide/latex/tkz-obj-eu-draw-circles.tex | 162 ----- .../tkz-euclide/latex/tkz-obj-eu-draw-lines.tex | 281 --------- .../tkz-euclide/latex/tkz-obj-eu-draw-points.tex | 172 ----- .../tkz-euclide/latex/tkz-obj-eu-draw-polygons.tex | 106 ---- .../tkz/tkz-euclide/latex/tkz-obj-eu-grids.tex | 83 --- .../tkz/tkz-euclide/latex/tkz-obj-eu-lines.tex | 293 --------- .../tkz/tkz-euclide/latex/tkz-obj-eu-points-by.tex | 520 --------------- .../tkz-euclide/latex/tkz-obj-eu-points-rnd.tex | 119 ---- .../tkz-euclide/latex/tkz-obj-eu-points-spc.tex | 644 ------------------- .../tkz-euclide/latex/tkz-obj-eu-points-with.tex | 265 -------- .../tkz/tkz-euclide/latex/tkz-obj-eu-points.tex | 173 ----- .../tkz/tkz-euclide/latex/tkz-obj-eu-polygons.tex | 113 ---- .../tkz-euclide/latex/tkz-obj-eu-protractor.tex | 121 ---- .../tkz/tkz-euclide/latex/tkz-obj-eu-sectors.tex | 326 ---------- .../tkz/tkz-euclide/latex/tkz-obj-eu-show.tex | 346 ---------- .../tkz/tkz-euclide/latex/tkz-obj-eu-triangles.tex | 500 --------------- .../tkz/tkz-euclide/latex/tkz-tools-eu-BB.tex | 30 - .../tkz/tkz-euclide/latex/tkz-tools-eu-angles.tex | 73 --- .../tkz/tkz-euclide/latex/tkz-tools-eu-base.tex | 89 --- .../tkz/tkz-euclide/latex/tkz-tools-eu-colors.tex | 57 -- .../latex/tkz-tools-eu-intersections.tex | 502 --------------- .../tkz/tkz-euclide/latex/tkz-tools-eu-math.tex | 227 ------- .../tkz/tkz-euclide/latex/tkz-tools-eu-modules.tex | 67 -- .../tkz/tkz-euclide/latex/tkz-tools-eu-text.tex | 88 --- .../tkz-euclide/latex/tkz-tools-eu-utilities.tex | 236 ------- .../latex/tools-lua/tkz-tools-lua-angles.tex | 102 +++ .../latex/tools-lua/tkz-tools-lua-base.tex | 89 +++ .../tools-lua/tkz-tools-lua-intersections.tex | 525 ++++++++++++++++ .../latex/tools-lua/tkz-tools-lua-math.tex | 417 +++++++++++++ .../tkz-euclide/latex/tools/tkz-tools-eu-BB.tex | 30 + .../latex/tools/tkz-tools-eu-angles.tex | 74 +++ .../tkz-euclide/latex/tools/tkz-tools-eu-base.tex | 89 +++ .../latex/tools/tkz-tools-eu-colors.tex | 57 ++ .../latex/tools/tkz-tools-eu-intersections.tex | 498 +++++++++++++++ .../tkz-euclide/latex/tools/tkz-tools-eu-math.tex | 256 ++++++++ .../latex/tools/tkz-tools-eu-modules.tex | 67 ++ .../tkz-euclide/latex/tools/tkz-tools-eu-text.tex | 88 +++ .../latex/tools/tkz-tools-eu-utilities.tex | 178 ++++++ 87 files changed, 9460 insertions(+), 7153 deletions(-) create mode 100644 macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-lua.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-circles.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-by.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-spc.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-with.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-lib-eu-marks.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-lib-eu-shape.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-axesmin.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-circles-by.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-circles.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-compass.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-angles.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-circles.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-lines.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-points.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-polygons.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-grids.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-lines.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-by.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-rnd.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-spc.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-with.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-polygons.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-protractor.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-sectors.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-show.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-triangles.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-BB.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-angles.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-base.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-colors.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-math.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-modules.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-text.tex delete mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-utilities.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-angles.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-base.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-intersections.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-math.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex create mode 100644 macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex (limited to 'macros/latex/contrib/tkz') diff --git a/macros/latex/contrib/tkz/tkz-euclide/README.md b/macros/latex/contrib/tkz/tkz-euclide/README.md index 770c67d356..c476d7a07f 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/README.md +++ b/macros/latex/contrib/tkz/tkz-euclide/README.md @@ -1,6 +1,6 @@ # tkz-euclide — for euclidean geometry -Release 4.25c 2022/09/23 +Release 5.00c 2023/01/23 ## Description @@ -41,16 +41,12 @@ To use the package `tkz-euclide`, place the following lines in the preamble of your LaTeX document: ``` -\usepackage{tkz-euclide} +\usepackage{tkz-euclide} or \usepackage[lua]{tkz-euclide} \begin{document} \begin{tikzpicture} your code \end{tikzpicture} ``` - -The line `\usetkzobj{all}` is no longer required with `tkz-euclide` but you can use it with -other packages. - If you use the `xcolor` package, load that package before `tkz-euclide` to avoid package conflicts. @@ -67,6 +63,8 @@ Other examples, in French, are on my site. ## History +- 5.00c Added the "lua" option to the package, allowing to perform most of the calculations with "lua". This saves time and precision; + - 4.25c. Remove \input{tkz-obj-eu-draw-triangles.tex} from the list of files to load. - 4.24c. Correction of a bug in the macro `\tkzMarkAngle`; diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-FAQ.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-FAQ.tex index 8aee9b7021..97e137007e 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-FAQ.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-FAQ.tex @@ -25,7 +25,7 @@ \item Do not mix the syntax of \tkzNamePack{pgfmath} and \tkzNamePack{xfp}. I've often chosen \tkzNamePack{xfp} but if you prefer pgfmath then do your calculations before passing parameters. - \item Error "dimension too large" : In some cases, this error occurs. One way to avoid it is to use the "\tkzname{xfp}" option. When this option is used in an scope, the "veclen" function is replaced by a function dependent on "xfp". Do not use intersection macros in this scope. For example, an error occurs if you use the macro \tkzcname{tkzDrawArc} + \item Error "dimension too large" : In some cases, this error occurs. One way to avoid it is to use the "\tkzname{veclen}" option. When this option is used in an scope, the "veclen" function is replaced by a function dependent on "xfp". Do not use intersection macros in this scope. For example, an error occurs if you use the macro \tkzcname{tkzDrawArc} with too small an angle. The error is produced by the \NameLib{decoration} library when you want to place a mark on an arc. Even if the mark is absent, the error is still present. \end{itemize} diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-angles.tex index d077256d8a..3ab43bd43e 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-angles.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-angles.tex @@ -20,7 +20,7 @@ Let us agree that an angle measured counterclockwise is positive. \tkzname{Angles} are involved in several macros like \tkzcname{tkzDefPoint},\tkzcname{tkzDefPointBy[rotation = \dots]}, \tkzcname{tkzDrawArc} and the next one \tkzcname{tkzGetAngle}. With the exception of the last one, all these macros accept negative angles. - \begin{figure}[!h] + \begin{figure}[!ht] \centering \begin{tabular}{|c|c|} \hline diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-examples.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-examples.tex index 45a9be0f98..e436c406fe 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-examples.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-examples.tex @@ -94,24 +94,24 @@ The figure below shows a semicircle, with diameter $AB$. A tangent line is drawn \end{tikzpicture}% \begin{tkzexample}[vbox,small] -\begin{tikzpicture}[scale=.75] - \tkzDefPoint(0,0){D} \tkzDefPoint(8,0){A} - \tkzDefSquare(D,A) \tkzGetPoints{B}{C} - \tkzDefMidPoint(D,A) \tkzGetPoint{E} - \tkzInterLC(D,A)(E,B)\tkzGetSecondPoint{F} - \tkzInterLC(A,B)(A,F)\tkzGetSecondPoint{G} - \tkzDefSquare(A,F)\tkzGetFirstPoint{H} - \tkzInterLL(C,D)(H,G)\tkzGetPoint{I} - \tkzFillPolygon[teal!10](I,G,B,C) - \tkzFillPolygon[teal!10](A,F,H,G) - \tkzDrawArc[angles](E,B)(0,120) - \tkzDrawSemiCircle(A,F) - \tkzDrawSegments(A,F E,B H,I F,H) - \tkzDrawPolygons(A,B,C,D) - \tkzDrawPoints(A,...,I) - \tkzLabelPoints[below right](A,E,D,F,I) - \tkzLabelPoints[above right](C,B,G,H) -\end{tikzpicture} + \begin{tikzpicture}[scale=.75] + \tkzDefPoint(0,0){D} \tkzDefPoint(8,0){A} + \tkzDefSquare(D,A) \tkzGetPoints{B}{C} + \tkzDefMidPoint(D,A) \tkzGetPoint{E} + \tkzInterLC(D,A)(E,B)\tkzGetSecondPoint{F} + \tkzInterLC[near](B,A)(A,F)\tkzGetFirstPoint{G} + \tkzDefSquare(A,F)\tkzGetFirstPoint{H} + \tkzInterLL(C,D)(H,G)\tkzGetPoint{I} + \tkzFillPolygon[teal!10](I,G,B,C) + \tkzFillPolygon[teal!10](A,F,H,G) + \tkzDrawArc[angles](E,B)(0,120) + \tkzDrawSemiCircle(A,F) + \tkzDrawSegments(A,F E,B H,I F,H) + \tkzDrawPolygons(A,B,C,D) + \tkzDrawPoints(A,...,I) + \tkzLabelPoints[below right](A,E,D,F,I) + \tkzLabelPoints[above right](C,B,G,H) + \end{tikzpicture} \end{tkzexample} \newpage diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-labelling.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-labelling.tex index 4fbe35123c..f3c8a0b3da 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-labelling.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-labelling.tex @@ -93,7 +93,7 @@ Here the points are positioned relative to the center of gravity of $A,B,C \text \tkzDrawCircle(O,A) \tkzDrawPoints(O,A,B,C) \tkzDrawSegments(C,B B,A A,O O,C) - \tkzDefCentroid(A,B,C,O) + \tkzDefTriangleCenter[centroid](A,B,C) \tkzGetPoint{O} \tkzDrawPoint(tkzPointResult) \tkzLabelPoints(O,A,C,B) \end{tikzpicture} diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-lua.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-lua.tex new file mode 100644 index 0000000000..e5e9f999dd --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-lua.tex @@ -0,0 +1,22 @@ +\newpage +\section{Working with lua : option \tkzname{lua}} \label{calc_with_lua} + +You can now use the "lua" option with \tkzname{\tkznameofpack} version 5. +You just have to write in your preamble + + |usepackage[lua]{tkz-euclide}|. + Évidemment vous devrez compiler avec LuaLaTeX. Nothing changes for the syntax. + +Without the option you can use \tkzname{\tkznameofpack} with the proposed code of version 4.25. + +This version is not yet finalized although the documentation you are currently reading has been compiled with this option. + +Some information about the method used and the results obtained. Concerning the method, I considered two possibilities. The first one was simply to replace everywhere I could the calculations made by "xfp" or sometimes by "lua". This is how I went from "fp" to "xfp" and now to "lua". The second and more ambitious possibility would have been to associate to each point a complex number and to make the calculations on the complexes with "lua". Unfortunately for that I have to use libraries for which I don't know the license. + +Otherwise the results are good. This documentation with "LualaTeX" and "xfp" compiles in 47s while with "lua" it takes only 30s for 236 pages. + +Another document of 61 pages is compiled 16s with "pdflaTeX" and "xfp" and 13s with "LualaTeX" and "xfp". + +This documentation compiles with |\usepackage{tkz-base}| and |\usepackage[lua]{tkz-euclide}| but I didn't test all the interactions thoroughly. + +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex index 9203b9e562..1f4e33dd60 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex @@ -1,6 +1,6 @@ % !TEX TS-program = lualatex % encoding : utf8 -% Documentation of tkz-euclide v4 +% Documentation of tkz-euclide v5 % Copyright 2022 Alain Matthes % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -22,10 +22,10 @@ ]{tkz-doc} %\usepackage{etoc} \gdef\tkznameofpack{tkz-euclide} -\gdef\tkzversionofpack{4.25c} +\gdef\tkzversionofpack{5.00c} \gdef\tkzdateofpack{\today} \gdef\tkznameofdoc{doc-tkz-euclide} -\gdef\tkzversionofdoc{4.25c} +\gdef\tkzversionofdoc{5.00c} \gdef\tkzdateofdoc{\today} \gdef\tkzauthorofpack{Alain Matthes} \gdef\tkzadressofauthor{} @@ -37,7 +37,9 @@ % -- Packages --------------------------------------------------- \usepackage[dvipsnames,svgnames]{xcolor} \usepackage{calc} -\usepackage{tkz-base,tkz-euclide,pgfornament} +\usepackage{tkz-base} +\usepackage[lua]{tkz-euclide} +\usepackage{pgfornament} \usetikzlibrary{backgrounds} \usepackage[colorlinks,pdfencoding=auto, psdextra]{hyperref} \hypersetup{ @@ -113,11 +115,11 @@ \begin{document} \parindent=0pt -\tkzTitleFrame{tkz-euclide\\Euclidean Geometry} +\tkzTitleFrame{tkz-euclide v5\\Euclidean Geometry} \clearpage \defoffile{\lefthand\ -From version 4.00, \tkzname{\tkznameofpack} became independent from \tkzname{tkz-base} . This has implied some changes : the next major step will be the version 5 which will see the introduction of Lua. To prepare for this change, I removed the last macros that allowed to plot and define at the same time. Indeed Lua will be there to make all the calculations and define all the necessary nodes. As for \TIKZ\ , it will remain to carry out the tracings, the markings and the labels.\\ +\tkzname{\tkznameofpack} passes in version 5 with the possibility of carrying out part of the calculations using \tkzname{lua}. See the "news" and "lua" sections for more information.\\ \tkzname{\tkznameofpack} is a set of convenient macros for drawing in a plane (fundamental two-dimensional object) with a Cartesian coordinate system. It handles the most classic situations in Euclidean Geometry. \tkzname{\tkznameofpack} is built on top of PGF and its associated front-end \TIKZ\ and is a (La)TeX-friendly drawing package. The aim is to provide a high-level user interface to build graphics relatively simply. The idea is to allow you to follow step by step a construction that would be done by hand as naturally as possible.\\ English is not my native language so there might be some errors. } @@ -128,7 +130,7 @@ English is not my native language so there might be some errors. \lefthand\ Firstly, I would like to thank \textbf{Till Tantau} for the beautiful \LaTeX{} package, namely \href{http://sourceforge.net/projects/pgf/}{\TIKZ}. \vspace*{12pt} -\lefthand\ Acknowledgements : I received much valuable advice, remarks, corrections and examples from \tkzimp{Jean-Côme Charpentier}, \tkzimp{Josselin Noirel}, \tkzimp{Manuel Pégourié-Gonnard}, \tkzimp{Franck Pastor}, \tkzimp{David Arnold}, \tkzimp{Ulrike Fischer}, \tkzimp{Stefan Kottwitz}, \tkzimp{Christian Tellechea}, \tkzimp{Nicolas Kisselhoff}, \tkzimp{David Arnold}, \tkzimp{Wolfgang Büchel}, \tkzimp{John Kitzmiller}, \tkzimp{Dimitri Kapetas}, \tkzimp{Gaétan Marris}, \tkzimp{Mark Wibrow}, \tkzimp{Yves Combe} for his work on a protractor, \tkzimp{Paul Gaborit}, \tkzimp{Laurent Van Deik} for all his corrections, remarks and questions and \tkzimp{Muzimuzhi Z} for the code about the option "dim". +\lefthand\ Acknowledgements : I received much valuable advice, remarks, corrections and examples from \tkzimp{Jean-Côme Charpentier}, \tkzimp{Josselin Noirel}, \tkzimp{Manuel Pégourié-Gonnard}, \tkzimp{Franck Pastor}, \tkzimp{David Arnold}, \tkzimp{Ulrike Fischer}, \tkzimp{Stefan Kottwitz}, \tkzimp{Christian Tellechea}, \tkzimp{Nicolas Kisselhoff}, \tkzimp{David Arnold}, \tkzimp{Wolfgang Büchel}, \tkzimp{John Kitzmiller}, \tkzimp{Dimitri Kapetas}, \tkzimp{Gaétan Marris}, \tkzimp{Mark Wibrow}, \tkzimp{Yves Combe} for his work on a protractor, \tkzimp{Paul Gaborit}, \tkzimp{Laurent Van Deik} for all his corrections, remarks and questions and \tkzimp{Muzimuzhi Z} for the code about the option "dim". A big thank you to \tkzimp{Chetan Shirore} and \tkzimp{Dr. Ajit Kumar} because their work on complex numbers in their package \tkzimp{luamaths} helped me a lot. \vspace*{12pt} \lefthand\ I would also like to thank Eric Weisstein, creator of MathWorld: @@ -152,6 +154,7 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch \part{General survey : a brief but comprehensive review} \input{TKZdoc-euclide-news.tex} +\input{TKZdoc-euclide-lua.tex} \input{TKZdoc-euclide-installation.tex} \input{TKZdoc-euclide-presentation.tex} \input{TKZdoc-euclide-elements.tex} diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-marking.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-marking.tex index c23d56a460..97bf596219 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-marking.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-marking.tex @@ -126,118 +126,6 @@ More delicate operation because there are many options. The symbols used for mar |, ||,|||, z, s, x, o, oo \end{tkzltxexample} -% Their definitions are as follows -% -% \begin{tkzltxexample}[] -% \pgfdeclareplotmark{||} -% %double bar -% {% -% \pgfpathmoveto{\pgfqpoint{2\pgflinewidth}{\pgfplotmarksize}} -% \pgfpathlineto{\pgfqpoint{2\pgflinewidth}{-\pgfplotmarksize}} -% \pgfpathmoveto{\pgfqpoint{-2\pgflinewidth}{\pgfplotmarksize}} -% \pgfpathlineto{\pgfqpoint{-2\pgflinewidth}{-\pgfplotmarksize}} -% \pgfusepathqstroke -% } -% \end{tkzltxexample} -% -% \begin{tkzltxexample}[] -% %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 -% } -% \end{tkzltxexample} -% -% \begin{tkzltxexample}[] -% % An bar slant -% \pgfdeclareplotmark{s|} -% {% -% \pgfpathmoveto{\pgfqpoint{-.70710678\pgfplotmarksize}% -% {-.70710678\pgfplotmarksize}} -% \pgfpathlineto{\pgfqpoint{.70710678\pgfplotmarksize}% -% {.70710678\pgfplotmarksize}} -% \pgfusepathqstroke -% } -% \end{tkzltxexample} -% -% -% \begin{tkzltxexample}[] -% % 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 -% } -% \end{tkzltxexample} -% -% -% \begin{tkzltxexample}[] -% % 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 -% } -% \end{tkzltxexample} -% -% \begin{tkzltxexample}[] -% % 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 -% } -% \end{tkzltxexample} -% -% \begin{tkzltxexample}[] -% % 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 -% } -% \end{tkzltxexample} -% % \tkzMarkAngle(B, A, C) @@ -300,6 +188,34 @@ options & default & definition \\ With common options, there is a macro for multiple angles. \end{NewMacroBox} +\subsection{Problem to mark a small angle: {\tkzname{Option veclen}}}\label{opt-veclen} + The problem comes from the "decorate" action and from the value used in size in + \tkzcname{tkzMarkAngle}. The solution is to enclose the macro \tkzcname{tkzMarkAngle}. + In the next example without the "scope" the result is : Latex Error: Dimension too large. + + \begin{tkzexample}[latex=6cm,small] + \begin{tikzpicture}[scale=1] + \tkzDefPoint(0,0){O} + \tkzDefPoint(2.5,0){N} + \tkzDefPoint(-4.2,0.5){M} + \tkzDefPointBy[rotation=center O angle 30](N) + \tkzGetPoint{B} + \tkzDefPointBy[rotation=center O angle -50](N) + \tkzGetPoint{A} + \tkzInterLC[common=B](M,B)(O,B) \tkzGetFirstPoint{C} + \tkzInterLC[common=A](M,A)(O,A) \tkzGetFirstPoint{A'} + \tkzDrawSegments(A,C M,A M,B A,B) + \tkzDrawCircle(O,N) + \begin{scope}[veclen] + \tkzMarkAngle[mkpos=.2, size=1.2](C,A,M) + \end{scope} + \tkzDrawPoints(O, A, B, M, B, C, A') + \tkzLabelPoints[right](O,A,B) + \tkzLabelPoints[above left](M,C) + \tkzLabelPoint[below left](A'){$A'$} + \end{tikzpicture} + \end{tkzexample} + \subsection{Marking a right angle: {\tkzcname{tkzMarkRightAngle}}} diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex index a36ade459b..d4efae7995 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-news.tex @@ -1,5 +1,15 @@ \section*{News and compatibility} +\subsection{With 5.0 version} % (fold) + +\begin{itemize} + + \item Finally, I added the "lua" option for the package \tkzname{\tkznameofpack}. This allows to do the calculations for the main functions using lua; (see \ref{calc_with_lua}). The syntax is unchanged. Nothing changes for the user. + + \item The "xfp" option has become "veclen" see \ref{opt-veclen}; + +\end{itemize} + \subsection{With 4.2 version} % (fold) \label{sub:with_4_2_version} @@ -43,7 +53,7 @@ If you want to draw a circle, you can't do so |\tkzDrawCircle[R](A,1)|. First yo \item |\tkzDefLine[euler](A,B,C)| is a macro that allows you to obtain the line of \tkzname{Euler} when possible. |\tkzDefLine[altitude](A,B,C)| is possible again, as well as |\tkzDefLine[tangent at=A](O)| and |\tkzDefLine[tangent from=P](O,A)| which did not works; -\item | \tkzDefTangent| is replaced by |\tkzDelLine[tangent from = ...]| or |\tkzDelLine[tangent at = ...]|; +\item | \tkzDefTangent| is replaced by |\tkzDefLine[tangent from = ...]| or |\tkzDefLine[tangent at = ...]|; \item I added the macro |\tkzPicAngle[tikz options](A,B,C)| for those who prefer to use \TIKZ ; @@ -117,6 +127,7 @@ As a reminder, the following changes have been made previously: you can use |\iftkzLinear| (idem for |\tkzIsOrtho|); \item A style for vectors has been added that you can of course modify + |tikzset{vector style/.style={>=Latex,->}}|; diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-others.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-others.tex index 0548bbaf6a..0df63975d8 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-others.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-others.tex @@ -69,10 +69,9 @@ Another possiblity is to use \tkzcname{tkzFillAngle}. \tkzDrawCircle(O,N) \tkzLabelCircle[above left](O,N)(120){% $\mathcal{C}$} - \begin{scope}[xfp] - \tkzMarkAngle[mkpos=.2, size=1.2](C,A,M) + \begin{scope}[veclen] + \tkzMarkAngle[mkpos=.2, size=1.2](C,A,M) \end{scope} - \tkzDrawPoints(O, A, B, M, B, C) \tkzLabelPoints[right](O,A,B) \tkzLabelPoints[above left](M,C) diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex index e9fc2c6388..6228a9b8a8 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-presentation.tex @@ -240,8 +240,8 @@ We draw the circle $\mathcal{K}$ with center $D$ and passing through $G$. It int \tkzDefPoint(0.75,0.25){B} \tkzDefPoint(1,1.5){C} \tkzDefTriangle[equilateral](A,B) \tkzGetPoint{D} -\tkzInterLC[near](D,B)(B,C) \tkzGetSecondPoint{G} -\tkzInterLC[near](D,A)(D,G) \tkzGetFirstPoint{L} +\tkzInterLC[near](D,B)(B,C) \tkzGetSecondPoint{G} +\tkzInterLC[near](A,D)(D,G) \tkzGetFirstPoint{L} \tkzDrawCircles(B,C D,G) \tkzDrawLines[add=0 and 2](D,A D,B) \tkzDrawSegment(A,B) @@ -259,10 +259,14 @@ We draw the circle $\mathcal{K}$ with center $D$ and passing through $G$. It int \end{tikzpicture} \end{tkzexample} -\subsection{\tkzname{\tkznameofpack 4} vs \tkzname{\tkznameofpack 3}} +\subsection{\tkzname{\tkznameofpack\ 4} vs \tkzname{\tkznameofpack\ 3}} Now I am no longer a Mathematics teacher, and I only spend a few hours studying geometry. I wanted to avoid multiple complications by trying to make \tkzname{tkz-euclide} independent of \tkzname{tkz-base}. Thus was born \tkzname{\tkznameofpack} 4. The latter is a simplified version of its predecessor. The macros of \tkzname{tkz-euclide 3} have been retained. The unit is now \tkzname{cm}. If you need some macros from \tkzname{tkz-base}, you may need to use the \tkzcname{tkzInit}. +\subsection{\tkzname{\tkznameofpack\ 5} vs \tkzname{\tkznameofpack\ 4}} + +Rien ne change pour l'utilisateur. La compilation doit être effectuée avec le moteur LuaLaTeX et les résultats sont plus précis et obtenus plus rapidement. Il suffit de charger \tkzname{\tkznameofpack} 5 comme ceci |\usepackage[lua{tkz-euclide}]|. + \subsection{How to use the \tkzname{\tkznameofpack} package ?} \subsubsection{Let's look at a classic example} In order to show the right way, we will see how to build an equilateral triangle. Several possibilities are open to us, we are going to follow the steps of Euclid. @@ -274,7 +278,7 @@ In order to show the right way, we will see how to build an equilateral triangle \end{verbatim} \item Then load the \tkzname{\tkznameofpack} package: \begin{verbatim} -\usepackage{tkz-euclide} +\usepackage{tkz-euclide} or \usepackage[lua]{tkz-euclide} \end{verbatim} You don't need to load \TIKZ\ because the \tkzname{\tkznameofpack} package works on top of TikZ and loads it. diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-tools.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-tools.tex index 979801aa33..1123d86a2f 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-tools.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-tools.tex @@ -294,12 +294,11 @@ arguments & example & explanation \\ \tkzDrawPoints(A,H) \tkzLabelPoints(A,B,H) \tkzLabelPoints[above](C) \tkzDotProduct(A,B,C) \tkzGetResult{pabc} - \pgfmathparse{round(10*\pabc)/10} + % \pgfmathparse{round(10*\pabc)/10} \let\pabc\pgfmathresult - \node at (1,-3) {% - $\overrightarrow{PA}\cdot \overrightarrow{PB}=\pabc$}; + \node at (1,-3) {$\overrightarrow{PA}\cdot \overrightarrow{PB}=\pabc$}; \tkzDotProduct(A,H,B) \tkzGetResult{phab} - \pgfmathparse{round(10*\phab)/10} + % \pgfmathparse{round(10*\phab)/10} \let\phab\pgfmathresult \node at (1,-4) {$PA \times PH = \phab $}; \end{tikzpicture} diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf b/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf index 540a04d5a5..c24f592ca7 100644 Binary files a/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf and b/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf differ diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex new file mode 100644 index 0000000000..3676422441 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex @@ -0,0 +1,538 @@ +% tkz-tool-eu-angles.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-tool-eu-angles.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% tkzSetUpArc +%<--------------------------------------------------------------------------–> +\pgfkeys{/tkzsetuparc/.cd, + color/.store in = \tkz@arc@color, + line width/.store in = \tkz@arc@lw, + style/.store in = \tkz@arc@style, + line width = \tkz@euc@linewidth, + color = \tkz@euc@linecolor, + style = \tkz@euc@linestyle, + /tkzsetuparc/.search also = {/tikz,/tkzcompass}, + } +\def\tkzSetUpArc{\pgfutil@ifnextchar[{\tkz@SetUpArc}{\tkz@SetUpArc[]}} +\def\tkz@SetUpArc[#1]{% +\pgfqkeys{/tkzsetuparc}{#1} +\tikzset{arc style/.style={color = \tkz@arc@color, + line width = \tkz@arc@lw, + style = \tkz@arc@style + }} +}% end setup +%<------------------------------ Arcs -------------------------------------– +% options : delta +% \def\tkz@delta{0} +% \tikzset{arc style/.style={#1}} +% \pgfkeys{/tikz/.cd,delta/.code={\def\tkz@delta{#1}}} +\newif\iftkz@reverse +\gdef\tkz@numa{0} +\pgfkeys{/tkzdrawarc/.cd, + type/.is choice, + type/towards/.code = \def\tkz@numa{0}, + type/rotate/.code = \def\tkz@numa{1}, + type/angles/.code = \def\tkz@numa{2}, + type/R/.code = \def\tkz@numa{3}, + type/R with nodes/.code = \def\tkz@numa{4}, + towards/.style = {type=towards}, + rotate/.style = {type=rotate}, + R/.style = {type=R}, + angles/.style = {type=angles}, + R with nodes/.style = {type=R with nodes}, + diameter/.code = {}, + arc/.code = {}, + size/.code = {}, + mark/.code = {}, + mkpos/.code = {}, + mksize/.code = {}, + mkcolor/.code = {}, + type/.default = towards, + delta/.store in = \tkz@delta, + delta = 0, + reverse/.is if = tkz@reverse, + reverse/.default = true, + reverse = false, + /tkzdrawarc/.search also = {/tikz} +} +\def\tkzDrawArc{\pgfutil@ifnextchar[{\tkz@DrawArc}{\tkz@DrawArc[]}} +\def\tkz@DrawArc[#1](#2,#3)(#4){% +\begingroup +\pgfqkeys{/tkzdrawarc}{#1} +\ifcase\tkz@numa% + \tkzDrawArcTowards[#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 +} +%<--------------------------------------------------------------------------–> +% ARC nodes #2 center #3 first point last point #4 +% delta un peu plus à chaque extrémité +% example : \tkzDrawArc(A,B)(C) +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcTowards{\pgfutil@ifnextchar[{\tkz@DrawArcN}{\tkz@DrawArcN[]}} +\def\tkz@DrawArcN[#1](#2,#3)(#4){% +\begingroup + \tkz@@CalcLengthcm(#2,#3){tkz@radius} + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} + \tkz@DrawArcRAngles[#1](#2,\tkz@radius)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +% nodes #2 center #3 first point rotate #4 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 + \tkz@@CalcLength(#2,#3){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 + \tkz@@CalcLength(#2,#3){tkzLengthResult} + \tkz@DrawArcRAngles[#1](#2,\tkzLengthResult pt)(#4,#5) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Degree #2 center #4 - #3 radius from #5 (degree) to #6(degree) +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcRwithNodes{\pgfutil@ifnextchar[{\tkz@DrawArcRwithNodes}{% + \tkz@DrawArcRwithNodes[]}} +\def\tkz@DrawArcRwithNodes[#1](#2,#3,#4)(#5,#6){% +\begingroup + \tkz@@CalcLength(#3,#4){tkzLengthResult} + \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)(A,B) +%<--------------------------------------------------------------------------–> +\def\tkzDrawArcR{\pgfutil@ifnextchar[{\tkz@DrawArcR}{\tkz@DrawArcR[]}} +\def\tkz@DrawArcR[#1](#2,#3)(#4,#5){% +\begingroup + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@SecondAngle} + \tkz@DrawArcRAngles[#1](#2,#3)(\tkz@FirstAngle,\tkz@SecondAngle) +\endgroup +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% #1 center #2 radius #4 first angle (degree) #5 second angle (degree) +% angles 0 .. 180 or -180 .. 0 +%<--------------------------------------------------------------------------–> +% example : \tkzDrawArc(A,2)(30,90) +\def\tkzDrawArcRAngles{\pgfutil@ifnextchar[{\tkz@DrawArcRAngles}{% + \tkz@DrawArcRAngles[]}} +\def\tkz@DrawArcRAngles[#1](#2,#3)(#4,#5){% + \begingroup + \tkzNormalizeAngle(#4,#5) + \pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} + \edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathadd{\tkz@SecondAngle}{\tkz@delta} + \edef\tkz@SecondAngle{\pgfmathresult} + \iftkz@reverse + \let\tkztemp\tkz@FirstAngle + \let\tkz@FirstAngle\tkz@SecondAngle + \let\tkz@SecondAngle\tkztemp + \fi + \draw[shift = {(#2)},arc style,/tkzdrawarc/.cd,#1]% + (\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3); +\endgroup +} +%<--------------------------------------------------------------------------–> +\pgfkeys{ + /@tkzmarkarc/.cd, + pos/.store in = \tkz@mkarcpos, + color/.store in = \tkz@mkcolor, + mark/.store in = \tkz@markarcseg, + size/.store in = \tkz@mkarcsize, + color = teal!20, + size = 4pt, + pos = .5, + mark = none, + /@tkzmarkarc/.search also={/tikz}, +} +\def\tkzMarkArc{\pgfutil@ifnextchar[{\tkz@MarkArc}{\tkz@MarkArc[]}} +\def\tkz@MarkArc[#1](#2,#3,#4){% +\begingroup + \pgfqkeys{/@tkzmarkarc}{#1} \def\tkz@mymarkarc{\pgfsetplotmarksize{\tkz@mkarcsize}\pgfuseplotmark{\tkz@markarcseg}} +\tkz@@CalcLength(#2,#3){tkz@radius} +\tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} +\tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} +\tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) + \pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} + \edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathadd{\tkz@SecondAngle}{\tkz@delta} + \edef\tkz@SecondAngle{\pgfmathresult} +\begin{scope}[decoration={markings,mark=at position \tkz@mkarcpos with {\tkz@mymarkarc}}] +\path[shift = {(#2)},\tkz@mkcolor,/@tkzmarkarc/.cd,#1,postaction={decorate}]% +(\tkz@FirstAngle:\tkz@radius pt) arc (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@radius pt); +\end{scope} +\endgroup +} + +\def\tkzLabelArc{\pgfutil@ifnextchar[{\tkz@LabelArc}{\tkz@LabelArc[]}} +\def\tkz@LabelArc[#1](#2,#3,#4)#5{% +\begingroup +\pgfqkeys{/@tkzmarkarc}{#1} +\tkz@@CalcLength(#2,#3){tkz@radius} +\tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} +\tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} +\tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) +\pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} +\edef\tkz@FirstAngle{\pgfmathresult}% +\pgfmathadd{\tkz@SecondAngle}{\tkz@delta} +\edef\tkz@SecondAngle{\pgfmathresult} +\begin{scope}[decoration={markings,mark=at position \tkz@mkarcpos with \node{#5};}] + \path[shift = {(#2)},/@tkzmarkarc/.cd,#1,postaction={decorate}]% + (\tkz@FirstAngle:\tkz@radius pt) arc (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@radius pt); \end{scope} +\endgroup +} +%<---------------------------------------------------------------------------> +% tkzDrawArcRAN > +%<---------------------------------------------------------------------------> +\def\tkzDrawArcRAN[#1](#2,#3)(#4,#5){% +\begingroup + \draw[shift = {(#2)},/tkzdrawarc/.cd,#1] (#4:#3) arc (#4:#5:#3); +\endgroup +} +%<--------------- tkzPathArcRAN ---------------------------------- +\def\tkzPathArcRAN[#1](#2,#3)(#4,#5){% +\begingroup + \path[shift = {(#2)},/tkzdrawarc/.cd,#1] (#4:#3) arc (#4:#5:#3); +\endgroup +} +%<---------------------------------------------------------------------------> +% Mark an angle modi 3.03 suppression de \tkz@mksize, +%<---------------------------------------------------------------------------> +% \tkzMarkAngle(B, A, C) +% +% Marque d'angle +% arc de cercle (simple/double/triple) et marque d'églité. +% +% Par défaut: +% arc = simple +% size = 1 (rayon de l'arc) +% style traits pleins +% mkpos ? position: 0.5 (position de la marque) +% mark rien du tout (ignoré si type est utilisé) +% +% Paramètres (optionnels) +% arc : l, ll, lll +% mksize : 1 +% gap : 3pt +% dist ? +% style : type de traits +% position: 0.5 +% mark : none , |, ||,|||, z, s, x, o, oo mais tous les +% % symboles de tikz sont permis +%<------------------------- Label on angle --------------------------------> +\def\tkz@arcsimple{l} +\def\tkz@arcdouble{ll} +\def\tkz@arctriple{lll} + +%\tikzset{lbstyle/.style = {color=\tkz@mainlinecolor}} + +\pgfkeys{/tkzmkangle/.cd, + arc/.estore in = \tkz@arc, + size/.store in = \tkz@size, + mark/.store in = \tkz@markang, + mkpos/.estore in = \tkz@mkpos, + mksize/.store in = \tkz@mksize, + mkcolor/.store in = \tkz@mkcolor, + arc = l, + size = 1, + mark = none, + mksize = 4pt, + mkcolor = black, + mkpos = 0.5, + /tkzmkangle/.search also={/tikz} +} +\def\tkzMarkAngle{\pgfutil@ifnextchar[{\tkz@MarkAngle}{\tkz@MarkAngle[]}} +\def\tkz@MarkAngle[#1](#2,#3,#4){% +\begingroup +\pgfqkeys{/tkzmkangle}{#1} +\tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} +\tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} +\tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) + +\def\tkz@mymark{\pgfsetplotmarksize{\tkz@mksize}\pgfuseplotmark{\tkz@markang}} +% draw the arcs +\begin{scope}[veclen] + \begin{scope}[decoration= {markings, + mark=at position \tkz@mkpos with {\tkz@mymark}}] + \ifx\tkz@arc\tkz@arcsimple + \tkzDrawArcRAN[#1,fill=none]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzPathArcRAN[\tkz@mkcolor,postaction={decorate}]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle) + \else + \ifx\tkz@arc\tkz@arcdouble + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm-2.5\pgflinewidth)% + (\tkz@FirstAngle,\tkz@SecondAngle) + \tkzPathArcRAN[\tkz@mkcolor,postaction={decorate}]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm+2.5\pgflinewidth)% + (\tkz@FirstAngle,\tkz@SecondAngle)% + \else + \ifx\tkz@arc\tkz@arctriple + \tkzDrawArcRAN[#1,fill=none]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzPathArcRAN[\tkz@mkcolor,postaction={decorate}]% + (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm-2.5\pgflinewidth)% + (\tkz@FirstAngle,\tkz@SecondAngle)% + \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm+2.5\pgflinewidth)% + (\tkz@FirstAngle,\tkz@SecondAngle)% + \fi + \fi + \fi + \end{scope} +\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){% +\xdef\tkz@optma{#1} + \begingroup + \let\next\tkz@multiMA + \next#2 \@nil % +\endgroup +} +% fin de \tkzMarkAngle +%<---------------------------------------------------------------------------> +% Pic Angle +%<---------------------------------------------------------------------------> +\def\tkzPicAngle{\pgfutil@ifnextchar[{\tkz@PicAngle}{\tkz@PicAngle[]}} +\def\tkz@PicAngle[#1](#2,#3,#4){% +\begingroup +\draw pic [#1]{angle=#2--#3--#4}; +\endgroup +} +\def\tkzPicRightAngle{\pgfutil@ifnextchar[{\tkz@PicRightAngle}{\tkz@PicRightAngle[]}} +\def\tkz@PicRightAngle[#1](#2,#3,#4){% +\begingroup +\draw pic [#1]{right angle=#2--#3--#4}; +\endgroup +} +%<---------------------------------------------------------------------------> +% FillAngle +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzFill/.cd, + size/.store in = \tkz@size, + size = 1, + /tkzFill/.search also = {/tikz} + } + +\def\tkzFillAngle{\pgfutil@ifnextchar[{\tkz@FillAngle}{\tkz@FillAngle[]}} +\def\tkz@FillAngle[#1](#2,#3,#4){% +\begingroup +\pgfqkeys{/tkzFill}{#1} + \tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} + \tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} + \tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) + \path[shift = {(#3)},fill=\tkz@euc@linecolor!10,/tkzFill/.cd,#1]% + (#3) -- (\tkz@FirstAngle:\tkz@size) arc% + (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@size)--cycle; +\endgroup +} +%<---------------------------------------------------------------------------> +% multiple +\def\tkz@multiFA#1 #2\@nil{\protected@edef\tkz@temp{% + \noexpand \tkzFillAngle[\tkz@optfa](#1)}% + \tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<---------------------------------------------------------------------------> +\def\tkzFillAngles{\pgfutil@ifnextchar[{\tkz@MFillAngles}{\tkz@MFillAngles[]}} +\def\tkz@MFillAngles[#1](#2){% +\xdef\tkz@optfa{#1} +\begingroup + \let\next\tkz@multiFA + \next#2 \@nil % +\endgroup +} +%<------------------------- Label on angle --------------------------------> +\pgfkeys{/tkzlabelangle/.cd, + dist/.store in = \tkzlabeldist, + angle/.store in = \tkzlabelangle, + dist = 1, + angle = {}, + /tkzlabelangle/.search also={/tikz} +} +\def\tkzLabelAngle{\pgfutil@ifnextchar[{\tkz@LabelAngle}{\tkz@LabelAngle[]}} +\def\tkz@LabelAngle[#1](#2,#3,#4)#5{%2016 added normalize from karu's code +\begingroup + \pgfqkeys{/tkzlabelangle}{#1} + \ifx\tkzutil@empty\tkzlabelangle% no value so calc angle of bisector + \tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} + \tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} + \tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) + \edef\tkzlabelAngle{\fpeval{(\tkz@SecondAngle+\tkz@FirstAngle)/2}} + \fi + \path (#3) --+(\tkzlabelAngle:\tkzlabeldist) node[label angle style,% + /tkzlabelangle/.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{% + \def\tkz@optlba{#1} + \def\tkz@labelangle{#3} + \begingroup + \let\next\tkz@multiLBA + \next#2 \@nil % + \endgroup +} +%<----------------------------------------------------------------------- +% Symbole droites perpendiculaires +%<---------------------------------------------------------------------- +\pgfkeys{/tkzrightangle/.cd, + norm tkz code/.is if = normtkzcode@execute, + german/.code = \normtkzcode@executefalse, + size/.store in = \tkz@ra@size, + dotsize/.store in = \tkz@dotsize, + size = .25, + dotsize = 3 pt, + /tkzrightangle/.search also={/tikz}, +} +\newcommand*{\tkzMarkRightAngle}[1][]{\tkz@MarkRightAngle[#1]} +\def\tkz@MarkRightAngle[#1](#2,#3,#4){% +\begingroup +\normtkzcode@executetrue +\pgfqkeys{/tkzrightangle}{#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% + \ifnormtkzcode@execute% + \draw[/tkzrightangle/.cd,#1] + (#3) --++( 28.45274*\tkz@ra@size\tkz@ax , 28.45274*\tkz@ra@size\tkz@ay) + --++( 28.45274*\tkz@ra@size\tkz@bx , 28.45274*\tkz@ra@size\tkz@by) + --++(-28.45274*\tkz@ra@size\tkz@ax ,-28.45274*\tkz@ra@size\tkz@ay) + -- (#3); + \else% + % find angles + \tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} + \tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} + \tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) + \edef\tkzCircleAngle{\fpeval{(\tkz@SecondAngle+\tkz@FirstAngle)/2}} + \tkzDrawArcRAN[/tkzrightangle/.cd,#1](#3,\tkz@ra@size)% + (\tkz@FirstAngle,\tkz@SecondAngle) + \path (#3) --+ (\tkzCircleAngle:\tkz@ra@size/2) + node[fill,circle,minimum size=\tkz@dotsize, + inner sep=0 pt,/tkzrightangle/.cd,#1] {}; +\fi% +\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){% +\xdef\tkz@optRA{#1} +\begingroup + \let\next\tkz@multiRA + \next#2 \@nil % +\endgroup +} +%<---------------------------------------------------------------------------> +% tkzdefMidArc center and two points +\def\tkzDefMidArc(#1,#2,#3){% +\begingroup +\tkz@@CalcLength(#1,#2){tkz@radius} +\tkzFindSlopeAngle(#1,#2)\tkzGetAngle{tkz@FirstAngle} +\tkzFindSlopeAngle(#1,#3)\tkzGetAngle{tkz@SecondAngle} +\tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) + \path[shift = {(#1)}](\tkz@FirstAngle:\tkz@radius pt) arc + (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@radius pt) coordinate[midway] (tkzPointResult); +\endgroup +} +\makeatother + +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex new file mode 100644 index 0000000000..8a9764d763 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex @@ -0,0 +1,165 @@ +% tkz-obj-eu-draw-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-eu-draw-circles.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% tkzSetUpCircle +%<--------------------------------------------------------------------------–> +\pgfkeys{% + /tkzsetupcirc/.cd, + color/.code = \def\tkz@circle@color{#1}, + line width/.code = \def\tkz@circle@linewidth{#1}, + style/.code = \def\tkz@circle@style{#1}, + /tkzsetupcirc/.search also = {/tikz} + } + %<--------------------------------------------------------------------------–> + +\def\tkzSetUpCircle{\pgfutil@ifnextchar[{\tkz@SetUpCircle}{\tkz@SetUpCircle[]}} +\def\tkz@SetUpCircle[#1]{% +\pgfkeys{% + tkzsetupcirc/.cd, + line width = \tkz@euc@circlelw, + color = \tkz@euc@circlecolor, + style = \tkz@euc@circlestyle +} +\pgfqkeys{/tkzsetupcirc}{#1} +\tikzset{% + circle style/.append style = { % + color = \tkz@circle@color, + line width = \tkz@circle@linewidth, + style = \tkz@circle@style, + #1} + } +}% end setup + %<--------------------------------------------------------------------------–> + +\def\tkzDrawCircle{\pgfutil@ifnextchar[{\tkz@DrawCircle}{\tkz@DrawCircle[]}} +\def\tkz@DrawCircle[#1](#2,#3){% +\begingroup +\node [draw,circle through=(#3), circle style,#1] at (#2) {}; +%perhaps I need to use the last method + % \tkzCalcLength(#2,#3) \tkzGetLength{tkz@ncradius} + % \draw[circle style,#1](#2) circle (\tkz@ncradius); +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkz@multicircles#1 #2\@nil{% +\protected@edef\tkz@temp{ +\noexpand \tkzDrawCircle[\tkz@optcircle](#1)}\tkz@temp% +\def\tkz@nextArg{#2}% +\ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble +\fi +\next#2\@nil +}% +%<--------------------------------------------------------------------------–> +\def\tkzDrawCircles{\pgfutil@ifnextchar[{\tkz@DrawCircles}{\tkz@DrawCircles[]}} +\def\tkz@DrawCircles[#1](#2){% +\xdef\tkz@optcircle{#1} +\begingroup + \let\next\tkz@multicircles + \next#2 \@nil % +\endgroup +}% +%<--------------------------------------------------------------------------–> +% #2 #3 rayon + +\def\tkzDrawSemiCircle{\pgfutil@ifnextchar[{\tkz@DrawSemiCircle}{% + \tkz@DrawSemiCircle[]}} +\def\tkz@DrawSemiCircle[#1](#2,#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{#3}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% + \path(#2)--++(-\tkz@ax,-\tkz@ay) coordinate (tkz@pt); + \tkzDrawArc[#1,delta=0](#2,#3)(tkz@pt) +\endgroup +}% +%<--------------------------------------------------------------------------–> +\def\tkz@multisemicircles#1 #2\@nil{% +\protected@edef\tkz@temp{ +\noexpand \tkzDrawSemiCircle[\tkz@optsemicircle](#1)}\tkz@temp% +\def\tkz@nextArg{#2}% +\ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble +\fi +\next#2\@nil +}% +%<--------------------------------------------------------------------------–> +\def\tkzDrawSemiCircles{\pgfutil@ifnextchar[{\tkz@DrawSemiCircles}{% +\tkz@DrawSemiCircles[]}} +\def\tkz@DrawSemiCircles[#1](#2){% +\xdef\tkz@optsemicircle{#1} +\begingroup + \let\next\tkz@multisemicircles + \next#2 \@nil % +\endgroup +}% +%<---------------------------- Fill Circle --------------------------------–> +\def\tkzFillCircle{\pgfutil@ifnextchar[{\tkz@FillCircle}{\tkz@FillCircle[]}} +\def\tkz@FillCircle[#1](#2,#3){% +\begingroup + \node [fill,circle through=(#3),#1] at (#2) {}; +\endgroup +}% +\def\tkz@multifillcircles#1 #2\@nil{% +\protected@edef\tkz@temp{ +\noexpand \tkzFillCircle[\tkz@optfillcircle](#1)}\tkz@temp% +\def\tkz@nextArg{#2}% +\ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble +\fi +\next#2\@nil +}% +\def\tkzFillCircles{\pgfutil@ifnextchar[{\tkz@FillCircles}{% +\tkz@FillCircles[]}} +\def\tkz@FillCircles[#1](#2){% +\xdef\tkz@optfillcircle{#1} +\begingroup + \let\next\tkz@multifillcircles + \next#2 \@nil % +\endgroup +}% + +%<--------------------------- Clip Circle ---------------------------------–> +\pgfkeys{/tkzclipc/.cd, + out code/.is if = tkzClipOutCircle, + out/.code = \tkzClipOutCirclefalse +}% +%<--------------------------------------------------------------------------–> +\def\tkzClipCircle{\pgfutil@ifnextchar[{\tkz@ClipCircle}{\tkz@ClipCircle[]}} +\def\tkz@ClipCircle[#1](#2,#3){% +\tkzClipOutCircletrue +\pgfqkeys{/tkzclipc}{#1} + \tkz@@CalcLength(#2,#3){tkzLengthResult} + \iftkzClipOutCircle + \clip (#2) circle (\tkzLengthResult pt); + \else + \clip (#2) circle (\tkzLengthResult pt) [tkzreverseclip] ; + \fi +} +%<--------------------------- Label Circle --------------------------------–> +\def\tkzLabelCircle{\pgfutil@ifnextchar[{\tkz@LabelCircle}{% + \tkz@LabelCircle[]}} +% [option] (#2,#3) #2 center #3 un point du cercle #4 angle #5 the label +\def\tkz@LabelCircle[#1](#2,#3)(#4)#5{% +\begingroup + \tkzURotateAngle(#2,#4)(#3) + \node[label style,#1] at (tkzPointResult) {#5}; +\endgroup +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex new file mode 100644 index 0000000000..76f3a888be --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex @@ -0,0 +1,100 @@ +% tkz-obj-eu-compass.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-eu-compass.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% Author Alain Matthes +% idea from Y. Combe +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% Utilisation du Compas : Compass +%<--------------------------------------------------------------------------–> +% Setup Compass +%<--------------------------------------------------------------------------–> +\pgfkeys{tkzsucompass/.cd, + line width/.store in = \tkz@compass@lw, + color/.store in = \tkz@compass@color, + style/.store in = \tkz@compass@style, + line width = \tkz@euc@compasswidth, + color = \tkz@euc@compasscolor, + style = \tkz@euc@compassstyle, + /tkzsucompass/.search also = {/tikz,/tkzcompass} + } +%<--------------------------------------------------------------------------–> +\def\tkzSetUpCompass{\pgfutil@ifnextchar[{\tkz@SetUpCompass}{\tkz@SetUpCompass[]}} +%<--------------------------------------------------------------------------–> +\def\tkz@SetUpCompass[#1]{% +\pgfqkeys{/tkzsucompass}{#1} +\tikzset{compass style/.style={% + color = \tkz@compass@color, + line width = \tkz@compass@lw, + style = \tkz@compass@style + }} +} +%<--------------------------------------------------------------------------–> +% \tkzCompass(A, B) +% +% Marque de compas auto-ajustée en longueur +% #2 center #3 le point +% Par défaut: +% longueur : 1cm, mais avec un maximum d'un angle de 180° +% angle calculé pour la longueur +% style traits pleins + +%<--------------------------------------------------------------------------–> + \pgfkeys{/tkzcompass/.cd, + delta/.store in = \tkz@delta, + length/.store in = \tkz@length, + length = 1, + delta = 0, + /tkzcompass/.unknown/.code = {\let\searchname=\pgfkeyscurrentname + \pgfkeysalso{\searchname/.try=#1, /tikz/\searchname/.retry=#1}} +} + +\def\tkzCompass{\pgfutil@ifnextchar[{\tkz@Compass}{\tkz@Compass[]}} +\def\tkz@Compass[#1](#2,#3){% +\begingroup +\pgfkeys{tkzcompass/.cd,#1} +\tkz@@CalcLength(#2,#3){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 style,/tkzcompass/.cd,#1]% + (\tkz@angle-\tkz@delta:\tkz@tempLen pt)% + arc (\tkz@angle-\tkz@delta:\tkz@angle+\tkz@delta:\tkz@tempLen pt); +\endgroup} +%<--------------------------------------------------------------------------–> +\def\tkz@multiCompass#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzCompass[\tkz@optcompass](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +\def\tkzCompasss{\pgfutil@ifnextchar[{\tkz@Compasss}{\tkz@Compasss[]}} + +\def\tkz@Compasss[#1](#2){% +\global\edef\tkz@optcompass{#1} +\begingroup + \let\next\tkz@multiCompass + \next#2 \@nil % +\endgroup +}% + +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex new file mode 100644 index 0000000000..216bc15fcb --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex @@ -0,0 +1,281 @@ +% tkz-obj-eu-draw-lines.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-eu-draw-lines.tex} +\makeatletter + +%<--------------------------------------------------------------------------–> +% Setup Line +%<--------------------------------------------------------------------------–> +\pgfkeys{% + tkzsuline/.cd, + line width/.code = \def\tkz@line@width{#1}, + color/.code = \def\tkz@line@color{#1}, + style/.code = \def\tkz@line@style{#1}, + add/.code args = {#1 and #2} {\def\tkz@line@left{#1} + \def\tkz@line@right{#2}}, + /tkzsuline/.search also = {/tikz} +} +%<--------------------------------------------------------------------------–> +\def\tkzSetUpLine{\pgfutil@ifnextchar[{\tkz@SetUpLine}{\tkz@SetUpLine[]}} +\def\tkz@SetUpLine[#1]{% +\pgfkeys{% + tkzsuline/.cd, + line width = \tkz@euc@linewidth, + color = \tkz@euc@linecolor, + style = \tkz@euc@linestyle, + add = {\tkz@euc@lineleft} and {\tkz@euc@lineright}} +\pgfqkeys{/tkzsuline}{#1} +\tikzset{% + line style/.append style ={% + line width = \tkz@line@width, + color = \tkz@line@color, + style = \tkz@line@style, + add = {\tkz@line@left} and {\tkz@line@right}, + line cap = round, + #1} + } +}% end setup +%<--------------------------------------------------------------------------–> +% Drawing a line +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% \pgfkeys{/tkzdrawl/.cd, +% /tkzdrawl/.search also={/tikz} +% } +\def\tkzDrawLine{\pgfutil@ifnextchar[{\tkz@DrawLine}{\tkz@DrawLine[]}} +\def\tkz@DrawLine[#1](#2,#3){% +\begingroup + % \pgfqkeys{/tkzdrawl}{#1} + \draw[line style,#1] (#2) to (#3); +\endgroup +} +%<-------------------------------------------------------------------------– +% tkzDrawLines +%<-------------------------------------------------------------------------– +\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){% +\xdef\tkz@optline{#1} +\begingroup + \let\next\tkz@@multiLines + \next#2 \@nil % +\endgroup +}% +%<-------------------------------------------------------------------------–> +% Label +%<-------------------------------------------------------------------------–> +\def\tkzLabelLine{\pgfutil@ifnextchar[{\tkz@AddLabelLine}{\tkz@AddLabelLine[]}} +\def\tkz@AddLabelLine[#1](#2,#3)#4{\path (#2) to node[#1]{#4}(#3);} + + +%<--------------------------------------------------------------------------–> +% draw segment (s) +%<--------------------------------------------------------------------------–> +\pgfkeys{/tkzdraws/.cd, + /tkzdraws/.search also={/tikz}, +} +\def\tkzDrawSegment{\pgfutil@ifnextchar[{\tkz@DrawSegment}{% + \tkz@DrawSegment[]}} +\def\tkz@DrawSegment[#1](#2,#3){% +\scope + \pgfqkeys{/tkzdraws}{#1} + \draw[line style,add=0 and 0,#1] (#2) to (#3); +\endscope +}% + +\def\tkz@multiDrawSeg#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzDrawSegment[\tkz@optseg](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +\def\tkzDrawSegments{\pgfutil@ifnextchar[{\tkz@DrawSegments}{% + \tkz@DrawSegments[]}} +\def\tkz@DrawSegments[#1](#2){% +\def\tkz@optseg{#1} +\begingroup + \let\next\tkz@multiDrawSeg + \next#2 \@nil % +\endgroup +} +%<--------------------------------------------------------------------------–> +% Mark Segment +%<--------------------------------------------------------------------------–> +\pgfkeys{ + /@tkzmarkoptions/.cd, + pos/.store in = \tkz@mkpos, + color/.store in = \tkz@mkcolor, + mark/.store in = \tkz@markseg, + size/.store in = \tkz@mksize, + size = 4pt, + color = \tkz@mk@color, + pos = .5, + mark = |, + /@tkzmarkoptions/.search also={/tikz}, +} +\def\tkzMarkSegment{\pgfutil@ifnextchar[{\tkz@MarkSegment}{\tkz@MarkSegment[]}} +\def\tkz@MarkSegment[#1](#2,#3){% +\begingroup + \pgfqkeys{/@tkzmarkoptions}{#1} +\def\tkz@mymark{\pgfsetplotmarksize{\tkz@mksize}\pgfuseplotmark{\tkz@markseg}} +\begin{scope} + [decoration={markings,mark=at position \tkz@mkpos with {\tkz@mymark}}] + \path [\tkz@mkcolor,/@tkzmarkoptions/.cd,#1,postaction={decorate}] (#2) -- (#3); +\end{scope} +\endgroup +} +%<--------------------------------------------------------------------------–> +% multiple +\def\tkz@multiMS#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzMarkSegment[\tkz@optsg](#1)}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<--------------------------------------------------------------------------–> +\def\tkzMarkSegments{\pgfutil@ifnextchar[{\tkz@MarkSegments}{\tkz@MarkSegments[]}} +\def\tkz@MarkSegments[#1](#2){% +\def\tkz@optsg{#1} + \begingroup + \let\next\tkz@multiMS + \next#2 \@nil % +\endgroup +} +%<-------------------------------------------------------------------------–> +% Label on segment +%<-------------------------------------------------------------------------–> +\def\tkzLabelSegment{\pgfutil@ifnextchar[{\tkz@LabelSegment}% + {\tkz@LabelSegment[]}} +\def\tkz@LabelSegment[#1](#2,#3)#4{% +\begingroup + \path (#2) to node[label style,#1]{#4} (#3) ; +\endgroup +} +%<--------------------------------------------------------------------------–> +% multiple +\def\tkz@multiLS#1 #2\@nil{% + \protected@edef\tkz@temp{ + \noexpand \tkzLabelSegment[\tkz@optls](#1){\tkz@labelseg}}\tkz@temp% + \def\tkz@nextArg{#2}% + \ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble + \fi + \next#2\@nil +} +%<--------------------------------------------------------------------------–> +\def\tkzLabelSegments{\pgfutil@ifnextchar[{\tkz@LabelSegments}{\tkz@LabelSegments[]}} +\def\tkz@LabelSegments[#1](#2)#3{% +\def\tkz@optls{#1} +\def\tkz@labelseg{#3} + \begingroup + \let\next\tkz@multiLS + \next#2 \@nil % +\endgroup +} +%<--------------------------------------------------------------------------–> +% PolySeg +%<--------------------------------------------------------------------------–> +\def\tkzDrawPolySeg{\pgfutil@ifnextchar[{\tkz@DrawPolySeg}{\tkz@DrawPolySeg[]}} +\def\tkz@DrawPolySeg[#1](#2,#3){% +\begingroup +\draw[line style,#1] (#2) + \foreach \pt in {#2,#3}{--(\pt)};% +\endgroup +} + + +%<--------------------------------------------------------------------------–> +% add dim + % \draw[dim={5,7pt,}] (A) -- (B); + % \draw[dim={7,10pt,transform shape}] (B) -- (C); + % \draw[dim={X,,}] (A) -- (C); +%<--------------------------------------------------------------------------–> +% new code from muzimuzhi Z +%https://tex.stackexchange.com/questions/553430/change-color-and-style-of-dimension-lines-in-tkz-euclide/553441 + +\pgfkeys{/pgf/decoration/.cd, distance/.initial = 10pt} + +\pgfdeclaredecoration{add dim}{final}{ +\state{final}{% +\pgfmathsetmacro{\dist}{\pgfkeysvalueof{/pgf/decoration/distance}} + \pgfpathmoveto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{1.2*\dist}} + \pgfpathmoveto{\pgfpoint{\pgfdecoratedpathlength}{0pt}} + \pgfpathlineto{\pgfpoint{(\pgfdecoratedpathlength}{1.2*\dist}} + % start of patch + \pgfusepath{stroke} + \pgfsetarrowsstart{latex} + \pgfsetarrowsend{latex} + \expandafter\pgfsetdash\tkz@dim@dashpattern + \pgfsetstrokecolor{\tkz@dim@color} + % end of patch + \pgfpathmoveto{\pgfpoint{0pt}{\dist}} + \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{\dist}} + \pgfusepath{stroke} + \pgfpathmoveto{\pgfpoint{0pt}{0pt}} + \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}} +}} + + +\tikzset{ + dim/.style args={#1,#2,#3}{% + postaction={ + decoration={ + show path construction, + lineto code={ + % dim fence + \draw[dim fence style/.try] + (\tikzinputsegmentfirst) -- + ($ (\tikzinputsegmentfirst)!1.2*(#2)!90:(\tikzinputsegmentlast) $) + (\tikzinputsegmentlast) -- + ($ (\tikzinputsegmentlast)!1.2*(#2)!-90:(\tikzinputsegmentfirst) $); + % dim + \draw[dim style/.try] + ($ (\tikzinputsegmentfirst)!#2!90:(\tikzinputsegmentlast) $) -- + node[inner sep=0pt, font=\footnotesize, fill=\tkz@fillcolor, pos=.5, #3] {#1} + ($ (\tikzinputsegmentlast)!#2!-90:(\tikzinputsegmentfirst) $); + } + }, + decorate, + } + }, + dim/.default={,0pt,}, + dim style/.style={ + latex-latex, + }, +} + +%<--------------------------- style line ---------------------------------> +\tikzset{add/.style args={#1 and #2}{to path={% + ($(\tikztostart)!-#1!(\tikztotarget)$)--($(\tikztotarget)!-#2!(\tikztostart)$)% + \tikztonodes}} +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex new file mode 100644 index 0000000000..eeffaecff2 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex @@ -0,0 +1,171 @@ + % tkz-obj-eu-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-eu-points.tex} +\makeatletter +%<---------------------------------------------------------------------------> +% tkzSetUpPoint définit la forme d'un point +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzsetuppt/.cd, + size/.store in = \tkz@pt@size, + color/.store in = \tkz@pt@color, + fill/.store in = \tkz@pt@fill, + shape/.store in = \tkz@pt@shape, + size = \tkz@euc@pointsize, + color = \tkz@euc@pointcolor, + fill = \tkz@euc@pointcolor, + shape = \tkz@euc@pointshape, + /tkzsetuppt/.search also = {/tikz}, + } +\def\tkzSetUpPoint{\pgfutil@ifnextchar[{\tkz@SetUpPoint}{% + \tkz@SetUpPoint[]}} +\def\tkz@SetUpPoint[#1]{% +\pgfqkeys{/tkzsetuppt}{#1} +% redefine point style with new values +\tikzset{point style/.style={draw = \tkz@pt@color, + inner sep = 0pt, + shape = \tkz@pt@shape, + minimum size = \tkz@pt@size, + fill = \tkz@pt@fill}} +}% end setup +%<---------------------------------------------------------------------------> +% Draw Point +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzdrawpt/.cd, + size/.code = {\tikzset{point style/.append style={minimum size = #1}}}, + size = \tkz@euc@pointsize, + /tkzdrawpt/.search also = {/tikz}, +} +%<-------------------------------------------------------------------------- +\def\tkzDrawPoint{\pgfutil@ifnextchar[{\tkz@DrawPoint}{\tkz@DrawPoint[]}} +\def\tkz@DrawPoint[#1](#2){% +\begingroup + \pgfqkeys{/tkzdrawpt}{#1} + \node[point style,/tkzdrawpt/.cd,#1] at (#2) {};%2016 +\endgroup +} +%<---------------------------------------------------------------------------> +\def\tkzDrawPoints{\pgfutil@ifnextchar[{\tkz@drawpts}{\tkz@drawpts[]}} +%<---------------------------------------------------------------------------> +\def\tkz@drawpts[#1](#2){% +\begingroup + \pgfqkeys{/tkzdrawpt}{#1} + \foreach \point in {#2}{\node[point style,/tkzdrawpt/.cd,#1] at (\point) {};} %2016 +\endgroup +} +%<--------------------------------------------------------------------------> +% tkzLabelPoint Affichage des LABELS pour un point +%<--------------------------------------------------------------------------> +\def\tkzLabelPoint{\pgfutil@ifnextchar[{\tkz@LabelPoint}{\tkz@LabelPoint[]}} +\def\tkz@LabelPoint[#1](#2)#3{% + \node[label style,#1] at (#2) {#3};}% +%<---------------------------------------------------------------------------> + +\def\tkzLabelPoints{\pgfutil@ifnextchar[{\tkz@LabelPoints}{\tkz@LabelPoints[]}}% +\def\tkz@LabelPoints[#1](#2){% + \foreach \point in {#2}{ + \node[label style,#1] at (\point) {$\point$};} +}% +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzsetuppt/.cd, + size/.store in = \tkz@pt@size, + color/.store in = \tkz@pt@color, + fill/.store in = \tkz@pt@fill, + shape/.store in = \tkz@pt@shape, + size = \tkz@euc@pointsize, + color = \tkz@euc@pointcolor, + fill = \tkz@euc@pointcolor, + shape = \tkz@euc@pointshape, + /tkzsetuppt/.search also = {/tikz}, + } +\def\tkzSetUpPoint{\pgfutil@ifnextchar[{\tkz@SetUpPoint}{% + \tkz@SetUpPoint[]}} +\def\tkz@SetUpPoint[#1]{% +\pgfqkeys{/tkzsetuppt}{#1} +% redefine point style with new values +\tikzset{point style/.style={draw = \tkz@pt@color, + inner sep = 0pt, + shape = \tkz@pt@shape, + minimum size = \tkz@pt@size, + fill = \tkz@pt@fill}} +}% end setup +%<---------------------------------------------------------------------------> +% +%<---------------------------------------------------------------------------> +\def\tkzSetUpLabel{\pgfutil@ifnextchar[{\tkz@SetUpLabel}{% + \tkz@SetUpLabel[]}} +\def\tkz@SetUpLabel[#1]{% +\tikzset{label style/.style={#1}} +}% end setup +%<---------------------------------------------------------------------------> + +\pgfkeys{/tkzautolab/.cd, + center/.store in = \tkz@center, + dist/.store in = \tkz@dist, + dist = 0.15, + /tkzautolab/.search also = {/tikz}, +} +\def\tkzAutoLabelPoints{\pgfutil@ifnextchar[{\tkz@AutoLabelPoints}{\tkz@AutoLabelPoints[]}}% +\def\tkz@AutoLabelPoints[#1](#2){% +\begingroup +\pgfqkeys{/tkzautolab}{#1} + \foreach \point in {#2}{ + \path (\tkz@center) -- ($ (\point) + \tkz@dist*($(\point)-(\tkz@center)$) $) node[/tkzautolab/.cd,label style,#1]{$\point$};} +\endgroup +}% +%<---------------------------------------------------------------------------> +% PointShowCoord +%<---------------------------------------------------------------------------> +\pgfkeys{/tkzprcoord/.cd, + xlabel/.store in = \tkz@xlabel, + ylabel/.store in = \tkz@ylabel, + xstyle/.code = {\tikzset{xcoord style/.append style={#1}}}, + ystyle/.code = {\tikzset{ycoord style/.append style={#1}}}, + noxdraw/.is if = tkz@coord@noxdraw, + noxdraw/.default = true, + noydraw/.is if = tkz@coord@noydraw, + noydraw/.default = true, + xlabel = {}, + ylabel = {}, + xstyle = {}, + ystyle = {}, + noxdraw = false, + noydraw = false, + /tkzprcoord/.search also = {/tikz}, +} +\def\tkzPointShowCoord{\pgfutil@ifnextchar[{\tkz@PointShowCoord}{\tkz@PointShowCoord[]}} +\def\tkz@PointShowCoord[#1](#2){% +\begingroup +\pgfqkeys{/tkzprcoord}{#1} +% 2019 for showcoord + \iftkznodedefined{tkz@xline}{}{% + \path (0,0) --(1,0) node(tkz@xline){}; + \path (0,0) --(0,1) node(tkz@yline){}; + } +\iftkz@coord@noxdraw\else\draw[arrow coord style,/tkzprcoord/.cd,#1] (#2)--(#2 |- tkz@xline);\fi +\iftkz@coord@noydraw\else\draw[arrow coord style,/tkzprcoord/.cd,#1] (#2)--(#2 -| tkz@yline);\fi +\ifx\tkzutil@empty\tkz@xlabel +\else +\path (#2)--(#2 |- tkz@xline) + node[xcoord style] {\tkz@xlabel}; +\fi +\ifx\tkzutil@empty\tkz@ylabel +\else + \path (#2)--(#2 -| tkz@yline) + node[ycoord style] {\tkz@ylabel}; +\fi +\endgroup +} +\let\tkzShowPointCoord\tkzPointShowCoord +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex new file mode 100644 index 0000000000..a0f59a0a65 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex @@ -0,0 +1,106 @@ +% tkz-obj-eu-polygons.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-eu-polygons.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% Polygon +%<--------------------------------------------------------------------------–> +%<---------------------------- Draw --------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzDrawPolygon{\pgfutil@ifnextchar[{\tkz@DrawPolygon}{% + \tkz@DrawPolygon[]}} +\def\tkz@DrawPolygon[#1](#2,#3){% + \begingroup + \draw[line style,line join=round,#1] (#2) + \foreach \pt in {#2,#3}{--(\pt)}--cycle;% + \endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkz@multipolygons#1 #2\@nil{% +\protected@edef\tkz@temp{ +\noexpand \tkzDrawPolygon[\tkz@optpolygon](#1)}\tkz@temp% +\def\tkz@nextArg{#2}% +\ifx\tkzutil@empty\tkz@nextArg + \let\next\@gobble +\fi +\next#2\@nil +} +%<--------------------------------------------------------------------------–> +\def\tkzDrawPolygons{\pgfutil@ifnextchar[{\tkz@DrawPolygons}{\tkz@DrawPolygons[]}} +\def\tkz@DrawPolygons[#1](#2){% +\xdef\tkz@optpolygon{#1} +\begingroup + \let\next\tkz@multipolygons + \next#2 \@nil % +\endgroup +}% +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +%<---------------------------- FILL --------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzFillPolygon{\pgfutil@ifnextchar[{\tkz@FillPolygon}{% + \tkz@FillPolygon[]}} +\def\tkz@FillPolygon[#1](#2,#3){% + \begingroup + \fill[#1] (#2) + \foreach \pt in {#2,#3}{--(\pt)}--cycle;% +\endgroup +} +%<--------------------------------------------------------------------------–> +%<-------------- Labels for Regular Polygon -------------------------–> +% +%<--------------------------------------------------------------------------–> +\pgfkeys{/deflabelregpoly/.cd, + name/.store in = \tkz@regpolname, + sep/.store in = \tkz@regpolsep, + name = P, + sep = 1.1 +} + +\def\tkzLabelRegPolygon{\pgfutil@ifnextchar[{\tkz@labelPolygon}{% + \tkz@labelPolygon[]}} +\def\tkz@labelPolygon[#1](#2)#3{% +\begingroup +\pgfqkeys{/deflabelregpoly}{#1} + \foreach \v [count=\vi from 1] in {#3} {% + \path (#2) to [pos=1.1] node {$\v$} (\tkz@regpolname\vi) ; + \pgfnodealias{\v}{\tkz@regpolname\vi} + } +\endgroup +} +%<---------------------------- CLIP --------------------------------–> +% +%<--------------------------------------------------------------------------–> + +\pgfkeys{tkzclippolygon/.cd, + out code/.is if = tkzClipOutPoly, + out/.code = \tkzClipOutPolyfalse} + +\def\tkzClipPolygon{\pgfutil@ifnextchar[{\tkz@ClipPolygon}{\tkz@ClipPolygon[]}} +\def\tkz@ClipPolygon[#1](#2,#3){% +\tkzClipOutPolytrue +\pgfqkeys{/tkzclippolygon}{#1}% +\iftkzClipOutPoly +\clip (#2) + \foreach \pt in {#2,#3}{--(\pt)}--cycle; +\else + \clip(#2) + \foreach \pt in {#2,#3}{--(\pt)}--cycle[tkzreverseclip] ; +\fi +}% +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex new file mode 100644 index 0000000000..fb995eead7 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex @@ -0,0 +1,121 @@ +% tkz-obj-eu-protractor.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-eu-protractor.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% !!! 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\FullProtractor{% +\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); +} + +\def\FullProtractorReturn{% +\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); +} + +\pgfkeys{ + protractor/.cd, + 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/.code = \tkz@RappReturnfalse, + /protractor/.search also={/tikz}, + lw = 0.4pt, + scale=1, + shift={(0,0)}, + rotate=0 + } + +\def\tkzProtractor{\pgfutil@ifnextchar[{\tkz@Protractor}{\tkz@Protractor[]}} +\def\tkz@Protractor[#1](#2,#3){% +\tkz@RappReturnfalse +\pgfqkeys{/protractor}{#1} + \tkz@@extractxy{#2} + \global\tkz@ax\pgf@x + \global\tkz@ay\pgf@y + \tkzFindSlopeAngle(#2,#3) + \tkzGetAngle{cmdMO@Rap@rotate}% + \global\let\tkz@@Protractor\FullProtractor% + \iftkz@RappReturn + \global\let\tkz@@Protractor\FullProtractorReturn + \else + \global\let\tkz@@Protractor\FullProtractor + \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} +} +%<--------------------------------------------------------------------------–> +% fin de \tkzProtractor +%<--------------------------------------------------------------------------–> +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex new file mode 100644 index 0000000000..685ee59242 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex @@ -0,0 +1,326 @@ +% tkz-obj-eu-sectors.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-eu-sectors.tex} +\makeatletter +%<----------------------- Sectors ------------------------------–> +\gdef\tkz@nums{0} +\pgfkeys{/drawsector/.cd, + towards/.code = {\def\tkz@nums{0}}, + rotate/.code = {\def\tkz@nums{1}}, + R/.code = {\def\tkz@nums{2}}, + R with nodes/.code = {\def\tkz@nums{3}}, + towards, + /drawsector/.search also = {/tikz}, +} + +\def\tkzDrawSector{\pgfutil@ifnextchar[{\tkz@DrawSector}{\tkz@DrawSector[]}} +\def\tkz@DrawSector[#1](#2,#3)(#4){% +\begingroup +\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 + \tkz@@CalcLengthcm(#2,#3){tkz@radius} + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius)(\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 + \tkz@@CalcLengthcm(#2,#3){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)(\tkz@FirstA,\tkz@SecondA) + \else + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius)(\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 + \tkz@@CalcLengthcm(#2,#3){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 + \tkz@@CalcLengthcm(#3,#4){tkz@radius} + \tkz@DrawSectorRAngles[#1](#2,\tkz@radius pt)(#5,#6) +\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 +%<--------------------------------------------------------------------------–> +\gdef\tkz@nums{0} +\pgfkeys{/@fillsector/.cd, + towards/.code = {\def\tkz@nums{0}}, + rotate/.code = {\def\tkz@nums{1}}, + R/.code = {\def\tkz@nums{2}}, + R with nodes/.code = {\def\tkz@nums{3}}, + towards, + /@fillsector/.search also={/tikz}, +} + +\def\tkzFillSector{\pgfutil@ifnextchar[{\tkz@FillSector}{\tkz@FillSector[]}} +\def\tkz@FillSector[#1](#2,#3)(#4){% +\begingroup +\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}{0} + \edef\tkz@FirstAngle{\pgfmathresult}% + \pgfmathadd{\tkz@SecondAngle}{0} + \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 + \tkz@@CalcLength(#2,#3){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 + \tkz@@CalcLength(#2,#3){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\tkzFillSectorAngles{\pgfutil@ifnextchar[{\tkz@FillSectorAngles}{% + \tkz@FillSectorAngles[]}} +\def\tkz@FillSectorAngles[#1](#2,#3)(#4,#5){% +\begingroup + \tkz@@CalcLength(#2,#3){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 + \tkz@@CalcLength(#1,#2){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 + \tkz@@CalcLength(#1,#2){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 = {\def\tkz@numcs{0}}, + rotate/.code = {\def\tkz@numcs{1}}, + R/.code = {\def\tkz@numcs{2}}, +} +%<--------------------------------------------------------------------------–> +\def\tkzClipSector{\pgfutil@ifnextchar[{\tkz@ClipSector}{% + \tkz@ClipSector[]}} + +\def\tkz@ClipSector[#1](#2,#3)(#4){% +\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 +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex new file mode 100644 index 0000000000..2f5d97bc98 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex @@ -0,0 +1,347 @@ +%tkz-obj-eu-show.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-eu-show.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% finding specific points in a triangle +%<--------------------------------------------------------------------------–> +% equi points +%<--------------------------------------------------------------------------–> +% draw ? show ? +\pgfkeys{/tkzEquiPt/.cd, + from/.store in = {\tkz@frompoint}, + dist/.store in = {\tkz@equ@dist}, + show/.is if = tkz@equi@show, + dist = 2, + show = false, + /tkzEquiPt/.search also={/tikz} +} + +\def\tkzDefEquiPoints{\pgfutil@ifnextchar[{\tkz@DefEquiPoints}{% + \tkz@DefEquiPoints[]}} +\def\tkz@DefEquiPoints[#1](#2,#3){% +\pgfqkeys{/tkzEquiPt}{#1} +\begingroup + \tkzUProjection(#2,#3)(\tkz@frompoint) + \pgfnodealias{tkzEQpoint}{tkzPointResult} + \tkzVecKNorm[\tkz@equ@dist](tkzEQpoint,#2) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzVecKNorm[-\tkz@equ@dist](tkzEQpoint,#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \iftkz@equi@show + \tkzCompass[compass style,#1](\tkz@frompoint,tkzFirstPointResult) + \tkzCompass[compass style,#1](\tkz@frompoint,tkzSecondPointResult) + \fi +\endgroup +} + +%<--------------------------- The SHOW --------------------------------–> +%<--------------------------------------------------------------------------–> +\global\def\tkz@numsh{0} +\pgfkeys{/show/.cd, + mediator/.code = \def\tkz@numsh{0}, + perpendicular/.code args = {through #1} {\global\def\tkz@numsh{1}% + \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, + /tkzcompass/\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) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzURotateAngle(#3,60)(#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \tkz@VecKOrthNorm[1](tkzmidpoint,#2) + \pgfnodealias{MED@tmp1}{tkzPointResult} + \tkz@VecKOrthNorm[1](tkzmidpoint,#3) + \pgfnodealias{MED@tmp2}{tkzPointResult} + \tkz@VecKNorm[\tkz@show@gap](tkzmidpoint,MED@tmp1) + \pgfnodealias{MED@1}{tkzPointResult} + \tkz@VecKNorm[\tkz@show@gap](tkzmidpoint,MED@tmp2) + \pgfnodealias{MED@2}{tkzPointResult} + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#2,MED@1) + \tkzCompass[compass style,#1](#3,MED@1) + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#2,MED@2) + \tkzCompass[compass style,#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) + \pgfnodealias{tkz@lltmp}{tkzPointResult} + \tkzCompass[compass style,#1](#4,tkz@lltmp) + \tkzCompass[compass style,#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, + size = 1} +\pgfkeys{show/.cd,#1} + \tkzDefPointWith(#2,#3) + \pgfnodealias{tkz@OLtmp}{tkzPointResult} + \tkz@VecKCoLinear[1](#2,tkz@OLtmp,#4) + \pgfnodealias{tkzPointCo}{tkzPointResult} + \tkzInterLL(#2,#3)(#4,tkzPointCo) + \pgfnodealias{tkzPOpoint}{tkzPointResult} + \tkz@@CalcLength(#4,tkzPOpoint){tkz@mathLen} + \tkz@VecKNorm[1](#2,#3) + \pgfnodealias{PO@tmp}{tkzPointResult} + \tkz@VecKCoLinear[1](#2,PO@tmp,tkzPOpoint) + \pgfnodealias{PO@tmp2}{tkzPointResult} + \tkz@VecKCoLinear[-1](#2,PO@tmp,tkzPOpoint) + \pgfnodealias{PO@tmp1}{tkzPointResult} + \tkz@VecKCoLinear[\tkz@show@size](tkzPOpoint,PO@tmp1,tkzPOpoint) + \pgfnodealias{PO@1}{tkzPointResult} + \tkz@VecKCoLinear[\tkz@show@size](tkzPOpoint,PO@tmp2,tkzPOpoint) + \pgfnodealias{PO@2}{tkzPointResult} + \ifdim\tkz@mathLen pt>10 pt\relax + \tkz@VecKNorm[1](#4,tkzPOpoint) + \pgfnodealias{PO@tmp1}{tkzPointResult} + \else + \tkz@VecKOrthNorm[1](tkzPOpoint,PO@2) + \pgfnodealias{PO@tmp1}{tkzPointResult} + \fi + \tkz@VecKCoLinear[-\tkz@show@gap](PO@tmp1,tkzPOpoint,tkzPOpoint) + \pgfnodealias{PO@3}{tkzPointResult} + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@1) + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@2) + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](PO@1,PO@3) + \tkzCompass[compass style,#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) + \pgfnodealias{tkz@pt1}{tkzPointResult} + \tkzVecKNorm(#3,#4) + \pgfnodealias{tkz@pt2}{tkzPointResult} + \tkzDefMidPoint(tkz@pt1,tkz@pt2) + \pgfnodealias{tkz@pt3}{tkzPointResult} + \tkzDefEquilateral(tkz@pt2,tkz@pt1) + \pgfnodealias{tkz@pt4}{tkzPointResult} + \tkzDefMidPoint(tkz@pt3,tkz@pt4) + \pgfnodealias{tkz@ptm}{tkzPointResult} + \tkzVecKNorm(#3,tkz@ptm) + \pgfnodealias{tkzBisPoint}{tkzPointResult} + \tkzVecKNorm[\tkz@show@size](#3,#2) + \pgfnodealias{BI@1}{tkzPointResult} + \tkzVecKNorm[\tkz@show@size](#3,#4) + \pgfnodealias{BI@2}{tkzPointResult} + \tkzVecK[\tkz@show@gap](#3,tkzBisPoint) + \pgfnodealias{tkzBisPoint}{tkzPointResult} + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#3,BI@1) + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#3,BI@2) + \tkzCompass[compass style,#1,length=\tkz@show@length](BI@1,tkzBisPoint) + \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](BI@2,tkzBisPoint) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Transformations Géométriques +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% 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, + /tkzcompass/\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} + \pgfinterruptboundingbox +\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 + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzShowTranslation{\pgfutil@ifnextchar[{\tkz@ShowTranslation}{% + \tkz@ShowTranslation[]}} + +\def\tkz@ShowTranslation[#1](#2,#3)(#4){% +\begingroup +\tkz@VecKCoLinear[1](#2,#3,#4) \pgfnodealias{tkz@lltmp}{tkzPointResult} +\tkzCompass[compass style,#1](#4,tkz@lltmp) +\tkzCompass[compass style,#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) + \pgfnodealias{tkzPointofSym}{tkzPointResult} + \tkz@VecK[2](#4,tkzPointofSym) + \pgfnodealias{tkz@pointtsf}{tkzPointResult} + \tkzCompass[compass style,#1](#2,#4) + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#3,#4) + \tkzCompass[compass style,#1](#2,tkz@pointtsf) + \tkzCompass[compass style,#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[compass style,#1](#2,tkz@pointtsf) + \tkzCompass[compass style,#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) + \pgfnodealias{tkz@pointtsf}{tkzPointResult} + \tkz@VecKCoLinear[1](#2,#3,tkz@pointtsf) + \pgfnodealias{SO@tmp1}{tkzPointResult} + \tkz@VecKCoLinear[-1](#2,#3,tkz@pointtsf) + \pgfnodealias{SO@tmp2}{tkzPointResult} + \tkz@VecKNorm[\tkz@show@size](tkz@pointtsf,SO@tmp1) + \pgfnodealias{SO@1}{tkzPointResult} + \tkz@VecKNorm[\tkz@show@size](tkz@pointtsf,SO@tmp2) + \pgfnodealias{SO@2}{tkzPointResult} + \tkz@VecKNorm[-\tkz@show@gap](tkz@pointtsf,#4) + \pgfnodealias{SO@3}{tkzPointResult} + \tkzCompass[compass style,#1](#4,SO@1) + \tkzCompass[compass style,#1](#4,SO@2) + \tkzCompass[compass style,#1](SO@1,SO@3) + \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](SO@2,SO@3) +\endgroup +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex new file mode 100644 index 0000000000..3e536edc33 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex @@ -0,0 +1,122 @@ +% tkz-eu-lib-marks.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-lib-eu-marks.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% 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 +} +\pgfdeclareplotmark{s|||} +{% + \pgfpathmoveto{\pgfqpoint{-0.75\pgfplotmarksize}{-\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{0.25\pgfplotmarksize}{\pgfplotmarksize}} + \pgfpathmoveto{\pgfqpoint{0\pgfplotmarksize}{-\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{1\pgfplotmarksize}{\pgfplotmarksize}} + \pgfpathmoveto{\pgfqpoint{0.75\pgfplotmarksize}{-\pgfplotmarksize}} + \pgfpathlineto{\pgfqpoint{1.75\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 +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex new file mode 100644 index 0000000000..522e205162 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex @@ -0,0 +1,49 @@ + % tkz-lib-eu-shape.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-lib-eu-shape.tex} +%<--------------------------------------------------------------------------–> +% Création des symboles +%<--------------------------------------------------------------------------–> +% define a new shape for the points +\pgfdeclareshape{cross} +{% + \inheritsavedanchors[from=rectangle] % this is nearly a rectangle + \inheritanchorborder[from=rectangle] + \inheritanchor[from=rectangle]{north} + \inheritanchor[from=rectangle]{north west} + \inheritanchor[from=rectangle]{north east} + \inheritanchor[from=rectangle]{center} + \inheritanchor[from=rectangle]{west} + \inheritanchor[from=rectangle]{east} + \inheritanchor[from=rectangle]{mid} + \inheritanchor[from=rectangle]{mid west} + \inheritanchor[from=rectangle]{mid east} + \inheritanchor[from=rectangle]{base} + \inheritanchor[from=rectangle]{base west} + \inheritanchor[from=rectangle]{base east} + \inheritanchor[from=rectangle]{south} + \inheritanchor[from=rectangle]{south west} + \inheritanchor[from=rectangle]{south east} + \foregroundpath{ +% store lower right in xa/ya and upper right in xb/yb + \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y + \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y + \pgfpathmoveto{\pgfqpoint{0 pt}{\pgf@ya}} + \pgfpathlineto{\pgfqpoint{0 pt}{\pgf@yb}} + \pgfpathmoveto{\pgfqpoint{\pgf@xa}{0 pt}} + \pgfpathlineto{\pgfqpoint{\pgf@xb}{0 pt}} + } +} +\endinput \ No newline at end of file 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 diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex new file mode 100644 index 0000000000..3d2fedacc2 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex @@ -0,0 +1,171 @@ +% tkz-obj-eu-axesmin.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-eu-axesmin} + +\makeatletter +\def\removedot#1.{#1} +\newcommand\tkzgetinteger[1]{\expandafter\tkz@getinteger#1.\@nil} +\def\tkz@getinteger#1.#2\@nil{% + \ifx\empty#2\empty + \tkz@integertrue + \else + \ifnum\removedot#2=0 + \tkz@integertrue + \else + \tkz@integerfalse + \fi + \fi +} + +%<--------------------------------------------------------------------------–> +% Setup axe +%<--------------------------------------------------------------------------–> +\pgfkeys{tkzaxis/.cd, + line width/.code = \xdef\tkz@sua@lw{#1}, + color/.code = \xdef\tkz@sua@color{#1}, + tickwd/.code = \xdef\tkz@sua@tickwd{#1}, + ticka/.code = \xdef\tkz@sua@ticka{#1}, + tickb/.code = \xdef\tkz@sua@tickb{#1}, + line width = \tkz@init@lw, + color = \tkz@init@color, + tickwd = \tkz@init@tickwd, + ticka = \tkz@init@ticka, + tickb = \tkz@init@tickb +} + +\def\tkzSetUpAxis{\pgfutil@ifnextchar[{\tkz@SetUpAxis}{\tkz@SetUpAxis[]}} +\def\tkz@SetUpAxis[#1]{% +\begingroup +\pgfqkeys{/tkzaxis}{#1} +\global\let\tkz@init@lw\tkz@sua@lw +\global\let\tkz@init@gradsize\tkz@sua@gradsize +\global\let\tkz@init@color\tkz@sua@color +\global\let\tkz@init@tickwd\tkz@sua@tickwd +\global\let\tkz@init@ticka\tkz@sua@ticka +\global\let\tkz@init@tickb\tkz@sua@tickb +\endgroup +} +%<--------------------------------------------------------------------------–> +% tkzDrawX todo améliorer les unités +% sans doute à revoir loop from 0 to i then calcul dans la boucle de la position +% et de l'affichage +%<--------------------------------------------------------------------------–> +\pgfkeys{% + /tkzdrawX/.cd, + color/.store in = \tkz@X@color, + label/.store in = \tkz@X@label, + right space/.store in = \tkz@axe@rxspace, + left space/.store in = \tkz@axe@lxspace, + step/.code = {\edef\tkz@posnext{\fpeval{#1}}}, + color = \tkz@init@color, + label = \tkz@init@xlabel, + step = \tkz@init@xstep, + right space = \tkz@init@rightspace, %??? + left space = \tkz@init@leftspace, + noticks/.is if = tkz@X@noticks, + noticks/.default = true, + noticks = true, + tickwd/.store in = \tkz@X@tickwd, + tickup/.store in = \tkz@X@tickup, + tickdn/.store in = \tkz@X@tickdn, + tickwd = \tkz@init@tickwd, + tickup = \tkz@init@ticka, + tickdn = \tkz@init@tickb, + /tkzdrawX/.search also={/tikz}, + } + +\def\tkzDrawX{\pgfutil@ifnextchar[{\tkz@DrawX}{\tkz@DrawX[]}} +\def\tkz@DrawX[#1]{ +\begingroup% +\pgfqkeys{/tkzdrawX}{#1} +\edef\tkz@posmax{\fpeval{trunc(\tkz@xb,\tkz@init@xdec)}} +\edef\tkz@posmin{\fpeval{trunc(\tkz@xa,\tkz@init@xdec)}} +\edef\tkz@xbsup{\fpeval{\tkz@xb+\tkz@axe@rxspace}} +\edef\tkz@xainf{\fpeval{\tkz@xa-\tkz@axe@lxspace}} +\path (\tkz@xainf,0)--(\tkz@xbsup,0) node(tkz@xline){}; +\draw[xaxe style, + color = \tkz@X@color, + /tkzdrawX/.cd, #1] (\tkz@xainf,0)--(\tkz@xbsup,0) + node[ xlabel style, + /tkzdrawX/.cd, + #1]{\tkz@X@label}; + \iftkz@X@noticks + \else + \edef\tkz@posmax{\fpeval{trunc(\tkz@posmax,\tkz@init@xdec)}} + \edef\tkz@posnext{\fpeval{\tkz@posnext/\tkz@init@xstep+\tkz@posmin}} + \foreach \pos in {\tkz@posmin,...,\tkz@posmax}{% + \edef\tkz@pos{\fpeval{\pos*1}}% ??? + \draw[ color = \tkz@X@color, + line width = \tkz@X@tickwd, + shift = {(\tkz@pos,0)}]% + (0pt,\tkz@X@tickup)--(0pt,-\tkz@X@tickdn); + } + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% tkzDrawY todo améliorer les unités +%<--------------------------------------------------------------------------–> +\pgfkeys{% + /tkzdrawY/.cd, + color/.store in = \tkz@Y@color, + label/.store in = \tkz@Y@label, + up space/.store in = \tkz@axe@uyspace, + down space/.store in = \tkz@axe@dyspace, + step/.code = {\edef\tkz@posnext{\fpeval{#1}}}, + color = \tkz@init@color, + label = \tkz@init@ylabel, + step = \tkz@init@ystep, + up space = \tkz@init@upspace, + down space = \tkz@init@downspace, + noticks/.is if = tkz@Y@noticks, + noticks/.default = true, + noticks = true, + tickwd/.store in = \tkz@Y@tickwd, + ticklt/.store in = \tkz@Y@ticklt, + tickrt/.store in = \tkz@Y@tickrt, + tickwd = \tkz@init@tickwd, + ticklt = \tkz@init@tickb, + tickrt = \tkz@init@ticka, + /tkzdrawY/.search also={/tikz}, + } + +\def\tkzDrawY{\pgfutil@ifnextchar[{\tkz@DrawY}{\tkz@DrawY[]}} +\def\tkz@DrawY[#1]{% +\begingroup +\pgfkeys{/tkzdrawY/.cd,step = \tkz@init@ystep} +\pgfqkeys{/tkzdrawY}{#1} +\edef\tkz@posmax{\fpeval{trunc(\tkz@yb,\tkz@init@ydec)}} +\edef\tkz@posmin{\fpeval{trunc(\tkz@ya,\tkz@init@ydec)}} +\edef\tkz@ybsup{\fpeval{\tkz@yb+\tkz@axe@uyspace}} +\edef\tkz@yainf{\fpeval{\tkz@ya-\tkz@axe@dyspace}} +\path (0,\tkz@yainf)--(0,\tkz@ybsup) node(tkz@yline){}; +\draw[color = \tkz@Y@color, + yaxe style,/tkzdrawY/.cd,#1] (0,\tkz@yainf)--(0,\tkz@ybsup) + node[ylabel style,/tkzdrawY/.cd,#1]{\tkz@Y@label}; + \iftkz@Y@noticks + \else + \edef\tkz@posmax{\fpeval{trunc(\tkz@posmax,\tkz@init@ydec)}} + \edef\tkz@posnext{\fpeval{\tkz@posnext/\tkz@init@ystep+\tkz@posmin}} + \foreach \tkz@pos in {\tkz@posmin,\tkz@posnext,...,\tkz@posmax}{% + \draw[color = \tkz@Y@color, + line width = \tkz@Y@tickwd, + shift = {(0,\tkz@pos)}]% + (\tkz@Y@tickrt,0pt)--(-\tkz@Y@ticklt,0pt);} + + \fi +\endgroup} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex new file mode 100644 index 0000000000..b4f7f8ebaf --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex @@ -0,0 +1,157 @@ +% tkz-obj-eu-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-eu-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@numcby{0} +\pgfkeys{/tkzDefCircleBy/.cd, + translation/.code args = {from #1 to #2} { \def\tkz@numcby{0} + \def\tkzfrom{#1} + \def\tkzto{#2}}, + homothety/.code args = {center #1 ratio #2}{ \def\tkz@numcby{1} + \def\tkzcenter{#1} + \def\tkzratio{#2}}, + reflection/.code args = {over #1--#2}{ \def\tkz@numcby{2} + \def\tkzdeb{#1} + \def\tkzfin{#2}}, + symmetry/.code args = {center #1}{ \def\tkz@numcby{3} + \def\tkzcenter{#1}}, + rotation/.code args = {center #1 angle #2}{ \def\tkz@numcby{4} + \def\tkzcenter{#1} + \def\tkzangle{#2}}, + inversion/.code args={center #1 through #2}{ \def\tkz@numcby{5} + \def\tkzcenter{#1} + \def\tkzpoint{#2}}, + inversion negative/.code args = {center #1 through #2}{\def\tkz@numcby{6} + \def\tkzcenter{#1} + \def\tkzpoint{#2}} + } +\def\tkzDefCircleBy{\pgfutil@ifnextchar[{\tkz@DefCircleBy}{\tkz@DefCircleBy[]}} +\def\tkz@DefCircleBy[#1](#2){% +\begingroup +\pgfqkeys{/tkzDefCircleBy}{#1} +\ifcase\tkz@numcby% + \tkzDefCircleTranslation(#2)% + \or% 1 + \tkzDefCircleHomothety(#2) + \or% 2 + \tkzDefCircleReflection(#2) + \or% 3 + \tkzDefCircleSymmetry(#2) + \or% 4 + \tkzDefCircleRotation(#2) + \or% 5 + \tkzDefInversionCircle(#2,\tkzcenter,\tkzpoint) + \or% 6 + \tkzDefInversionNegativeCircle(#2,\tkzcenter,\tkzpoint) +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleTranslation(#1,#2){% +\begingroup + \tkzUTranslation(\tkzfrom,\tkzto)(#1) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzUTranslation(\tkzfrom,\tkzto)(#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleHomothety(#1,#2){% +\begingroup + \tkzUHomo(\tkzcenter,\tkzratio)(#1) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzUHomo(\tkzcenter,\tkzratio)(#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleReflection(#1,#2){% +\begingroup + \tkzUSymOrth(\tkzdeb,\tkzfin)(#1) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzUSymOrth(\tkzdeb,\tkzfin)(#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleSymmetry(#1,#2){% +\begingroup + \tkzUCSym(\tkzcenter)(#1) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzUCSym(\tkzcenter)(#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefCircleRotation(#1,#2){% +\begingroup + \tkzURotateAngle(\tkzcenter,\tkzangle)(#1) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzURotateAngle(\tkzcenter,\tkzangle)(#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% #3,#4 cercle d'inversion centre #3. through #4 +% Si le cercle passe par le pôle l'image est une droite +\def\tkzDefInversionCircle(#1,#2,#3,#4){% +\begingroup + \tkz@@CalcLengthcm(#1,#2){tkz@lna}% + \tkz@@CalcLengthcm(#1,#3){tkz@lnb}% + \gdef\tkzMathResult{\fpeval{round(abs(\tkz@lnb - \tkz@lna),6)}} + \ifdim\tkzMathResult pt < 1 pt\relax% + \tkzURotateAngle(#1,-90)(#2) + \pgfnodealias{tkz@a}{tkzPointResult} + \tkzUInversePoint(#3,#4)(tkz@a) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzUInversePoint(#3,#4)(#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \else + \tkzURotateAngle(#1,90)(#2) + \pgfnodealias{tkz@a}{tkzPointResult} + \tkzURotateAngle(#1,-90)(#2) + \pgfnodealias{tkz@b}{tkzPointResult} + \tkzUInversePoint(#3,#4)(tkz@a) + \pgfnodealias{tkz@p1}{tkzPointResult} + \tkzUInversePoint(#3,#4)(tkz@b) + \pgfnodealias{tkz@p2}{tkzPointResult} + \tkzUInversePoint(#3,#4)(#2) + \pgfnodealias{tkz@p3}{tkzPointResult} + \tkzDefCircle[circum](tkz@p3,tkz@p1,tkz@p2) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefInversionNegativeCircle(#1,#2,#3,#4){% +\begingroup + \tkzDefInversionCircle(#1,#2,#3,#4) + \tkzUCSym(\tkzcenter)(tkzFirstPointResult) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzUCSym(\tkzcenter)(tkzSecondPointResult) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% End Def Circle +%<--------------------------------------------------------------------------–> +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex new file mode 100644 index 0000000000..4428f407f5 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex @@ -0,0 +1,223 @@ +% tkz-obj-eu-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-eu-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 + \tkzDefBarycentricPoint(#1=1,#2=\tkz@koeff) + \pgfnodealias{apo@pta}{tkzPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \tkzDefBarycentricPoint(#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/tkz-obj-eu-grids.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex new file mode 100644 index 0000000000..c6c1be300d --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex @@ -0,0 +1,83 @@ +% tkz-obj-eu-grids.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-eu-grids.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% Setup Grid +%<--------------------------------------------------------------------------–> +\pgfkeys{/tkzsugrid/.cd, + line width/.store in = \tkz@sug@lw, + color/.store in = \tkz@sug@color, + line width = \tkz@grid@lw, + color = \tkz@grid@color + } + +\def\tkzSetUpGrid{\pgfutil@ifnextchar[{\tkz@SetUpGrid}{\tkz@SetUpGrid[]}} +\def\tkz@SetUpGrid[#1]{% +\begingroup +\pgfqkeys{/tkzsugrid}{#1} +\global\let\tkz@grid@lw\tkz@sug@lw +\global\let\tkz@grid@color\tkz@sug@color +\endgroup +} +%<--------------------------------------------------------------------------–> +% tkzGrid +%<--------------------------------------------------------------------------–> +\pgfkeys{/tkzGrid/.cd, + color/.code = {\def\tkz@gd@color{#1}% + \edef\tkz@gd@subcolor{% + \tkz@gd@color!\tkzCoeffSubColor}}, + subxstep/.store in = {\tkz@gd@subxstep}, + subystep/.store in = {\tkz@gd@subystep}, + ratio/.store in = {\tkz@gd@ratio}, + line width/.code = {\edef\tkz@gd@lw{#1} + \edef\tkz@gd@sublw{\tkz@gd@ratio\tkz@gd@lw}}, + sub/.is if = tkz@gd@sub, + sub/.default = true , + sub = false, + color = \tkz@grid@color, + ratio = 0.75, + subxstep = \tkz@grid@xstep, + subystep = \tkz@grid@ystep, + line width = \tkz@grid@lw, + /tkzGrid/.search also= {/tikz}, +} +%<--------------------------------------------------------------------------–> +\def\tkzGrid{\pgfutil@ifnextchar[{\tkz@Grid}{\tkz@Grid[]}} +\def\tkz@Grid[#1]{\@ifnextchar({\tkz@@Grid[#1]}% + {\tkz@@Grid[#1](\tkz@tmp@xa,\tkz@tmp@ya)(\tkz@tmp@xb,\tkz@tmp@yb)}} +\def\tkz@@Grid[#1](#2,#3)(#4,#5){% + \pgfqkeys{/tkzGrid}{#1} + \begingroup + \edef\tkz@gxa{\fpeval{(#2-\tkz@init@xorigine)/\tkz@init@xstep}} + \edef\tkz@gxb{\fpeval{(#4-\tkz@init@xorigine)/\tkz@init@xstep}} + \edef\tkz@gya{\fpeval{(#3-\tkz@init@yorigine)/\tkz@init@ystep}} + \edef\tkz@gyb{\fpeval{(#5-\tkz@init@yorigine)/\tkz@init@ystep}} + \iftkz@gd@sub% + \edef\@subxstep{\fpeval{\tkz@gd@subxstep/\tkz@init@xstep}}% + \edef\@subystep{\fpeval{\tkz@gd@subystep/\tkz@init@ystep}}% + \draw [xstep = \@subxstep cm,% + ystep = \@subystep cm,% + color = \tkz@gd@subcolor,% + line width = \tkzRatioLineGrid]% + (\tkz@gxa,\tkz@gya) grid (\tkz@gxb,\tkz@gyb);% + \fi + \draw [color = \tkz@gd@color,% + line width = \tkz@gd@lw]% + (\tkz@gxa,\tkz@gya) grid (\tkz@gxb,\tkz@gyb);% + \endgroup +}% +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex new file mode 100644 index 0000000000..5d5e2934fe --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex @@ -0,0 +1,293 @@ +% tkz-obj-eu-lines.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-eu-lines.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% les lignes +%<--------------------------------------------------------------------------–> +\def\tkz@numline{0} +\pgfkeys{/tkzdefline/.cd, + mediator/.code = \def\tkz@numline{0}, + perpendicular/.code args = {through #1} {\def\tkz@numline{1}% + \def\tkz@through{#1}}, + orthogonal/.code args = {through #1} {\def\tkz@numline{1}% + \def\tkz@through{#1}}, + parallel/.code args = {through #1}{\def\tkz@numline{2}% + \def\tkz@through{#1}}, + bisector/.code = \def\tkz@numline{3}, + bisector out/.code = \def\tkz@numline{4}, + symmedian/.code = \def\tkz@numline{5}, + altitude/.code = \def\tkz@numline{6}, + euler/.code = \def\tkz@numline{7}, + tangent from/.code = \def\tkz@numline{8} \def\tkz@ptfrom{#1}, + tangent at/.code = \def\tkz@numline{9} \def\tkz@ptat{#1}, + K/.code = \def\tkz@koeff{#1}, + K = 1, + normed/.is if = tkz@line@normed, + normed/.default = true, + normed = false, + mediator +} +\def\tkzDefLine{\pgfutil@ifnextchar[{\tkz@DefLine}{\tkz@DefLine[]}} +\def\tkz@DefLine[#1](#2){% +\begingroup +%\pgfkeys{/tkzdefline/.cd,K=1} +\pgfqkeys{/tkzdefline}{#1} +\ifcase\tkz@numline% + % first case 0 + \tkzDefMediatorLine(#2) + \or% 1 + \tkzDefOrthLine[\tkz@koeff](#2) + \or% 2 + \tkzDefLineLL(#2) + \or% 3 + \tkzDefBisectorLine(#2) + \or% 4 + \tkzDefBisectorOutLine(#2) + \or% 5 + \tkzDefSymmedianLine(#2) + \or% 6 + \tkzDefAltitudeLine(#2) + \or% 7 + \tkzDefEulerLine(#2) + \or% 8 + \tkzTgtFromP(#2)(\tkz@ptfrom) + \or% 9 + \tkzTgtAt(#2)(\tkz@ptat) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% tkzLineLL revoir out !! +%<--------------------------------------------------------------------------–> +\def\tkzDefLineLL{\pgfutil@ifnextchar[{\tkz@DefLineLL}{% + \tkz@DefLineLL[1]}} +\def\tkz@DefLineLL[#1](#2,#3){% +\begingroup + \pgfpointdiff{\pgfpointanchor{#2}{center}}{\pgfpointanchor{#3}{center}}% + \pgf@xa=\pgf@x\relax%% + \pgf@ya=\pgf@y\relax%% + \pgfinterruptboundingbox + \path[coordinate](\tkz@through)--++(\tkz@koeff\pgf@xa,\tkz@koeff\pgf@ya)% + coordinate (tkzPointResult); + \endpgfinterruptboundingbox + \iftkz@line@normed + \tkzVecKNorm(\tkz@through,tkzPointResult) + \fi +\endgroup}% +%<--------------------------------------------------------------------------–> +% tkzOrthLine +%<--------------------------------------------------------------------------–> +\def\tkzDefOrthLine{\pgfutil@ifnextchar[{\tkz@DefOrthLine}{% + \tkz@DefOrthLine[1]}} +\def\tkz@DefOrthLine[#1](#2,#3){% +\begingroup + \tkzDefPointWith(#2,#3) + \pgfnodealias{tkz@OLtmp}{tkzPointResult} + \tkz@VecKCoLinear[\tkz@koeff](#2,tkz@OLtmp,\tkz@through) + \iftkz@line@normed + \pgfinterruptboundingbox + \tkzVecKNorm(\tkz@through,tkzPointResult) + \endpgfinterruptboundingbox + \fi +\endgroup}% +%<--------------------------------------------------------------------------–> +% tkzMediatorLine +%<--------------------------------------------------------------------------–> +\def\tkzDefMediatorLine{\pgfutil@ifnextchar[{\tkz@DefMediatorLine}{% + \tkz@DefMediatorLine[1]}} + +\def\tkz@DefMediatorLine[#1](#2,#3){% new 2020 +\begingroup + \tkzDefEquilateral(#2,#3) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzDefEquilateral(#3,#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \ifx\tkz@koeff=1 % + \else + \tkzDefMidPoint(#2,#3) + \pgfnodealias{tkz@mid}{tkzPointResult} + \tkz@VecK[\tkz@koeff](tkz@mid,tkzFirstPointResult) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkz@VecK[\tkz@koeff](tkz@mid,tkzSecondPointResult) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + \fi + \iftkz@line@normed + \tkzDefMidPoint(#2,#3) + \pgfnodealias{tkz@mid}{tkzPointResult} + % \pgfinterruptboundingbox + \tkzVecKNorm[\tkz@koeff](tkz@mid,tkzFirstPointResult) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzVecKNorm[\tkz@koeff](tkz@mid,tkzSecondPointResult) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} + % \endpgfinterruptboundingbox + \fi +\endgroup} +% autre possibilité + +%<--------------------------------------------------------------------------–> +% BisectorLine +%<--------------------------------------------------------------------------–> +\def\tkzDefBisectorLine(#1,#2,#3){% +\begingroup + \pgfinterruptboundingbox + \tkzDuplicateSegment(#2,#1)(#2,#3) + \pgfnodealias{bi@tmp}{tkzPointResult} + \tkzDefMidPoint(bi@tmp,#1) +% \tkzDefEquilateral(bi@tmp,#1) + \ifx\tkz@koeff=1 % + \else + \tkzVecK[\tkz@koeff](#2,tkzPointResult) + \fi + \iftkz@line@normed + \tkzVecKNorm[\tkz@koeff](#2,tkzPointResult) + \fi + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% Out BisectorLine +%<--------------------------------------------------------------------------–> +\def\tkzDefBisectorOutLine(#1,#2,#3){% +\begingroup +\pgfinterruptboundingbox + \tkzDuplicateLength(#2,#1)(#2,#3) + \pgfnodealias{out@tmp}{tkzPointResult} + \tkzDefMidPoint(#1,out@tmp) + \pgfnodealias{out@pt1}{tkzPointResult} + \tkzURotateAngle(#2,90)(out@pt1) + \ifx\tkz@koeff=1 % + \else + \tkzVecK[\tkz@koeff](#2,tkzPointResult) + \fi + \iftkz@line@normed + \tkzVecKNorm[\tkz@koeff](#2,tkzPointResult) + \fi +\endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% Symmedian line +%<--------------------------------------------------------------------------–> +\def\tkzDefSymmedianLine(#1,#2,#3){% +\begingroup + \tkzDefBisectorLine(#1,#2,#3) + \pgfnodealias{sym@pt1}{tkzPointResult} + \tkzDefMidPoint(#1,#3) + \pgfnodealias{sym@pt2}{tkzPointResult} + \tkzUSymOrth(#2,sym@pt1)(sym@pt2) + \ifx\tkz@koeff=1 % + \else + \tkzVecK[\tkz@koeff](#2,tkzPointResult) + \fi + \iftkz@line@normed + \tkzVecKNorm[\tkz@koeff](#2,tkzPointResult) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% Altitude Line +%<--------------------------------------------------------------------------–> +\def\tkzDefAltitudeLine(#1,#2,#3){% +\begingroup + \pgfinterruptboundingbox + \tkzUProjection(#1,#3)(#2) + \pgfnodealias{ort@pta}{tkzPointResult} + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% Euler Line +%<--------------------------------------------------------------------------–> +\def\tkzDefEulerLine(#1,#2,#3){% +\begingroup + \pgfinterruptboundingbox + \tkzOrthoCenter(#1,#2,#3) + \pgfnodealias{euler@pt1}{tkzPointResult} + \tkzEulerCenter(#1,#2,#3) + \pgfnodealias{euler@pt2}{tkzPointResult} + \pgfnodealias{tkzSecondPointResult}{euler@pt2} + \pgfnodealias{tkzFirstPointResult}{euler@pt1} + \endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% tangente à cercle passant par un point donné +%<--------------------------------------------------------------------------–> + +\def\tkzTgtAt(#1)(#2){% +\begingroup + \tkz@VecKOrthNorm[-1](#2,#1) + \endgroup +} +%<-------------------------------------------------------------------------–> +\def\tkzTgtFromP(#1,#2)(#3){% +\begingroup + \tkz@@CalcLengthcm(#1,#2){tkz@radone} + \tkzDefMidPoint(#1,#3) + \tkz@@CalcLengthcm(tkzPointResult,#1){tkz@radtwo} + \tkzInterCCR(#1,\tkz@radone)(tkzPointResult,\tkz@radtwo){% + tkzFirstPointResult}{tkzSecondPointResult}% + \tkzFindAngle(#3,tkzFirstPointResult,#1) \tkzGetAngle{tkz@an} + \ifdim\tkz@an pt<180 pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi +\endgroup +} +%<-------------------------------------------------------------------------–> +\def\tkzTgtFromPR(#1,#2)(#3){% +\begingroup + \tkzDefMidPoint(#1,#3) + \tkz@@CalcLengthcm(tkzPointResult,#1){tkzLengthResult} + \tkzInterCCR(#1,#2)(tkzPointResult,\tkzLengthResult){% + tkzFirstPointResult}{% + tkzSecondPointResult}% + \tkzFindAngle(#3,tkzFirstPointResult,#1) \tkzGetAngle{tkz@an} + \ifdim\tkz@an pt<180 pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkz@numtang{0} +\pgfkeys{/tkz@tang/.cd, + at/.code = {\def\tkz@numtang{0}\def\tkz@ptat{#1}}, + from/.code = {\def\tkz@numtang{1}\def\tkz@ptfrom{#1}}, + from with R/.code = {\def\tkz@numtang{2}\def\tkz@ptfrom{#1}} + } +%<--------------------------------------------------------------------------–> +\def\tkzDefTangent{\pgfutil@ifnextchar[{\tkz@Tangent}{\tkz@Tangent[]}} + +\def\tkz@Tangent[#1](#2){% +\begingroup +\pgfkeys{tkz@tang/.cd} +\pgfqkeys{/tkz@tang}{#1} +\ifcase\tkz@numtang + \tkzTgtAt(#2)(\tkz@ptat) +\or + \tkzTgtFromP(#2)(\tkz@ptfrom) + \or + \tkzTgtFromPR(#2)(\tkz@ptfrom) +\fi +\endgroup +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex new file mode 100644 index 0000000000..2af038e957 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex @@ -0,0 +1,520 @@ +% tkz-tools-eu-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-eu-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% + \pgfmathrotatepointaround{\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% + \pgfmathrotatepointaround{\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% + \pgfmathrotatepointaround{\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% + \pgfmathrotatepointaround{\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% + \pgfmathrotatepointaround{\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% + \pgfmathrotatepointaround{\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/tkz-obj-eu-points-rnd.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex new file mode 100644 index 0000000000..a5aa32776a --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex @@ -0,0 +1,119 @@ +% tkz-obj-eu-points-rnd.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-eu-points-rnd.tex} +%<--------------------------------------------------------------------------–> +\makeatletter +%<-------------------------------------------------------------------------–> +% Points aléatoires sur un segment, une droite, une demi-droite un cercle +%<--------------------------------------------------------------------------–> +% les points aléatoires +%<--------------------------------------------------------------------------–> +\def\tkz@numrp{0} +\pgfkeys{/@tkzDefRandPoint/.cd, + rectangle/.code args = {#1 and #2}{\def\tkz@numrp{0}% + \def\tkz@infl{#1}% + \def\tkz@supr{#2}}, + segment/.code args = {#1--#2}{\def\tkz@numrp{1}% + \def\tkz@start{#1}% + \def\tkz@end{#2}}, + line/.code args = {#1--#2}{\def\tkz@numrp{2}% + \def\tkz@start{#1}% + \def\tkz@end{#2}}, + circle/.code args = {center #1 radius #2}{\def\tkz@numrp{3}% + \def\tkz@center{#1} + \def\tkz@rad{#2}}, + circle through/.code args = {center #1 through #2}{\def\tkz@numrp{4}% + \def\tkz@center{#1} + \def\tkz@point{#2}}, + disk through/.code args = {center #1 through #2}{\def\tkz@numrp{5}% + \def\tkz@center{#1} + \def\tkz@point{#2}}, +} +%<------------------------ version 2019 ----------------------------------> +\def\tkzDefRandPointOn{\pgfutil@ifnextchar[{\tkz@DefRandPointOn}{% + \tkz@DefRandPointOn[]}} +\def\tkz@DefRandPointOn[#1]{% +\begingroup +\pgfqkeys{/@tkzDefRandPoint}{#1} +\ifcase\tkz@numrp% + % first case 0 + \tkzRandPointOnRect(\tkz@infl,\tkz@supr) + \or% 1 + \tkzRandPointOnSegment(\tkz@start,\tkz@end) + \or% 2 + \tkzRandPointOnLine(\tkz@start,\tkz@end) + \or% 3 + \tkzRandPointOnCircle(\tkz@center,\tkz@rad) + \or% 4 + \tkzRandPointOnCircleThrough(\tkz@center,\tkz@point) + \or% 5 + \tkzRandPointOnDisk(\tkz@center,\tkz@point) +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzRandPointOnRect(#1,#2){% +\tkz@@extractxy{#1} + \pgf@xa=\pgf@x\relax% + \pgf@ya=\pgf@y\relax% + \tkz@@extractxy{#2} + \pgf@xb=\pgf@x\relax% + \pgf@yb=\pgf@y\relax% + \edef\tkz@a{\fpeval{\pgf@xb-\pgf@xa}} + \edef\tkz@b{\fpeval{\pgf@yb-\pgf@ya}} + \pgfmathparse{rnd}\global\let\tkzrndone\pgfmathresult + \pgfmathparse{rnd}\global\let\tkzrndtwo\pgfmathresult + \path[coordinate] ($(#1)+(\tkzrndone*\tkz@a pt,\tkzrndtwo*\tkz@b pt)$) coordinate (tkzPointResult); + } +%<--------------------------------------------------------------------------–> +\def\tkzRandPointOnSegment(#1,#2){% + \pgfmathparse{rnd} + \let\myrnd\pgfmathresult +\path[coordinate] ($ (#1)!\myrnd!(#2) $) coordinate (tkzPointResult); +} +%<--------------------------------------------------------------------------–> +\def\tkzRandPointOnLine(#1,#2){% + \pgfmathparse{rand} + \let\myrnd\pgfmathresult +\path[coordinate] ($ (#1)!\myrnd!(#2) $) coordinate (tkzPointResult); +} +%<--------------------------------------------------------------------------–> +\def\tkzRandPointOnCircle(#1,#2){% +\pgfmathrandominteger{\tkzrnd}{0}{360} +\tkz@ax#2cm % + \edef\tkz@pxa{\fpeval{\tkz@ax*cosd(\tkzrnd)}} + \edef\tkz@pxb{\fpeval{\tkz@ax*sind(\tkzrnd)}} + \path[coordinate]($(#1) + (\tkz@pxa pt,\tkz@pxb pt) $) coordinate (tkzPointResult); +} +\def\tkzRandPointOnCircleThrough(#1,#2){% +\pgfmathrandominteger{\tkzrnd}{0}{360} +\tkz@@CalcLength(#1,#2){tkzLengthResult} + \edef\tkz@pxa{\fpeval{\tkzLengthResult*cosd(\tkzrnd)}} + \edef\tkz@pxb{\fpeval{\tkzLengthResult*sind(\tkzrnd)}} +\path[coordinate]($(#1) + (\tkz@pxa pt ,\tkz@pxb pt) $) coordinate (tkzPointResult); +} +%<--------------------------------------------------------------------------–> +\def\tkzRandPointOnDisk(#1,#2){% + \pgfmathrandominteger{\tkzrnd}{0}{360} + \tkz@@CalcLength(#1,#2){tkzLengthResult} + \edef\tkz@pxa{\fpeval{\tkzLengthResult*cosd(\tkzrnd)}} + \edef\tkz@pxb{\fpeval{\tkzLengthResult*sind(\tkzrnd)}} + \path[coordinate]($(#1) + (\tkz@pxa pt ,\tkz@pxb pt) $) coordinate (tkz@tmp); + \pgfmathparse{rnd} + \let\myrnd\pgfmathresult + \path[coordinate] ($ (#1)!\myrnd!(tkz@tmp) $) coordinate (tkzPointResult); +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex new file mode 100644 index 0000000000..b650e32727 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex @@ -0,0 +1,265 @@ +% tkz-obj-el-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-eu-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{\fpeval{\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% + \edef\tkz@x{\fpeval{28.45274*(#1)*\pgf@xa}} + \edef\tkz@y{\fpeval{28.45274*(#1)*\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% + \edef\tkz@x{\fpeval{28.45274*(#1)*\pgf@xa}} + \edef\tkz@y{\fpeval{28.45274*(#1)*\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{\fpeval{28.45274*(#1)*\pgf@xa}} + \edef\tkz@y{\fpeval{28.45274*(#1)*\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/tkz-obj-eu-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex new file mode 100644 index 0000000000..5a247848dd --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex @@ -0,0 +1,173 @@ + % tkz-obj-eu-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-eu-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{\fpeval{(\tkz@x-\tkz@init@xorigine)/\tkz@init@xstep}} +\edef\tkzpt@ya{\fpeval{(\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\tkz@drawnode#1{\path[coordinate](\tkzpt@xa,\tkzpt@ya) coordinate(#1); +% \tkz@DrawPt{#1} +% } +% +%<---------------------------------------------------------------------------> +\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 diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex new file mode 100644 index 0000000000..4c79826734 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex @@ -0,0 +1,113 @@ +% tkz-obj-eu-polygons.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-eu-polygons.tex} +% bug in regular polygon side 2020/03/09 +\makeatletter +%<--------------------------------------------------------------------------–> +% Polygon +%<--------------------------------------------------------------------------–> +%<--------------------------- square ------------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzDefSquare(#1,#2){ +\begingroup + \tkzURotateAngle(#2,-90)(#1) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzURotateAngle(#1, 90)(#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} +\endgroup +} +%<--------------------- parallélogramme ---------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzDefParallelogram(#1,#2,#3){ +\begingroup +\tkzDefPointWith[colinear= at #3](#2,#1) +\endgroup +} +%<--------------------- rectangle ---------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzDefRectangle{\pgfutil@ifnextchar[{\tkz@DefRectangle}% + {\tkz@DefRectangle[]}} +\def\tkz@DefRectangle[#1](#2,#3){% +\begingroup + \path[#1](#2) -| coordinate (tkzFirstPointResult) (#3) -| coordinate (tkzSecondPointResult) (#2); +\endgroup +} +%<-------------------------- gold rectangle -------------------------------–> +% +%<--------------------------------------------------------------------------–> +\def\tkzDefGoldRectangle(#1,#2){ +\begingroup + \tkzDefPointWith[K=-\tkzInvPhi](#2,#1) + \pgfnodealias{tkzFirstPointResult}{tkzPointResult} + \tkzDefPointWith[K=\tkzInvPhi](#1,#2) + \pgfnodealias{tkzSecondPointResult}{tkzPointResult} +\endgroup +} +\let\tkzDefGoldenRectangle\tkzDefGoldRectangle +%<---------------------------- Regular Polygon -------------------------–> +\def\tkz@numregpol{0} +\pgfkeys{/defregpoly/.cd, + name/.store in = \tkz@regpolname, + sides/.store in = \tkz@regpolsides, + center/.code = \def\tkz@numregpol{0}, + side/.code = \def\tkz@numregpol{1}, + name/.default = P, + sides/.default = 5, + center +} +\def\tkzDefRegPolygon{\pgfutil@ifnextchar[{\tkz@DefRegPolygon}{\tkz@DefRegPolygon[]}} +\def\tkz@DefRegPolygon[#1](#2,#3){% +\begingroup +\pgfqkeys{/defregpoly}{#1} +\ifcase\tkz@numregpol% + \tkzRegPolygonCenter(#2,#3) + \or% + \tkzRegPolygonSide(#2,#3) + \fi +\endgroup +} +\def\tkzRegPolygonCenter(#1,#2){ +\begingroup + \foreach \v in {1,2,...,\tkz@regpolsides} + {% + \pgfmathsetmacro{\tkz@regangle}{360/\tkz@regpolsides*(\v-1)} + \tkzDefPointBy[rotation= center #1 angle \tkz@regangle](#2) + \pgfnodealias{\tkz@regpolname\v}{tkzPointResult} + } +\endgroup +} +\def\tkzRegPolygonSide(#1,#2){ +\begingroup +% get the center +\pgfmathsetmacro{\tkz@regangle}{360/\tkz@regpolsides*(\tkz@regpolsides-1)} +\pgfmathsetmacro{\tkz@regangleside}{(180-\tkz@regangle)/2} +\tkzDefMidPoint(#1,#2) +\pgfnodealias{tkz@tempPt}{tkzPointResult} +\tkz@@CalcLengthcm(tkz@tempPt,#1){tkz@len} +\pgfmathsetmacro{\tkz@inscriberadius}{% + \tkz@len*tan(90*(\tkz@regpolsides-2)/\tkz@regpolsides)} +\tkzDefPointWith[orthogonal normed,K=\tkz@inscriberadius](tkz@tempPt,#2) +\pgfnodealias{tkz@RegPolCenter}{tkzPointResult} +\tkzRegPolygonCenter(tkz@RegPolCenter,#1) +\pgfnodealias{tkzPointResult}{tkz@RegPolCenter} +\endgroup +} + + +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex new file mode 100644 index 0000000000..738221b1b6 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex @@ -0,0 +1,500 @@ +% tkz-obj-eu-triangles.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-eu-triangles.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% Triangle Equilateral +%<--------------------------------------------------------------------------–> +\def\tkzDefEquilateral(#1,#2){ +\begingroup + %\tkzDefMidPoint(#1,#2) + \tkzURotateAngle(#1,60)(#2) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Triangle Isosceles Right +%<--------------------------------------------------------------------------–> +\def\tkzDefIsoscelesRightTriangle(#1,#2){ +\begingroup + \tkzURotateAngle(#1,45)(#2) + \pgfnodealias{tkz@a}{tkzPointResult} + \tkzUHomo(#1,\tkzSqrTwobyTwo)(tkz@a) +\endgroup +} +%<--------------------------------------------------------------------------–> +\def\tkzDefIsoscelesRightTriangle(#1,#2){% +\begingroup + \tkzURotateAngle(#1,45)(#2) + \pgfnodealias{tkz@a}{tkzPointResult} + \tkzUHomo(#1,\tkzSqrTwobyTwo)(tkz@a) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Triangle OneTwo +%<--------------------------------------------------------------------------–> +\def\tkzDefTwoOne(#1,#2){ +\begingroup + \iftkz@swap@tr + \tkzDefPointWith[K=-.5](#2,#1) + \else + \tkzDefPointWith[K=.5](#2,#1) + \fi + \endgroup +} +%<--------------------------------------------------------------------------– +% Pythagore +%<--------------------------------------------------------------------------– +\def\tkzDefPythagore(#1,#2){ +\begingroup +\iftkz@swap@tr + \tkzDefPointWith[K=-.75](#2,#1) + \else + \tkzDefPointWith[K=.75](#2,#1) + \fi +\endgroup +} +%<--------------------------------------------------------------------------– +% School +%<--------------------------------------------------------------------------– +\def\tkzDefSchoolTriangle(#1,#2){ +\begingroup +\iftkz@swap@tr + \tkzDefPointWith(#2,#1) + \pgfnodealias{tkz@a}{tkzPointResult} + \tkzURotateAngle(#1,-30)(#2) + \tkzInterLL(#1,tkzPointResult)(#2,tkz@a) +\else + \tkzDefPointWith(#2,#1) + \pgfnodealias{tkz@a}{tkzPointResult} + \tkzURotateAngle(#1,30)(#2) + \tkzInterLL(#1,tkzPointResult)(#2,tkz@a) + \fi +\endgroup +} +%<--------------------------------------------------------------------------– +% Gold +%<--------------------------------------------------------------------------– +\def\tkzDefGoldTriangle(#1,#2){ +\begingroup + \iftkz@swap@tr + \tkzDefPointWith[K=-\tkzInvPhi](#2,#1) + \else + \tkzDefPointWith[K=\tkzInvPhi](#2,#1) + \fi +\endgroup +} +%<--------------------------------------------------------------------------– +% +%<--------------------------------------------------------------------------– +\def\tkzDefEuclideTriangle(#1,#2){ +\begingroup + \iftkz@swap@tr + \tkzURotateAngle(#1,36)(#2) + \else + \tkzURotateAngle(#1,-36)(#2) + \fi +\endgroup +} +%<--------------------------------------------------------------------------– +% +%<--------------------------------------------------------------------------– +\def\tkzDefGoldenTriangle(#1,#2){ +\begingroup + \tkzURotateAngle(#1,72)(#2) + \tkzUHomo(#1,\tkzPhi)(tkzPointResult) +\endgroup +} +%<--------------------------------------------------------------------------– +% +%<--------------------------------------------------------------------------– +\def\tkzDefCheopsTriangle(#1,#2){ +\begingroup + \tkzDefMidPoint(#1,#2) + \tkzDefPointWith[K=-\tkzSqrtPhi](tkzPointResult,#1) +\endgroup +} +%<--------------------------------------------------------------------------– +% +%<--------------------------------------------------------------------------– +\def\tkzDefTwoAnglesTriangle(#1,#2){ +\begingroup + \tkzURotateAngle(#1,\tkz@alpha)(#2) + \pgfnodealias{tkz@a}{tkzPointResult} + \tkzURotateAngle(#2,-\tkz@beta)(#1) + \pgfnodealias{tkz@b}{tkzPointResult} + \tkzInterLL(#1,tkz@a)(#2,tkz@b) +\endgroup +} +%<--------------------------------------------------------------------------–> +% Triangles +%<--------------------------------------------------------------------------–> + +\def\tkz@numtr{0} +\pgfkeys{/deftriangle/.cd, + equilateral/.code = \def\tkz@numtr{0}, + half/.code = \def\tkz@numtr{1}, + two one/.code = \def\tkz@numtr{1}, + pythagore/.code = \def\tkz@numtr{2}, + pythagoras/.code = \def\tkz@numtr{2}, + right/.code = \def\tkz@numtr{2}, + egyptian/.code = \def\tkz@numtr{2}, + school/.code = \def\tkz@numtr{3}, + golden/.code = \def\tkz@numtr{4}, + sublime/.code = \def\tkz@numtr{4}, + euclid/.code = \def\tkz@numtr{5}, + euclide/.code = \def\tkz@numtr{5}, + gold/.code = \def\tkz@numtr{6}, + cheops/.code = \def\tkz@numtr{7}, + two angles/.code args = {#1 and #2} { \def\tkz@numtr{8}% + \def\tkz@alpha{#1}% + \def\tkz@beta{#2}}, + isosceles right/.code = \def\tkz@numtr{9}, + swap/.is if = tkz@swap@tr, + swap/.default = true, + swap = false, + equilateral +} + +\def\tkzDefTriangle{\pgfutil@ifnextchar[{\tkz@DefTriangle}{\tkz@DefTriangle[]}} +\def\tkz@DefTriangle[#1](#2,#3){% +\begingroup +\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) + \or% 9 + \tkzDefIsoscelesRightTriangle(#2,#3) + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% les triangles sspécifiques +%<--------------------------------------------------------------------------–> + +%<--------------------------------------------------------------------------– +\def\tkz@numtspc{0} +\pgfkeys{/tkzDefSpcTriangle/.cd, + in/.code = \def\tkz@numtspc{0}, + incentral/.code = \def\tkz@numtspc{0}, + ex/.code = \def\tkz@numtspc{1}, + excentral/.code = \def\tkz@numtspc{1}, + extouch/.code = \def\tkz@numtspc{2}, + intouch/.code = \def\tkz@numtspc{3}, + contact/.code = \def\tkz@numtspc{3}, + centroid/.code = \def\tkz@numtspc{4}, + medial/.code = \def\tkz@numtspc{4}, + orthic/.code = \def\tkz@numtspc{5}, + ortho/.code = \def\tkz@numtspc{5}, + feuerbach/.code = \def\tkz@numtspc{6}, + euler/.code = \def\tkz@numtspc{7}, + tangential/.code = \def\tkz@numtspc{8}, + symmedial/.code = \def\tkz@numtspc{9}, + name/.store in = \tkz@pttr@name, + name = {}, + centroid, + } +\def\tkzDefSpcTriangle{\pgfutil@ifnextchar[{\tkz@DefSpcTriangle}{% + \tkz@DefSpcTriangle[]}} +\def\tkz@DefSpcTriangle[#1](#2)#3{% +\begingroup +\pgfqkeys{/tkzDefSpcTriangle}{#1} +\ifcase\tkz@numtspc% + \tkzDefIncentralTriangle(#2){#3} + \or% 1 + \tkzDefExcentralTriangle(#2){#3} + \or% 2 + \tkzDefExtouchTriangle(#2){#3} + \or% 3 + \tkzDefIntouchTriangle(#2){#3} + \or% 4 + \tkzDefCentroidTriangle(#2){#3} + \or% 5 + \tkzDefOrthicTriangle(#2){#3} + \or% 6 + \tkzDefFeuerbachTriangle(#2){#3} + \or% 7 + \tkzDefEulerTriangle(#2){#3} + \or% 8 + \tkzDefTangentialTriangle(#2){#3} + \or% 8 + \tkzDefSymmedialTriangle(#2){#3} + \fi +\endgroup +} + +\pgfkeys{/setuppttr/.is family} +\def\SetUpPTTR#1{\pgfqkeys{/setuppttr}{#1}} +\pgfkeys{/setuppttr/.cd, + name/.store in = \tkz@pttr@name, + name = {} +} +%<--------------------------------------------------------------------------– +% InCentral +%<--------------------------------------------------------------------------– +%<--------------------------------------------------------------------------–> +\def\@DefIncentralTriangle(#1,#2,#3)(#4,#5){% +\def\tkz@tmp{#5}% + \tkz@recuplast(#3) + \tkzDefBisectorLine(#2,#1,\tkz@last) + \tkzInterLL(#2,\tkz@last)(#1,tkzPointResult) + \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} + \ifx\tkz@tmp\tkz@stop\else\@DefIncentralTriangle(#2,#3)(#5)\fi +} + +\def\tkzDefIncentralTriangle{\pgfutil@ifnextchar[{% + \tkz@DefIncentralTriangle}{% + \tkz@DefIncentralTriangle[]}} + +\def\tkz@DefIncentralTriangle[#1](#2)#3{% +\begingroup + \SetUpPTTR{#1} + \pgfinterruptboundingbox + \@DefIncentralTriangle(#2,#2)(#3,\tkz@stop) + \endpgfinterruptboundingbox +\endgroup +} +\let\tkzIncentralTriangle\tkzInExcentralTriangle +%<--------------------------------------------------------------------------– +% ExCentral +%<--------------------------------------------------------------------------– + +%<--------------------------------------------------------------------------–> +\def\@DefExcentralTriangle(#1,#2,#3)(#4,#5){% + \def\tkz@tmp{#5}% + \tkz@recuplast(#3) + \tkzDefExCircle(#2,#1,\tkz@last) + \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} + \ifx\tkz@tmp\tkz@stop\else\@DefExcentralTriangle(#2,#3)(#5)\fi +} + +\def\tkzDefExcentralTriangle{\pgfutil@ifnextchar[{% + \tkz@DefExcentralTriangle}{% + \tkz@DefExcentralTriangle[]}} + +\def\tkz@DefExcentralTriangle[#1](#2)#3{% +\begingroup + \SetUpPTTR{#1} + \@DefExcentralTriangle(#2,#2)(#3,\tkz@stop) +\endgroup +} +\let\tkzExcentralTriangle\tkzDefExcentralTriangle +%<--------------------------------------------------------------------------–> +% Intouch Triangle +%<--------------------------------------------------------------------------–> +\def\@DefIntouchTriangle(#1,#2,#3)(#4,#5){% + \def\tkz@tmp{#5}% + \tkz@recuplast(#3) + \tkzUProjection(#2,\tkz@last)(tkz@pt) + \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} + \ifx\tkz@tmp\tkz@stop\else\@DefIntouchTriangle(#2,#3)(#5)\fi +} + +\def\tkzDefIntouchTriangle{\pgfutil@ifnextchar[{% + \tkz@DefIntouchTriangle}{% + \tkz@DefIntouchTriangle[]}} + +\def\tkz@DefIntouchTriangle[#1](#2)#3{% +\begingroup + \SetUpPTTR{#1} + \tkzInCenter(#2) + \pgfnodealias{tkz@pt}{tkzPointResult} + \@DefIntouchTriangle(#2,#2)(#3,\tkz@stop) +\endgroup +} +\let\tkzDefContactTriangle\tkzDefIntouchTriangle +%<--------------------------------------------------------------------------–> +% Extouch Triangle +%<--------------------------------------------------------------------------–> +\def\tkzDefExtouchTriangle{\pgfutil@ifnextchar[{% + \tkz@DefExtouchTriangle}{% + \tkz@DefExtouchTriangle[]}} + +\def\tkz@DefExtouchTriangle[#1](#2,#3,#4)#5{% +\begingroup + \SetUpPTTR{#1} + \foreach \name [count=\i] in {#5} {% + \global\expandafter\edef\csname tkz@point\i\endcsname{\name} + } + \begingroup + \def\tkz@pttr@name{} + \tkzDefExcentralTriangle(#2,#3,#4){tkz@a,tkz@b,tkz@c} + \endgroup + \tkzUProjection(#3,#4)(tkz@a) + \pgfnodealias{\tkz@pttr@name\csname tkz@point1\endcsname}{tkzPointResult} + \tkzUProjection(#2,#3)(tkz@c) + \pgfnodealias{\tkz@pttr@name\csname tkz@point3\endcsname}{tkzPointResult} + \tkzUProjection(#2,#4)(tkz@b) + \pgfnodealias{\tkz@pttr@name\csname tkz@point2\endcsname}{tkzPointResult} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Feuerbach triangle +%<--------------------------------------------------------------------------–> +\def\tkzDefFeuerbachTriangle{\pgfutil@ifnextchar[{% + \tkz@DefFeuerbachTriangle}{\tkz@DefFeuerbachTriangle[]}} + +\def\tkz@DefFeuerbachTriangle[#1](#2,#3,#4)#5{% +\begingroup + \SetUpPTTR{#1} + \foreach \name [count=\i] in {#5} {% + \global\expandafter\edef\csname tkz@point\i\endcsname{\name} + } + \tkzDefExCircle(#2,#3,#4) \tkzGetPoints{tkz@b}{tkz@hb} + \tkzDefExCircle(#3,#4,#2) \tkzGetPoints{tkz@c}{tkz@hc} + \tkzDefExCircle(#4,#2,#3) \tkzGetPoints{tkz@a}{tkz@ha} + \tkzInterLC[near](#3,tkz@b)(tkz@b,tkz@hb) + \tkzGetFirstPoint{\tkz@pttr@name\csname tkz@point2\endcsname} + \tkzInterLC[near](#4,tkz@c)(tkz@c,tkz@hc) + \tkzGetFirstPoint{\tkz@pttr@name\csname tkz@point3\endcsname} + \tkzInterLC[near](#2,tkz@a)(tkz@a,tkz@ha) + \tkzGetFirstPoint{\tkz@pttr@name\csname tkz@point1\endcsname} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Centroid +%<--------------------------------------------------------------------------–> +% The medial triangle or midpoint triangle of a triangle ABC +\def\@DefCentroidTriangle(#1,#2,#3)(#4,#5){% + \def\tkz@tmp{#5}% + \tkz@recuplast(#3) + \pgfcoordinate{\tkz@pttr@name#4}{% + \pgfpointscale{0.5}{% + \pgfpointadd{\pgfpointanchor{#2}{center}}% + {\pgfpointanchor{\tkz@last}{center}}} + }% + \ifx\tkz@tmp\tkz@stop\else\@DefCentroidTriangle(#2,#3)(#5)\fi + } +\def\tkzDefCentroidTriangle{\pgfutil@ifnextchar[{\tkz@DefCentroidTriangle} + {\tkz@DefCentroidTriangle[]}} +\def\tkz@DefCentroidTriangle[#1](#2)#3{% +\begingroup + \SetUpPTTR{#1} + \@DefCentroidTriangle(#2,#2)(#3,\tkz@stop) +\endgroup +} +\let\tkzDefMedialTriangle\tkzDefCentroidTriangle +\let\tkzDefMidpointTriangle\tkzDefCentroidTriangle +%<--------------------------------------------------------------------------–> +% Orthic Triangle H Ha Hb Hc modif 3.03 +%<--------------------------------------------------------------------------–> +\def\@DefOrthicTriangle(#1,#2,#3)(#4,#5){% + \def\tkz@tmp{#5}% + \tkz@recuplast(#3) + \tkzUProjection(#2,\tkz@last)(#1) + \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} + \ifx\tkz@tmp\tkz@stop\else\@DefOrthicTriangle(#2,#3)(#5)\fi +} + +\def\tkzDefOrthicTriangle{\pgfutil@ifnextchar[{\tkz@DefOrthicTriangle} + {\tkz@DefOrthicTriangle[]}} +\def\tkz@DefOrthicTriangle[#1](#2)#3{% +\begingroup + \SetUpPTTR{#1} + \@DefOrthicTriangle(#2,#2)(#3,\tkz@stop) +\endgroup +} +\let\tkzDefAltitudeTriangle\tkzDefOrthicTriangle + +%<--------------------------------------------------------------------------–> +% The Euler triangle +%<--------------------------------------------------------------------------–> +\def\tkzDefEulerTriangle{\pgfutil@ifnextchar[{% + \tkz@DefEulerTriangle}{\tkz@DefEulerTriangle[]}} +\def\tkz@DefEulerTriangle[#1](#2,#3,#4)#5{% +\begingroup + \SetUpPTTR{#1} + \pgfinterruptboundingbox + \tkzOrthoCenter(#2,#3,#4) + \pgfnodealias{tkz@e}{tkzPointResult} + \tkzDefMidPoint(#2,tkz@e) + \pgfnodealias{tkz@m1}{tkzPointResult} + \tkzDefMidPoint(#3,tkz@e) + \pgfnodealias{tkz@m2}{tkzPointResult} + \tkzDefMidPoint(#4,tkz@e) + \pgfnodealias{tkz@m3}{tkzPointResult} + \endpgfinterruptboundingbox + \foreach \name [count=\i] in {#5} {% + \coordinate (\tkz@pttr@name\name) at (tkz@m\i); + } +\endgroup +} +%<--------------------------------------------------------------------------–> +% TangentialTriangle +%<--------------------------------------------------------------------------–> +\def\tkzDefTangentialTriangle{\pgfutil@ifnextchar[{% + \tkz@DefTangentialTriangle}{\tkz@DefTangentialTriangle[]}} +\def\tkz@DefTangentialTriangle[#1](#2,#3,#4)#5{% +\begingroup + \SetUpPTTR{#1} + \tkzCircumCenter(#2,#3,#4) + \pgfnodealias{tkz@circ}{tkzPointResult} + \tkzDefLine[orthogonal=through #2](tkz@circ,#2) + \pgfnodealias{tkz@pta}{tkzPointResult} + \tkzDefLine[orthogonal=through #3](tkz@circ,#3) + \pgfnodealias{tkz@ptb}{tkzPointResult} + \tkzDefLine[orthogonal=through #4](tkz@circ,#4) + \pgfnodealias{tkz@ptc}{tkzPointResult} + \tkzInterLL(#2,tkz@pta)(#3,tkz@ptb) + \pgfnodealias{tkz@tg3}{tkzPointResult} + \tkzInterLL(#3,tkz@ptb)(#4,tkz@ptc) + \pgfnodealias{tkz@tg1}{tkzPointResult} + \tkzInterLL(#4,tkz@ptc)(#2,tkz@pta) + \pgfnodealias{tkz@tg2}{tkzPointResult} + \foreach \name [count=\i] in {#5} {% + \coordinate (\tkz@pttr@name\name) at (tkz@tg\i); + } +\endgroup +} +%<--------------------------------------------------------------------------– +% tkzDefSymmedianLine +%<--------------------------------------------------------------------------– +\def\@DefSymmedialTriangle(#1,#2,#3)(#4,#5){% + \def\tkz@tmp{#5}% + \tkz@recuplast(#3) + \tkzDefSymmedianLine(#2,#1,\tkz@last) + \tkzInterLL(#2,\tkz@last)(#1,tkzPointResult) + \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} + \ifx\tkz@tmp\tkz@stop\else\@DefSymmedialTriangle(#2,#3)(#5)\fi +} + +\def\tkzDefSymmedialTriangle{\pgfutil@ifnextchar[{% + \tkz@DefSymmedialTriangle}{% + \tkz@DefSymmedialTriangle[]}} + +\def\tkz@DefSymmedialTriangle[#1](#2)#3{% +\begingroup + \SetUpPTTR{#1} + \pgfinterruptboundingbox + \@DefSymmedialTriangle(#2,#2)(#3,\tkz@stop) + \endpgfinterruptboundingbox +\endgroup +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg index 4d7415232e..a67e46e31a 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg @@ -1,5 +1,5 @@ % tkz-euclide.cfg -% Copyright 2022 Alain Matthes +% 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. @@ -16,9 +16,9 @@ % and save the file in a directory part of your TEXINPUTS environment % variable. -\def\fileversion{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-euclide.cfg} +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-euclide.cfg} %<------ colors ---------------------------------------–> \def\tkz@backgroundcolor{white} \def\tkz@textcolor{black} @@ -134,7 +134,7 @@ arc style/.style={% \def\tkz@mk@fill{\tkz@otherlinecolor} %<--------------------------------------------------------------------------–> %<------------------------------ styles ---------------------------------–> -\def\tkzSetUpStyle[#1]#2{\tikzset{#2/.style={#1}}}% add 2022 +\def\tkzSetUpStyle[#1]#2{\tikzset{#2/.style={#1}}}% add 2023 \tikzset{xlabel style/.style = {below = 3 pt, inner sep = 1pt, diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty index d0eb08def5..3b2c9f4365 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty @@ -1,5 +1,5 @@ % tkz-euclide.sty -% Copyright 2022 Alain Matthes +% 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. @@ -10,11 +10,16 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. %------------------------------------------------------------------------------- -\def\fileversion{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-euclide.sty} +\def\fileversion{5.00c} +\def\filedate{2023/11/03} +\typeout{2023/11/03 5.00c tkz-euclide.sty} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tkz-euclide}[ 2022/09/23 4.25c for pure Euclidean Geometry ] +\ProvidesPackage{tkz-euclide}[ 2023/11/03 5.00c for pure Euclidean Geometry ] +\newif\if@tkzlua +\@tkzluafalse +\DeclareOption{lua}{\@tkzluatrue} +\ProcessOptions\relax + \@ifpackageloaded{tkz-base}{ \newdimen\tkzRadius \newdimen\tkzLength @@ -148,45 +153,66 @@ \def\tkz@tmp@ya{-5} \def\tkz@tmp@yb{+5} %------------------------------------------------------------------------------- -\DeclareOption*{} -\ProcessOptions +% \DeclareOption*{} +% \ProcessOptions %<----------------------------------------------------------> % Initialisation %<----------------------------------------------------------> +\if@tkzlua +\RequirePackage{luacode} +\fi + + \@ifpackageloaded{tkz-base}{}{% -% from base +% from base +\input{tkz-lib-eu-marks.tex} +\input{tkz-lib-eu-shape.tex} \input{tkz-tools-eu-base.tex} \input{tkz-tools-eu-utilities.tex} \input{tkz-tools-eu-BB.tex} -\input{tkz-obj-eu-grids.tex} -\input{tkz-lib-eu-marks.tex} +\input{tkz-tools-eu-colors.tex} \input{tkz-tools-eu-text.tex} -\input{tkz-lib-eu-shape.tex} +\input{tkz-obj-eu-grids.tex} \input{tkz-obj-eu-axesmin.tex} -\input{tkz-tools-eu-colors.tex} \input{tkz-obj-eu-points.tex} -\input{tkz-obj-eu-draw-points.tex} +\input{tkz-draw-eu-points.tex} } -% next from euclide -\input{tkz-tools-eu-angles} -\input{tkz-tools-eu-intersections} +% % next from euclide +\makeatletter +\if@tkzlua +\input{tkz-tools-lua-base.tex} +\input{tkz-obj-lua-points.tex} +\input{tkz-tools-lua-math.tex} +\input{tkz-tools-lua-intersections.tex} +\input{tkz-obj-lua-points-by.tex} +\input{tkz-obj-lua-points-with.tex} +\input{tkz-obj-lua-points-spc.tex} +\input{tkz-tools-lua-angles.tex} +\else +\input{tkz-obj-eu-points.tex} +\input{tkz-obj-eu-points-by.tex} \input{tkz-tools-eu-math.tex} -\input{tkz-obj-eu-compass.tex} +\input{tkz-tools-eu-intersections.tex} +\input{tkz-obj-eu-points-with.tex} +\input{tkz-obj-eu-points-spc.tex} +\input{tkz-tools-eu-angles.tex} + \fi + +\input{tkz-obj-eu-points-rnd.tex} \input{tkz-obj-eu-circles.tex} \input{tkz-obj-eu-circles-by.tex} -\input{tkz-obj-eu-draw-angles.tex} -\input{tkz-obj-eu-draw-circles.tex} -\input{tkz-obj-eu-draw-lines.tex} -\input{tkz-obj-eu-draw-polygons.tex} \input{tkz-obj-eu-lines.tex} -\input{tkz-obj-eu-points-by.tex} -\input{tkz-obj-eu-points-rnd.tex} -\input{tkz-obj-eu-points-spc.tex} -\input{tkz-obj-eu-points-with.tex} \input{tkz-obj-eu-polygons.tex} -\input{tkz-obj-eu-protractor.tex} -\input{tkz-obj-eu-sectors.tex} -\input{tkz-obj-eu-show.tex} \input{tkz-obj-eu-triangles} +% drawings +\input{tkz-draw-eu-lines.tex} +\input{tkz-draw-eu-circles.tex} +\input{tkz-draw-eu-polygons.tex} +\input{tkz-draw-eu-angles.tex} +\input{tkz-draw-eu-sectors.tex} +\input{tkz-draw-eu-compass.tex} +\input{tkz-draw-eu-show.tex} +\input{tkz-draw-eu-protractor.tex} + \endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-lib-eu-marks.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-lib-eu-marks.tex deleted file mode 100644 index 999b28734e..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-lib-eu-marks.tex +++ /dev/null @@ -1,122 +0,0 @@ -% tkz-eu-lib-marks.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-lib-eu-marks.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% 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 -} -\pgfdeclareplotmark{s|||} -{% - \pgfpathmoveto{\pgfqpoint{-0.75\pgfplotmarksize}{-\pgfplotmarksize}} - \pgfpathlineto{\pgfqpoint{0.25\pgfplotmarksize}{\pgfplotmarksize}} - \pgfpathmoveto{\pgfqpoint{0\pgfplotmarksize}{-\pgfplotmarksize}} - \pgfpathlineto{\pgfqpoint{1\pgfplotmarksize}{\pgfplotmarksize}} - \pgfpathmoveto{\pgfqpoint{0.75\pgfplotmarksize}{-\pgfplotmarksize}} - \pgfpathlineto{\pgfqpoint{1.75\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 -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-lib-eu-shape.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-lib-eu-shape.tex deleted file mode 100644 index 12965c9e51..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-lib-eu-shape.tex +++ /dev/null @@ -1,51 +0,0 @@ - % tkz-lib-eu-shape.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-lib-eu-shape.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% Création des symboles -%<--------------------------------------------------------------------------–> -% define a new shape for the points -\pgfdeclareshape{cross} -{% - \inheritsavedanchors[from=rectangle] % this is nearly a rectangle - \inheritanchorborder[from=rectangle] - \inheritanchor[from=rectangle]{north} - \inheritanchor[from=rectangle]{north west} - \inheritanchor[from=rectangle]{north east} - \inheritanchor[from=rectangle]{center} - \inheritanchor[from=rectangle]{west} - \inheritanchor[from=rectangle]{east} - \inheritanchor[from=rectangle]{mid} - \inheritanchor[from=rectangle]{mid west} - \inheritanchor[from=rectangle]{mid east} - \inheritanchor[from=rectangle]{base} - \inheritanchor[from=rectangle]{base west} - \inheritanchor[from=rectangle]{base east} - \inheritanchor[from=rectangle]{south} - \inheritanchor[from=rectangle]{south west} - \inheritanchor[from=rectangle]{south east} - \foregroundpath{ -% store lower right in xa/ya and upper right in xb/yb - \southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y - \northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y - \pgfpathmoveto{\pgfqpoint{0 pt}{\pgf@ya}} - \pgfpathlineto{\pgfqpoint{0 pt}{\pgf@yb}} - \pgfpathmoveto{\pgfqpoint{\pgf@xa}{0 pt}} - \pgfpathlineto{\pgfqpoint{\pgf@xb}{0 pt}} - } -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-axesmin.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-axesmin.tex deleted file mode 100644 index ab81c6d3ec..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-axesmin.tex +++ /dev/null @@ -1,171 +0,0 @@ -% tkz-obj-eu-axesmin.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-axesmin} - -\makeatletter -\def\removedot#1.{#1} -\newcommand\tkzgetinteger[1]{\expandafter\tkz@getinteger#1.\@nil} -\def\tkz@getinteger#1.#2\@nil{% - \ifx\empty#2\empty - \tkz@integertrue - \else - \ifnum\removedot#2=0 - \tkz@integertrue - \else - \tkz@integerfalse - \fi - \fi -} - -%<--------------------------------------------------------------------------–> -% Setup axe -%<--------------------------------------------------------------------------–> -\pgfkeys{tkzaxis/.cd, - line width/.code = \xdef\tkz@sua@lw{#1}, - color/.code = \xdef\tkz@sua@color{#1}, - tickwd/.code = \xdef\tkz@sua@tickwd{#1}, - ticka/.code = \xdef\tkz@sua@ticka{#1}, - tickb/.code = \xdef\tkz@sua@tickb{#1}, - line width = \tkz@init@lw, - color = \tkz@init@color, - tickwd = \tkz@init@tickwd, - ticka = \tkz@init@ticka, - tickb = \tkz@init@tickb -} - -\def\tkzSetUpAxis{\pgfutil@ifnextchar[{\tkz@SetUpAxis}{\tkz@SetUpAxis[]}} -\def\tkz@SetUpAxis[#1]{% -\begingroup -\pgfqkeys{/tkzaxis}{#1} -\global\let\tkz@init@lw\tkz@sua@lw -\global\let\tkz@init@gradsize\tkz@sua@gradsize -\global\let\tkz@init@color\tkz@sua@color -\global\let\tkz@init@tickwd\tkz@sua@tickwd -\global\let\tkz@init@ticka\tkz@sua@ticka -\global\let\tkz@init@tickb\tkz@sua@tickb -\endgroup -} -%<--------------------------------------------------------------------------–> -% tkzDrawX todo améliorer les unités -% sans doute à revoir loop from 0 to i then calcul dans la boucle de la position -% et de l'affichage -%<--------------------------------------------------------------------------–> -\pgfkeys{% - /tkzdrawX/.cd, - color/.store in = \tkz@X@color, - label/.store in = \tkz@X@label, - right space/.store in = \tkz@axe@rxspace, - left space/.store in = \tkz@axe@lxspace, - step/.code = {\edef\tkz@posnext{\fpeval{#1}}}, - color = \tkz@init@color, - label = \tkz@init@xlabel, - step = \tkz@init@xstep, - right space = \tkz@init@rightspace, %??? - left space = \tkz@init@leftspace, - noticks/.is if = tkz@X@noticks, - noticks/.default = true, - noticks = true, - tickwd/.store in = \tkz@X@tickwd, - tickup/.store in = \tkz@X@tickup, - tickdn/.store in = \tkz@X@tickdn, - tickwd = \tkz@init@tickwd, - tickup = \tkz@init@ticka, - tickdn = \tkz@init@tickb, - /tkzdrawX/.search also={/tikz}, - } - -\def\tkzDrawX{\pgfutil@ifnextchar[{\tkz@DrawX}{\tkz@DrawX[]}} -\def\tkz@DrawX[#1]{ -\begingroup% -\pgfqkeys{/tkzdrawX}{#1} -\edef\tkz@posmax{\fpeval{trunc(\tkz@xb,\tkz@init@xdec)}} -\edef\tkz@posmin{\fpeval{trunc(\tkz@xa,\tkz@init@xdec)}} -\edef\tkz@xbsup{\fpeval{\tkz@xb+\tkz@axe@rxspace}} -\edef\tkz@xainf{\fpeval{\tkz@xa-\tkz@axe@lxspace}} -\path (\tkz@xainf,0)--(\tkz@xbsup,0) node(tkz@xline){}; -\draw[xaxe style, - color = \tkz@X@color, - /tkzdrawX/.cd, #1] (\tkz@xainf,0)--(\tkz@xbsup,0) - node[ xlabel style, - /tkzdrawX/.cd, - #1]{\tkz@X@label}; - \iftkz@X@noticks - \else - \edef\tkz@posmax{\fpeval{trunc(\tkz@posmax,\tkz@init@xdec)}} - \edef\tkz@posnext{\fpeval{\tkz@posnext/\tkz@init@xstep+\tkz@posmin}} - \foreach \pos in {\tkz@posmin,...,\tkz@posmax}{% - \edef\tkz@pos{\fpeval{\pos*1}}% ??? - \draw[ color = \tkz@X@color, - line width = \tkz@X@tickwd, - shift = {(\tkz@pos,0)}]% - (0pt,\tkz@X@tickup)--(0pt,-\tkz@X@tickdn); - } - \fi -\endgroup -} -%<--------------------------------------------------------------------------–> -% tkzDrawY todo améliorer les unités -%<--------------------------------------------------------------------------–> -\pgfkeys{% - /tkzdrawY/.cd, - color/.store in = \tkz@Y@color, - label/.store in = \tkz@Y@label, - up space/.store in = \tkz@axe@uyspace, - down space/.store in = \tkz@axe@dyspace, - step/.code = {\edef\tkz@posnext{\fpeval{#1}}}, - color = \tkz@init@color, - label = \tkz@init@ylabel, - step = \tkz@init@ystep, - up space = \tkz@init@upspace, - down space = \tkz@init@downspace, - noticks/.is if = tkz@Y@noticks, - noticks/.default = true, - noticks = true, - tickwd/.store in = \tkz@Y@tickwd, - ticklt/.store in = \tkz@Y@ticklt, - tickrt/.store in = \tkz@Y@tickrt, - tickwd = \tkz@init@tickwd, - ticklt = \tkz@init@tickb, - tickrt = \tkz@init@ticka, - /tkzdrawY/.search also={/tikz}, - } - -\def\tkzDrawY{\pgfutil@ifnextchar[{\tkz@DrawY}{\tkz@DrawY[]}} -\def\tkz@DrawY[#1]{% -\begingroup -\pgfkeys{/tkzdrawY/.cd,step = \tkz@init@ystep} -\pgfqkeys{/tkzdrawY}{#1} -\edef\tkz@posmax{\fpeval{trunc(\tkz@yb,\tkz@init@ydec)}} -\edef\tkz@posmin{\fpeval{trunc(\tkz@ya,\tkz@init@ydec)}} -\edef\tkz@ybsup{\fpeval{\tkz@yb+\tkz@axe@uyspace}} -\edef\tkz@yainf{\fpeval{\tkz@ya-\tkz@axe@dyspace}} -\path (0,\tkz@yainf)--(0,\tkz@ybsup) node(tkz@yline){}; -\draw[color = \tkz@Y@color, - yaxe style,/tkzdrawY/.cd,#1] (0,\tkz@yainf)--(0,\tkz@ybsup) - node[ylabel style,/tkzdrawY/.cd,#1]{\tkz@Y@label}; - \iftkz@Y@noticks - \else - \edef\tkz@posmax{\fpeval{trunc(\tkz@posmax,\tkz@init@ydec)}} - \edef\tkz@posnext{\fpeval{\tkz@posnext/\tkz@init@ystep+\tkz@posmin}} - \foreach \tkz@pos in {\tkz@posmin,\tkz@posnext,...,\tkz@posmax}{% - \draw[color = \tkz@Y@color, - line width = \tkz@Y@tickwd, - shift = {(0,\tkz@pos)}]% - (\tkz@Y@tickrt,0pt)--(-\tkz@Y@ticklt,0pt);} - - \fi -\endgroup} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-circles-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-circles-by.tex deleted file mode 100644 index 03f81e35f8..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-circles-by.tex +++ /dev/null @@ -1,158 +0,0 @@ -% tkz-obj-eu-circles.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-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@numcby{0} -\pgfkeys{/tkzDefCircleBy/.cd, - translation/.code args = {from #1 to #2} { \def\tkz@numcby{0} - \def\tkzfrom{#1} - \def\tkzto{#2}}, - homothety/.code args = {center #1 ratio #2}{ \def\tkz@numcby{1} - \def\tkzcenter{#1} - \def\tkzratio{#2}}, - reflection/.code args = {over #1--#2}{ \def\tkz@numcby{2} - \def\tkzdeb{#1} - \def\tkzfin{#2}}, - symmetry/.code args = {center #1}{ \def\tkz@numcby{3} - \def\tkzcenter{#1}}, - rotation/.code args = {center #1 angle #2}{ \def\tkz@numcby{4} - \def\tkzcenter{#1} - \def\tkzangle{#2}}, - inversion/.code args={center #1 through #2}{ \def\tkz@numcby{5} - \def\tkzcenter{#1} - \def\tkzpoint{#2}}, - inversion negative/.code args = {center #1 through #2}{\def\tkz@numcby{6} - \def\tkzcenter{#1} - \def\tkzpoint{#2}} - } -\def\tkzDefCircleBy{\pgfutil@ifnextchar[{\tkz@DefCircleBy}{\tkz@DefCircleBy[]}} -\def\tkz@DefCircleBy[#1](#2){% -\begingroup -\pgfqkeys{/tkzDefCircleBy}{#1} -\ifcase\tkz@numcby% - \tkzDefCircleTranslation(#2)% - \or% 1 - \tkzDefCircleHomothety(#2) - \or% 2 - \tkzDefCircleReflection(#2) - \or% 3 - \tkzDefCircleSymmetry(#2) - \or% 4 - \tkzDefCircleRotation(#2) - \or% 5 - \tkzDefInversionCircle(#2,\tkzcenter,\tkzpoint) - \or% 6 - \tkzDefInversionNegativeCircle(#2,\tkzcenter,\tkzpoint) -\fi -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkzDefCircleTranslation(#1,#2){% -\begingroup - \tkzUTranslation(\tkzfrom,\tkzto)(#1) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzUTranslation(\tkzfrom,\tkzto)(#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkzDefCircleHomothety(#1,#2){% -\begingroup - \tkzUHomo(\tkzcenter,\tkzratio)(#1) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzUHomo(\tkzcenter,\tkzratio)(#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkzDefCircleReflection(#1,#2){% -\begingroup - \tkzUSymOrth(\tkzdeb,\tkzfin)(#1) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzUSymOrth(\tkzdeb,\tkzfin)(#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkzDefCircleSymmetry(#1,#2){% -\begingroup - \tkzUCSym(\tkzcenter)(#1) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzUCSym(\tkzcenter)(#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkzDefCircleRotation(#1,#2){% -\begingroup - \tkzURotateAngle(\tkzcenter,\tkzangle)(#1) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzURotateAngle(\tkzcenter,\tkzangle)(#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} -\endgroup -} -%<--------------------------------------------------------------------------–> -% #3,#4 cercle d'inversion centre #3. through #4 -% Si le cercle passe par le pôle l'image est une droite -\def\tkzDefInversionCircle(#1,#2,#3,#4){% -\begingroup - \tkz@@CalcLengthcm(#1,#2){tkz@lna}% - \tkz@@CalcLengthcm(#1,#3){tkz@lnb}% - \gdef\tkzMathResult{\fpeval{round(abs(\tkz@lnb - \tkz@lna),6)}} - \ifdim\tkzMathResult pt < 1 pt\relax% - \tkzURotateAngle(#1,-90)(#2) - \pgfnodealias{tkz@a}{tkzPointResult} - - \tkzUInversePoint(#3,#4)(tkz@a) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzUInversePoint(#3,#4)(#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} - \else - \tkzURotateAngle(#1,90)(#2) - \pgfnodealias{tkz@a}{tkzPointResult} - \tkzURotateAngle(#1,-90)(#2) - \pgfnodealias{tkz@b}{tkzPointResult} - \tkzUInversePoint(#3,#4)(tkz@a) - \pgfnodealias{tkz@p1}{tkzPointResult} - \tkzUInversePoint(#3,#4)(tkz@b) - \pgfnodealias{tkz@p2}{tkzPointResult} - \tkzUInversePoint(#3,#4)(#2) - \pgfnodealias{tkz@p3}{tkzPointResult} - \tkzDefCircle[circum](tkz@p3,tkz@p1,tkz@p2) - \fi -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkzDefInversionNegativeCircle(#1,#2,#3,#4){% -\begingroup - \tkzDefInversionCircle(#1,#2,#3,#4) - \tkzUCSym(\tkzcenter)(tkzFirstPointResult) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzUCSym(\tkzcenter)(tkzSecondPointResult) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} -\endgroup -} -%<--------------------------------------------------------------------------–> -% End Def Circle -%<--------------------------------------------------------------------------–> -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-circles.tex deleted file mode 100644 index 487ef547cd..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-circles.tex +++ /dev/null @@ -1,233 +0,0 @@ -% tkz-obj-eu-circles.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-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 -} -%<--------------------------------------------------------------------------–> -% Through Circle center and point -%<--------------------------------------------------------------------------–> -\def\tkzDefCircleThrough(#1,#2){% -\begingroup - \tkz@@CalcLengthcm(#1,#2){tkzLengthResult} - \node [draw,circle through=(#2)] at (#1) {}; - \tkzRenamePoint(#1){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 - \tkzDefBarycentricPoint(#1=1,#2=\tkz@koeff) - \pgfnodealias{apo@pta}{tkzPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} - \tkzDefBarycentricPoint(#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/tkz-obj-eu-compass.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-compass.tex deleted file mode 100644 index 9798e98f4f..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-compass.tex +++ /dev/null @@ -1,100 +0,0 @@ -% tkz-obj-eu-compass.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-compass.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% Author Alain Matthes -% idea from Y. Combe -%<--------------------------------------------------------------------------–> -%<--------------------------------------------------------------------------–> -% Utilisation du Compas : Compass -%<--------------------------------------------------------------------------–> -% Setup Compass -%<--------------------------------------------------------------------------–> -\pgfkeys{tkzsucompass/.cd, - line width/.store in = \tkz@compass@lw, - color/.store in = \tkz@compass@color, - style/.store in = \tkz@compass@style, - line width = \tkz@euc@compasswidth, - color = \tkz@euc@compasscolor, - style = \tkz@euc@compassstyle, - /tkzsucompass/.search also = {/tikz,/tkzcompass} - } -%<--------------------------------------------------------------------------–> -\def\tkzSetUpCompass{\pgfutil@ifnextchar[{\tkz@SetUpCompass}{\tkz@SetUpCompass[]}} -%<--------------------------------------------------------------------------–> -\def\tkz@SetUpCompass[#1]{% -\pgfqkeys{/tkzsucompass}{#1} -\tikzset{compass style/.style={% - color = \tkz@compass@color, - line width = \tkz@compass@lw, - style = \tkz@compass@style - }} -} -%<--------------------------------------------------------------------------–> -% \tkzCompass(A, B) -% -% Marque de compas auto-ajustée en longueur -% #2 center #3 le point -% Par défaut: -% longueur : 1cm, mais avec un maximum d'un angle de 180° -% angle calculé pour la longueur -% style traits pleins - -%<--------------------------------------------------------------------------–> - \pgfkeys{/tkzcompass/.cd, - delta/.store in = \tkz@delta, - length/.store in = \tkz@length, - length = 1, - delta = 0, - /tkzcompass/.unknown/.code = {\let\searchname=\pgfkeyscurrentname - \pgfkeysalso{\searchname/.try=#1, /tikz/\searchname/.retry=#1}} -} - -\def\tkzCompass{\pgfutil@ifnextchar[{\tkz@Compass}{\tkz@Compass[]}} -\def\tkz@Compass[#1](#2,#3){% -\begingroup -\pgfkeys{tkzcompass/.cd,#1} -\tkz@@CalcLength(#2,#3){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 style,/tkzcompass/.cd,#1]% - (\tkz@angle-\tkz@delta:\tkz@tempLen pt)% - arc (\tkz@angle-\tkz@delta:\tkz@angle+\tkz@delta:\tkz@tempLen pt); -\endgroup} -%<--------------------------------------------------------------------------–> -\def\tkz@multiCompass#1 #2\@nil{% - \protected@edef\tkz@temp{ - \noexpand \tkzCompass[\tkz@optcompass](#1)}\tkz@temp% - \def\tkz@nextArg{#2}% - \ifx\tkzutil@empty\tkz@nextArg - \let\next\@gobble - \fi - \next#2\@nil -} -\def\tkzCompasss{\pgfutil@ifnextchar[{\tkz@Compasss}{\tkz@Compasss[]}} - -\def\tkz@Compasss[#1](#2){% -\global\edef\tkz@optcompass{#1} -\begingroup - \let\next\tkz@multiCompass - \next#2 \@nil % -\endgroup -}% - -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-angles.tex deleted file mode 100644 index 5b8f9747ba..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-angles.tex +++ /dev/null @@ -1,534 +0,0 @@ -% tkz-tool-eu-angles.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tool-eu-angles.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% tkzSetUpArc -%<--------------------------------------------------------------------------–> -\pgfkeys{/tkzsetuparc/.cd, - color/.store in = \tkz@arc@color, - line width/.store in = \tkz@arc@lw, - style/.store in = \tkz@arc@style, - line width = \tkz@euc@linewidth, - color = \tkz@euc@linecolor, - style = \tkz@euc@linestyle, - /tkzsetuparc/.search also = {/tikz,/tkzcompass}, - } -\def\tkzSetUpArc{\pgfutil@ifnextchar[{\tkz@SetUpArc}{\tkz@SetUpArc[]}} -\def\tkz@SetUpArc[#1]{% -\pgfqkeys{/tkzsetuparc}{#1} -\tikzset{arc style/.style={color = \tkz@arc@color, - line width = \tkz@arc@lw, - style = \tkz@arc@style - }} -}% end setup -%<------------------------------ Arcs -------------------------------------– -% options : delta -% \def\tkz@delta{0} -% \tikzset{arc style/.style={#1}} -% \pgfkeys{/tikz/.cd,delta/.code={\def\tkz@delta{#1}}} -\newif\iftkz@reverse -\gdef\tkz@numa{0} -\pgfkeys{/tkzdrawarc/.cd, - type/.is choice, - type/towards/.code = \def\tkz@numa{0}, - type/rotate/.code = \def\tkz@numa{1}, - type/angles/.code = \def\tkz@numa{2}, - type/R/.code = \def\tkz@numa{3}, - type/R with nodes/.code = \def\tkz@numa{4}, - towards/.style = {type=towards}, - rotate/.style = {type=rotate}, - R/.style = {type=R}, - angles/.style = {type=angles}, - R with nodes/.style = {type=R with nodes}, - diameter/.code = {}, - arc/.code = {}, - size/.code = {}, - mark/.code = {}, - mkpos/.code = {}, - mksize/.code = {}, - mkcolor/.code = {}, - type/.default = towards, - delta/.store in = \tkz@delta, - delta = 0, - reverse/.is if = tkz@reverse, - reverse/.default = true, - reverse = false, - /tkzdrawarc/.search also = {/tikz} -} -\def\tkzDrawArc{\pgfutil@ifnextchar[{\tkz@DrawArc}{\tkz@DrawArc[]}} -\def\tkz@DrawArc[#1](#2,#3)(#4){% -\begingroup -\pgfqkeys{/tkzdrawarc}{#1} -\ifcase\tkz@numa% - \tkzDrawArcTowards[#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 -} -%<--------------------------------------------------------------------------–> -% ARC nodes #2 center #3 first point last point #4 -% delta un peu plus à chaque extrémité -% example : \tkzDrawArc(A,B)(C) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcTowards{\pgfutil@ifnextchar[{\tkz@DrawArcN}{\tkz@DrawArcN[]}} -\def\tkz@DrawArcN[#1](#2,#3)(#4){% -\begingroup - \tkz@@CalcLength(#2,#3){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 #4 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 - \tkz@@CalcLength(#2,#3){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 - \tkz@@CalcLength(#2,#3){tkzLengthResult} - \tkz@DrawArcRAngles[#1](#2,\tkzLengthResult pt)(#4,#5) -\endgroup -} -%<--------------------------------------------------------------------------–> -% Degree #2 center #4 - #3 radius from #5 (degree) to #6(degree) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcRwithNodes{\pgfutil@ifnextchar[{\tkz@DrawArcRwithNodes}{% - \tkz@DrawArcRwithNodes[]}} -\def\tkz@DrawArcRwithNodes[#1](#2,#3,#4)(#5,#6){% -\begingroup - \tkz@@CalcLength(#3,#4){tkzLengthResult} - \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)(A,B) -%<--------------------------------------------------------------------------–> -\def\tkzDrawArcR{\pgfutil@ifnextchar[{\tkz@DrawArcR}{\tkz@DrawArcR[]}} -\def\tkz@DrawArcR[#1](#2,#3)(#4,#5){% -\begingroup - \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@FirstAngle} - \tkzFindSlopeAngle(#2,#5)\tkzGetAngle{tkz@SecondAngle} - \tkz@DrawArcRAngles[#1](#2,#3)(\tkz@FirstAngle,\tkz@SecondAngle) -\endgroup -} -%<--------------------------------------------------------------------------–> -%<--------------------------------------------------------------------------–> -% #1 center #2 radius #4 first angle (degree) #5 second angle (degree) -% angles 0 .. 180 or -180 .. 0 -%<--------------------------------------------------------------------------–> -% example : \tkzDrawArc(A,2)(30,90) -\def\tkzDrawArcRAngles{\pgfutil@ifnextchar[{\tkz@DrawArcRAngles}{% - \tkz@DrawArcRAngles[]}} -\def\tkz@DrawArcRAngles[#1](#2,#3)(#4,#5){% - \begingroup - \tkzNormalizeAngle(#4,#5) - \pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} - \edef\tkz@FirstAngle{\pgfmathresult}% - \pgfmathadd{\tkz@SecondAngle}{\tkz@delta} - \edef\tkz@SecondAngle{\pgfmathresult} - \iftkz@reverse - \let\tkztemp\tkz@FirstAngle - \let\tkz@FirstAngle\tkz@SecondAngle - \let\tkz@SecondAngle\tkztemp - \fi - \draw[shift = {(#2)},arc style,/tkzdrawarc/.cd,#1]% - (\tkz@FirstAngle:#3) arc (\tkz@FirstAngle:\tkz@SecondAngle:#3); -\endgroup -} -%<--------------------------------------------------------------------------–> -\pgfkeys{ - /@tkzmarkarc/.cd, - pos/.store in = \tkz@mkarcpos, - color/.store in = \tkz@mkcolor, - mark/.store in = \tkz@markarcseg, - size/.store in = \tkz@mkarcsize, - color = teal!20, - size = 4pt, - pos = .5, - mark = none, - /@tkzmarkarc/.search also={/tikz}, -} -\def\tkzMarkArc{\pgfutil@ifnextchar[{\tkz@MarkArc}{\tkz@MarkArc[]}} -\def\tkz@MarkArc[#1](#2,#3,#4){% -\begingroup - \pgfqkeys{/@tkzmarkarc}{#1} \def\tkz@mymarkarc{\pgfsetplotmarksize{\tkz@mkarcsize}\pgfuseplotmark{\tkz@markarcseg}} -\tkz@@CalcLength(#2,#3){tkz@radius} -\tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} -\tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} -\tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) - \pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} - \edef\tkz@FirstAngle{\pgfmathresult}% - \pgfmathadd{\tkz@SecondAngle}{\tkz@delta} - \edef\tkz@SecondAngle{\pgfmathresult} -\begin{scope}[decoration={markings,mark=at position \tkz@mkarcpos with {\tkz@mymarkarc}}] -\path[shift = {(#2)},\tkz@mkcolor,/@tkzmarkarc/.cd,#1,postaction={decorate}]% -(\tkz@FirstAngle:\tkz@radius pt) arc (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@radius pt); -\end{scope} -\endgroup -} - -\def\tkzLabelArc{\pgfutil@ifnextchar[{\tkz@LabelArc}{\tkz@LabelArc[]}} -\def\tkz@LabelArc[#1](#2,#3,#4)#5{% -\begingroup -\pgfqkeys{/@tkzmarkarc}{#1} -\tkz@@CalcLength(#2,#3){tkz@radius} -\tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} -\tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} -\tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) -\pgfmathsubtract{\tkz@FirstAngle}{\tkz@delta} -\edef\tkz@FirstAngle{\pgfmathresult}% -\pgfmathadd{\tkz@SecondAngle}{\tkz@delta} -\edef\tkz@SecondAngle{\pgfmathresult} -\begin{scope}[decoration={markings,mark=at position \tkz@mkarcpos with \node{#5};}] - \path[shift = {(#2)},/@tkzmarkarc/.cd,#1,postaction={decorate}]% - (\tkz@FirstAngle:\tkz@radius pt) arc (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@radius pt); \end{scope} -\endgroup -} -%<---------------------------------------------------------------------------> -% tkzDrawArcRAN > -%<---------------------------------------------------------------------------> -\def\tkzDrawArcRAN[#1](#2,#3)(#4,#5){% -\begingroup - \draw[shift = {(#2)},/tkzdrawarc/.cd,#1] (#4:#3) arc (#4:#5:#3); -\endgroup -} -%<--------------- tkzPathArcRAN ---------------------------------- -\def\tkzPathArcRAN[#1](#2,#3)(#4,#5){% -\begingroup - \path[shift = {(#2)},/tkzdrawarc/.cd,#1] (#4:#3) arc (#4:#5:#3); -\endgroup -} -%<---------------------------------------------------------------------------> -% Mark an angle modi 3.03 suppression de \tkz@mksize, -%<---------------------------------------------------------------------------> -% \tkzMarkAngle(B, A, C) -% -% Marque d'angle -% arc de cercle (simple/double/triple) et marque d'églité. -% -% Par défaut: -% arc = simple -% size = 1 (rayon de l'arc) -% style traits pleins -% mkpos ? position: 0.5 (position de la marque) -% mark rien du tout (ignoré si type est utilisé) -% -% Paramètres (optionnels) -% arc : l, ll, lll -% mksize : 1 -% gap : 3pt -% dist ? -% style : type de traits -% position: 0.5 -% mark : none , |, ||,|||, z, s, x, o, oo mais tous les -% % symboles de tikz sont permis -%<------------------------- Label on angle --------------------------------> -\def\tkz@arcsimple{l} -\def\tkz@arcdouble{ll} -\def\tkz@arctriple{lll} - -%\tikzset{lbstyle/.style = {color=\tkz@mainlinecolor}} - -\pgfkeys{/tkzmkangle/.cd, - arc/.estore in = \tkz@arc, - size/.store in = \tkz@size, - mark/.store in = \tkz@markang, - mkpos/.estore in = \tkz@mkpos, - mksize/.store in = \tkz@mksize, - mkcolor/.store in = \tkz@mkcolor, - arc = l, - size = 1, - mark = none, - mksize = 4pt, - mkcolor = black, - mkpos = 0.5, - /tkzmkangle/.search also={/tikz} -} -\def\tkzMarkAngle{\pgfutil@ifnextchar[{\tkz@MarkAngle}{\tkz@MarkAngle[]}} -\def\tkz@MarkAngle[#1](#2,#3,#4){% -\begingroup -\pgfqkeys{/tkzmkangle}{#1} -\tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} -\tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} -\tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) - -\def\tkz@mymark{\pgfsetplotmarksize{\tkz@mksize}\pgfuseplotmark{\tkz@markang}} -% draw the arcs -\begin{scope}[decoration= {markings, - mark=at position \tkz@mkpos with {\tkz@mymark}}] - \ifx\tkz@arc\tkz@arcsimple - \tkzDrawArcRAN[#1,fill=none]% - (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% - \tkzPathArcRAN[\tkz@mkcolor,postaction={decorate}]% - (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle) - \else - \ifx\tkz@arc\tkz@arcdouble - \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm-2.5\pgflinewidth)% - (\tkz@FirstAngle,\tkz@SecondAngle) - \tkzPathArcRAN[\tkz@mkcolor,postaction={decorate}]% - (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% - \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm+2.5\pgflinewidth)% - (\tkz@FirstAngle,\tkz@SecondAngle)% - \else - \ifx\tkz@arc\tkz@arctriple - \tkzDrawArcRAN[#1,fill=none]% - (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% - \tkzPathArcRAN[\tkz@mkcolor,postaction={decorate}]% - (#3,\tkz@size)(\tkz@FirstAngle,\tkz@SecondAngle)% - \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm-2.5\pgflinewidth)% - (\tkz@FirstAngle,\tkz@SecondAngle)% - \tkzDrawArcRAN[#1,fill=none](#3,\tkz@size cm+2.5\pgflinewidth)% - (\tkz@FirstAngle,\tkz@SecondAngle)% - \fi - \fi - \fi -\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){% -\xdef\tkz@optma{#1} - \begingroup - \let\next\tkz@multiMA - \next#2 \@nil % -\endgroup -} -% fin de \tkzMarkAngle -%<---------------------------------------------------------------------------> -% Pic Angle -%<---------------------------------------------------------------------------> -\def\tkzPicAngle{\pgfutil@ifnextchar[{\tkz@PicAngle}{\tkz@PicAngle[]}} -\def\tkz@PicAngle[#1](#2,#3,#4){% -\begingroup -\draw pic [#1]{angle=#2--#3--#4}; -\endgroup -} -\def\tkzPicRightAngle{\pgfutil@ifnextchar[{\tkz@PicRightAngle}{\tkz@PicRightAngle[]}} -\def\tkz@PicRightAngle[#1](#2,#3,#4){% -\begingroup -\draw pic [#1]{right angle=#2--#3--#4}; -\endgroup -} -%<---------------------------------------------------------------------------> -% FillAngle -%<---------------------------------------------------------------------------> -\pgfkeys{/tkzFill/.cd, - size/.store in = \tkz@size, - size = 1, - /tkzFill/.search also = {/tikz} - } - -\def\tkzFillAngle{\pgfutil@ifnextchar[{\tkz@FillAngle}{\tkz@FillAngle[]}} -\def\tkz@FillAngle[#1](#2,#3,#4){% -\begingroup -\pgfqkeys{/tkzFill}{#1} - \tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} - \tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} - \tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) - \path[shift = {(#3)},fill=\tkz@euc@linecolor!10,/tkzFill/.cd,#1]% - (#3) -- (\tkz@FirstAngle:\tkz@size) arc% - (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@size)--cycle; -\endgroup -} -%<---------------------------------------------------------------------------> -% multiple -\def\tkz@multiFA#1 #2\@nil{\protected@edef\tkz@temp{% - \noexpand \tkzFillAngle[\tkz@optfa](#1)}% - \tkz@temp% - \def\tkz@nextArg{#2}% - \ifx\tkzutil@empty\tkz@nextArg - \let\next\@gobble - \fi - \next#2\@nil -} -%<---------------------------------------------------------------------------> -\def\tkzFillAngles{\pgfutil@ifnextchar[{\tkz@MFillAngles}{\tkz@MFillAngles[]}} -\def\tkz@MFillAngles[#1](#2){% -\xdef\tkz@optfa{#1} -\begingroup - \let\next\tkz@multiFA - \next#2 \@nil % -\endgroup -} -%<------------------------- Label on angle --------------------------------> -\pgfkeys{/tkzlabelangle/.cd, - dist/.store in = \tkzlabeldist, - angle/.store in = \tkzlabelangle, - dist = 1, - angle = {}, - /tkzlabelangle/.search also={/tikz} -} -\def\tkzLabelAngle{\pgfutil@ifnextchar[{\tkz@LabelAngle}{\tkz@LabelAngle[]}} -\def\tkz@LabelAngle[#1](#2,#3,#4)#5{%2016 added normalize from karu's code -\begingroup - \pgfqkeys{/tkzlabelangle}{#1} - \ifx\tkzutil@empty\tkzlabelangle% no value so calc angle of bisector - \tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} - \tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} - \tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) - \edef\tkzlabelAngle{\fpeval{(\tkz@SecondAngle+\tkz@FirstAngle)/2}} - \fi - \path (#3) --+(\tkzlabelAngle:\tkzlabeldist) node[label angle style,% - /tkzlabelangle/.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{% - \def\tkz@optlba{#1} - \def\tkz@labelangle{#3} - \begingroup - \let\next\tkz@multiLBA - \next#2 \@nil % - \endgroup -} -%<----------------------------------------------------------------------- -% Symbole droites perpendiculaires -%<---------------------------------------------------------------------- -\pgfkeys{/tkzrightangle/.cd, - norm tkz code/.is if = normtkzcode@execute, - german/.code = \normtkzcode@executefalse, - size/.store in = \tkz@ra@size, - dotsize/.store in = \tkz@dotsize, - size = .25, - dotsize = 3 pt, - /tkzrightangle/.search also={/tikz}, -} -\newcommand*{\tkzMarkRightAngle}[1][]{\tkz@RightAngle[#1]} -\def\tkz@RightAngle[#1](#2,#3,#4){% -\begingroup -\normtkzcode@executetrue -\pgfqkeys{/tkzrightangle}{#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% - \ifnormtkzcode@execute% - \draw[/tkzrightangle/.cd,#1] - (#3) --++( 28.45274*\tkz@ra@size\tkz@ax , 28.45274*\tkz@ra@size\tkz@ay) - --++( 28.45274*\tkz@ra@size\tkz@bx , 28.45274*\tkz@ra@size\tkz@by) - --++(-28.45274*\tkz@ra@size\tkz@ax ,-28.45274*\tkz@ra@size\tkz@ay) - -- (#3); - \else% - % find angles - \tkzFindSlopeAngle(#3,#2)\tkzGetAngle{tkz@dirOne} - \tkzFindSlopeAngle(#3,#4)\tkzGetAngle{tkz@dirTwo} - \tkzNormalizeAngle(\tkz@dirOne,\tkz@dirTwo) - \edef\tkzCircleAngle{\fpeval{(\tkz@SecondAngle+\tkz@FirstAngle)/2}} - \tkzDrawArcRAN[/tkzrightangle/.cd,#1](#3,\tkz@ra@size)% - (\tkz@FirstAngle,\tkz@SecondAngle) - \path (#3) --+ (\tkzCircleAngle:\tkz@ra@size/2) - node[fill,circle,minimum size=\tkz@dotsize, - inner sep=0 pt,/tkzrightangle/.cd,#1] {}; -\fi% -\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){% -\xdef\tkz@optRA{#1} -\begingroup - \let\next\tkz@multiRA - \next#2 \@nil % -\endgroup -} -%<---------------------------------------------------------------------------> -% tkzdefMidArc center and two points -\def\tkzDefMidArc(#1,#2,#3){% -\begingroup -\tkz@@CalcLength(#1,#2){tkz@radius} -\tkzFindSlopeAngle(#1,#2)\tkzGetAngle{tkz@FirstAngle} -\tkzFindSlopeAngle(#1,#3)\tkzGetAngle{tkz@SecondAngle} -\tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) - \path[shift = {(#1)}](\tkz@FirstAngle:\tkz@radius pt) arc - (\tkz@FirstAngle:\tkz@SecondAngle:\tkz@radius pt) coordinate[midway] (tkzPointResult); -\endgroup -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-circles.tex deleted file mode 100644 index e168ae6004..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-circles.tex +++ /dev/null @@ -1,162 +0,0 @@ -% tkz-obj-eu-draw-circles.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-draw-circles.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% tkzSetUpCircle -%<--------------------------------------------------------------------------–> -\pgfkeys{% - /tkzsetupcirc/.cd, - color/.code = \def\tkz@circle@color{#1}, - line width/.code = \def\tkz@circle@linewidth{#1}, - style/.code = \def\tkz@circle@style{#1}, - /tkzsetupcirc/.search also = {/tikz} - } - %<--------------------------------------------------------------------------–> - -\def\tkzSetUpCircle{\pgfutil@ifnextchar[{\tkz@SetUpCircle}{\tkz@SetUpCircle[]}} -\def\tkz@SetUpCircle[#1]{% -\pgfkeys{% - tkzsetupcirc/.cd, - line width = \tkz@euc@circlelw, - color = \tkz@euc@circlecolor, - style = \tkz@euc@circlestyle -} -\pgfqkeys{/tkzsetupcirc}{#1} -\tikzset{% - circle style/.append style = { % - color = \tkz@circle@color, - line width = \tkz@circle@linewidth, - style = \tkz@circle@style, - #1} - } -}% end setup - %<--------------------------------------------------------------------------–> - -\def\tkzDrawCircle{\pgfutil@ifnextchar[{\tkz@DrawCircle}{\tkz@DrawCircle[]}} -\def\tkz@DrawCircle[#1](#2,#3){% -\begingroup -\node [draw,circle through=(#3), circle style,#1] at (#2) {}; -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkz@multicircles#1 #2\@nil{% -\protected@edef\tkz@temp{ -\noexpand \tkzDrawCircle[\tkz@optcircle](#1)}\tkz@temp% -\def\tkz@nextArg{#2}% -\ifx\tkzutil@empty\tkz@nextArg - \let\next\@gobble -\fi -\next#2\@nil -}% -%<--------------------------------------------------------------------------–> -\def\tkzDrawCircles{\pgfutil@ifnextchar[{\tkz@DrawCircles}{\tkz@DrawCircles[]}} -\def\tkz@DrawCircles[#1](#2){% -\xdef\tkz@optcircle{#1} -\begingroup - \let\next\tkz@multicircles - \next#2 \@nil % -\endgroup -}% -%<--------------------------------------------------------------------------–> -% #2 #3 rayon - -\def\tkzDrawSemiCircle{\pgfutil@ifnextchar[{\tkz@DrawSemiCircle}{% - \tkz@DrawSemiCircle[]}} -\def\tkz@DrawSemiCircle[#1](#2,#3){% -\begingroup - \pgfpointdiff{\pgfpointanchor{#2}{center}}% - {\pgfpointanchor{#3}{center}}% - \tkz@ax=\pgf@x% - \tkz@ay=\pgf@y% - \path(#2)--++(-\tkz@ax,-\tkz@ay)coordinate (tkz@pt); - \tkzDrawArc[#1,delta=0](#2,#3)(tkz@pt) -\endgroup -}% -%<--------------------------------------------------------------------------–> -\def\tkz@multisemicircles#1 #2\@nil{% -\protected@edef\tkz@temp{ -\noexpand \tkzDrawSemiCircle[\tkz@optsemicircle](#1)}\tkz@temp% -\def\tkz@nextArg{#2}% -\ifx\tkzutil@empty\tkz@nextArg - \let\next\@gobble -\fi -\next#2\@nil -}% -%<--------------------------------------------------------------------------–> -\def\tkzDrawSemiCircles{\pgfutil@ifnextchar[{\tkz@DrawSemiCircles}{% -\tkz@DrawSemiCircles[]}} -\def\tkz@DrawSemiCircles[#1](#2){% -\xdef\tkz@optsemicircle{#1} -\begingroup - \let\next\tkz@multisemicircles - \next#2 \@nil % -\endgroup -}% -%<---------------------------- Fill Circle --------------------------------–> -\def\tkzFillCircle{\pgfutil@ifnextchar[{\tkz@FillCircle}{\tkz@FillCircle[]}} -\def\tkz@FillCircle[#1](#2,#3){% -\begingroup - \node [fill,circle through=(#3),#1] at (#2) {}; -\endgroup -}% -\def\tkz@multifillcircles#1 #2\@nil{% -\protected@edef\tkz@temp{ -\noexpand \tkzFillCircle[\tkz@optfillcircle](#1)}\tkz@temp% -\def\tkz@nextArg{#2}% -\ifx\tkzutil@empty\tkz@nextArg - \let\next\@gobble -\fi -\next#2\@nil -}% -\def\tkzFillCircles{\pgfutil@ifnextchar[{\tkz@FillCircles}{% -\tkz@FillCircles[]}} -\def\tkz@FillCircles[#1](#2){% -\xdef\tkz@optfillcircle{#1} -\begingroup - \let\next\tkz@multifillcircles - \next#2 \@nil % -\endgroup -}% - -%<--------------------------- Clip Circle ---------------------------------–> -\pgfkeys{/tkzclipc/.cd, - out code/.is if = tkzClipOutCircle, - out/.code = \tkzClipOutCirclefalse -}% -%<--------------------------------------------------------------------------–> -\def\tkzClipCircle{\pgfutil@ifnextchar[{\tkz@ClipCircle}{\tkz@ClipCircle[]}} -\def\tkz@ClipCircle[#1](#2,#3){% -\tkzClipOutCircletrue -\pgfqkeys{/tkzclipc}{#1} - \tkz@@CalcLength(#2,#3){tkzLengthResult} - \iftkzClipOutCircle - \clip (#2) circle (\tkzLengthResult pt); - \else - \clip (#2) circle (\tkzLengthResult pt) [tkzreverseclip] ; - \fi -} -%<--------------------------- Label Circle --------------------------------–> -\def\tkzLabelCircle{\pgfutil@ifnextchar[{\tkz@LabelCircle}{% - \tkz@LabelCircle[]}} -% [option] (#2,#3) #2 center #3 un point du cercle #4 angle #5 the label -\def\tkz@LabelCircle[#1](#2,#3)(#4)#5{% -\begingroup - \tkzURotateAngle(#2,#4)(#3) - \node[label style,#1] at (tkzPointResult) {#5}; -\endgroup -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-lines.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-lines.tex deleted file mode 100644 index 8c0d448ac8..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-lines.tex +++ /dev/null @@ -1,281 +0,0 @@ -% tkz-obj-eu-draw-lines.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-draw-lines.tex} -\makeatletter - -%<--------------------------------------------------------------------------–> -% Setup Line -%<--------------------------------------------------------------------------–> -\pgfkeys{% - tkzsuline/.cd, - line width/.code = \def\tkz@line@width{#1}, - color/.code = \def\tkz@line@color{#1}, - style/.code = \def\tkz@line@style{#1}, - add/.code args = {#1 and #2} {\def\tkz@line@left{#1} - \def\tkz@line@right{#2}}, - /tkzsuline/.search also = {/tikz} -} -%<--------------------------------------------------------------------------–> -\def\tkzSetUpLine{\pgfutil@ifnextchar[{\tkz@SetUpLine}{\tkz@SetUpLine[]}} -\def\tkz@SetUpLine[#1]{% -\pgfkeys{% - tkzsuline/.cd, - line width = \tkz@euc@linewidth, - color = \tkz@euc@linecolor, - style = \tkz@euc@linestyle, - add = {\tkz@euc@lineleft} and {\tkz@euc@lineright}} -\pgfqkeys{/tkzsuline}{#1} -\tikzset{% - line style/.append style ={% - line width = \tkz@line@width, - color = \tkz@line@color, - style = \tkz@line@style, - add = {\tkz@line@left} and {\tkz@line@right}, - line cap = round, - #1} - } -}% end setup -%<--------------------------------------------------------------------------–> -% Drawing a line -%<--------------------------------------------------------------------------–> -%<--------------------------------------------------------------------------–> -% \pgfkeys{/tkzdrawl/.cd, -% /tkzdrawl/.search also={/tikz} -% } -\def\tkzDrawLine{\pgfutil@ifnextchar[{\tkz@DrawLine}{\tkz@DrawLine[]}} -\def\tkz@DrawLine[#1](#2,#3){% -\begingroup - % \pgfqkeys{/tkzdrawl}{#1} - \draw[line style,#1] (#2) to (#3); -\endgroup -} -%<-------------------------------------------------------------------------– -% tkzDrawLines -%<-------------------------------------------------------------------------– -\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){% -\xdef\tkz@optline{#1} -\begingroup - \let\next\tkz@@multiLines - \next#2 \@nil % -\endgroup -}% -%<-------------------------------------------------------------------------–> -% Label -%<-------------------------------------------------------------------------–> -\def\tkzLabelLine{\pgfutil@ifnextchar[{\tkz@AddLabelLine}{\tkz@AddLabelLine[]}} -\def\tkz@AddLabelLine[#1](#2,#3)#4{\path (#2) to node[#1]{#4}(#3);} - - -%<--------------------------------------------------------------------------–> -% draw segment (s) -%<--------------------------------------------------------------------------–> -\pgfkeys{/tkzdraws/.cd, - /tkzdraws/.search also={/tikz}, -} -\def\tkzDrawSegment{\pgfutil@ifnextchar[{\tkz@DrawSegment}{% - \tkz@DrawSegment[]}} -\def\tkz@DrawSegment[#1](#2,#3){% -\scope - \pgfqkeys{/tkzdraws}{#1} - \draw[line style,add=0 and 0,#1] (#2) to (#3); -\endscope -}% - -\def\tkz@multiDrawSeg#1 #2\@nil{% - \protected@edef\tkz@temp{ - \noexpand \tkzDrawSegment[\tkz@optseg](#1)}\tkz@temp% - \def\tkz@nextArg{#2}% - \ifx\tkzutil@empty\tkz@nextArg - \let\next\@gobble - \fi - \next#2\@nil -} -\def\tkzDrawSegments{\pgfutil@ifnextchar[{\tkz@DrawSegments}{% - \tkz@DrawSegments[]}} -\def\tkz@DrawSegments[#1](#2){% -\def\tkz@optseg{#1} -\begingroup - \let\next\tkz@multiDrawSeg - \next#2 \@nil % -\endgroup -} -%<--------------------------------------------------------------------------–> -% Mark Segment -%<--------------------------------------------------------------------------–> -\pgfkeys{ - /@tkzmarkoptions/.cd, - pos/.store in = \tkz@mkpos, - color/.store in = \tkz@mkcolor, - mark/.store in = \tkz@markseg, - size/.store in = \tkz@mksize, - size = 4pt, - color = \tkz@mk@color, - pos = .5, - mark = |, - /@tkzmarkoptions/.search also={/tikz}, -} -\def\tkzMarkSegment{\pgfutil@ifnextchar[{\tkz@MarkSegment}{\tkz@MarkSegment[]}} -\def\tkz@MarkSegment[#1](#2,#3){% -\begingroup - \pgfqkeys{/@tkzmarkoptions}{#1} -\def\tkz@mymark{\pgfsetplotmarksize{\tkz@mksize}\pgfuseplotmark{\tkz@markseg}} -\begin{scope} - [decoration={markings,mark=at position \tkz@mkpos with {\tkz@mymark}}] - \path [\tkz@mkcolor,/@tkzmarkoptions/.cd,#1,postaction={decorate}] (#2) -- (#3); -\end{scope} -\endgroup -} -%<--------------------------------------------------------------------------–> -% multiple -\def\tkz@multiMS#1 #2\@nil{% - \protected@edef\tkz@temp{ - \noexpand \tkzMarkSegment[\tkz@optsg](#1)}\tkz@temp% - \def\tkz@nextArg{#2}% - \ifx\tkzutil@empty\tkz@nextArg - \let\next\@gobble - \fi - \next#2\@nil -} -%<--------------------------------------------------------------------------–> -\def\tkzMarkSegments{\pgfutil@ifnextchar[{\tkz@MarkSegments}{\tkz@MarkSegments[]}} -\def\tkz@MarkSegments[#1](#2){% -\def\tkz@optsg{#1} - \begingroup - \let\next\tkz@multiMS - \next#2 \@nil % -\endgroup -} -%<-------------------------------------------------------------------------–> -% Label on segment -%<-------------------------------------------------------------------------–> -\def\tkzLabelSegment{\pgfutil@ifnextchar[{\tkz@LabelSegment}% - {\tkz@LabelSegment[]}} -\def\tkz@LabelSegment[#1](#2,#3)#4{% -\begingroup - \path (#2) to node[label style,#1]{#4} (#3) ; -\endgroup -} -%<--------------------------------------------------------------------------–> -% multiple -\def\tkz@multiLS#1 #2\@nil{% - \protected@edef\tkz@temp{ - \noexpand \tkzLabelSegment[\tkz@optls](#1){\tkz@labelseg}}\tkz@temp% - \def\tkz@nextArg{#2}% - \ifx\tkzutil@empty\tkz@nextArg - \let\next\@gobble - \fi - \next#2\@nil -} -%<--------------------------------------------------------------------------–> -\def\tkzLabelSegments{\pgfutil@ifnextchar[{\tkz@LabelSegments}{\tkz@LabelSegments[]}} -\def\tkz@LabelSegments[#1](#2)#3{% -\def\tkz@optls{#1} -\def\tkz@labelseg{#3} - \begingroup - \let\next\tkz@multiLS - \next#2 \@nil % -\endgroup -} -%<--------------------------------------------------------------------------–> -% PolySeg -%<--------------------------------------------------------------------------–> -\def\tkzDrawPolySeg{\pgfutil@ifnextchar[{\tkz@DrawPolySeg}{\tkz@DrawPolySeg[]}} -\def\tkz@DrawPolySeg[#1](#2,#3){% -\begingroup -\draw[line style,#1] (#2) - \foreach \pt in {#2,#3}{--(\pt)};% -\endgroup -} - - -%<--------------------------------------------------------------------------–> -% add dim - % \draw[dim={5,7pt,}] (A) -- (B); - % \draw[dim={7,10pt,transform shape}] (B) -- (C); - % \draw[dim={X,,}] (A) -- (C); -%<--------------------------------------------------------------------------–> -% new code from muzimuzhi Z -%https://tex.stackexchange.com/questions/553430/change-color-and-style-of-dimension-lines-in-tkz-euclide/553441 - -\pgfkeys{/pgf/decoration/.cd, distance/.initial = 10pt} - -\pgfdeclaredecoration{add dim}{final}{ -\state{final}{% -\pgfmathsetmacro{\dist}{\pgfkeysvalueof{/pgf/decoration/distance}} - \pgfpathmoveto{\pgfpoint{0pt}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{1.2*\dist}} - \pgfpathmoveto{\pgfpoint{\pgfdecoratedpathlength}{0pt}} - \pgfpathlineto{\pgfpoint{(\pgfdecoratedpathlength}{1.2*\dist}} - % start of patch - \pgfusepath{stroke} - \pgfsetarrowsstart{latex} - \pgfsetarrowsend{latex} - \expandafter\pgfsetdash\tkz@dim@dashpattern - \pgfsetstrokecolor{\tkz@dim@color} - % end of patch - \pgfpathmoveto{\pgfpoint{0pt}{\dist}} - \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{\dist}} - \pgfusepath{stroke} - \pgfpathmoveto{\pgfpoint{0pt}{0pt}} - \pgfpathlineto{\pgfpoint{\pgfdecoratedpathlength}{0pt}} -}} - - -\tikzset{ - dim/.style args={#1,#2,#3}{% - postaction={ - decoration={ - show path construction, - lineto code={ - % dim fence - \draw[dim fence style/.try] - (\tikzinputsegmentfirst) -- - ($ (\tikzinputsegmentfirst)!1.2*(#2)!90:(\tikzinputsegmentlast) $) - (\tikzinputsegmentlast) -- - ($ (\tikzinputsegmentlast)!1.2*(#2)!-90:(\tikzinputsegmentfirst) $); - % dim - \draw[dim style/.try] - ($ (\tikzinputsegmentfirst)!#2!90:(\tikzinputsegmentlast) $) -- - node[inner sep=0pt, font=\footnotesize, fill=\tkz@fillcolor, pos=.5, #3] {#1} - ($ (\tikzinputsegmentlast)!#2!-90:(\tikzinputsegmentfirst) $); - } - }, - decorate, - } - }, - dim/.default={,0pt,}, - dim style/.style={ - latex-latex, - }, -} - -%<--------------------------- style line ---------------------------------> -\tikzset{add/.style args={#1 and #2}{to path={% - ($(\tikztostart)!-#1!(\tikztotarget)$)--($(\tikztotarget)!-#2!(\tikztostart)$)% - \tikztonodes}} -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-points.tex deleted file mode 100644 index 4a80f44f17..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-points.tex +++ /dev/null @@ -1,172 +0,0 @@ - % tkz-obj-eu-points.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-points.tex} -\makeatletter -%<---------------------------------------------------------------------------> -% tkzSetUpPoint définit la forme d'un point -%<---------------------------------------------------------------------------> -\pgfkeys{/tkzsetuppt/.cd, - size/.store in = \tkz@pt@size, - color/.store in = \tkz@pt@color, - fill/.store in = \tkz@pt@fill, - shape/.store in = \tkz@pt@shape, - size = \tkz@euc@pointsize, - color = \tkz@euc@pointcolor, - fill = \tkz@euc@pointcolor, - shape = \tkz@euc@pointshape, - /tkzsetuppt/.search also = {/tikz}, - } -\def\tkzSetUpPoint{\pgfutil@ifnextchar[{\tkz@SetUpPoint}{% - \tkz@SetUpPoint[]}} -\def\tkz@SetUpPoint[#1]{% -\pgfqkeys{/tkzsetuppt}{#1} -% redefine point style with new values -\tikzset{point style/.style={draw = \tkz@pt@color, - inner sep = 0pt, - shape = \tkz@pt@shape, - minimum size = \tkz@pt@size, - fill = \tkz@pt@fill}} -}% end setup -%<---------------------------------------------------------------------------> -% Draw Point -%<---------------------------------------------------------------------------> -\pgfkeys{/tkzdrawpt/.cd, - size/.code = {\tikzset{point style/.append style={minimum size = #1}}}, - size = \tkz@euc@pointsize, - /tkzdrawpt/.search also = {/tikz}, -} -%<-------------------------------------------------------------------------- -\def\tkzDrawPoint{\pgfutil@ifnextchar[{\tkz@DrawPoint}{\tkz@DrawPoint[]}} -\def\tkz@DrawPoint[#1](#2){% -\begingroup - \pgfqkeys{/tkzdrawpt}{#1} - \node[point style,/tkzdrawpt/.cd,#1] at (#2) {};%2016 -\endgroup -} -%<---------------------------------------------------------------------------> -\def\tkzDrawPoints{\pgfutil@ifnextchar[{\tkz@drawpts}{\tkz@drawpts[]}} -%<---------------------------------------------------------------------------> -\def\tkz@drawpts[#1](#2){% -\begingroup - \pgfqkeys{/tkzdrawpt}{#1} - \foreach \point in {#2}{\node[point style,/tkzdrawpt/.cd,#1] at (\point) {};} %2016 -\endgroup -} -%<--------------------------------------------------------------------------> -% tkzLabelPoint Affichage des LABELS pour un point -%<--------------------------------------------------------------------------> -\def\tkzLabelPoint{\pgfutil@ifnextchar[{\tkz@LabelPoint}{\tkz@LabelPoint[]}} -\def\tkz@LabelPoint[#1](#2)#3{% - \node[label style,#1] at (#2) {#3};}% -%<---------------------------------------------------------------------------> - -\def\tkzLabelPoints{\pgfutil@ifnextchar[{\tkz@LabelPoints}{\tkz@LabelPoints[]}}% -\def\tkz@LabelPoints[#1](#2){% - \foreach \point in {#2}{ - \node[label style,#1] at (\point) {$\point$};} -}% -%<---------------------------------------------------------------------------> -\pgfkeys{/tkzsetuppt/.cd, - size/.store in = \tkz@pt@size, - color/.store in = \tkz@pt@color, - fill/.store in = \tkz@pt@fill, - shape/.store in = \tkz@pt@shape, - size = \tkz@euc@pointsize, - color = \tkz@euc@pointcolor, - fill = \tkz@euc@pointcolor, - shape = \tkz@euc@pointshape, - /tkzsetuppt/.search also = {/tikz}, - } -\def\tkzSetUpPoint{\pgfutil@ifnextchar[{\tkz@SetUpPoint}{% - \tkz@SetUpPoint[]}} -\def\tkz@SetUpPoint[#1]{% -\pgfqkeys{/tkzsetuppt}{#1} -% redefine point style with new values -\tikzset{point style/.style={draw = \tkz@pt@color, - inner sep = 0pt, - shape = \tkz@pt@shape, - minimum size = \tkz@pt@size, - fill = \tkz@pt@fill}} -}% end setup -%<---------------------------------------------------------------------------> -% -%<---------------------------------------------------------------------------> -\def\tkzSetUpLabel{\pgfutil@ifnextchar[{\tkz@SetUpLabel}{% - \tkz@SetUpLabel[]}} -\def\tkz@SetUpLabel[#1]{% -\tikzset{label style/.style={#1}} -}% end setup -%<---------------------------------------------------------------------------> - -\pgfkeys{/tkzautolab/.cd, - center/.store in = \tkz@center, - dist/.store in = \tkz@dist, - dist = 0.15, - /tkzautolab/.search also = {/tikz}, -} -\def\tkzAutoLabelPoints{\pgfutil@ifnextchar[{\tkz@AutoLabelPoints}{\tkz@AutoLabelPoints[]}}% -\def\tkz@AutoLabelPoints[#1](#2){% -\begingroup -\pgfqkeys{/tkzautolab}{#1} - \foreach \point in {#2}{ - \path (\tkz@center) -- ($ (\point) + \tkz@dist*($(\point)-(\tkz@center)$) $) node[/tkzautolab/.cd,label style,#1]{$\point$};} -\endgroup -}% -%<---------------------------------------------------------------------------> -% PointShowCoord -%<---------------------------------------------------------------------------> -\pgfkeys{/tkzprcoord/.cd, - xlabel/.store in = \tkz@xlabel, - ylabel/.store in = \tkz@ylabel, - xstyle/.code = {\tikzset{xcoord style/.append style={#1}}}, - ystyle/.code = {\tikzset{ycoord style/.append style={#1}}}, - noxdraw/.is if = tkz@coord@noxdraw, - noxdraw/.default = true, - noydraw/.is if = tkz@coord@noydraw, - noydraw/.default = true, - xlabel = {}, - ylabel = {}, - xstyle = {}, - ystyle = {}, - noxdraw = false, - noydraw = false, - /tkzprcoord/.search also = {/tikz}, -} -\def\tkzPointShowCoord{\pgfutil@ifnextchar[{\tkz@PointShowCoord}{\tkz@PointShowCoord[]}} -\def\tkz@PointShowCoord[#1](#2){% -\begingroup -\pgfqkeys{/tkzprcoord}{#1} -% 2019 for showcoord - \iftkznodedefined{tkz@xline}{}{% - \path (0,0) --(1,0) node(tkz@xline){}; - \path (0,0) --(0,1) node(tkz@yline){}; - } -\iftkz@coord@noxdraw\else\draw[arrow coord style,/tkzprcoord/.cd,#1] (#2)--(#2 |- tkz@xline);\fi -\iftkz@coord@noydraw\else\draw[arrow coord style,/tkzprcoord/.cd,#1] (#2)--(#2 -| tkz@yline);\fi -\ifx\tkzutil@empty\tkz@xlabel -\else -\path (#2)--(#2 |- tkz@xline) - node[xcoord style] {\tkz@xlabel}; -\fi -\ifx\tkzutil@empty\tkz@ylabel -\else - \path (#2)--(#2 -| tkz@yline) - node[ycoord style] {\tkz@ylabel}; -\fi -\endgroup -} -\let\tkzShowPointCoord\tkzPointShowCoord -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-polygons.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-polygons.tex deleted file mode 100644 index 6b3d2246e9..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-draw-polygons.tex +++ /dev/null @@ -1,106 +0,0 @@ -% tkz-obj-eu-polygons.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-polygons.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% Polygon -%<--------------------------------------------------------------------------–> -%<---------------------------- Draw --------------------------------–> -% -%<--------------------------------------------------------------------------–> -\def\tkzDrawPolygon{\pgfutil@ifnextchar[{\tkz@DrawPolygon}{% - \tkz@DrawPolygon[]}} -\def\tkz@DrawPolygon[#1](#2,#3){% - \begingroup - \draw[line style,line join=round,#1] (#2) - \foreach \pt in {#2,#3}{--(\pt)}--cycle;% - \endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkz@multipolygons#1 #2\@nil{% -\protected@edef\tkz@temp{ -\noexpand \tkzDrawPolygon[\tkz@optpolygon](#1)}\tkz@temp% -\def\tkz@nextArg{#2}% -\ifx\tkzutil@empty\tkz@nextArg - \let\next\@gobble -\fi -\next#2\@nil -} -%<--------------------------------------------------------------------------–> -\def\tkzDrawPolygons{\pgfutil@ifnextchar[{\tkz@DrawPolygons}{\tkz@DrawPolygons[]}} -\def\tkz@DrawPolygons[#1](#2){% -\xdef\tkz@optpolygon{#1} -\begingroup - \let\next\tkz@multipolygons - \next#2 \@nil % -\endgroup -}% -%<--------------------------------------------------------------------------–> -%<--------------------------------------------------------------------------–> -%<---------------------------- FILL --------------------------------–> -% -%<--------------------------------------------------------------------------–> -\def\tkzFillPolygon{\pgfutil@ifnextchar[{\tkz@FillPolygon}{% - \tkz@FillPolygon[]}} -\def\tkz@FillPolygon[#1](#2,#3){% - \begingroup - \fill[#1] (#2) - \foreach \pt in {#2,#3}{--(\pt)}--cycle;% -\endgroup -} -%<--------------------------------------------------------------------------–> -%<-------------- Labels for Regular Polygon -------------------------–> -% -%<--------------------------------------------------------------------------–> -\pgfkeys{/deflabelregpoly/.cd, - name/.store in = \tkz@regpolname, - sep/.store in = \tkz@regpolsep, - name = P, - sep = 1.1 -} - -\def\tkzLabelRegPolygon{\pgfutil@ifnextchar[{\tkz@labelPolygon}{% - \tkz@labelPolygon[]}} -\def\tkz@labelPolygon[#1](#2)#3{% -\begingroup -\pgfqkeys{/deflabelregpoly}{#1} - \foreach \v [count=\vi from 1] in {#3} {% - \path (#2) to [pos=1.1] node {$\v$} (\tkz@regpolname\vi) ; - \pgfnodealias{\v}{\tkz@regpolname\vi} - } -\endgroup -} -%<---------------------------- CLIP --------------------------------–> -% -%<--------------------------------------------------------------------------–> - -\pgfkeys{tkzclippolygon/.cd, - out code/.is if = tkzClipOutPoly, - out/.code = \tkzClipOutPolyfalse} - -\def\tkzClipPolygon{\pgfutil@ifnextchar[{\tkz@ClipPolygon}{\tkz@ClipPolygon[]}} -\def\tkz@ClipPolygon[#1](#2,#3){% -\tkzClipOutPolytrue -\pgfqkeys{/tkzclippolygon}{#1}% -\iftkzClipOutPoly -\clip (#2) - \foreach \pt in {#2,#3}{--(\pt)}--cycle; -\else - \clip(#2) - \foreach \pt in {#2,#3}{--(\pt)}--cycle[tkzreverseclip] ; -\fi -}% -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-grids.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-grids.tex deleted file mode 100644 index 14d476fede..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-grids.tex +++ /dev/null @@ -1,83 +0,0 @@ -% tkz-obj-eu-grids.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-grids.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% Setup Grid -%<--------------------------------------------------------------------------–> -\pgfkeys{/tkzsugrid/.cd, - line width/.store in = \tkz@sug@lw, - color/.store in = \tkz@sug@color, - line width = \tkz@grid@lw, - color = \tkz@grid@color - } - -\def\tkzSetUpGrid{\pgfutil@ifnextchar[{\tkz@SetUpGrid}{\tkz@SetUpGrid[]}} -\def\tkz@SetUpGrid[#1]{% -\begingroup -\pgfqkeys{/tkzsugrid}{#1} -\global\let\tkz@grid@lw\tkz@sug@lw -\global\let\tkz@grid@color\tkz@sug@color -\endgroup -} -%<--------------------------------------------------------------------------–> -% tkzGrid -%<--------------------------------------------------------------------------–> -\pgfkeys{/tkzGrid/.cd, - color/.code = {\def\tkz@gd@color{#1}% - \edef\tkz@gd@subcolor{% - \tkz@gd@color!\tkzCoeffSubColor}}, - subxstep/.store in = {\tkz@gd@subxstep}, - subystep/.store in = {\tkz@gd@subystep}, - ratio/.store in = {\tkz@gd@ratio}, - line width/.code = {\edef\tkz@gd@lw{#1} - \edef\tkz@gd@sublw{\tkz@gd@ratio\tkz@gd@lw}}, - sub/.is if = tkz@gd@sub, - sub/.default = true , - sub = false, - color = \tkz@grid@color, - ratio = 0.75, - subxstep = \tkz@grid@xstep, - subystep = \tkz@grid@ystep, - line width = \tkz@grid@lw, - /tkzGrid/.search also= {/tikz}, -} -%<--------------------------------------------------------------------------–> -\def\tkzGrid{\pgfutil@ifnextchar[{\tkz@Grid}{\tkz@Grid[]}} -\def\tkz@Grid[#1]{\@ifnextchar({\tkz@@Grid[#1]}% - {\tkz@@Grid[#1](\tkz@tmp@xa,\tkz@tmp@ya)(\tkz@tmp@xb,\tkz@tmp@yb)}} -\def\tkz@@Grid[#1](#2,#3)(#4,#5){% - \pgfqkeys{/tkzGrid}{#1} - \begingroup - \edef\tkz@gxa{\fpeval{(#2-\tkz@init@xorigine)/\tkz@init@xstep}} - \edef\tkz@gxb{\fpeval{(#4-\tkz@init@xorigine)/\tkz@init@xstep}} - \edef\tkz@gya{\fpeval{(#3-\tkz@init@yorigine)/\tkz@init@ystep}} - \edef\tkz@gyb{\fpeval{(#5-\tkz@init@yorigine)/\tkz@init@ystep}} - \iftkz@gd@sub% - \edef\@subxstep{\fpeval{\tkz@gd@subxstep/\tkz@init@xstep}}% - \edef\@subystep{\fpeval{\tkz@gd@subystep/\tkz@init@ystep}}% - \draw [xstep = \@subxstep cm,% - ystep = \@subystep cm,% - color = \tkz@gd@subcolor,% - line width = \tkzRatioLineGrid]% - (\tkz@gxa,\tkz@gya) grid (\tkz@gxb,\tkz@gyb);% - \fi - \draw [color = \tkz@gd@color,% - line width = \tkz@gd@lw]% - (\tkz@gxa,\tkz@gya) grid (\tkz@gxb,\tkz@gyb);% - \endgroup -}% -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-lines.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-lines.tex deleted file mode 100644 index 3a2875c829..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-lines.tex +++ /dev/null @@ -1,293 +0,0 @@ -% tkz-obj-eu-lines.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-lines.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% les lignes -%<--------------------------------------------------------------------------–> -\def\tkz@numline{0} -\pgfkeys{/tkzdefline/.cd, - mediator/.code = \def\tkz@numline{0}, - perpendicular/.code args = {through #1} {\def\tkz@numline{1}% - \def\tkz@through{#1}}, - orthogonal/.code args = {through #1} {\def\tkz@numline{1}% - \def\tkz@through{#1}}, - parallel/.code args = {through #1}{\def\tkz@numline{2}% - \def\tkz@through{#1}}, - bisector/.code = \def\tkz@numline{3}, - bisector out/.code = \def\tkz@numline{4}, - symmedian/.code = \def\tkz@numline{5}, - altitude/.code = \def\tkz@numline{6}, - euler/.code = \def\tkz@numline{7}, - tangent from/.code = \def\tkz@numline{8} \def\tkz@ptfrom{#1}, - tangent at/.code = \def\tkz@numline{9} \def\tkz@ptat{#1}, - K/.code = \def\tkz@koeff{#1}, - K = 1, - normed/.is if = tkz@line@normed, - normed/.default = true, - normed = false, - mediator -} -\def\tkzDefLine{\pgfutil@ifnextchar[{\tkz@DefLine}{\tkz@DefLine[]}} -\def\tkz@DefLine[#1](#2){% -\begingroup -%\pgfkeys{/tkzdefline/.cd,K=1} -\pgfqkeys{/tkzdefline}{#1} -\ifcase\tkz@numline% - % first case 0 - \tkzDefMediatorLine(#2) - \or% 1 - \tkzDefOrthLine[\tkz@koeff](#2) - \or% 2 - \tkzDefLineLL(#2) - \or% 3 - \tkzDefBisectorLine(#2) - \or% 4 - \tkzDefBisectorOutLine(#2) - \or% 5 - \tkzDefSymmedianLine(#2) - \or% 6 - \tkzDefAltitudeLine(#2) - \or% 7 - \tkzDefEulerLine(#2) - \or% 8 - \tkzTgtFromP(#2)(\tkz@ptfrom) - \or% 9 - \tkzTgtAt(#2)(\tkz@ptat) - \fi -\endgroup -} -%<--------------------------------------------------------------------------–> -% tkzLineLL revoir out !! -%<--------------------------------------------------------------------------–> -\def\tkzDefLineLL{\pgfutil@ifnextchar[{\tkz@DefLineLL}{% - \tkz@DefLineLL[1]}} -\def\tkz@DefLineLL[#1](#2,#3){% -\begingroup - \pgfpointdiff{\pgfpointanchor{#2}{center}}{\pgfpointanchor{#3}{center}}% - \pgf@xa=\pgf@x\relax%% - \pgf@ya=\pgf@y\relax%% - \pgfinterruptboundingbox - \path[coordinate](\tkz@through)--++(\tkz@koeff\pgf@xa,\tkz@koeff\pgf@ya)% - coordinate (tkzPointResult); - \endpgfinterruptboundingbox - \iftkz@line@normed - \tkzVecKNorm(\tkz@through,tkzPointResult) - \fi -\endgroup}% -%<--------------------------------------------------------------------------–> -% tkzOrthLine -%<--------------------------------------------------------------------------–> -\def\tkzDefOrthLine{\pgfutil@ifnextchar[{\tkz@DefOrthLine}{% - \tkz@DefOrthLine[1]}} -\def\tkz@DefOrthLine[#1](#2,#3){% -\begingroup - \tkzDefPointWith(#2,#3) - \pgfnodealias{tkz@OLtmp}{tkzPointResult} - \tkz@VecKCoLinear[\tkz@koeff](#2,tkz@OLtmp,\tkz@through) - \iftkz@line@normed - \pgfinterruptboundingbox - \tkzVecKNorm(\tkz@through,tkzPointResult) - \endpgfinterruptboundingbox - \fi -\endgroup}% -%<--------------------------------------------------------------------------–> -% tkzMediatorLine -%<--------------------------------------------------------------------------–> -\def\tkzDefMediatorLine{\pgfutil@ifnextchar[{\tkz@DefMediatorLine}{% - \tkz@DefMediatorLine[1]}} - -\def\tkz@DefMediatorLine[#1](#2,#3){% new 2020 -\begingroup - \tkzDefEquilateral(#2,#3) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzDefEquilateral(#3,#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} - \ifx\tkz@koeff=1 % - \else - \tkzDefMidPoint(#2,#3) - \pgfnodealias{tkz@mid}{tkzPointResult} - \tkz@VecK[\tkz@koeff](tkz@mid,tkzFirstPointResult) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkz@VecK[\tkz@koeff](tkz@mid,tkzSecondPointResult) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} - \fi - \iftkz@line@normed - \tkzDefMidPoint(#2,#3) - \pgfnodealias{tkz@mid}{tkzPointResult} - % \pgfinterruptboundingbox - \tkzVecKNorm[\tkz@koeff](tkz@mid,tkzFirstPointResult) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzVecKNorm[\tkz@koeff](tkz@mid,tkzSecondPointResult) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} - % \endpgfinterruptboundingbox - \fi -\endgroup} -% autre possibilité - -%<--------------------------------------------------------------------------–> -% BisectorLine -%<--------------------------------------------------------------------------–> -\def\tkzDefBisectorLine(#1,#2,#3){% -\begingroup - \pgfinterruptboundingbox - \tkzDuplicateSegment(#2,#1)(#2,#3) - \pgfnodealias{bi@tmp}{tkzPointResult} - \tkzDefMidPoint(bi@tmp,#1) -% \tkzDefEquilateral(bi@tmp,#1) - \ifx\tkz@koeff=1 % - \else - \tkzVecK[\tkz@koeff](#2,tkzPointResult) - \fi - \iftkz@line@normed - \tkzVecKNorm[\tkz@koeff](#2,tkzPointResult) - \fi - \endpgfinterruptboundingbox -\endgroup -} -%<--------------------------------------------------------------------------–> -% Out BisectorLine -%<--------------------------------------------------------------------------–> -\def\tkzDefBisectorOutLine(#1,#2,#3){% -\begingroup - \pgfinterruptboundingbox - \tkzDuplicateLength(#2,#1)(#2,#3) - \pgfnodealias{out@tmp}{tkzPointResult} - \tkzDefMidPoint(#1,out@tmp) - \pgfnodealias{out@pt1}{tkzPointResult} - \tkzURotateAngle(#2,90)(out@pt1) - \ifx\tkz@koeff=1 % - \else - \tkzVecK[\tkz@koeff](#2,tkzPointResult) - \fi - \iftkz@line@normed - \tkzVecKNorm[\tkz@koeff](#2,tkzPointResult) - \fi - \endpgfinterruptboundingbox -\endgroup -} -%<--------------------------------------------------------------------------–> -% Symmedian line -%<--------------------------------------------------------------------------–> -\def\tkzDefSymmedianLine(#1,#2,#3){% -\begingroup - \tkzDefBisectorLine(#1,#2,#3) - \pgfnodealias{sym@pt1}{tkzPointResult} - \tkzDefMidPoint(#1,#3) - \pgfnodealias{sym@pt2}{tkzPointResult} - \tkzUSymOrth(#2,sym@pt1)(sym@pt2) - \ifx\tkz@koeff=1 % - \else - \tkzVecK[\tkz@koeff](#2,tkzPointResult) - \fi - \iftkz@line@normed - \tkzVecKNorm[\tkz@koeff](#2,tkzPointResult) - \fi -\endgroup -} -%<--------------------------------------------------------------------------–> -% Altitude Line -%<--------------------------------------------------------------------------–> -\def\tkzDefAltitudeLine(#1,#2,#3){% -\begingroup - \pgfinterruptboundingbox - \tkzUProjection(#1,#3)(#2) - \pgfnodealias{ort@pta}{tkzPointResult} - \endpgfinterruptboundingbox -\endgroup -} -%<--------------------------------------------------------------------------–> -% Euler Line -%<--------------------------------------------------------------------------–> -\def\tkzDefEulerLine(#1,#2,#3){% -\begingroup - \pgfinterruptboundingbox - \tkzOrthoCenter(#1,#2,#3) - \pgfnodealias{euler@pt1}{tkzPointResult} - \tkzEulerCenter(#1,#2,#3) - \pgfnodealias{euler@pt2}{tkzPointResult} - \pgfnodealias{tkzSecondPointResult}{euler@pt2} - \pgfnodealias{tkzFirstPointResult}{euler@pt1} - \endpgfinterruptboundingbox -\endgroup -} -%<--------------------------------------------------------------------------–> -% tangente à cercle passant par un point donné -%<--------------------------------------------------------------------------–> - -\def\tkzTgtAt(#1)(#2){% -\begingroup - \tkz@VecKOrthNorm[-1](#2,#1) - \endgroup -} -%<-------------------------------------------------------------------------–> -\def\tkzTgtFromP(#1,#2)(#3){% -\begingroup - \tkz@@CalcLengthcm(#1,#2){tkz@radone} - \tkzDefMidPoint(#1,#3) - \tkz@@CalcLengthcm(tkzPointResult,#1){tkz@radtwo} - \tkzInterCCR(#1,\tkz@radone)(tkzPointResult,\tkz@radtwo){% - tkzFirstPointResult}{tkzSecondPointResult}% - \tkzFindAngle(#3,tkzFirstPointResult,#1) \tkzGetAngle{tkz@an} - \ifdim\tkz@an pt<180 pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi -\endgroup -} -%<-------------------------------------------------------------------------–> -\def\tkzTgtFromPR(#1,#2)(#3){% -\begingroup - \tkzDefMidPoint(#1,#3) - \tkz@@CalcLengthcm(tkzPointResult,#1){tkzLengthResult} - \tkzInterCCR(#1,#2)(tkzPointResult,\tkzLengthResult){% - tkzFirstPointResult}{% - tkzSecondPointResult}% - \tkzFindAngle(#3,tkzFirstPointResult,#1) \tkzGetAngle{tkz@an} - \ifdim\tkz@an pt<180 pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkz@numtang{0} -\pgfkeys{/tkz@tang/.cd, - at/.code = {\def\tkz@numtang{0}\def\tkz@ptat{#1}}, - from/.code = {\def\tkz@numtang{1}\def\tkz@ptfrom{#1}}, - from with R/.code = {\def\tkz@numtang{2}\def\tkz@ptfrom{#1}} - } -%<--------------------------------------------------------------------------–> -\def\tkzDefTangent{\pgfutil@ifnextchar[{\tkz@Tangent}{\tkz@Tangent[]}} - -\def\tkz@Tangent[#1](#2){% -\begingroup -\pgfkeys{tkz@tang/.cd} -\pgfqkeys{/tkz@tang}{#1} -\ifcase\tkz@numtang - \tkzTgtAt(#2)(\tkz@ptat) -\or - \tkzTgtFromP(#2)(\tkz@ptfrom) - \or - \tkzTgtFromPR(#2)(\tkz@ptfrom) -\fi -\endgroup -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-by.tex deleted file mode 100644 index fc8b53160c..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-by.tex +++ /dev/null @@ -1,520 +0,0 @@ -% tkz-tools-eu-points-by.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tools-eu-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% - \pgfmathrotatepointaround{\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% - \pgfmathrotatepointaround{\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% - \pgfmathrotatepointaround{\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% - \pgfmathrotatepointaround{\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% - \pgfmathrotatepointaround{\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% - \pgfmathrotatepointaround{\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/tkz-obj-eu-points-rnd.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-rnd.tex deleted file mode 100644 index 8d604321ed..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-rnd.tex +++ /dev/null @@ -1,119 +0,0 @@ -% tkz-obj-eu-points-rnd.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-points-rnd.tex} -%<--------------------------------------------------------------------------–> -\makeatletter -%<-------------------------------------------------------------------------–> -% Points aléatoires sur un segment, une droite, une demi-droite un cercle -%<--------------------------------------------------------------------------–> -% les points aléatoires -%<--------------------------------------------------------------------------–> -\def\tkz@numrp{0} -\pgfkeys{/@tkzDefRandPoint/.cd, - rectangle/.code args = {#1 and #2}{\def\tkz@numrp{0}% - \def\tkz@infl{#1}% - \def\tkz@supr{#2}}, - segment/.code args = {#1--#2}{\def\tkz@numrp{1}% - \def\tkz@start{#1}% - \def\tkz@end{#2}}, - line/.code args = {#1--#2}{\def\tkz@numrp{2}% - \def\tkz@start{#1}% - \def\tkz@end{#2}}, - circle/.code args = {center #1 radius #2}{\def\tkz@numrp{3}% - \def\tkz@center{#1} - \def\tkz@rad{#2}}, - circle through/.code args = {center #1 through #2}{\def\tkz@numrp{4}% - \def\tkz@center{#1} - \def\tkz@point{#2}}, - disk through/.code args = {center #1 through #2}{\def\tkz@numrp{5}% - \def\tkz@center{#1} - \def\tkz@point{#2}}, -} -%<------------------------ version 2019 ----------------------------------> -\def\tkzDefRandPointOn{\pgfutil@ifnextchar[{\tkz@DefRandPointOn}{% - \tkz@DefRandPointOn[]}} -\def\tkz@DefRandPointOn[#1]{% -\begingroup -\pgfqkeys{/@tkzDefRandPoint}{#1} -\ifcase\tkz@numrp% - % first case 0 - \tkzRandPointOnRect(\tkz@infl,\tkz@supr) - \or% 1 - \tkzRandPointOnSegment(\tkz@start,\tkz@end) - \or% 2 - \tkzRandPointOnLine(\tkz@start,\tkz@end) - \or% 3 - \tkzRandPointOnCircle(\tkz@center,\tkz@rad) - \or% 4 - \tkzRandPointOnCircleThrough(\tkz@center,\tkz@point) - \or% 5 - \tkzRandPointOnDisk(\tkz@center,\tkz@point) -\fi -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkzRandPointOnRect(#1,#2){% -\tkz@@extractxy{#1} - \pgf@xa=\pgf@x\relax% - \pgf@ya=\pgf@y\relax% - \tkz@@extractxy{#2} - \pgf@xb=\pgf@x\relax% - \pgf@yb=\pgf@y\relax% - \edef\tkz@a{\fpeval{\pgf@xb-\pgf@xa}} - \edef\tkz@b{\fpeval{\pgf@yb-\pgf@ya}} - \pgfmathparse{rnd}\global\let\tkzrndone\pgfmathresult - \pgfmathparse{rnd}\global\let\tkzrndtwo\pgfmathresult - \path[coordinate] ($(#1)+(\tkzrndone*\tkz@a pt,\tkzrndtwo*\tkz@b pt)$) coordinate (tkzPointResult); - } -%<--------------------------------------------------------------------------–> -\def\tkzRandPointOnSegment(#1,#2){% - \pgfmathparse{rnd} - \let\myrnd\pgfmathresult -\path[coordinate] ($ (#1)!\myrnd!(#2) $) coordinate (tkzPointResult); -} -%<--------------------------------------------------------------------------–> -\def\tkzRandPointOnLine(#1,#2){% - \pgfmathparse{rand} - \let\myrnd\pgfmathresult -\path[coordinate] ($ (#1)!\myrnd!(#2) $) coordinate (tkzPointResult); -} -%<--------------------------------------------------------------------------–> -\def\tkzRandPointOnCircle(#1,#2){% -\pgfmathrandominteger{\tkzrnd}{0}{360} -\tkz@ax#2cm % - \edef\tkz@pxa{\fpeval{\tkz@ax*cosd(\tkzrnd)}} - \edef\tkz@pxb{\fpeval{\tkz@ax*sind(\tkzrnd)}} - \path[coordinate]($(#1) + (\tkz@pxa pt,\tkz@pxb pt) $) coordinate (tkzPointResult); -} -\def\tkzRandPointOnCircleThrough(#1,#2){% -\pgfmathrandominteger{\tkzrnd}{0}{360} -\tkz@@CalcLength(#1,#2){tkzLengthResult} - \edef\tkz@pxa{\fpeval{\tkzLengthResult*cosd(\tkzrnd)}} - \edef\tkz@pxb{\fpeval{\tkzLengthResult*sind(\tkzrnd)}} -\path[coordinate]($(#1) + (\tkz@pxa pt ,\tkz@pxb pt) $) coordinate (tkzPointResult); -} -%<--------------------------------------------------------------------------–> -\def\tkzRandPointOnDisk(#1,#2){% - \pgfmathrandominteger{\tkzrnd}{0}{360} - \tkz@@CalcLength(#1,#2){tkzLengthResult} - \edef\tkz@pxa{\fpeval{\tkzLengthResult*cosd(\tkzrnd)}} - \edef\tkz@pxb{\fpeval{\tkzLengthResult*sind(\tkzrnd)}} - \path[coordinate]($(#1) + (\tkz@pxa pt ,\tkz@pxb pt) $) coordinate (tkz@tmp); - \pgfmathparse{rnd} - \let\myrnd\pgfmathresult - \path[coordinate] ($ (#1)!\myrnd!(tkz@tmp) $) coordinate (tkzPointResult); -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-spc.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-spc.tex deleted file mode 100644 index 0ce48fcda5..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-spc.tex +++ /dev/null @@ -1,644 +0,0 @@ -% tkz-obj-eu-points.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-points.tex} -\makeatletter -%add ExCenter -%<--------------------------------------------------------------------------–> -% Specific points -%<--------------------------------------------------------------------------–> -% barycentre -%<--------------------------------------------------------------------------–> -\def\tkzDefBarycentricPoint(#1){% -\begingroup - \path[coordinate] (barycentric cs:#1) coordinate (tkzPointResult); -\endgroup -} -\let\tkzDefBCPoint\tkzDefBarycentricPoint - -\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 - \path[coordinate](barycentric cs:#2=\tkz@rf,#4=\tkz@rt)coordinate (tkzPointResult); - \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 - \path[coordinate](barycentric cs:#2=-\tkz@rf,#4=\tkz@rt) coordinate(tkzPointResult); - \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% - \advance\tkz@cx by\tkz@ax\relax% - \advance\tkz@cy by\tkz@ay\relax% - \advance\tkz@cx by\tkz@bx\relax% - \advance\tkz@cy by\tkz@by\relax% - \divide\tkz@cx by3\relax% - \divide\tkz@cy by3\relax - \pgfinterruptboundingbox - \pgfcoordinate{tkzPointResult}{\pgfqpoint{\tkz@cx}{\tkz@cy}} - \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/tkz-obj-eu-points-with.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-with.tex deleted file mode 100644 index e530dd5dfd..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points-with.tex +++ /dev/null @@ -1,265 +0,0 @@ -% tkz-obj-el-points-with.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-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{\fpeval{\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% - \edef\tkz@x{\fpeval{28.45274*(#1)*\pgf@xa}} - \edef\tkz@y{\fpeval{28.45274*(#1)*\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% - \edef\tkz@x{\fpeval{28.45274*(#1)*\pgf@xa}} - \edef\tkz@y{\fpeval{28.45274*(#1)*\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{\fpeval{28.45274*(#1)*\pgf@xa}} - \edef\tkz@y{\fpeval{28.45274*(#1)*\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/tkz-obj-eu-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points.tex deleted file mode 100644 index e3dbc6e7cf..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-points.tex +++ /dev/null @@ -1,173 +0,0 @@ - % tkz-obj-eu-points.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-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{\fpeval{(\tkz@x-\tkz@init@xorigine)/\tkz@init@xstep}} -\edef\tkzpt@ya{\fpeval{(\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\tkz@drawnode#1{\path[coordinate](\tkzpt@xa,\tkzpt@ya) coordinate(#1); -% \tkz@DrawPt{#1} -% } -% -%<---------------------------------------------------------------------------> -\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 diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-polygons.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-polygons.tex deleted file mode 100644 index 79fd6e561a..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-polygons.tex +++ /dev/null @@ -1,113 +0,0 @@ -% tkz-obj-eu-polygons.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-polygons.tex} -% bug in regular polygon side 2020/03/09 -\makeatletter -%<--------------------------------------------------------------------------–> -% Polygon -%<--------------------------------------------------------------------------–> -%<--------------------------- square ------------------------------------–> -% -%<--------------------------------------------------------------------------–> -\def\tkzDefSquare(#1,#2){ -\begingroup - \tkzURotateAngle(#2,-90)(#1) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzURotateAngle(#1, 90)(#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} -\endgroup -} -%<--------------------- parallélogramme ---------------------------------–> -% -%<--------------------------------------------------------------------------–> -\def\tkzDefParallelogram(#1,#2,#3){ -\begingroup -\tkzDefPointWith[colinear= at #3](#2,#1) -\endgroup -} -%<--------------------- rectangle ---------------------------------–> -% -%<--------------------------------------------------------------------------–> -\def\tkzDefRectangle{\pgfutil@ifnextchar[{\tkz@DefRectangle}% - {\tkz@DefRectangle[]}} -\def\tkz@DefRectangle[#1](#2,#3){% -\begingroup - \path[#1](#2) -| coordinate (tkzFirstPointResult) (#3) -| coordinate (tkzSecondPointResult) (#2); -\endgroup -} -%<-------------------------- gold rectangle -------------------------------–> -% -%<--------------------------------------------------------------------------–> -\def\tkzDefGoldRectangle(#1,#2){ -\begingroup - \tkzDefPointWith[K=-\tkzInvPhi](#2,#1) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzDefPointWith[K=\tkzInvPhi](#1,#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} -\endgroup -} -\let\tkzDefGoldenRectangle\tkzDefGoldRectangle -%<---------------------------- Regular Polygon -------------------------–> -\def\tkz@numregpol{0} -\pgfkeys{/defregpoly/.cd, - name/.store in = \tkz@regpolname, - sides/.store in = \tkz@regpolsides, - center/.code = \def\tkz@numregpol{0}, - side/.code = \def\tkz@numregpol{1}, - name/.default = P, - sides/.default = 5, - center -} -\def\tkzDefRegPolygon{\pgfutil@ifnextchar[{\tkz@DefRegPolygon}{\tkz@DefRegPolygon[]}} -\def\tkz@DefRegPolygon[#1](#2,#3){% -\begingroup -\pgfqkeys{/defregpoly}{#1} -\ifcase\tkz@numregpol% - \tkzRegPolygonCenter(#2,#3) - \or% - \tkzRegPolygonSide(#2,#3) - \fi -\endgroup -} -\def\tkzRegPolygonCenter(#1,#2){ -\begingroup - \foreach \v in {1,2,...,\tkz@regpolsides} - {% - \pgfmathsetmacro{\tkz@regangle}{360/\tkz@regpolsides*(\v-1)} - \tkzDefPointBy[rotation= center #1 angle \tkz@regangle](#2) - \pgfnodealias{\tkz@regpolname\v}{tkzPointResult} - } -\endgroup -} -\def\tkzRegPolygonSide(#1,#2){ -\begingroup -% get the center -\pgfmathsetmacro{\tkz@regangle}{360/\tkz@regpolsides*(\tkz@regpolsides-1)} -\pgfmathsetmacro{\tkz@regangleside}{(180-\tkz@regangle)/2} -\tkzDefMidPoint(#1,#2) -\pgfnodealias{tkz@tempPt}{tkzPointResult} -\tkz@@CalcLengthcm(tkz@tempPt,#1){tkz@len} -\pgfmathsetmacro{\tkz@inscriberadius}{% - \tkz@len*tan(90*(\tkz@regpolsides-2)/\tkz@regpolsides)} -\tkzDefPointWith[orthogonal normed,K=\tkz@inscriberadius](tkz@tempPt,#2) -\pgfnodealias{tkz@RegPolCenter}{tkzPointResult} -\tkzRegPolygonCenter(tkz@RegPolCenter,#1) -\pgfnodealias{tkzPointResult}{tkz@RegPolCenter} -\endgroup -} - - -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-protractor.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-protractor.tex deleted file mode 100644 index 6aa6624611..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-protractor.tex +++ /dev/null @@ -1,121 +0,0 @@ -% tkz-obj-eu-protractor.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-protractor.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% !!! 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\FullProtractor{% -\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); -} - -\def\FullProtractorReturn{% -\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); -} - -\pgfkeys{ - protractor/.cd, - 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/.code = \tkz@RappReturnfalse, - /protractor/.search also={/tikz}, - lw = 0.4pt, - scale=1, - shift={(0,0)}, - rotate=0 - } - -\def\tkzProtractor{\pgfutil@ifnextchar[{\tkz@Protractor}{\tkz@Protractor[]}} -\def\tkz@Protractor[#1](#2,#3){% -\tkz@RappReturnfalse -\pgfqkeys{/protractor}{#1} - \tkz@@extractxy{#2} - \global\tkz@ax\pgf@x - \global\tkz@ay\pgf@y - \tkzFindSlopeAngle(#2,#3) - \tkzGetAngle{cmdMO@Rap@rotate}% - \global\let\tkz@@Protractor\FullProtractor% - \iftkz@RappReturn - \global\let\tkz@@Protractor\FullProtractorReturn - \else - \global\let\tkz@@Protractor\FullProtractor - \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} -} -%<--------------------------------------------------------------------------–> -% fin de \tkzProtractor -%<--------------------------------------------------------------------------–> -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-sectors.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-sectors.tex deleted file mode 100644 index a934e87122..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-sectors.tex +++ /dev/null @@ -1,326 +0,0 @@ -% tkz-obj-eu-sectors.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-sectors.tex} -\makeatletter -%<----------------------- Sectors ------------------------------–> -\gdef\tkz@nums{0} -\pgfkeys{/drawsector/.cd, - towards/.code = {\def\tkz@nums{0}}, - rotate/.code = {\def\tkz@nums{1}}, - R/.code = {\def\tkz@nums{2}}, - R with nodes/.code = {\def\tkz@nums{3}}, - towards, - /drawsector/.search also = {/tikz}, -} - -\def\tkzDrawSector{\pgfutil@ifnextchar[{\tkz@DrawSector}{\tkz@DrawSector[]}} -\def\tkz@DrawSector[#1](#2,#3)(#4){% -\begingroup -\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 - \tkz@@CalcLengthcm(#2,#3){tkz@radius} - \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@FirstAngle} - \tkzFindSlopeAngle(#2,#4)\tkzGetAngle{tkz@SecondAngle} - \tkz@DrawSectorRAngles[#1](#2,\tkz@radius)(\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 - \tkz@@CalcLengthcm(#2,#3){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)(\tkz@FirstA,\tkz@SecondA) - \else - \tkz@DrawSectorRAngles[#1](#2,\tkz@radius)(\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 - \tkz@@CalcLengthcm(#2,#3){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 - \tkz@@CalcLengthcm(#3,#4){tkz@radius} - \tkz@DrawSectorRAngles[#1](#2,\tkz@radius pt)(#5,#6) -\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 -%<--------------------------------------------------------------------------–> -\gdef\tkz@nums{0} -\pgfkeys{/@fillsector/.cd, - towards/.code = {\def\tkz@nums{0}}, - rotate/.code = {\def\tkz@nums{1}}, - R/.code = {\def\tkz@nums{2}}, - R with nodes/.code = {\def\tkz@nums{3}}, - towards, - /@fillsector/.search also={/tikz}, -} - -\def\tkzFillSector{\pgfutil@ifnextchar[{\tkz@FillSector}{\tkz@FillSector[]}} -\def\tkz@FillSector[#1](#2,#3)(#4){% -\begingroup -\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}{0} - \edef\tkz@FirstAngle{\pgfmathresult}% - \pgfmathadd{\tkz@SecondAngle}{0} - \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 - \tkz@@CalcLength(#2,#3){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 - \tkz@@CalcLength(#2,#3){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\tkzFillSectorAngles{\pgfutil@ifnextchar[{\tkz@FillSectorAngles}{% - \tkz@FillSectorAngles[]}} -\def\tkz@FillSectorAngles[#1](#2,#3)(#4,#5){% -\begingroup - \tkz@@CalcLength(#2,#3){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 - \tkz@@CalcLength(#1,#2){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 - \tkz@@CalcLength(#1,#2){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 = {\def\tkz@numcs{0}}, - rotate/.code = {\def\tkz@numcs{1}}, - R/.code = {\def\tkz@numcs{2}}, -} -%<--------------------------------------------------------------------------–> -\def\tkzClipSector{\pgfutil@ifnextchar[{\tkz@ClipSector}{% - \tkz@ClipSector[]}} - -\def\tkz@ClipSector[#1](#2,#3)(#4){% -\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 -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-show.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-show.tex deleted file mode 100644 index 3b3a00e745..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-show.tex +++ /dev/null @@ -1,346 +0,0 @@ -%tkz-obj-eu-show.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-show.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% finding specific points in a triangle -%<--------------------------------------------------------------------------–> -% equi points -%<--------------------------------------------------------------------------–> -% draw ? show ? -\pgfkeys{/tkzEquiPt/.cd, - from/.store in = {\tkz@frompoint}, - dist/.store in = {\tkz@equ@dist}, - show/.is if = tkz@equi@show, - dist = 2, - show = false, - /tkzEquiPt/.search also={/tikz} -} - -\def\tkzDefEquiPoints{\pgfutil@ifnextchar[{\tkz@DefEquiPoints}{% - \tkz@DefEquiPoints[]}} -\def\tkz@DefEquiPoints[#1](#2,#3){% -\pgfqkeys{/tkzEquiPt}{#1} -\begingroup - \tkzUProjection(#2,#3)(\tkz@frompoint) - \pgfnodealias{tkzEQpoint}{tkzPointResult} - \tkzVecKNorm[\tkz@equ@dist](tkzEQpoint,#2) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzVecKNorm[-\tkz@equ@dist](tkzEQpoint,#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} - \iftkz@equi@show - \tkzCompass[compass style,#1](\tkz@frompoint,tkzFirstPointResult) - \tkzCompass[compass style,#1](\tkz@frompoint,tkzSecondPointResult) - \fi -\endgroup -} - -%<--------------------------- The SHOW --------------------------------–> -%<--------------------------------------------------------------------------–> -\global\def\tkz@numsh{0} -\pgfkeys{/show/.cd, - mediator/.code = \def\tkz@numsh{0}, - perpendicular/.code args = {through #1} {\global\def\tkz@numsh{1}% - \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, - /tkzcompass/\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) - \pgfnodealias{tkzFirstPointResult}{tkzPointResult} - \tkzURotateAngle(#3,60)(#2) - \pgfnodealias{tkzSecondPointResult}{tkzPointResult} - \tkz@VecKOrthNorm[1](tkzmidpoint,#2) - \pgfnodealias{MED@tmp1}{tkzPointResult} - \tkz@VecKOrthNorm[1](tkzmidpoint,#3) - \pgfnodealias{MED@tmp2}{tkzPointResult} - \tkz@VecKNorm[\tkz@show@gap](tkzmidpoint,MED@tmp1) - \pgfnodealias{MED@1}{tkzPointResult} - \tkz@VecKNorm[\tkz@show@gap](tkzmidpoint,MED@tmp2) - \pgfnodealias{MED@2}{tkzPointResult} - \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#2,MED@1) - \tkzCompass[compass style,#1](#3,MED@1) - \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#2,MED@2) - \tkzCompass[compass style,#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) - \pgfnodealias{tkz@lltmp}{tkzPointResult} - \tkzCompass[compass style,#1](#4,tkz@lltmp) - \tkzCompass[compass style,#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, - size = 1} -\pgfkeys{show/.cd,#1} - \tkzDefPointWith(#2,#3) - \pgfnodealias{tkz@OLtmp}{tkzPointResult} - \tkz@VecKCoLinear[1](#2,tkz@OLtmp,#4) - \pgfnodealias{tkzPointCo}{tkzPointResult} - \tkzInterLL(#2,#3)(#4,tkzPointCo) - \pgfnodealias{tkzPOpoint}{tkzPointResult} - \tkz@@CalcLength(#4,tkzPOpoint){tkz@mathLen} - \tkz@VecKNorm[1](#2,#3) - \pgfnodealias{PO@tmp}{tkzPointResult} - \tkz@VecKCoLinear[1](#2,PO@tmp,tkzPOpoint) - \pgfnodealias{PO@tmp2}{tkzPointResult} - \tkz@VecKCoLinear[-1](#2,PO@tmp,tkzPOpoint) - \pgfnodealias{PO@tmp1}{tkzPointResult} - \tkz@VecKCoLinear[\tkz@show@size](tkzPOpoint,PO@tmp1,tkzPOpoint) - \pgfnodealias{PO@1}{tkzPointResult} - \tkz@VecKCoLinear[\tkz@show@size](tkzPOpoint,PO@tmp2,tkzPOpoint) - \pgfnodealias{PO@2}{tkzPointResult} - \ifdim\tkz@mathLen pt>10 pt\relax - \tkz@VecKNorm[1](#4,tkzPOpoint) - \pgfnodealias{PO@tmp1}{tkzPointResult} - \else - \tkz@VecKOrthNorm[1](tkzPOpoint,PO@2) - \pgfnodealias{PO@tmp1}{tkzPointResult} - \fi - \tkz@VecKCoLinear[-\tkz@show@gap](PO@tmp1,tkzPOpoint,tkzPOpoint) - \pgfnodealias{PO@3}{tkzPointResult} - \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@1) - \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#4,PO@2) - \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](PO@1,PO@3) - \tkzCompass[compass style,#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) - \pgfnodealias{tkz@pt1}{tkzPointResult} - \tkzVecKNorm(#3,#4) - \pgfnodealias{tkz@pt2}{tkzPointResult} - \tkzDefMidPoint(tkz@pt1,tkz@pt2) - \pgfnodealias{tkz@pt3}{tkzPointResult} - \tkzDefEquilateral(tkz@pt2,tkz@pt1) - \pgfnodealias{tkz@pt4}{tkzPointResult} - \tkzDefMidPoint(tkz@pt3,tkz@pt4) - \pgfnodealias{tkz@ptm}{tkzPointResult} - \tkzVecKNorm(#3,tkz@ptm) - \pgfnodealias{tkzBisPoint}{tkzPointResult} - \tkzVecKNorm[\tkz@show@size](#3,#2) - \pgfnodealias{BI@1}{tkzPointResult} - \tkzVecKNorm[\tkz@show@size](#3,#4) - \pgfnodealias{BI@2}{tkzPointResult} - \tkzVecK[\tkz@show@gap](#3,tkzBisPoint) - \pgfnodealias{tkzBisPoint}{tkzPointResult} - \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#3,BI@1) - \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](#3,BI@2) - \tkzCompass[compass style,#1,length=\tkz@show@length](BI@1,tkzBisPoint) - \tkzCompass[compass style,#1,length=\tkz@show@ratio *\tkz@show@length](BI@2,tkzBisPoint) -\endgroup -} -%<--------------------------------------------------------------------------–> -% Transformations Géométriques -%<--------------------------------------------------------------------------–> -%<--------------------------------------------------------------------------–> -% 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, - /tkzcompass/\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} - \pgfinterruptboundingbox -\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 - \endpgfinterruptboundingbox -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkzShowTranslation{\pgfutil@ifnextchar[{\tkz@ShowTranslation}{% - \tkz@ShowTranslation[]}} - -\def\tkz@ShowTranslation[#1](#2,#3)(#4){% -\begingroup -\tkz@VecKCoLinear[1](#2,#3,#4) \pgfnodealias{tkz@lltmp}{tkzPointResult} -\tkzCompass[compass style,#1](#4,tkz@lltmp) -\tkzCompass[compass style,#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) - \pgfnodealias{tkzPointofSym}{tkzPointResult} - \tkz@VecK[2](#4,tkzPointofSym) - \pgfnodealias{tkz@pointtsf}{tkzPointResult} - \tkzCompass[compass style,#1](#2,#4) - \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](#3,#4) - \tkzCompass[compass style,#1](#2,tkz@pointtsf) - \tkzCompass[compass style,#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[compass style,#1](#2,tkz@pointtsf) - \tkzCompass[compass style,#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) - \pgfnodealias{tkz@pointtsf}{tkzPointResult} - \tkz@VecKCoLinear[1](#2,#3,tkz@pointtsf) - \pgfnodealias{SO@tmp1}{tkzPointResult} - \tkz@VecKCoLinear[-1](#2,#3,tkz@pointtsf) - \pgfnodealias{SO@tmp2}{tkzPointResult} - \tkz@VecKNorm[\tkz@show@size](tkz@pointtsf,SO@tmp1) - \pgfnodealias{SO@1}{tkzPointResult} - \tkz@VecKNorm[\tkz@show@size](tkz@pointtsf,SO@tmp2) - \pgfnodealias{SO@2}{tkzPointResult} - \tkz@VecKNorm[-\tkz@show@gap](tkz@pointtsf,#4) - \pgfnodealias{SO@3}{tkzPointResult} - \tkzCompass[compass style,#1](#4,SO@1) - \tkzCompass[compass style,#1](#4,SO@2) - \tkzCompass[compass style,#1](SO@1,SO@3) - \tkzCompass[compass style,#1,length=\tkz@show@ratio*\tkz@show@length](SO@2,SO@3) -\endgroup -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-triangles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-triangles.tex deleted file mode 100644 index 9879bd6768..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-obj-eu-triangles.tex +++ /dev/null @@ -1,500 +0,0 @@ -% tkz-obj-eu-triangles.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-triangles.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% Triangle Equilateral -%<--------------------------------------------------------------------------–> -\def\tkzDefEquilateral(#1,#2){ -\begingroup - %\tkzDefMidPoint(#1,#2) - \tkzURotateAngle(#1,60)(#2) -\endgroup -} -%<--------------------------------------------------------------------------–> -% Triangle Isosceles Right -%<--------------------------------------------------------------------------–> -\def\tkzDefIsoscelesRightTriangle(#1,#2){ -\begingroup - \tkzURotateAngle(#1,45)(#2) - \pgfnodealias{tkz@a}{tkzPointResult} - \tkzUHomo(#1,\tkzSqrTwobyTwo)(tkz@a) -\endgroup -} -%<--------------------------------------------------------------------------–> -\def\tkzDefIsoscelesRightTriangle(#1,#2){% -\begingroup - \tkzURotateAngle(#1,45)(#2) - \pgfnodealias{tkz@a}{tkzPointResult} - \tkzUHomo(#1,\tkzSqrTwobyTwo)(tkz@a) -\endgroup -} -%<--------------------------------------------------------------------------–> -% Triangle OneTwo -%<--------------------------------------------------------------------------–> -\def\tkzDefTwoOne(#1,#2){ -\begingroup - \iftkz@swap@tr - \tkzDefPointWith[K=-.5](#2,#1) - \else - \tkzDefPointWith[K=.5](#2,#1) - \fi - \endgroup -} -%<--------------------------------------------------------------------------– -% Pythagore -%<--------------------------------------------------------------------------– -\def\tkzDefPythagore(#1,#2){ -\begingroup -\iftkz@swap@tr - \tkzDefPointWith[K=-.75](#2,#1) - \else - \tkzDefPointWith[K=.75](#2,#1) - \fi -\endgroup -} -%<--------------------------------------------------------------------------– -% School -%<--------------------------------------------------------------------------– -\def\tkzDefSchoolTriangle(#1,#2){ -\begingroup -\iftkz@swap@tr - \tkzDefPointWith(#2,#1) - \pgfnodealias{tkz@a}{tkzPointResult} - \tkzURotateAngle(#1,-30)(#2) - \tkzInterLL(#1,tkzPointResult)(#2,tkz@a) -\else - \tkzDefPointWith(#2,#1) - \pgfnodealias{tkz@a}{tkzPointResult} - \tkzURotateAngle(#1,30)(#2) - \tkzInterLL(#1,tkzPointResult)(#2,tkz@a) - \fi -\endgroup -} -%<--------------------------------------------------------------------------– -% Gold -%<--------------------------------------------------------------------------– -\def\tkzDefGoldTriangle(#1,#2){ -\begingroup - \iftkz@swap@tr - \tkzDefPointWith[K=-\tkzInvPhi](#2,#1) - \else - \tkzDefPointWith[K=\tkzInvPhi](#2,#1) - \fi -\endgroup -} -%<--------------------------------------------------------------------------– -% -%<--------------------------------------------------------------------------– -\def\tkzDefEuclideTriangle(#1,#2){ -\begingroup - \iftkz@swap@tr - \tkzURotateAngle(#1,36)(#2) - \else - \tkzURotateAngle(#1,-36)(#2) - \fi -\endgroup -} -%<--------------------------------------------------------------------------– -% -%<--------------------------------------------------------------------------– -\def\tkzDefGoldenTriangle(#1,#2){ -\begingroup - \tkzURotateAngle(#1,72)(#2) - \tkzUHomo(#1,\tkzPhi)(tkzPointResult) -\endgroup -} -%<--------------------------------------------------------------------------– -% -%<--------------------------------------------------------------------------– -\def\tkzDefCheopsTriangle(#1,#2){ -\begingroup - \tkzDefMidPoint(#1,#2) - \tkzDefPointWith[K=-\tkzSqrtPhi](tkzPointResult,#1) -\endgroup -} -%<--------------------------------------------------------------------------– -% -%<--------------------------------------------------------------------------– -\def\tkzDefTwoAnglesTriangle(#1,#2){ -\begingroup - \tkzURotateAngle(#1,\tkz@alpha)(#2) - \pgfnodealias{tkz@a}{tkzPointResult} - \tkzURotateAngle(#2,-\tkz@beta)(#1) - \pgfnodealias{tkz@b}{tkzPointResult} - \tkzInterLL(#1,tkz@a)(#2,tkz@b) -\endgroup -} -%<--------------------------------------------------------------------------–> -% Triangles -%<--------------------------------------------------------------------------–> - -\def\tkz@numtr{0} -\pgfkeys{/deftriangle/.cd, - equilateral/.code = \def\tkz@numtr{0}, - half/.code = \def\tkz@numtr{1}, - two one/.code = \def\tkz@numtr{1}, - pythagore/.code = \def\tkz@numtr{2}, - pythagoras/.code = \def\tkz@numtr{2}, - right/.code = \def\tkz@numtr{2}, - egyptian/.code = \def\tkz@numtr{2}, - school/.code = \def\tkz@numtr{3}, - golden/.code = \def\tkz@numtr{4}, - sublime/.code = \def\tkz@numtr{4}, - euclid/.code = \def\tkz@numtr{5}, - euclide/.code = \def\tkz@numtr{5}, - gold/.code = \def\tkz@numtr{6}, - cheops/.code = \def\tkz@numtr{7}, - two angles/.code args = {#1 and #2} { \def\tkz@numtr{8}% - \def\tkz@alpha{#1}% - \def\tkz@beta{#2}}, - isosceles right/.code = \def\tkz@numtr{9}, - swap/.is if = tkz@swap@tr, - swap/.default = true, - swap = false, - equilateral -} - -\def\tkzDefTriangle{\pgfutil@ifnextchar[{\tkz@DefTriangle}{\tkz@DefTriangle[]}} -\def\tkz@DefTriangle[#1](#2,#3){% -\begingroup -\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) - \or% 9 - \tkzDefIsoscelesRightTriangle(#2,#3) - \fi -\endgroup -} -%<--------------------------------------------------------------------------–> -% les triangles sspécifiques -%<--------------------------------------------------------------------------–> - -%<--------------------------------------------------------------------------– -\def\tkz@numtspc{0} -\pgfkeys{/tkzDefSpcTriangle/.cd, - in/.code = \def\tkz@numtspc{0}, - incentral/.code = \def\tkz@numtspc{0}, - ex/.code = \def\tkz@numtspc{1}, - excentral/.code = \def\tkz@numtspc{1}, - extouch/.code = \def\tkz@numtspc{2}, - intouch/.code = \def\tkz@numtspc{3}, - contact/.code = \def\tkz@numtspc{3}, - centroid/.code = \def\tkz@numtspc{4}, - medial/.code = \def\tkz@numtspc{4}, - orthic/.code = \def\tkz@numtspc{5}, - ortho/.code = \def\tkz@numtspc{5}, - feuerbach/.code = \def\tkz@numtspc{6}, - euler/.code = \def\tkz@numtspc{7}, - tangential/.code = \def\tkz@numtspc{8}, - symmedial/.code = \def\tkz@numtspc{9}, - name/.store in = \tkz@pttr@name, - name = {}, - centroid, - } -\def\tkzDefSpcTriangle{\pgfutil@ifnextchar[{\tkz@DefSpcTriangle}{% - \tkz@DefSpcTriangle[]}} -\def\tkz@DefSpcTriangle[#1](#2)#3{% -\begingroup -\pgfqkeys{/tkzDefSpcTriangle}{#1} -\ifcase\tkz@numtspc% - \tkzDefIncentralTriangle(#2){#3} - \or% 1 - \tkzDefExcentralTriangle(#2){#3} - \or% 2 - \tkzDefExtouchTriangle(#2){#3} - \or% 3 - \tkzDefIntouchTriangle(#2){#3} - \or% 4 - \tkzDefCentroidTriangle(#2){#3} - \or% 5 - \tkzDefOrthicTriangle(#2){#3} - \or% 6 - \tkzDefFeuerbachTriangle(#2){#3} - \or% 7 - \tkzDefEulerTriangle(#2){#3} - \or% 8 - \tkzDefTangentialTriangle(#2){#3} - \or% 8 - \tkzDefSymmedialTriangle(#2){#3} - \fi -\endgroup -} - -\pgfkeys{/setuppttr/.is family} -\def\SetUpPTTR#1{\pgfqkeys{/setuppttr}{#1}} -\pgfkeys{/setuppttr/.cd, - name/.store in = \tkz@pttr@name, - name = {} -} -%<--------------------------------------------------------------------------– -% InCentral -%<--------------------------------------------------------------------------– -%<--------------------------------------------------------------------------–> -\def\@DefIncentralTriangle(#1,#2,#3)(#4,#5){% -\def\tkz@tmp{#5}% - \tkz@recuplast(#3) - \tkzDefBisectorLine(#2,#1,\tkz@last) - \tkzInterLL(#2,\tkz@last)(#1,tkzPointResult) - \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} - \ifx\tkz@tmp\tkz@stop\else\@DefIncentralTriangle(#2,#3)(#5)\fi -} - -\def\tkzDefIncentralTriangle{\pgfutil@ifnextchar[{% - \tkz@DefIncentralTriangle}{% - \tkz@DefIncentralTriangle[]}} - -\def\tkz@DefIncentralTriangle[#1](#2)#3{% -\begingroup - \SetUpPTTR{#1} - \pgfinterruptboundingbox - \@DefIncentralTriangle(#2,#2)(#3,\tkz@stop) - \endpgfinterruptboundingbox -\endgroup -} -\let\tkzIncentralTriangle\tkzInExcentralTriangle -%<--------------------------------------------------------------------------– -% ExCentral -%<--------------------------------------------------------------------------– - -%<--------------------------------------------------------------------------–> -\def\@DefExcentralTriangle(#1,#2,#3)(#4,#5){% - \def\tkz@tmp{#5}% - \tkz@recuplast(#3) - \tkzDefExCircle(#2,#1,\tkz@last) - \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} - \ifx\tkz@tmp\tkz@stop\else\@DefExcentralTriangle(#2,#3)(#5)\fi -} - -\def\tkzDefExcentralTriangle{\pgfutil@ifnextchar[{% - \tkz@DefExcentralTriangle}{% - \tkz@DefExcentralTriangle[]}} - -\def\tkz@DefExcentralTriangle[#1](#2)#3{% -\begingroup - \SetUpPTTR{#1} - \@DefExcentralTriangle(#2,#2)(#3,\tkz@stop) -\endgroup -} -\let\tkzExcentralTriangle\tkzDefExcentralTriangle -%<--------------------------------------------------------------------------–> -% Intouch Triangle -%<--------------------------------------------------------------------------–> -\def\@DefIntouchTriangle(#1,#2,#3)(#4,#5){% - \def\tkz@tmp{#5}% - \tkz@recuplast(#3) - \tkzUProjection(#2,\tkz@last)(tkz@pt) - \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} - \ifx\tkz@tmp\tkz@stop\else\@DefIntouchTriangle(#2,#3)(#5)\fi -} - -\def\tkzDefIntouchTriangle{\pgfutil@ifnextchar[{% - \tkz@DefIntouchTriangle}{% - \tkz@DefIntouchTriangle[]}} - -\def\tkz@DefIntouchTriangle[#1](#2)#3{% -\begingroup - \SetUpPTTR{#1} - \tkzInCenter(#2) - \pgfnodealias{tkz@pt}{tkzPointResult} - \@DefIntouchTriangle(#2,#2)(#3,\tkz@stop) -\endgroup -} -\let\tkzDefContactTriangle\tkzDefIntouchTriangle -%<--------------------------------------------------------------------------–> -% Extouch Triangle -%<--------------------------------------------------------------------------–> -\def\tkzDefExtouchTriangle{\pgfutil@ifnextchar[{% - \tkz@DefExtouchTriangle}{% - \tkz@DefExtouchTriangle[]}} - -\def\tkz@DefExtouchTriangle[#1](#2,#3,#4)#5{% -\begingroup - \SetUpPTTR{#1} - \foreach \name [count=\i] in {#5} {% - \global\expandafter\edef\csname tkz@point\i\endcsname{\name} - } - \begingroup - \def\tkz@pttr@name{} - \tkzDefExcentralTriangle(#2,#3,#4){tkz@a,tkz@b,tkz@c} - \endgroup - \tkzUProjection(#3,#4)(tkz@a) - \pgfnodealias{\tkz@pttr@name\csname tkz@point1\endcsname}{tkzPointResult} - \tkzUProjection(#2,#3)(tkz@c) - \pgfnodealias{\tkz@pttr@name\csname tkz@point3\endcsname}{tkzPointResult} - \tkzUProjection(#2,#4)(tkz@b) - \pgfnodealias{\tkz@pttr@name\csname tkz@point2\endcsname}{tkzPointResult} -\endgroup -} -%<--------------------------------------------------------------------------–> -% Feuerbach triangle -%<--------------------------------------------------------------------------–> -\def\tkzDefFeuerbachTriangle{\pgfutil@ifnextchar[{% - \tkz@DefFeuerbachTriangle}{\tkz@DefFeuerbachTriangle[]}} - -\def\tkz@DefFeuerbachTriangle[#1](#2,#3,#4)#5{% -\begingroup - \SetUpPTTR{#1} - \foreach \name [count=\i] in {#5} {% - \global\expandafter\edef\csname tkz@point\i\endcsname{\name} - } - \tkzDefExCircle(#2,#3,#4) \tkzGetPoints{tkz@b}{tkz@hb} - \tkzDefExCircle(#3,#4,#2) \tkzGetPoints{tkz@c}{tkz@hc} - \tkzDefExCircle(#4,#2,#3) \tkzGetPoints{tkz@a}{tkz@ha} - \tkzInterLC[near](#3,tkz@b)(tkz@b,tkz@hb) - \tkzGetFirstPoint{\tkz@pttr@name\csname tkz@point2\endcsname} - \tkzInterLC[near](#4,tkz@c)(tkz@c,tkz@hc) - \tkzGetFirstPoint{\tkz@pttr@name\csname tkz@point3\endcsname} - \tkzInterLC[near](#2,tkz@a)(tkz@a,tkz@ha) - \tkzGetFirstPoint{\tkz@pttr@name\csname tkz@point1\endcsname} -\endgroup -} -%<--------------------------------------------------------------------------–> -% Centroid -%<--------------------------------------------------------------------------–> -% The medial triangle or midpoint triangle of a triangle ABC -\def\@DefCentroidTriangle(#1,#2,#3)(#4,#5){% - \def\tkz@tmp{#5}% - \tkz@recuplast(#3) - \pgfcoordinate{\tkz@pttr@name#4}{% - \pgfpointscale{0.5}{% - \pgfpointadd{\pgfpointanchor{#2}{center}}% - {\pgfpointanchor{\tkz@last}{center}}} - }% - \ifx\tkz@tmp\tkz@stop\else\@DefCentroidTriangle(#2,#3)(#5)\fi - } -\def\tkzDefCentroidTriangle{\pgfutil@ifnextchar[{\tkz@DefCentroidTriangle} - {\tkz@DefCentroidTriangle[]}} -\def\tkz@DefCentroidTriangle[#1](#2)#3{% -\begingroup - \SetUpPTTR{#1} - \@DefCentroidTriangle(#2,#2)(#3,\tkz@stop) -\endgroup -} -\let\tkzDefMedialTriangle\tkzDefCentroidTriangle -\let\tkzDefMidpointTriangle\tkzDefCentroidTriangle -%<--------------------------------------------------------------------------–> -% Orthic Triangle H Ha Hb Hc modif 3.03 -%<--------------------------------------------------------------------------–> -\def\@DefOrthicTriangle(#1,#2,#3)(#4,#5){% - \def\tkz@tmp{#5}% - \tkz@recuplast(#3) - \tkzUProjection(#2,\tkz@last)(#1) - \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} - \ifx\tkz@tmp\tkz@stop\else\@DefOrthicTriangle(#2,#3)(#5)\fi -} - -\def\tkzDefOrthicTriangle{\pgfutil@ifnextchar[{\tkz@DefOrthicTriangle} - {\tkz@DefOrthicTriangle[]}} -\def\tkz@DefOrthicTriangle[#1](#2)#3{% -\begingroup - \SetUpPTTR{#1} - \@DefOrthicTriangle(#2,#2)(#3,\tkz@stop) -\endgroup -} -\let\tkzDefAltitudeTriangle\tkzDefOrthicTriangle - -%<--------------------------------------------------------------------------–> -% The Euler triangle -%<--------------------------------------------------------------------------–> -\def\tkzDefEulerTriangle{\pgfutil@ifnextchar[{% - \tkz@DefEulerTriangle}{\tkz@DefEulerTriangle[]}} -\def\tkz@DefEulerTriangle[#1](#2,#3,#4)#5{% -\begingroup - \SetUpPTTR{#1} - \pgfinterruptboundingbox - \tkzOrthoCenter(#2,#3,#4) - \pgfnodealias{tkz@e}{tkzPointResult} - \tkzDefMidPoint(#2,tkz@e) - \pgfnodealias{tkz@m1}{tkzPointResult} - \tkzDefMidPoint(#3,tkz@e) - \pgfnodealias{tkz@m2}{tkzPointResult} - \tkzDefMidPoint(#4,tkz@e) - \pgfnodealias{tkz@m3}{tkzPointResult} - \endpgfinterruptboundingbox - \foreach \name [count=\i] in {#5} {% - \coordinate (\tkz@pttr@name\name) at (tkz@m\i); - } -\endgroup -} -%<--------------------------------------------------------------------------–> -% TangentialTriangle -%<--------------------------------------------------------------------------–> -\def\tkzDefTangentialTriangle{\pgfutil@ifnextchar[{% - \tkz@DefTangentialTriangle}{\tkz@DefTangentialTriangle[]}} -\def\tkz@DefTangentialTriangle[#1](#2,#3,#4)#5{% -\begingroup - \SetUpPTTR{#1} - \tkzCircumCenter(#2,#3,#4) - \pgfnodealias{tkz@circ}{tkzPointResult} - \tkzDefLine[orthogonal=through #2](tkz@circ,#2) - \pgfnodealias{tkz@pta}{tkzPointResult} - \tkzDefLine[orthogonal=through #3](tkz@circ,#3) - \pgfnodealias{tkz@ptb}{tkzPointResult} - \tkzDefLine[orthogonal=through #4](tkz@circ,#4) - \pgfnodealias{tkz@ptc}{tkzPointResult} - \tkzInterLL(#2,tkz@pta)(#3,tkz@ptb) - \pgfnodealias{tkz@tg3}{tkzPointResult} - \tkzInterLL(#3,tkz@ptb)(#4,tkz@ptc) - \pgfnodealias{tkz@tg1}{tkzPointResult} - \tkzInterLL(#4,tkz@ptc)(#2,tkz@pta) - \pgfnodealias{tkz@tg2}{tkzPointResult} - \foreach \name [count=\i] in {#5} {% - \coordinate (\tkz@pttr@name\name) at (tkz@tg\i); - } -\endgroup -} -%<--------------------------------------------------------------------------– -% tkzDefSymmedianLine -%<--------------------------------------------------------------------------– -\def\@DefSymmedialTriangle(#1,#2,#3)(#4,#5){% - \def\tkz@tmp{#5}% - \tkz@recuplast(#3) - \tkzDefSymmedianLine(#2,#1,\tkz@last) - \tkzInterLL(#2,\tkz@last)(#1,tkzPointResult) - \pgfnodealias{\tkz@pttr@name#4}{tkzPointResult} - \ifx\tkz@tmp\tkz@stop\else\@DefSymmedialTriangle(#2,#3)(#5)\fi -} - -\def\tkzDefSymmedialTriangle{\pgfutil@ifnextchar[{% - \tkz@DefSymmedialTriangle}{% - \tkz@DefSymmedialTriangle[]}} - -\def\tkz@DefSymmedialTriangle[#1](#2)#3{% -\begingroup - \SetUpPTTR{#1} - \pgfinterruptboundingbox - \@DefSymmedialTriangle(#2,#2)(#3,\tkz@stop) - \endpgfinterruptboundingbox -\endgroup -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-BB.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-BB.tex deleted file mode 100644 index 4ac1e79ba9..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-BB.tex +++ /dev/null @@ -1,30 +0,0 @@ -% tkz-tools-eu-BB.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-obj-eu-BB.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -\def\tkzShowBB{\pgfutil@ifnextchar[{\tkz@ShowBB}{\tkz@ShowBB[]}} -\def\tkz@ShowBB[#1]{% - \draw[#1] (current bounding box.south west) rectangle - (current bounding box.north east); -} -%<--------------------------------------------------------------------------–> -\def\tkzClipBB{% -\clip (current bounding box.south west) rectangle - (current bounding box.north east); -} -%<--------------------------------------------------------------------------–> -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-angles.tex deleted file mode 100644 index ddf83dc0fa..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-angles.tex +++ /dev/null @@ -1,73 +0,0 @@ -% tkz-tools-angles.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tools-eu-angles.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -%<--------------------------------------------------------------------------–> -% thanks karu : http://tex.stackexchange.com/questions/151667/tkzgetangle-strange-behavior/196224#196224 -% \tkzGetAngle strange behavior -% defines \tkz@FirstAngle and \tkz@SecondAngle sens trigo -%<--------------------------------------------------------------------------–> - \def\tkzNormalizeAngle(#1,#2){% - \begingroup - \pgfmathparse{#1}\xdef\tkz@FirstAngle{\pgfmathresult}% - \pgfmathparse{#2}\xdef\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} - \xdef\tkz@FirstAngle{\pgfmathresult}% - \fi - \else - \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} - \ifdim\pgfmathresult pt=1 pt\relax% - \pgfmathadd{\tkz@SecondAngle}{360} - \xdef\tkz@SecondAngle{\pgfmathresult}% - \fi - \fi - \endgroup - } -%<--------------------------------------------------------------------------–> -% Angle -% Recherche l'angle formé par #1 et #2 par rapport à l'horizontale -%<--------------------------------------------------------------------------–> -\def\tkzFindSlopeAngle(#1,#2){% -\begingroup - \pgfmathanglebetweenpoints{\pgfpointanchor{#1}{center}}{% - \pgfpointanchor{#2}{center}} - \global\let\tkzAngleResult\pgfmathresult -\endgroup -} -%<--------------------------------------------------------------------------–> -% Angle avec trois nodes -%<--------------------------------------------------------------------------–> -\def\tkzFindAngle(#1,#2,#3){% new code 2016 -\begingroup - \tkzFindSlopeAngle(#2,#1)\tkzGetAngle{tkz@FirstAngle} - \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@SecondAngle} - \tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) - \edef\tkz@Angle{\fpeval{\tkz@SecondAngle-\tkz@FirstAngle}} - \global\let\tkzAngleResult\tkz@Angle -\endgroup -} -%<--------------------------------------------------------------------------–> -% Find angle -%<--------------------------------------------------------------------------–> -\def\tkzGetAngle#1{% - \global\expandafter\edef\csname #1\endcsname{\tkzAngleResult} -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-base.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-base.tex deleted file mode 100644 index 4bc2e5d072..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-base.tex +++ /dev/null @@ -1,89 +0,0 @@ -% tkz-tools-eu-base.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tools-eu-base.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -\global\let\tkz@tmp@xa\tkz@init@xmin% modif 2016 -\global\let\tkz@tmp@xb\tkz@init@xmax% modif 2016 -\global\let\tkz@tmp@ya\tkz@init@ymin% modif 2016 -\global\let\tkz@tmp@yb\tkz@init@ymax% modif 2016 -%<--------------------------------------------------------------------------–> -\pgfkeys{ - /tkzInit/.cd, - xmin/.store in = \tkz@init@xmin, - xmax/.store in = \tkz@init@xmax, - xstep/.store in = \tkz@init@xstep, - ymin/.store in = \tkz@init@ymin, - ymax/.store in = \tkz@init@ymax, - ystep/.store in = \tkz@init@ystep, - NO/.is if = tkz@init@NO, - NO/.default = true, - xmin = 0, - xmax = 10, - xstep = 1, - ymin = 0, - ymax = 10, - ystep = 1, - NO = false - } - -\def\tkzInit{\pgfutil@ifnextchar[{\tkz@Init}{\tkz@Init[]}} -\def\tkz@Init[#1]{% - \pgfqkeys{/tkzInit}{#1} - \ifx\tkzfctloaded\undefined - \else - \tkz@tkzf@fct=0 % only if tkz-fct loaded - \fi - \xdef\tkz@init@xorigine{0} - \xdef\tkz@init@yorigine{0} - \edef\@xsgmin{\fpeval{sign(\tkz@init@xmin)}} - \edef\@xsgmax{\fpeval{sign(\tkz@init@xmax)}} - \edef\@ysgmin{\fpeval{sign(\tkz@init@ymin)}} - \edef\@ysgmax{\fpeval{sign(\tkz@init@ymax)}} - \let\tkz@tmp@xa\tkz@init@xmin %modif 2016 - \let\tkz@tmp@xb\tkz@init@xmax %modif 2016 - \let\tkz@tmp@ya\tkz@init@ymin %modif 2016 - \let\tkz@tmp@yb\tkz@init@ymax %modif 2016 - \tkz@init@NOfalse - \ifx\@xsgmin\@xsgmax \tkz@init@NOtrue \fi - \ifx\@ysgmin\@ysgmax \tkz@init@NOtrue \fi - \iftkz@init@NO% - \ifx\@xsgmin\@xsgmax - \edef\tkz@init@xmax{\fpeval{\tkz@init@xmax-\tkz@init@xmin}} - \edef\tkz@init@xorigine{\tkz@init@xmin} - \edef\tkz@init@xmin{0} - \fi - \ifx\@ysgmin\@ysgmax - \edef\tkz@init@ymax{\fpeval{\tkz@init@ymax-\tkz@init@ymin}} - \edef\tkz@init@yorigine{\tkz@init@ymin} - \edef\tkz@init@ymin{0} - \fi - \fi - \edef\tkz@xa{\fpeval{\tkz@init@xmin/\tkz@init@xstep}} - \edef\tkz@xb{\fpeval{\tkz@init@xmax/\tkz@init@xstep}} - \edef\tkz@ya{\fpeval{\tkz@init@ymin/\tkz@init@ystep}} - \edef\tkz@yb{\fpeval{\tkz@init@ymax/\tkz@init@ystep}} - \tkz@getdecimal{\tkz@init@xstep} % amélioration nb dec et integer - \xdef\tkz@init@xdec{\number\c@pgfmath@countb} - \tkz@getdecimal{\tkz@init@ystep} - \xdef\tkz@init@ydec{\number\c@pgfmath@countb} -}% -\def\tkzAddName{\pgfutil@ifnextchar[{\tkz@AddName}{\tkz@AddName[]}} -\def\tkz@AddName[#1]#2{% -\node[above left,#1] at (\pgf@path@lastx,\pgf@path@lasty){#2}; -}% -%<--------------------------------------------------------------------------–> -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-colors.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-colors.tex deleted file mode 100644 index d0a921c993..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-colors.tex +++ /dev/null @@ -1,57 +0,0 @@ -% tkz-tools-eu-colors -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tools-eu-colors} -\makeatletter - -%<------ Initialisation of the colors with tkzSetUpColors -----------------> -% Première macro SetUpColors %%%%%%%%%%%%%%%%%%%%% -%Possible -\pgfkeys{/tkzsucolor/.is family} -\def\setupcolorkeys#1{% - \pgfkeys{/tkzsucolor,#1}} -\setupcolorkeys{ - background/.estore in = \setupcolor@background, - text/.estore in = \setupcolor@text, - @initial/.style = {background=white,text=black}, - @apply/.code = {\pagecolor{\setupcolor@background}% - \color{\setupcolor@text}% - }, -} -\def\tkzSetUpColors{\pgfutil@ifnextchar[{\tkz@SetUpColors}{\tkz@SetUpColors[]}} -\def\tkz@SetUpColors[#1]{\setupcolorkeys{@initial,#1,@apply}} - -%<------ Initialisation of all colors -----------------> -\pgfkeys{/tkzsupallcol/.cd, - background/.store in = \tkz@suac@bkc, - text/.store in = \tkz@suac@txt, - background = \tkz@backgroundcolor,% see tkz-euclide.cfg - text = \tkz@textcolor% idem - } -\def\tkzSetUpAllColors{\pgfutil@ifnextchar[{\tkz@SetUpAllColors}{% - \tkz@SetUpAllColors[]}} -\def\tkz@SetUpAllColors[#1]{% - \pgfqkeys{/tkzsupallcol}{#1} % now we redine the based colors - \def\tkz@fillcolor{\tkz@suac@bkc} - \def\tkz@mainlinecolor{\tkz@suac@txt} - \def\tkz@textcolor{\tkz@suac@txt} - \def\tkz@otherlinecolor{\tkz@suac@txt!50} - \def\tkz@sua@color{\tkz@suac@txt} - \tkzSetUpAxis[color=\tkz@suac@txt] - \tkzSetUpGrid[color=\tkz@suac@txt] - \pagecolor{\tkz@suac@bkc} - \color{\tkz@suac@txt} -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex deleted file mode 100644 index 4c05e5a3dc..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-intersections.tex +++ /dev/null @@ -1,502 +0,0 @@ -% tkz-tools-intersections.tex -% Copyright 2022 Alain Matthes -% This work may be distributed and/or modified under the -% conditions of the LaTeX Project Public License, either version 1.3 -% of this license or (at your option) any later version. -% The latest version of this license is in -% http://www.latex-project.org/lppl.txt -% and version 1.3 or later is part of all distributions of LaTeX -% version 2005/12/01 or later. -% -% This work has the LPPL maintenance status “maintained”. -% -% The Current Maintainer of this work is Alain Matthes. -% utf8 encoding - -\def\fileversion{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tools-eu-intersections.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% intersection de deux lignes -%<--------------------------------------------------------------------------–> -\def\tkzInterLL(#1,#2)(#3,#4){% méthode avec xfp -\tkz@InterLL(#1,#2)(#3,#4){tkzPointResult} -} - -\def\tkz@InterLL(#1,#2)(#3,#4)#5{% -\path (intersection of #1--#2 and #3--#4) coordinate(#5); -% méthode with tikz -% \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% -% -% \edef\tkz@deltax{\fpeval{(\tkz@ax-\tkz@bx)/(28.45274)}} -% \edef\tkz@deltaxx{\fpeval{(\tkz@cx-\tkz@dx)/(28.45274)}} -% \edef\tkz@deltay{\fpeval{(\tkz@ay-\tkz@by)/(28.45274)}} -% \edef\tkz@deltayy{\fpeval{(\tkz@cy-\tkz@dy)/(28.45274)}} -% \edef\tkz@deltaxy{\fpeval{((\tkz@ax*\tkz@by)-(\tkz@ay*\tkz@bx))/(809.55841)}} -% \edef\tkz@deltaxxyy{\fpeval{((\tkz@cx*\tkz@dy)-(\tkz@cy*\tkz@dx))/(809.55841)}} -% \edef\tkz@div{\fpeval{(\tkz@deltax*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxx)}} -% \edef\tkz@numx{\fpeval{(\tkz@deltaxy*\tkz@deltaxx)-(\tkz@deltax*\tkz@deltaxxyy)}} -% \edef\tkz@numy{\fpeval{(\tkz@deltaxy*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxxyy)}} -% \edef\tkz@xs{\fpeval{round(\tkz@numx/\tkz@div,5)}} -% \edef\tkz@ys{\fpeval{round(\tkz@numy/\tkz@div,5)}} -% \path[coordinate](\tkz@xs,\tkz@ys) coordinate (#5); -} - - -% méthode with coordinates -\def\tkzInterLLxy(#1,#2,#3,#4)(#5,#6,#7,#8){% -%\path (intersection of #1--#2 and #3--#4) coordinate(#5);% -\tkz@ax#1% -\tkz@ay#2% -\tkz@bx#3% -\tkz@by#4% -\tkz@cx#5% -\tkz@cy#6% -\tkz@dx#7% -\tkz@dy#8% -\edef\tkz@deltax{\fpeval{(\tkz@ax-\tkz@bx)/(28.45274)}} -\edef\tkz@deltaxx{\fpeval{(\tkz@cx-\tkz@dx)/(28.45274)}} -\edef\tkz@deltay{\fpeval{(\tkz@ay-\tkz@by)/(28.45274)}} -\edef\tkz@deltayy{\fpeval{(\tkz@cy-\tkz@dy)/(28.45274)}} -\edef\tkz@deltaxy{\fpeval{((\tkz@ax*\tkz@by)-(\tkz@ay*\tkz@bx))/(809.55841)}} -\edef\tkz@deltaxxyy{\fpeval{((\tkz@cx*\tkz@dy)-(\tkz@cy*\tkz@dx))/(809.55841)}} -\edef\tkz@div{\fpeval{(\tkz@deltax*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxx)}} -\edef\tkz@numx{\fpeval{(\tkz@deltaxy*\tkz@deltaxx)-(\tkz@deltax*\tkz@deltaxxyy)}} -\edef\tkz@numy{\fpeval{(\tkz@deltaxy*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxxyy)}} -\edef\tkz@xs{\fpeval{round(\tkz@numx/\tkz@div,5)}} -\edef\tkz@ys{\fpeval{round(\tkz@numy/\tkz@div,5)}} -\path[coordinate](\tkz@xs,\tkz@ys) coordinate (tkzPointResult); -} - -%<--------------------------------------------------------------------------–> -% 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); -% } -%<---------- test ------------------------------------------------------–> -\def\tkzTestInterLC(#1,#2)(#3,#4){% -\begingroup -\tkz@Projection(#1,#2)(#3){tkz@pth}% distance centre à la ligne -\tkz@@CalcLength(#3,tkz@pth){tkz@mathLen}% -\tkz@@CalcLength(#3,#4){tkzLengthResult}%calcul du rayon -\ifdim\tkz@mathLen pt>\tkzLengthResult pt\relax% -\global\tkzFlagLCfalse -\else -\global\tkzFlagLCtrue -\fi -\endgroup -} -%<--------------------------------------------------------------------------–> -\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}, - common/.store in = \tkz@common, - common = {}, - near/.is if = tkz@near, - near/.default = true, - near = false, - next to/.store in = \tkz@nextto, - next to/.initial = {}, - next/.default = {}, - next to = {}, - next to/.value required, - node - } -%<--------------------------------------------------------------------------–> -\def\tkzInterLC{\pgfutil@ifnextchar[{\tkz@InterLC}{\tkz@InterLC[]}} -\def\tkz@InterLC[#1](#2,#3)(#4,#5){% -\begingroup -\pgfqkeys{/linecircle}{#1} - \pgfinterruptboundingbox -\ifcase\tkz@numlc% - % first case 0 - \tkz@@CalcLength(#4,#5){tkzLengthResult} - \tkzInterLCR(#2,#3)(#4,\tkzLengthResult pt){tkzFirstPointResult}% - {tkzSecondPointResult} -\or% 1 - \tkzInterLCR(#2,#3)(#4,#5 cm){tkzFirstPointResult} - {tkzSecondPointResult}% -\or% 2 - \tkzInterLCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}% - {tkzSecondPointResult}% -\fi -\iftkz@near - \tkz@@CalcLength(#2,tkzFirstPointResult){tkzLengthFirst} - \tkz@@CalcLength(#2,tkzSecondPointResult){tkzLengthSecond} - \ifdim \tkzLengthFirst pt < \tkzLengthSecond pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi -\else - \ifx\tkz@common\tkzutil@empty - \ifx\tkz@nextto\tkzutil@empty - \tkzFindAngle(tkzSecondPointResult,tkzFirstPointResult,#4) - \tkzGetAngle{tkz@an} - \ifdim\tkz@an pt<180 pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi - \else - \tkz@@CalcLength(\tkz@nextto,tkzFirstPointResult){tkzLengthFirst} - \tkz@@CalcLength(\tkz@nextto,tkzSecondPointResult){tkzLengthSecond} - \ifdim \tkzLengthFirst pt < \tkzLengthSecond pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi - \fi - \else - \tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen} - \ifdim\tkz@mathLen pt<1pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi - \fi -\fi%near -\endpgfinterruptboundingbox -\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% - \pgfpointborderellipse{\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% - \pgfcoordinate{#6}{\pgfqpoint{\tkz@bx}{\tkz@by}} - \tkzCSym(#3)(#6){#5} - \else - \edef\pgfmathresult{\fpeval{\tkz@mathLen/\tkz@radi}} - % \edef\tkz@angle{\fpeval{acosd(\pgfmathresult)}} - \pgfmathacos@{\pgfmathresult}% - \let\tkz@angle\pgfmathresult% - \pgfpointdiff{\pgfpointanchor{#3}{center}}% - {\pgfpointanchor{tkz@pth}{center}}% - \tkz@ax=\pgf@x% - \tkz@ay=\pgf@y% - \pgfpointborderellipse{\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} - \pgfmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}% - {\pgfpoint{\tkz@ax}{\tkz@ay}}% - {\tkz@angle} - \pgfcoordinate{#5}{\pgfqpoint{\pgf@x}{\pgf@y}} - \pgfmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}% - {\pgfpoint{\tkz@ax}{\tkz@ay}}% - {-\tkz@angle} - \pgfcoordinate{#6}{\pgfqpoint{\pgf@x}{\pgf@y}} - -\fi -\endgroup -} -%<--------------------------------------------------------------------------–> -% intersection de Ligne Cercle -% #4 center #5 point sur le cercle -%<--------------------------------------------------------------------------–> -% \def\tkzInterLC(#1,#2)(#3,#4)#5#6{% -% \begingroup -% \tkz@@CalcLength(#3,#4){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 - \tkz@@CalcLength(#4,#5){tkz@radius} - \tkzInterLCR(#1,#2)(#3,\tkz@radius pt){#6}{#7} -\endgroup -} -%<--------------------------------------------------------------------------–> -% Intersection of 2 circles -%<--------------------------------------------------------------------------–> -%<--------------------------------------------------------------------------–> -% 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; -% } -%<--------------------------------------------------------------------------–> -% Intersection de deux cercles -%<--------------------------------------------------------------------------–> -%<---------- test ------------------------------------------------------–> -% test avec des nodes R-r <= d <= R+r -\def\tkzTestInterCC(#1,#2)(#3,#4){% -\begingroup -\tkz@@CalcLength(#1,#3){tkz@mathLen}% distance entre les centres -\tkz@@CalcLength(#2,#1){tkz@rA}%calcul du rayon -\tkz@@CalcLength(#4,#3){tkz@rB}%calcul du rayon -% test if d <= rA + rB ? -\edef\tkz@rS{\fpeval{\tkz@rA+\tkz@rB}} -\ifdim\tkz@mathLen pt > \tkz@rS pt\relax% -\global\tkzFlagCCfalse -\else -% now test if d>= rA - rB or rB-rA - \ifdim \tkz@rA pt > \tkz@rB pt\relax% - \edef\tkz@rD{\fpeval{\tkz@rA-\tkz@rB}} - \else - \edef\tkz@rD{\fpeval{\tkz@rB-\tkz@rA}} - \fi -\ifdim \tkz@rD pt > \tkz@mathLen pt\relax% - \global\tkzFlagCCfalse -\else -\global\tkzFlagCCtrue -\fi -\fi -\endgroup -} - -\def\tkz@numcc{0} -\pgfkeys{ -/circlecircle/.cd, - node/.code = \def\tkz@numcc{0}, - R/.code = \def\tkz@numcc{1}, - with nodes/.code = \def\tkz@numcc{2}, - common/.store in = \tkz@common, - common = {}, - node -} -%<--------------------------------------------------------------------------–> -\def\tkzInterCC{\pgfutil@ifnextchar[{\tkz@InterCC}{\tkz@InterCC[]}} -\def\tkz@InterCC[#1](#2,#3)(#4,#5){% -\begingroup -\pgfqkeys{/circlecircle}{#1} -\ifcase\tkz@numcc% - % first case 0 - \tkz@save@length - \tkz@@CalcLengthcm(#2,#3){tkz@rayA} - \tkz@@CalcLengthcm(#4,#5){tkz@rayB} - \tkz@restore@length - \tkzInterCCR(#2,\tkz@rayA)(#4,\tkz@rayB){tkzFirstPointResult}{% - tkzSecondPointResult} - \or% 1 - \tkzInterCCR(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}% - \or%2 - \tkzInterCCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult} -\fi - \ifx\tkz@common\tkzutil@empty - \tkzFindAngle(#2,tkzFirstPointResult,#4) \tkzGetAngle{tkz@an} - \ifdim\tkz@an pt<180 pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi - \else -\tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen} - \ifdim\tkz@mathLen pt<0.05pt\relax% - \else - \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} - \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} - \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} - \fi - \fi -\endgroup -} -%<--------------------------------------------------------------------------–> - -\def\tkzInterCCR(#1,#2)(#3,#4)#5#6{% -\begingroup -\pgfinterruptboundingbox -\tkz@save@length -\tkz@@CalcLength(#1,#3){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#2cm % -\tkz@cy#4cm % -\edef\tkz@aa{\fpeval{((\tkz@cx+\tkz@cy)/(2*\tkz@dd))*(\tkz@cx-\tkz@cy)+\tkz@dd/2}} -\edef\tkz@xx{\fpeval{\tkz@ax+\tkz@aa/\tkz@dd*(\tkz@bx - \tkz@ax)}} -\edef\tkz@yy{\fpeval{\tkz@ay+\tkz@aa/\tkz@dd*(\tkz@by - \tkz@ay)}} -\path[coordinate](\tkz@xx pt,\tkz@yy pt) coordinate (tkzRadialCenter); -\edef\tkz@hh{\fpeval{sqrt(abs((\tkz@cx+\tkz@aa)*(\tkz@cx-\tkz@aa)))}}% abs !2022 -\edef\tkz@rx{\fpeval{\tkz@hh / \tkz@dd * (\tkz@ay - \tkz@by)}} -\edef\tkz@ry{\fpeval{\tkz@hh / \tkz@dd * (\tkz@bx - \tkz@ax)}} -\edef\tkz@xs{\fpeval{\tkz@xx + \tkz@rx}} -\edef\tkz@ys{\fpeval{\tkz@yy + \tkz@ry}} -\path[coordinate](\tkz@xs pt,\tkz@ys pt) coordinate (#5); -\edef\tkz@xss{\fpeval{\tkz@xx - \tkz@rx}} -\edef\tkz@yss{\fpeval{\tkz@yy - \tkz@ry}} -\path[coordinate](\tkz@xss pt,\tkz@yss pt) coordinate (#6); -\endpgfinterruptboundingbox -\endgroup -} -%<--------------------------------------------------------------------------–> -% #2 node #3 node #4 node #5 node -% \def\tkzInterCC(#1,#2)(#3,#4)#5#6{% -% \begingroup -% \tkz@@CalcLength(#1,#2){tkz@rayA} -% \tkz@@CalcLength(#3,#4){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 - \tkz@@CalcLengthcm(#2,#3){tkz@rayA} - \tkz@@CalcLengthcm(#5,#6){tkz@rayB} - \tkzInterCCR(#1,\tkz@rayA)(#4,\tkz@rayB){#7}{#8} -\endgroup -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-math.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-math.tex deleted file mode 100644 index 7c11e8be03..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-math.tex +++ /dev/null @@ -1,227 +0,0 @@ -% tkz-tools-eu-math.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tools-eu-math.tex} -\makeatletter -%<--------------------------------------------------------------------------> -% \tkzpointnormalised# -% tkzCalcLength -% \tkzGetLength -% \tkzpttocm -% \tkzcmtopt -% \tkzFindSlope -% option xfp - -% \tkzpointnormalised normalise un point A-->A' tq ||v(OA')=1|| -% équivalent de \pgfpointnormalised avec fp -% example -% \tkzpointnormalised{% -% \pgfpointdiff{\pgfpointanchor{A}{center}} -% {\pgfpointanchor{B}{center}}} - -% or -% \pgf@x=1 cm -% \pgf@y=12 cm -% \tkzpointnormalised{} -%<-------------------------------------------------------------------------- -\def\tkzpointnormalised#1{% -\pgf@process{#1}% -\edef\tkz@den{\fpeval{sqrt((\pgf@x)^2+(\pgf@y)^2)}} -\edef\tkz@coordx{\fpeval{\pgf@x/\tkz@den}} -\edef\tkz@coordx{\fpeval{round(\tkz@coordx,5)}} -\edef\tkz@coordy{\fpeval{\pgf@y/\tkz@den}} -\edef\tkz@coordy{\fpeval{round(\tkz@coordy,5)}} -\pgf@x = \tkz@coordx pt -\pgf@y = \tkz@coordy pt -} -%<--------------------------------------------------------------------------> -% restaure and save length -\def\tkz@save@length{\global\let\tkz@temp@length\tkzLengthResult}% -\def\tkz@restore@length{\global\let\tkzLengthResult\tkz@temp@length }% -%<--------------------------------------------------------------------------> -% \tkzCalcLength Distance entre deux points en pt ou en cm avec xfp -% \veclen mais avec fp -% option cm le résultat est en cm sinon en pt with cm=false -%<--------------------------------------------------------------------------> -\pgfkeys{tkzcalclen/.cd, - cm/.is if = tkzLengthIncm, - cm/.default = true, - cm = true} - -\def\tkzCalcLength{\pgfutil@ifnextchar[{\tkz@CalcLength}{\tkz@CalcLength[]}} -\def\tkz@CalcLength[#1](#2,#3){% -%\pgfkeys{tkzcalclen/.cd, cm = true} -\pgfqkeys{/tkzcalclen}{#1}% -\begingroup -\tkz@@CalcLength(#2,#3){tkzLengthResult} -\iftkzLengthIncm - \pgfmathparse{\tkzLengthResult pt/1cm} - \edef\tkz@xfpMathLen{\fpeval{round(\pgfmathresult,6)}} - \global\let\tkzLengthResult\tkz@xfpMathLen -\fi -\endgroup -}% -\def\tkz@@CalcLength(#1,#2)#3{% -\pgfpointdiff{\pgfpointanchor{#1}{center}}% - {\pgfpointanchor{#2}{center}}% -\edef\tkz@xfpMathLen{\fpeval{sqrt((\pgf@x)^2+(\pgf@y)^2)}} -\edef\tkz@xfpMathLen{\fpeval{round(\tkz@xfpMathLen,6)}} -\global\expandafter\edef\csname #3\endcsname{\tkz@xfpMathLen} -} -\def\tkz@@CalcLengthcm(#1,#2)#3{% -\pgfpointdiff{\pgfpointanchor{#1}{center}}% - {\pgfpointanchor{#2}{center}}% -\edef\tkz@xfpMathLen{\fpeval{sqrt((\pgf@x)^2+(\pgf@y)^2)}} -\edef\tkz@xfpMathLen{\fpeval{round(\tkz@xfpMathLen/28.45274,6)}} -\global\expandafter\edef\csname #3\endcsname{\tkz@xfpMathLen} -} -%<--------------------------------------------------------------------------> -\def\tkzGetLength#1{% -\global\expandafter\edef\csname #1\endcsname{\tkzLengthResult}} -%<--------------------------------------------------------------------------> -% \tkzpttocm passage de pt   cm div par 28.45274 -%<--------------------------------------------------------------------------> -\def\tkzpttocm(#1)#2{% -\begingroup - \pgfmathparse{#1/1cm} - \edef\tkz@mathresult{\fpeval{round(\pgfmathresult,5)}} - \global\let\tkz@mathresult\tkz@mathresult - \global\expandafter\edef\csname #2\endcsname{\tkz@mathresult}% -\endgroup -}% -%<--------------------------------------------------------------------------> -% \tkzcmtopt passage de cm   pt mul par 28.45274 -%<-------------------------------------------------------------------------- -\def\tkzcmtopt(#1)#2{% -\begingroup - \pgfmathparse{#1*1cm} - \edef\tkz@mathresult{\fpeval{round(\pgfmathresult,5)}} - \global\let\tkz@mathresult\tkz@mathresult - \global\expandafter\edef\csname #2\endcsname{\tkz@mathresult}% -\endgroup -}% - -% Schrodinger's cat idea 03/01/20 -\tikzset{xfp/.code={% -\pgfmathdeclarefunction*{veclen}{2}{% -\begingroup% - \pgfmath@x##1pt\relax% - \pgfmath@y##2pt\relax% - \edef\tkz@xfpMathLen{\fpeval{sqrt((\pgf@x)^2+(\pgf@y)^2)}} - \pgfmath@returnone\tkz@xfpMathLen pt% -\endgroup% -}}}% -%<---------------------------------------------------------–> -\def\tkzSwapPoints(#1,#2){ - \pgfnodealias{tkzPointTmp}{#2} - \pgfnodealias{#2}{#1} - \pgfnodealias{#1}{tkzPointTmp}} -%<---------------------------------------------------------–> -\def\tkzPermute(#1,#2,#3){ -\tkzURotateWithNodes(#1,#3,#2)(#3) \tkzGetPoint{tkzpt} -\tkzURotateWithNodes(#1,#2,#3)(#2) \tkzGetPoint{#2} -\tkzSwapPoints(tkzpt,#3)} -%<---------------------------------------------------------–> -\def\tkzDotProduct(#1,#2,#3){% -\begingroup -\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% -\edef\tkz@@dotprod{\fpeval{round(abs((\tkz@bx-\tkz@ax)*(\tkz@cx-\tkz@ax)+(\tkz@by-\tkz@ay)*(\tkz@cy-\tkz@ay))/(28.45274*28.45274),5)}} -\global\let\tkzMathResult\tkz@@dotprod -\endgroup} -%<---------------------------------------------------------–> - \def\tkzGetResult#1{% - \global\expandafter\edef\csname #1\endcsname{\tkzMathResult}} -%<---------------------------------------------------------–> -% #1,#2 and #3 aligned -\def\tkzIsLinear(#1,#2,#3){% -\begingroup -\tkz@@CalcLengthcm(#1,#2){tkz@la} -\tkz@@CalcLengthcm(#1,#3){tkz@lb} -\tkzDotProduct(#1,#2,#3) -\edef\tkzResult{\fpeval{abs((\tkzMathResult)-(\tkz@la)*(\tkz@lb))}} -\ifdim \tkzResult pt < 0.01 pt\relax% -\global\tkzLineartrue -\else -\global\tkzLinearfalse -\fi -\endgroup -} -%<---------------------------------------------------------–> -% syntax : vec(#2,#1) ortho vec(#3,#1) -\def\tkzIsOrtho(#1,#2,#3){% -\begingroup -\tkzDotProduct(#1,#2,#3) -\edef\tkzResult{\fpeval{abs(\tkzMathResult)}} -\ifdim \tkzResult pt < 1 pt\relax% -\global\tkzOrthotrue -\else -\global\tkzOrthofalse -\fi -\endgroup -} -%<---------------------------------------------------------–> -%<---------------------------------------------------------–> -% \tkzPowerCircle(M)(O,A) --> OM^2-OA^2 -\def\tkzPowerCircle(#1)(#2,#3){% -\begingroup -\tkz@@CalcLengthcm(#2,#3){tkz@ra} -\tkz@@CalcLengthcm(#1,#2){tkz@om} -\gdef\tkzMathResult{\fpeval{round(\tkz@om*\tkz@om -\tkz@ra*\tkz@ra,5)}} -\endgroup -} -%<---------------------------------------------------------–> -\def\tkzDefRadicalAxis(#1,#2)(#3,#4){% -\begingroup -\tkz@@CalcLengthcm(#1,#3){tkz@d} -\tkz@@CalcLengthcm(#1,#2){tkz@ra} -\tkz@@CalcLengthcm(#3,#4){tkz@rb} -\edef\tkzMathResult{\fpeval{\tkz@d-(\tkz@ra+\tkz@rb)}} -\edef\tkzMathResultb{\fpeval{abs(\tkz@d-(\tkz@ra+\tkz@rb))}} -\edef\tkzMathResultc{\fpeval{abs(\tkz@d-abs(\tkz@ra-\tkz@rb))}} -\ifdim \tkzMathResultc pt < 0.1 pt\relax% - \tkzURotateAngle(#2,90)(#3) \tkzGetPoint{tkzFirstPointResult} - \tkzURotateAngle(#2,-90)(#3) \tkzGetPoint{tkzSecondPointResult} -\else -\ifdim \tkzMathResultb pt < 0.1 pt\relax% - \tkzURotateAngle(#2,90)(#3) \tkzGetPoint{tkzFirstPointResult} - \tkzURotateAngle(#2,-90)(#3) \tkzGetPoint{tkzSecondPointResult} - \else -\ifdim \tkzMathResult pt > 1 pt\relax% - \tkzURotateAngle(#1,60)(#3) \tkzGetPoint{tkz@aux} - \tkzInterCC(#1,#2)(tkz@aux,#1) \tkzGetPoints{tkz@pta}{tkz@ptb} - \tkzInterCC(#3,#4)(tkz@aux,#1) \tkzGetPoints{tkz@ptc}{tkz@ptd} - \tkzInterLL(tkz@pta,tkz@ptb)(tkz@ptc,tkz@ptd) \tkzGetPoint{tkz@pta} - \tkzUProjection(#1,#3)(tkz@pta) \tkzGetPoint{tkz@ptb} - \pgfnodealias{tkzSecondPointResult}{tkz@ptb} - \pgfnodealias{tkzFirstPointResult}{tkz@pta} -\else -\tkzInterCCR(#1,\tkz@ra)(#3,\tkz@rb){tkzFirstPointResult}{tkzSecondPointResult} -\fi -\fi -\fi -\endgroup -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-modules.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-modules.tex deleted file mode 100644 index 86c9f6947d..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-modules.tex +++ /dev/null @@ -1,67 +0,0 @@ -% tkz-tools-modules -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tools-eu-utilities.tex} -\makeatletter -%<------------- % chargement des modules ----------------------------------> -\def\tkz@obj@all{angles,arcs,compass,defcircles,deflines,defpoints,defpointsby,defpointsrnd,defpointswith,polygons,protractor,sectors,show,triangles}% -\def\tkz@obj@txt{all} -\def\usetkzobj{\pgfutil@ifnextchar[{\use@usetkzobj}{\use@@usetkzobj}}%} -\def\use@usetkzobj[#1]{\use@@usetkzobj{#1}} -\def\use@@usetkzobj#1{% - \def\tkz@list{#1} - \ifx\tkz@obj@txt\tkz@list \edef\tkz@list{\tkz@obj@all}% - \else - \edef\tkz@list{#1}% - \fi - \pgfutil@for\tkz@temp:=\tkz@list\do{% - \expandafter\ifx\csname tkz@library@\tkz@temp @loaded\endcsname\relax% - \expandafter\global\expandafter\let\csname tkz@library@\tkz@temp @loaded\endcsname=\pgfutil@empty% - \expandafter\edef\csname tkz@obj@#1@atcode\endcsname{\the\catcode`\@} - \expandafter\edef\csname tkz@obj@#1@barcode\endcsname{\the\catcode`\|} - \catcode`\@=11 - \catcode`\|=12 - \input tkz-obj-\tkz@temp.tex - \catcode`\@=\csname tkz@obj@#1@atcode\endcsname - \catcode`\|=\csname tkz@obj@#1@barcode\endcsname - \fi% - }% -}% -%<---------------------------------------------------------–> -\def\tkz@tool@all{math-xfp} -\def\tkz@tool@txt{all} - -\def\usetkztool{\pgfutil@ifnextchar[{\use@usetkztool}{\use@@usetkztool}}%} -\def\use@usetkztool[#1]{\use@@usetkztool{#1}} -\def\use@@usetkztool#1{% - \def\tkz@list{#1} - \ifx\tkz@tool@txt\tkz@list \edef\tkz@list{\tkz@tool@all}% - \else - \edef\tkz@list{#1}% - \fi - \pgfutil@for\tkz@temp:=\tkz@list\do{% - \expandafter\ifx\csname tkz@library@\tkz@temp @loaded\endcsname\relax% - \expandafter\global\expandafter\let\csname tkz@library@\tkz@temp @loaded\endcsname=\pgfutil@empty% - \expandafter\edef\csname tkz@tool@#1@atcode\endcsname{\the\catcode`\@} - \expandafter\edef\csname tkz@tool@#1@barcode\endcsname{\the\catcode`\|} - \catcode`\@=11 - \catcode`\|=12 - \input tkz-tools-\tkz@temp.tex - \catcode`\@=\csname tkz@tool@#1@atcode\endcsname - \catcode`\|=\csname tkz@tool@#1@barcode\endcsname - \fi% - }% -}% -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-text.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-text.tex deleted file mode 100644 index 8afaae338e..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-text.tex +++ /dev/null @@ -1,88 +0,0 @@ -% tkz-tools-eu-text.tex -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tools-eu-text.tex} -\makeatletter -%<--------------------------------------------------------------------------–> -% tkzText -%<--------------------------------------------------------------------------–> -\def\tkz@parsenode#1{% -\tkz@getvirg#1,\@nil -\iftkz@node -\else - \tkz@getfromcart#1\@nil -\fi -} -\def\tkz@getvirg#1,#2\@nil{% -\ifx\tkzempty#2\tkzempty% - \tkz@nodetrue -\else - \tkz@nodefalse -\fi -} -\def\tkzText{\pgfutil@ifnextchar[{\tkz@Text}{\tkz@Text[]}} -\def\tkz@Text[#1](#2)#3{% - \begingroup - \tkz@parsenode{#2} - \iftkz@node - \node[#1] at (#2){#3}; - \else - \edef\tkzpt@xa{\fpeval{(\tkz@absc-\tkz@init@xorigine)/\tkz@init@xstep}} - \edef\tkzpt@ya{\fpeval{(\tkz@ord-\tkz@init@yorigine)/\tkz@init@ystep}} - \node[#1] at (\tkzpt@xa,\tkzpt@ya){#3};% - \fi -\endgroup -}% -% %<--------------------------------------------------------------------------–> -% % légende -% %<--------------------------------------------------------------------------–> -\pgfkeys{/tkzlegend/.cd, - line/.is if = tkz@legend@line, - line/.default = true, - line = false, - /tkzlegend/.search also = {/tikz}, -} -\def\tkzLegend{\pgfutil@ifnextchar[{\tkz@Legend}{\tkz@Legend[]}} -\def\tkz@Legend[#1](#2,#3)#4{% -\pgfqkeys{/tkzlegend}{#1} -\begingroup - \c@pgfmath@counta=0 % - \edef\tkzpt@xa{\fpeval{(#2-\tkz@init@xorigine)/\tkz@init@xstep}} - \edef\tkzpt@ya{\fpeval{(#3-\tkz@init@yorigine)/\tkz@init@ystep}} - \node[/tkzlegend/.cd,#1] at (\tkzpt@xa,\tkzpt@ya) {% -\begin{tikzpicture} - \foreach \motif/\size/\col/\mtext in {#4}{% - \iftkz@legend@line - \draw[color = \col, - line width = \size, - style = \motif, - text = \tkz@mainlinecolor]% - (0cm ,\the\c@pgfmath@counta ex)--% - (\tkz@legend@line@len,\the\c@pgfmath@counta ex) - \else - \draw plot[mark size = \size,% - mark = \motif,% - mark options = {color=\col}]% - coordinates{(0 ex,\the\c@pgfmath@counta ex)}% - \fi - node[right=1ex] {\mtext}; - \global\advance\c@pgfmath@counta by 3 % - }% - -\end{tikzpicture}% -};% -\endgroup -} -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-utilities.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-utilities.tex deleted file mode 100644 index 05649512dc..0000000000 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-tools-eu-utilities.tex +++ /dev/null @@ -1,236 +0,0 @@ -% tkz-tools-eu-utilities -% Copyright 2022 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{4.25c} -\def\filedate{2022/09/23} -\typeout{2022/09/23 4.25c tkz-tools-eu-utilities.tex} -\makeatletter -\pgfkeys{/tkzClip/.cd, -space/.store in = {\tkz@CLI@space}, -space = {}} - -\def\tkzClip{\pgfutil@ifnextchar[{\tkz@Clip}{\tkz@Clip[]}} -\def\tkz@Clip[#1]{% - -\pgfqkeys{/tkzClip}{#1} -\ifx\tkzutil@empty\tkz@CLI@space - \clip (\tkz@xa,\tkz@ya) rectangle (\tkz@xb,\tkz@yb); - \else - \edef\tkz@xxa{\fpeval{\tkz@xa-\tkz@CLI@space}} - \edef\tkz@yya{\fpeval{\tkz@ya-\tkz@CLI@space}} - \edef\tkz@xxb{\fpeval{\tkz@xb+\tkz@CLI@space}} % correction bug 2020 - \edef\tkz@yyb{\fpeval{\tkz@yb+\tkz@CLI@space}} - \clip (\tkz@xxa,\tkz@yya) rectangle (\tkz@xxb,\tkz@yyb); -\fi -} - -% for testing results -\def\extractxy#1{% -\pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}} -\pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}} -\typeout{#1 \the\pgf@x,\the\pgf@y} -} -%<-------------- some tools -------------------------------------------------> -\def\tkzutil@empty{} -\def\tkzutil@firstofone#1{#1} -\def\tkzutil@firstoftwo#1#2{#1} -\def\tkzutil@secondoftwo#1#2{#2} -%<--------------------------------------------------------------------------–> -\long\def\tkzutil@ifundefined#1{% - \expandafter\ifx\csname#1\endcsname\relax - \expandafter\tkzutil@firstoftwo - \else - \expandafter\tkzutil@secondoftwo - \fi} -%<--------------------------------------------------------------------------–> -\long\def\iftkznodedefined#1#2#3{% - \tkzutil@ifundefined{pgf@sh@ns@#1}{#3}{#2}% -} -%<--------------------------------------------------------------------------–> -\gdef\tkzActivOff{% - \edef\tkzTwoPtCode{\the\catcode`\:} - \edef\tkzPtExCode{\the\catcode`\!} - \edef\tkzPtVirCode{\the\catcode`\;} - \catcode`\:=12 \catcode`\!=12 \catcode`\;=12 - }% -\gdef\tkzActivOn{% - \catcode`\:=\tkzTwoPtCode\relax - \catcode`\!=\tkzPtExCode\relax - \catcode`\;=\tkzPtVirCode\relax -}% -%<--------------------------------------------------------------------------–> -% Pour savoir le nombre de décimales d'un nombre -% le nombre dans #1 et le résultat dans \c@pgfmath@countb -%<--------------------------------------------------------------------------–> -\newcommand\tkz@getdecimal[1]{\expandafter\@getdecimal#1.\@nil} -\def\@getdecimal#1.#2\@nil{% - \ifx\empty#2\empty - % Si #2 est vide, c'est qu'il n'y avait pas de point - % dans la chaîne initiale - \c@pgfmath@countb0 % - \gdef\tkz@decpart{}% - \else - % sinon c'est la chaîne qui suit le point décimal... - \CountToken{#2}% - % ... y compris le point en trop ajouté par \tkz@getdecimal :-) - \advance\c@pgfmath@countb by-1 % - \@@getdecimal#2\@nil - \fi -} -\def\@@getdecimal#1.\@nil{\gdef\tkz@decpart{#1}} -%<---------------------------------------------------------–> -% code from JCC modifi -\newcommand\CountToken[1]{% - \c@pgfmath@countb0 % - \expandafter\C@untToken#1\@nil -%modifi ajout du expandafter -} -\newcommand\C@untToken{% - \afterassignment\C@untT@ken\let\CurrT@ken= -} -\newcommand\C@untT@ken{% - \ifx\CurrT@ken\@nil \else - \advance\c@pgfmath@countb by1 % - \expandafter\C@untToken - \fi -} -%<---------------------------------------------------------–> -\def\tkz@recuplast(#1,#2){\def\tkz@last{#1}} -\def\tkz@stop{\tkz@stop} -% end code from JCC -%<---------------------------------------------------------–> -% Tools -%<---------------------------------------------------------–> -%<–––––––– code from TeX in Practice ––––––––> -\def\SubStringConditional #1#2{% - TT\fi - \edef\@MainString{#1}% - \edef\@SubStringConditionalTemp{{#1}{#2}}% - \expandafter\@SubStringConditional\@SubStringConditionalTemp -} -\def\@SubStringConditional #1#2{% - \def\@TestSubS ##1#2##2\\{% - \def\@TestTemp{##1}% - }% - \@TestSubS #1#2\\ - \ifx\@MainString\@TestTemp - \tkz@TestSubStringfalse - \else - \tkz@TestSubStringtrue - \fi - \iftkz@TestSubString -} -\def\RecursionMacroEnd #1#2#3{% - #1\relax - \def\@RecursionMacroEndNext{#2}% - \else - \def\@RecursionMacroEndNext{#3}% - \fi - \@RecursionMacroEndNext -} -\def\ReplaceSubStrings #1#2#3#4{% - \def\@ReplaceResult{#1}% - \edef\@ReplaceMain{#2}% - \edef\@ReplaceSub{#3}% - \edef\@ReplaceSubRep{#4}% - \@ReplaceSubStrings -} -\def\@ReplaceSubStrings{% - \RecursionMacroEnd - {\if\SubStringConditional{\@ReplaceMain}{\@ReplaceSub}}% - {\@ReplaceSubStringsDo}{\expandafter\edef\@ReplaceResult{\@ReplaceMain}}% -} -\def\@ReplaceSubStringsDoX{% - \def\@ReplaceSubStringsDoA ##1% -}% -\def\@ReplaceSubStringsDo{% - \expandafter\@ReplaceSubStringsDoX \@ReplaceSub - ##2\@EndReplaceSubStrings{% - \edef\@ReplaceMain{##1\@ReplaceSubRep ##2}% - }% - \expandafter\@ReplaceSubStringsDoA\@ReplaceMain - \@EndReplaceSubStrings - \@ReplaceSubStrings -} -%<---------------------------------------------------------–> -\def\DisabledNumprint{% - \let\tkz@numprint\numprint - \let\numprint\relax - } -\def\EnabledNumprint{\let\numprint\tkz@numprint} -%<---------------------------------------------------------–> -\def\tkzSwapPoints(#1,#2){ - \pgfnodealias{tkzPointTmp}{#2} - \pgfnodealias{#2}{#1} - \pgfnodealias{#1}{tkzPointTmp}} -%<---------------------------------------------------------–> -\def\tkzPermute(#1,#2,#3){ -\tkzURotateWithNodes(#1,#3,#2)(#3) \tkzGetPoint{tkzpt} -\tkzURotateWithNodes(#1,#2,#3)(#2) \tkzGetPoint{#2} -\tkzSwapPoints(tkzpt,#3)} -%<---------------------------------------------------------–> -\def\tkzDotProduct(#1,#2,#3){% -\begingroup -\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% -\edef\tkz@dotprod{\fpeval{round(((\tkz@bx-\tkz@ax)*(\tkz@cx-\tkz@ax)+(\tkz@by-\tkz@ay)*(\tkz@cy-\tkz@ay))/(809.55841),5)}} -\global\let\tkzMathResult\tkz@dotprod -\endgroup} -%<---------------------------------------------------------–> - \def\tkzGetResult#1{% - \global\expandafter\edef\csname #1\endcsname{\tkzMathResult}} -%<---------------------------------------------------------–> -% #1,#2 and #3 aligned -\def\tkzIsLinear(#1,#2,#3){% -\begingroup -\tkz@@CalcLengthcm(#1,#2){tkz@la} -\tkz@@CalcLengthcm(#1,#3){tkz@lb} -\tkzDotProduct(#1,#2,#3) -\edef\tkzMathResult{\fpeval{abs(abs(\tkzMathResult)-(\tkz@la)*(\tkz@lb))}} -\ifdim \tkzMathResult pt < 0.0001 pt\relax% -\global\tkzLineartrue -\else -\global\tkzLinearfalse -\fi -\endgroup -} -%<---------------------------------------------------------–> -% syntax : vec(#2,#1) ortho vec(#3,#1) -\def\tkzIsOrtho(#1,#2,#3){% -\begingroup -\tkzDotProduct(#1,#2,#3) -\edef\tkzMathResult{\fpeval{abs(\tkzMathResult)}} -\ifdim \tkzMathResult pt < 0.0001 pt\relax% -\global\tkzOrthotrue -\else -\global\tkzOrthofalse -\fi -\endgroup -} -%<---------------------------------------------------------–> - \def\tkzHelpGrid{% - \draw[help lines] (current bounding box.south west) grid - (current bounding box.north east); - } - -\makeatother -\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-angles.tex new file mode 100644 index 0000000000..69fd1110ab --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-angles.tex @@ -0,0 +1,102 @@ +% tkz-tools-lua-angles.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-angles.tex} +\makeatletter +\def\tkzmathrotatepointaround#1#2#3{% + \pgf@process{% + \pgf@process{#1}% + \pgf@xc=\pgf@x% + \pgf@yc=\pgf@y% + \pgf@process{#2}% + \pgf@xa\pgf@x% + \pgf@ya\pgf@y% + \pgf@xb\pgf@x% + \pgf@yb\pgf@y% + \pgf@x=\pgf@xc% + \pgf@y=\pgf@yc% + \advance\pgf@x-\pgf@xa% + \advance\pgf@y-\pgf@ya% + \pgfmathsetmacro\angle{#3}% + \edef\sineangle{\tkz@Dec{\tkz@Sin{\tkz@Rad{\angle}}}}% + \edef\cosineangle{\tkz@Dec{\tkz@Cos{\tkz@Rad{\angle}}}}% + \pgf@xa\cosineangle\pgf@x% + \advance\pgf@xa-\sineangle\pgf@y% + \pgf@ya\sineangle\pgf@x% + \advance\pgf@ya\cosineangle\pgf@y% + \pgf@x\pgf@xb% + \pgf@y\pgf@yb% + \advance\pgf@x\pgf@xa% + \advance\pgf@y\pgf@ya% + }% +} + +%<--------------------------------------------------------------------------> +% Angles +%<--------------------------------------------------------------------------> +\def\tkzmathanglebetweenpoints#1#2{ +\pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}}% +\pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}}% +\edef\tkzax{\strip@pt\pgf@x}% +\edef\tkzay{\strip@pt\pgf@y}% +\pgfextractx{\pgf@x}{\pgfpointanchor{#2}{center}}% +\pgfextracty{\pgf@y}{\pgfpointanchor{#2}{center}}% +\edef\tkzbx{\strip@pt\pgf@x}% +\edef\tkzby{\strip@pt\pgf@y}% +\edef\tkz@tmp{\tkz@Angle{\tkzax}{\tkzay}{\tkzbx}{\tkzby}} +\edef\pgfmathresult{\tkz@Dec{\tkz@Round{\tkz@tmp}{2}}} +} +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% thanks karu : http://tex.stackexchange.com/questions/151667/tkzgetangle-strange-behavior/196224#196224 +% \tkzGetAngle strange behavior +% defines \tkz@FirstAngle and \tkz@SecondAngle sens trigo +%<--------------------------------------------------------------------------–> + +\def\tkzNormalizeAngle(#1,#2){% +\directlua{angleA, angleB = normalize(#1,#2) +token.set_macro("tkz@FirstAngle", angleA) +token.set_macro("tkz@SecondAngle", angleB) +}} +%<--------------------------------------------------------------------------–> +% Angle +% Recherche l'angle formé par #1 et #2 par rapport à l'horizontale +%<--------------------------------------------------------------------------–> +\def\tkzFindSlopeAngle(#1,#2){% +\begingroup + \tkzmathanglebetweenpoints{#1}{#2} + \global\let\tkzAngleResult\pgfmathresult +\endgroup +} +%<--------------------------------------------------------------------------–> +% Angle avec trois nodes +%<--------------------------------------------------------------------------–> +\def\tkzFindAngle(#1,#2,#3){% new code 2016 +\begingroup + \tkzFindSlopeAngle(#2,#1)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@SecondAngle} + \tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) + \edef\tkz@Angle{\fpeval{\tkz@SecondAngle-\tkz@FirstAngle}} + \global\let\tkzAngleResult\tkz@Angle +\endgroup +} + +%<--------------------------------------------------------------------------–> +% Find angle +%<--------------------------------------------------------------------------–> +\def\tkzGetAngle#1{% + \global\expandafter\edef\csname #1\endcsname{\tkzAngleResult} +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-base.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-base.tex new file mode 100644 index 0000000000..c31c925187 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-base.tex @@ -0,0 +1,89 @@ +% tkz-tools-lua-base.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-base.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +\global\let\tkz@tmp@xa\tkz@init@xmin% modif 2016 +\global\let\tkz@tmp@xb\tkz@init@xmax% modif 2016 +\global\let\tkz@tmp@ya\tkz@init@ymin% modif 2016 +\global\let\tkz@tmp@yb\tkz@init@ymax% modif 2016 +%<--------------------------------------------------------------------------–> +\pgfkeys{ + /tkzInit/.cd, + xmin/.store in = \tkz@init@xmin, + xmax/.store in = \tkz@init@xmax, + xstep/.store in = \tkz@init@xstep, + ymin/.store in = \tkz@init@ymin, + ymax/.store in = \tkz@init@ymax, + ystep/.store in = \tkz@init@ystep, + NO/.is if = tkz@init@NO, + NO/.default = true, + xmin = 0, + xmax = 10, + xstep = 1, + ymin = 0, + ymax = 10, + ystep = 1, + NO = false + } + +\def\tkzInit{\pgfutil@ifnextchar[{\tkz@Init}{\tkz@Init[]}} +\def\tkz@Init[#1]{% + \pgfqkeys{/tkzInit}{#1} + \ifx\tkzfctloaded\undefined + \else + \tkz@tkzf@fct=0 % only if tkz-fct loaded + \fi + \xdef\tkz@init@xorigine{0} + \xdef\tkz@init@yorigine{0} + \edef\@xsgmin{\fpeval{sign(\tkz@init@xmin)}} + \edef\@xsgmax{\fpeval{sign(\tkz@init@xmax)}} + \edef\@ysgmin{\fpeval{sign(\tkz@init@ymin)}} + \edef\@ysgmax{\fpeval{sign(\tkz@init@ymax)}} + \let\tkz@tmp@xa\tkz@init@xmin %modif 2016 + \let\tkz@tmp@xb\tkz@init@xmax %modif 2016 + \let\tkz@tmp@ya\tkz@init@ymin %modif 2016 + \let\tkz@tmp@yb\tkz@init@ymax %modif 2016 + \tkz@init@NOfalse + \ifx\@xsgmin\@xsgmax \tkz@init@NOtrue \fi + \ifx\@ysgmin\@ysgmax \tkz@init@NOtrue \fi + \iftkz@init@NO% + \ifx\@xsgmin\@xsgmax + \edef\tkz@init@xmax{\tkz@Dec{\tkz@init@xmax-(\tkz@init@xmin)}} + \edef\tkz@init@xorigine{\tkz@init@xmin} + \edef\tkz@init@xmin{0} + \fi + \ifx\@ysgmin\@ysgmax + \edef\tkz@init@ymax{\tkz@Dec{\tkz@init@ymax-(\tkz@init@ymin)}} + \edef\tkz@init@yorigine{\tkz@init@ymin} + \edef\tkz@init@ymin{0} + \fi + \fi + \edef\tkz@xa{\tkz@Dec{\tkz@init@xmin/\tkz@init@xstep}} + \edef\tkz@xb{\tkz@Dec{\tkz@init@xmax/\tkz@init@xstep}} + \edef\tkz@ya{\tkz@Dec{\tkz@init@ymin/\tkz@init@ystep}} + \edef\tkz@yb{\tkz@Dec{\tkz@init@ymax/\tkz@init@ystep}} + \tkz@getdecimal{\tkz@init@xstep} % amélioration nb dec et integer + \xdef\tkz@init@xdec{\number\c@pgfmath@countb} + \tkz@getdecimal{\tkz@init@ystep} + \xdef\tkz@init@ydec{\number\c@pgfmath@countb} +}% +\def\tkzAddName{\pgfutil@ifnextchar[{\tkz@AddName}{\tkz@AddName[]}} +\def\tkz@AddName[#1]#2{% +\node[above left,#1] at (\pgf@path@lastx,\pgf@path@lasty){#2}; +}% +%<--------------------------------------------------------------------------–> +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-intersections.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-intersections.tex new file mode 100644 index 0000000000..050697a1bb --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-intersections.tex @@ -0,0 +1,525 @@ +% tkz-tools-lua-intersections.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. +% utf8 encoding + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-tools-lua-intersections.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% intersection de deux lignes +%<--------------------------------------------------------------------------–> +\def\tkzInterLL(#1,#2)(#3,#4){% méthode avec xfp +\tkz@InterLL(#1,#2)(#3,#4){tkzPointResult} +} + +\def\tkz@InterLL(#1,#2)(#3,#4)#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% +\edef\tkzax{\strip@pt\tkz@ax}% +\edef\tkzay{\strip@pt\tkz@ay}% +\edef\tkzbx{\strip@pt\tkz@bx}% +\edef\tkzby{\strip@pt\tkz@by}% +\edef\tkzcx{\strip@pt\tkz@cx}% +\edef\tkzcy{\strip@pt\tkz@cy}% +\edef\tkzdx{\strip@pt\tkz@dx}% +\edef\tkzdy{\strip@pt\tkz@dy}% +\edef\tkz@deltax{\tkz@Dec{(\tkzax-(\tkzbx))/(28.45274)}} +\edef\tkz@deltaxx{\tkz@Dec{(\tkzcx-(\tkzdx))/(28.45274)}} +\edef\tkz@deltay{\tkz@Dec{(\tkzay-(\tkzby))/(28.45274)}} +\edef\tkz@deltayy{\tkz@Dec{(\tkzcy-(\tkzdy))/(28.45274)}} +\edef\tkz@deltaxy{\tkz@Dec{((\tkzax*\tkzby)-(\tkzay*\tkzbx))/(809.55841)}} +\edef\tkz@deltaxxyy{\tkz@Dec{((\tkzcx*\tkzdy)-(\tkzcy*\tkzdx))/(809.55841)}} +\edef\tkz@div{\tkz@Dec{(\tkz@deltax*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxx)}} +\edef\tkz@numx{\tkz@Dec{(\tkz@deltaxy*\tkz@deltaxx)-(\tkz@deltax*\tkz@deltaxxyy)}} +\edef\tkz@numy{\tkz@Dec{(\tkz@deltaxy*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxxyy)}} +\edef\tkz@xs{\tkz@Dec{\tkz@numx/\tkz@div}} +\edef\tkz@ys{\tkz@Dec{\tkz@numy/\tkz@div}} +\edef\tkz@xs{\tkz@Round{\tkz@xs}{5}} +\edef\tkz@ys{\tkz@Round{\tkz@ys}{5}} +\path[coordinate](\tkz@xs,\tkz@ys) coordinate (#5); +} + + +% méthode with coordinates +\def\tkzInterLLxy(#1,#2,#3,#4)(#5,#6,#7,#8){% +%\path (intersection of #1--#2 and #3--#4) coordinate(#5);% +\tkz@ax#1% +\tkz@ay#2% +\tkz@bx#3% +\tkz@by#4% +\tkz@cx#5% +\tkz@cy#6% +\tkz@dx#7% +\tkz@dy#8% +\edef\tkzax{\strip@pt\tkz@ax}% +\edef\tkzay{\strip@pt\tkz@ay}% +\edef\tkzbx{\strip@pt\tkz@bx}% +\edef\tkzby{\strip@pt\tkz@by}% +\edef\tkzcx{\strip@pt\tkz@cx}% +\edef\tkzcy{\strip@pt\tkz@cy}% +\edef\tkzdx{\strip@pt\tkz@dx}% +\edef\tkzdy{\strip@pt\tkz@dy}% +\edef\tkz@deltax{\tkz@Dec{(\tkzax-(\tkzbx))/(28.45274)}} +\edef\tkz@deltaxx{\tkz@Dec{(\tkzcx-(\tkzdx))/(28.45274)}} +\edef\tkz@deltay{\tkz@Dec{(\tkzay-(\tkzby))/(28.45274)}} +\edef\tkz@deltayy{\tkz@Dec{(\tkzcy-(\tkzdy))/(28.45274)}} +\edef\tkz@deltaxy{\tkz@Dec{((\tkzax*\tkzby)-(\tkzay*\tkzbx))/(809.55841)}} +\edef\tkz@deltaxxyy{\tkz@Dec{((\tkzcx*\tkzdy)-(\tkzcy*\tkzdx))/(809.55841)}} +\edef\tkz@div{\tkz@Dec{(\tkz@deltax*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxx)}} +\edef\tkz@numx{\tkz@Dec{(\tkz@deltaxy*\tkz@deltaxx)-(\tkz@deltax*\tkz@deltaxxyy)}} +\edef\tkz@numy{\tkz@Dec{(\tkz@deltaxy*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxxyy)}} +\edef\tkz@xs{\tkz@Dec{\tkz@numx/\tkz@div}} +\edef\tkz@ys{\tkz@Dec{\tkz@numy/\tkz@div}} +\edef\tkz@xs{\tkz@Round{\tkz@xs}{5}} +\edef\tkz@ys{\tkz@Round{\tkz@ys}{5}} +\path[coordinate](\tkz@xs,\tkz@ys) coordinate (tkzPointResult); +} + +%<--------------------------------------------------------------------------–> +% 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); +% } +%<---------- test ------------------------------------------------------–> +\def\tkzTestInterLC(#1,#2)(#3,#4){% +\begingroup +\tkz@Projection(#1,#2)(#3){tkz@pth}% distance centre à la ligne +\tkz@@CalcLength(#3,tkz@pth){tkz@mathLen}% +\tkz@@CalcLength(#3,#4){tkzLengthResult}%calcul du rayon +\ifdim\tkz@mathLen pt>\tkzLengthResult pt\relax% +\global\tkzFlagLCfalse +\else +\global\tkzFlagLCtrue +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +\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}, + common/.store in = \tkz@common, + common = {}, + near/.is if = tkz@near, + near/.default = true, + near = false, + next to/.store in = \tkz@nextto, + next to/.initial = {}, + next/.default = {}, + next to = {}, + next to/.value required, + node + } +%<--------------------------------------------------------------------------–> +\def\tkzInterLC{\pgfutil@ifnextchar[{\tkz@InterLC}{\tkz@InterLC[]}} +\def\tkz@InterLC[#1](#2,#3)(#4,#5){% +\begingroup +\pgfqkeys{/linecircle}{#1} + \pgfinterruptboundingbox +\ifcase\tkz@numlc% + % first case 0 + \tkz@@CalcLength(#4,#5){tkzLengthResult} + \tkzInterLCR(#2,#3)(#4,\tkzLengthResult pt){tkzFirstPointResult}% + {tkzSecondPointResult} +\or% 1 + \tkzInterLCR(#2,#3)(#4,#5 cm){tkzFirstPointResult} + {tkzSecondPointResult}% +\or% 2 + \tkzInterLCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}% + {tkzSecondPointResult}% +\fi +\iftkz@near + \tkz@@CalcLength(#2,tkzFirstPointResult){tkzLengthFirst} + \tkz@@CalcLength(#2,tkzSecondPointResult){tkzLengthSecond} + \ifdim \tkzLengthFirst pt < \tkzLengthSecond pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi +\else + \ifx\tkz@common\tkzutil@empty + \ifx\tkz@nextto\tkzutil@empty + \tkzFindAngle(tkzSecondPointResult,tkzFirstPointResult,#4) + \tkzGetAngle{tkz@an} + \ifdim\tkz@an pt<180 pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \else + \tkz@@CalcLength(\tkz@nextto,tkzFirstPointResult){tkzLengthFirst} + \tkz@@CalcLength(\tkz@nextto,tkzSecondPointResult){tkzLengthSecond} + \ifdim \tkzLengthFirst pt < \tkzLengthSecond pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \fi + \else + \tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen} + \ifdim\tkz@mathLen pt<1pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \fi +\fi%near +\endpgfinterruptboundingbox +\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% + \pgfpointborderellipse{\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% + \pgfcoordinate{#6}{\pgfqpoint{\tkz@bx}{\tkz@by}} + \tkzCSym(#3)(#6){#5} + \else + \edef\pgfmathresult{\fpeval{\tkz@mathLen/\tkz@radi}} + % \edef\tkz@angle{\fpeval{acosd(\pgfmathresult)}} + \pgfmathacos@{\pgfmathresult}% + \let\tkz@angle\pgfmathresult% + \pgfpointdiff{\pgfpointanchor{#3}{center}}% + {\pgfpointanchor{tkz@pth}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% + \pgfpointborderellipse{\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} + \pgfmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}% + {\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\tkz@angle} + \pgfcoordinate{#5}{\pgfqpoint{\pgf@x}{\pgf@y}} + \pgfmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}% + {\pgfpoint{\tkz@ax}{\tkz@ay}}% + {-\tkz@angle} + \pgfcoordinate{#6}{\pgfqpoint{\pgf@x}{\pgf@y}} + +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% intersection de Ligne Cercle +% #4 center #5 point sur le cercle +%<--------------------------------------------------------------------------–> +% \def\tkzInterLC(#1,#2)(#3,#4)#5#6{% +% \begingroup +% \tkz@@CalcLength(#3,#4){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 + \tkz@@CalcLength(#4,#5){tkz@radius} + \tkzInterLCR(#1,#2)(#3,\tkz@radius pt){#6}{#7} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Intersection of 2 circles +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% 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; +% } +%<--------------------------------------------------------------------------–> +% Intersection de deux cercles +%<--------------------------------------------------------------------------–> +%<---------- test ------------------------------------------------------–> +% test avec des nodes R-r <= d <= R+r +\def\tkzTestInterCC(#1,#2)(#3,#4){% +\begingroup +\tkz@@CalcLength(#1,#3){tkz@mathLen}% distance entre les centres +\tkz@@CalcLength(#2,#1){tkz@rA}%calcul du rayon +\tkz@@CalcLength(#4,#3){tkz@rB}%calcul du rayon +% test if d <= rA + rB ? +\edef\tkz@rS{\fpeval{\tkz@rA+\tkz@rB}} +\ifdim\tkz@mathLen pt > \tkz@rS pt\relax% +\global\tkzFlagCCfalse +\else +% now test if d>= rA - rB or rB-rA + \ifdim \tkz@rA pt > \tkz@rB pt\relax% + \edef\tkz@rD{\fpeval{\tkz@rA-\tkz@rB}} + \else + \edef\tkz@rD{\fpeval{\tkz@rB-\tkz@rA}} + \fi +\ifdim \tkz@rD pt > \tkz@mathLen pt\relax% + \global\tkzFlagCCfalse +\else +\global\tkzFlagCCtrue +\fi +\fi +\endgroup +} + +\def\tkz@numcc{0} +\pgfkeys{ +/circlecircle/.cd, + node/.code = \def\tkz@numcc{0}, + R/.code = \def\tkz@numcc{1}, + with nodes/.code = \def\tkz@numcc{2}, + common/.store in = \tkz@common, + common = {}, + node +} +%<--------------------------------------------------------------------------–> +\def\tkzInterCC{\pgfutil@ifnextchar[{\tkz@InterCC}{\tkz@InterCC[]}} +\def\tkz@InterCC[#1](#2,#3)(#4,#5){% +\begingroup +\pgfqkeys{/circlecircle}{#1} +\ifcase\tkz@numcc% + % first case 0 + \tkz@save@length + \tkz@@CalcLengthcm(#2,#3){tkz@rayA} + \tkz@@CalcLengthcm(#4,#5){tkz@rayB} + \tkz@restore@length +\tkzInterCCR(#2,\tkz@rayA)(#4,\tkz@rayB){tkzFirstPointResult}{tkzSecondPointResult} + \or% 1 + \tkzInterCCR(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}% + \or%2 + \tkzInterCCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult} +\fi + \ifx\tkz@common\tkzutil@empty + \tkzFindAngle(#2,tkzFirstPointResult,#4) \tkzGetAngle{tkz@an} + \ifdim\tkz@an pt<180 pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \else +\tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen} + \ifdim\tkz@mathLen pt<0.05pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> + +\def\tkzInterCCR(#1,#2)(#3,#4)#5#6{% +\begingroup +\pgfinterruptboundingbox +\tkz@save@length +\tkz@@CalcLength(#1,#3){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 % +\edef\tkzcax{\strip@pt\tkz@ax}% +\edef\tkzcay{\strip@pt\tkz@ay}% +\pgfextractx{\pgf@x}{\pgfpointanchor{#3}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#3}{center}} +\tkz@bx\pgf@x % +\tkz@by\pgf@y % +\edef\tkzcbx{\strip@pt\tkz@bx}% +\edef\tkzcby{\strip@pt\tkz@by}% +\tkz@cx#2cm % +\tkz@cy#4cm % +\edef\tkzccx{\strip@pt\tkz@cx}% +\edef\tkzccy{\strip@pt\tkz@cy}% +\edef\tkz@aa{\tkz@Dec{((\tkzccx+\tkzccy)/(2*\tkz@dd))*(\tkzccx-(\tkzccy))+\tkz@dd/2}} +\edef\tkz@xx{\tkz@Dec{\tkzcax+\tkz@aa/\tkz@dd*(\tkzcbx - (\tkzcax))}} +\edef\tkz@yy{\tkz@Dec{\tkzcay+\tkz@aa/\tkz@dd*(\tkzcby - (\tkzcay))}} +\path[coordinate](\tkz@xx pt,\tkz@yy pt) coordinate (tkzRadialCenter); +\edef\tkz@hh{\tkz@Abs{(\tkzccx+\tkz@aa)*(\tkzccx-(\tkz@aa))}} +\edef\tkz@hh{\tkz@Dec{\tkz@Sqrt{\tkz@hh}}} + \edef\tkz@rx{\tkz@Dec{\tkz@hh / \tkz@dd * (\tkzcay - (\tkzcby))}} +\edef\tkz@ry{\tkz@Dec{\tkz@hh / \tkz@dd * (\tkzcbx - (\tkzcax))}} +\edef\tkz@xs{\tkz@Dec{\tkz@xx + \tkz@rx}} +\edef\tkz@ys{\tkz@Dec{\tkz@yy + \tkz@ry}} +\path[coordinate](\tkz@xs pt,\tkz@ys pt) coordinate (#5); +\edef\tkz@xss{\tkz@Dec{\tkz@xx - \tkz@rx}} +\edef\tkz@yss{\tkz@Dec{\tkz@yy - \tkz@ry}} +\path[coordinate](\tkz@xss pt,\tkz@yss pt) coordinate (#6); +\endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% #2 node #3 node #4 node #5 node +% \def\tkzInterCC(#1,#2)(#3,#4)#5#6{% +% \begingroup +% \tkz@@CalcLength(#1,#2){tkz@rayA} +% \tkz@@CalcLength(#3,#4){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 + \tkz@@CalcLengthcm(#2,#3){tkz@rayA} + \tkz@@CalcLengthcm(#5,#6){tkz@rayB} + \tkzInterCCR(#1,\tkz@rayA)(#4,\tkz@rayB){#7}{#8} +\endgroup +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-math.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-math.tex new file mode 100644 index 0000000000..1a0491d599 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-math.tex @@ -0,0 +1,417 @@ +% tkz-tools-lua-math.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-math.tex} +\makeatletter +%<--------------------------------------------------------------------------> +%<--------------------------------------------------------------------------> +% Lengths +%<--------------------------------------------------------------------------> +%<--------------------------------------------------------------------------> +\begin{luacode*} +complex = {} -- global complex numbers registry +M = {} -- the module +local mt = {} --metatable for complex numbers +setmetatable(_ENV, {__index = complex}) + function new (r, i) + local cp = {} + cp = {r=r, i=i} + return setmetatable(cp,mt) + end + M.new = new -- add 'new' to the module + -- create constant 'i' + M.i = new(0, 1) + + function M.add (c1, c2) + return new(c1.r + c2.r, c1.i + c2.i) + end + + function M.sub (c1, c2) + return new(c1.r - c2.r, c1.i - c2.i) + end + + function M.mul (c1, c2) + return new(c1.r*c2.r - c1.i*c2.i, c1.r*c2.i + c1.i*c2.r) + end + + function M.inv (c) + local n = c.r^2 + c.i^2 + return new(c.r/n, -c.i/n) + end + + function M.div (c1, c2) + return M.mul(c1, M.inv(c2)) + end + + function M.re (c) + return new(c.r,0) + end + + function M.im (c) + return new(c.i,0) + end + + function M.mod (c) + local n = c.r^2 + c.i^2 + return new(n,0) + end + + function M.prinarg(c) + local arg + if c.r > 0 then + arg = math.atan(c.i/c.r) + elseif c.r < 0 and c.i >= 0 then + arg = math.atan(c.i/c.r) + math.pi + elseif c.r < 0 and c.i < 0 then + arg = math.atan(c.i/c.r) - math.pi + elseif c.r == 0 and c.i > 0 then + arg = math.pi / 2 + elseif c.r == 0 and c.i < 0 then + arg = - math.pi / 2 + else + error("Principal argument not defined.") + end + return arg + end + + function M.op (...) + return ... + end + + function M.tostring (c) + if c.i ==0 then + return string.format("%g", c.r) + elseif c.i> 0 and c.i==1 then + return string.format("%g+i", c.r) + elseif c.i> 0 and c.i~=1 then + return string.format("%g+%gi", c.r, c.i) + else + return string.format("%g%gi", c.r, c.i) --to avoid +- + end + end + + --Setting Metatable operations. + mt.__add = M.add + mt.__mul = M.mul + mt.__sub = M.sub + mt.__tostring = M.tostring +\end{luacode*} + + + +\begin{luacode*} + function normalize(angleA,angleB) + if angleA > 0 then + if angleA > angleB then + angleA = angleA - 360 + end + else + if angleA > angleB then + angleB = angleB + 360 + end + end + return angleA, angleB + end + + function math.angle(x1, y1, x2, y2) + local a = math.deg(math.atan(y2 - y1, x2 - x1)) + if a < 0 then + return a + 360 + else + return a + end + end + + function tkzop(...) + inf = math.huge + return ... +end + +function tkzround(nb, ND) + local p = 10^(ND or 0) + return math.floor(nb * p + 0.5) / p +end +\end{luacode*} + +\newcommand\cpxNew[2]{% +\directlua{complex[\luastringN{#1}] = M.new(#2)}} +\newcommand\cpxPrint[1]{% +\directlua{tex.sprint(tostring(complex[\luastringN{#1}]))}} +\newcommand\cpxAdd[3]{% +\directlua{complex[\luastringN{#1}]% + =M.add(complex[\luastringN{#2}],complex[\luastringN{#3}])}} + + +\def\tkz@Dec#1{% + \directlua{tex.print(string.format('\@percentchar.6f',#1))} + } +\def\tkz@Op#1{\directlua{tex.sprint(tostring(tkzop(#1)))}} +\def\tkz@Log#1{\directlua{tex.sprint(math.log(#1))}} +\def\tkz@Exp#1{\directlua{tex.sprint(math.exp(#1))}} +\def\tkz@Sqrt#1{\directlua{tex.sprint(math.sqrt(#1))}} +\def\tkz@Abs#1{\directlua{tex.sprint(math.abs(#1))}} +\def\tkz@Pi{\directlua{tex.sprint(math.pi)}} +\def\tkz@Cos#1{\directlua{tex.sprint(math.cos(#1))}} +\def\tkz@Sin#1{\directlua{tex.sprint(tostring(math.sin(#1)))}} +\def\tkz@Tan#1{\directlua{tex.sprint(math.tan(#1))}} +\def\tkz@Rad#1{\directlua{tex.sprint(math.rad(#1))}} +\def\tkz@Acos#1{\directlua{tex.sprint(math.acos(#1))}} +\def\tkz@Asin#1{\directlua{tex.sprint(math.asin(#1))}} +\def\tkz@Atan#1{\directlua{tex.sprint(math.atan(#1))}} +\def\tkz@Round#1#2{\directlua{tex.sprint(tostring(tkzround(#1,#2)))}} +\def\tkz@Angle#1#2#3#4{\directlua{tex.sprint(math.angle(#1,#2,#3,#4))}} +\def\tkz@Ceil#1{\directlua{tex.sprint(math.ceil(#1))}} +\def\tkz@Floor#1{\directlua{tex.sprint(math.floor(#1))}} +\def\tkz@Huge{\directlua{tex.sprint(math.huge)}} +\def\tkz@Max#1{\directlua{tex.sprint(math.max(#1))}} +\def\tkz@Min#1{\directlua{tex.sprint(math.min(#1))}} +\def\tkz@Random#1{\directlua{tex.sprint(math.random(#1))}} +\def\tkz@veclen#1#2{% + \directlua{% + tex.print(string.format('\@percentchar.6f',math.sqrt((#1)^2+(#2)^2)))% + }% +} +\let\tkzSqrt\tkz@Sqrt +\let\tkzPi\tkz@Pi +\let\tkzExp\tkz@Exp +\let\tkzLog\tkz@Log +\let\tkzSin\tkz@Sin +\let\tkzCos\tkz@Cos +% \tkzpointnormalised# +% tkzCalcLength +% \tkzGetLength +% \tkzpttocm +% \tkzcmtopt +% \tkzFindSlope +% option xfp + +% \tkzpointnormalised normalise un point A-->A' tq ||v(OA')=1|| +% équivalent de \pgfpointnormalised avec fp +% example +% \tkzpointnormalised{% +% \pgfpointdiff{\pgfpointanchor{A}{center}} +% {\pgfpointanchor{B}{center}}} + +% or +% \pgf@x=1 cm +% \pgf@y=12 cm +% \tkzpointnormalised{} +%<-------------------------------------------------------------------------- +\def\tkzpointnormalised#1{% +\pgf@process{#1}% +\pgf@xa=\pgf@x% +\pgf@ya=\pgf@y% +\edef\tkz@temp@xa{\strip@pt\pgf@xa}% +\edef\tkz@temp@ya{\strip@pt\pgf@ya}% +\edef\tkz@den{\tkz@veclen{\tkz@temp@xa}{\tkz@temp@ya}} +\edef\tkz@coordx{\tkz@Op{\tkz@temp@xa/\tkz@den}} +\edef\tkz@coordx{\tkz@Dec{\tkz@Round{\tkz@coordx}{5}}} +\edef\tkz@coordy{\tkz@Op{\tkz@temp@ya/\tkz@den}} +\edef\tkz@coordy{\tkz@Dec{\tkz@Round{\tkz@coordy}{5}}} +\pgf@x = \tkz@coordx pt +\pgf@y = \tkz@coordy pt +} +%\def\tkz@Dec#1{\directlua{tex.print(string.format('\@percentchar.12f',#1))}} +%<--------------------------------------------------------------------------> +% restaure and save length +\def\tkz@save@length{\global\let\tkz@temp@length\tkzLengthResult}% +\def\tkz@restore@length{\global\let\tkzLengthResult\tkz@temp@length }% +%<--------------------------------------------------------------------------> +% \tkzCalcLength Distance entre deux points en pt ou en cm avec xfp +% \veclen mais avec fp +% option cm le résultat est en cm sinon en pt with cm=false +%<--------------------------------------------------------------------------> +\pgfkeys{tkzcalclen/.cd, + cm/.is if = tkzLengthIncm, + cm/.default = true, + cm = true} + +\def\tkzCalcLength{\pgfutil@ifnextchar[{\tkz@CalcLength}{\tkz@CalcLength[]}} +\def\tkz@CalcLength[#1](#2,#3){% +\pgfqkeys{/tkzcalclen}{#1}% +\begingroup +\tkz@@CalcLength(#2,#3){tkzLengthResult} +\iftkzLengthIncm + \edef\tkz@xfpMathLen{\tkz@Dec{\tkz@Round{\tkzLengthResult/28.45274}{6}}} + \global\let\tkzLengthResult\tkz@xfpMathLen +\fi +\endgroup +}% + +\def\tkz@@CalcLength(#1,#2)#3{% +\pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% +\edef\tkz@xa{\strip@pt\pgf@x}% +\edef\tkz@ya{\strip@pt\pgf@y}% +\edef\tkz@xfpMathLen{\tkz@veclen{\tkz@xa}{\tkz@ya}} +\global\expandafter\edef\csname #3\endcsname{\tkz@xfpMathLen} +} + +\def\tkz@@CalcLengthcm(#1,#2)#3{% +\pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% +\edef\tkz@xa{\strip@pt\pgf@x}% +\edef\tkz@ya{\strip@pt\pgf@y}% +\edef\tkz@xfpMathLen{\tkz@veclen{\tkz@xa}{\tkz@ya}} +\edef\tkz@xfpMathLen{\tkz@Dec{\tkz@Round{\tkz@xfpMathLen/28.45274}{6}}} +\global\expandafter\edef\csname #3\endcsname{\tkz@xfpMathLen} +} +\def\tkz@@CalcLengthb(#1,#2)#3{% +\pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% +\edef\tkz@xfpMathLen{\fpeval{sqrt((\pgf@x)^2+(\pgf@y)^2)}} +\edef\tkz@xfpMathLen{\fpeval{round(\tkz@xfpMathLen,6)}} +\global\expandafter\edef\csname #3\endcsname{\tkz@xfpMathLen} +} +%<--------------------------------------------------------------------------> +\def\tkzGetLength#1{% +\global\expandafter\edef\csname #1\endcsname{\tkzLengthResult}} +%<--------------------------------------------------------------------------> +% \tkzpttocm passage de pt   cm div par 28.45274 +%<--------------------------------------------------------------------------> +\def\tkzpttocm(#1)#2{% +\begingroup + \edef\tkz@mathresult{\tkz@Round{#1/28.45274}{6}} + \global\expandafter\edef\csname #2\endcsname{\tkz@mathresult}% +\endgroup +}% +%<--------------------------------------------------------------------------> +% \tkzcmtopt passage de cm   pt mul par 28.45274 +%<-------------------------------------------------------------------------- +\def\tkzcmtopt(#1)#2{% +\begingroup + \edef\tkz@mathresult{\tkz@Round{#1*28.45274}{6}} + \global\expandafter\edef\csname #2\endcsname{\tkz@mathresult}% +\endgroup +}% +%<---------------------------------------------------------–> + \def\tkzGetResult#1{% + \global\expandafter\edef\csname #1\endcsname{\tkzMathResult}} +%<---------------------------------------------------------–> +% Schrodinger's cat idea 03/01/20 +\tikzset{veclen/.code={% +\pgfmathdeclarefunction*{veclen}{2}{% +\begingroup% + \pgfmath@x##1pt\relax% + \pgfmath@y##2pt\relax% + \pgf@xa=\pgf@x% + \pgf@ya=\pgf@y% + \edef\tkz@temp@xa{\strip@pt\pgf@xa}% + \edef\tkz@temp@ya{\strip@pt\pgf@ya}% + \edef\tkz@xfpMathLen{\tkz@veclen{\tkz@temp@xa}{\tkz@temp@ya}}% + \pgfmath@returnone\tkz@xfpMathLen pt% +\endgroup% +}}}% +%<---------------------------------------------------------–> +\def\tkzSwapPoints(#1,#2){ + \pgfnodealias{tkzPointTmp}{#2} + \pgfnodealias{#2}{#1} + \pgfnodealias{#1}{tkzPointTmp}} +%<---------------------------------------------------------–> +\def\tkzPermute(#1,#2,#3){ + \tkzURotateWithNodes(#1,#3,#2)(#3) \tkzGetPoint{tkzpt} + \tkzURotateWithNodes(#1,#2,#3)(#2) \tkzGetPoint{#2} + \tkzSwapPoints(tkzpt,#3) +} +%<---------------------------------------------------------–> +\def\tkzDotProduct(#1,#2,#3){% +\begingroup +\pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}}% +\pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}}% +\edef\tkzax{\strip@pt\pgf@x}% +\edef\tkzay{\strip@pt\pgf@y}% +\pgfextractx{\pgf@x}{\pgfpointanchor{#2}{center}}% +\pgfextracty{\pgf@y}{\pgfpointanchor{#2}{center}}% +\edef\tkzbx{\strip@pt\pgf@x}% +\edef\tkzby{\strip@pt\pgf@y}% +\pgfextractx{\pgf@x}{\pgfpointanchor{#3}{center}}% +\pgfextracty{\pgf@y}{\pgfpointanchor{#3}{center}}% +\edef\tkzcx{\strip@pt\pgf@x}% +\edef\tkzcy{\strip@pt\pgf@y}% +\edef\tkz@tmp{\tkz@Dec{\tkz@Round{((\tkzbx-(\tkzax))*(\tkzcx-(\tkzax))+(\tkzby-(\tkzay))*(\tkzcy-(\tkzay)))/809.55841}{6}}} +\global\let\tkzMathResult\tkz@tmp +\endgroup +} + +% #1,#2 and #3 aligned +\def\tkzIsLinear(#1,#2,#3){% +\begingroup +\tkz@@CalcLengthcm(#1,#2){tkz@la} +\tkz@@CalcLengthcm(#1,#3){tkz@lb} +\tkzDotProduct(#1,#2,#3) +\edef\tkzResult{\tkz@Dec{\tkz@Abs{\tkzMathResult}-(\tkz@la)*(\tkz@lb)}} +\ifdim \tkzResult pt < 0.01 pt\relax% +\global\tkzLineartrue +\else +\global\tkzLinearfalse +\fi +\endgroup +} +%<---------------------------------------------------------–> +% syntax : vec(#2,#1) ortho vec(#3,#1) +\def\tkzIsOrtho(#1,#2,#3){% +\begingroup +\tkzDotProduct(#1,#2,#3) +\edef\tkzResult{\tkz@Dec{\tkz@Abs{\tkzMathResult}}} +\ifdim \tkzResult pt < 1 pt\relax% +\global\tkzOrthotrue +\else +\global\tkzOrthofalse +\fi +\endgroup +} +%<---------------------------------------------------------–> +% \tkzPowerCircle(M)(O,A) --> OM^2-OA^2 +\def\tkzPowerCircle(#1)(#2,#3){% +\begingroup +\tkz@@CalcLengthcm(#2,#3){tkz@ra} +\tkz@@CalcLengthcm(#1,#2){tkz@om} +\gdef\tkzMathResult{\tkz@Dec{(\tkz@om)^2-(\tkz@ra)^2}} +\endgroup +} +%<---------------------------------------------------------–> +\def\tkzDefRadicalAxis(#1,#2)(#3,#4){% +\begingroup +\tkz@@CalcLengthcm(#1,#3){tkz@d} +\tkz@@CalcLengthcm(#1,#2){tkz@ra} +\tkz@@CalcLengthcm(#3,#4){tkz@rb} +\edef\tkzMathResult{\tkz@Dec{\tkz@d-(\tkz@ra+\tkz@rb)}} +\edef\tkzMathResultb{\tkz@Dec{\tkz@Abs{(\tkz@d-(\tkz@ra+\tkz@rb))}}} +\edef\tkzMathResultc{\tkz@Dec{\tkz@Abs{\tkz@d-\tkz@Abs{(\tkz@ra-(\tkz@rb))}}}} +\ifdim \tkzMathResultc pt < 0.1 pt\relax% + \tkzURotateAngle(#2,90)(#3) \tkzGetPoint{tkzFirstPointResult} + \tkzURotateAngle(#2,-90)(#3) \tkzGetPoint{tkzSecondPointResult} +\else +\ifdim \tkzMathResultb pt < 0.1 pt\relax% + \tkzURotateAngle(#2,90)(#3) \tkzGetPoint{tkzFirstPointResult} + \tkzURotateAngle(#2,-90)(#3) \tkzGetPoint{tkzSecondPointResult} + \else +\ifdim \tkzMathResult pt > 1 pt\relax% + \tkzURotateAngle(#1,60)(#3) \tkzGetPoint{tkz@aux} + \tkzInterCC(#1,#2)(tkz@aux,#1) \tkzGetPoints{tkz@pta}{tkz@ptb} + \tkzInterCC(#3,#4)(tkz@aux,#1) \tkzGetPoints{tkz@ptc}{tkz@ptd} + \tkzInterLL(tkz@pta,tkz@ptb)(tkz@ptc,tkz@ptd) \tkzGetPoint{tkz@pta} + \tkzUProjection(#1,#3)(tkz@pta) \tkzGetPoint{tkz@ptb} + \pgfnodealias{tkzSecondPointResult}{tkz@ptb} + \pgfnodealias{tkzFirstPointResult}{tkz@pta} +\else +\tkzInterCCR(#1,\tkz@ra)(#3,\tkz@rb){tkzFirstPointResult}{tkzSecondPointResult} +\fi +\fi +\fi +\endgroup +} + +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex new file mode 100644 index 0000000000..2276dead1a --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex @@ -0,0 +1,30 @@ +% tkz-tools-eu-BB.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-eu-BB.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +\def\tkzShowBB{\pgfutil@ifnextchar[{\tkz@ShowBB}{\tkz@ShowBB[]}} +\def\tkz@ShowBB[#1]{% + \draw[#1] (current bounding box.south west) rectangle + (current bounding box.north east); +} +%<--------------------------------------------------------------------------–> +\def\tkzClipBB{% +\clip (current bounding box.south west) rectangle + (current bounding box.north east); +} +%<--------------------------------------------------------------------------–> +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex new file mode 100644 index 0000000000..f8ec42d3e0 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex @@ -0,0 +1,74 @@ +% tkz-tools-angles.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-eu-angles.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% thanks karu : http://tex.stackexchange.com/questions/151667/tkzgetangle-strange-behavior/196224#196224 +% \tkzGetAngle strange behavior +% defines \tkz@FirstAngle and \tkz@SecondAngle sens trigo +%<--------------------------------------------------------------------------–> +\def\tkzNormalizeAngle(#1,#2){% +\begingroup +\pgfmathparse{#1}\xdef\tkz@FirstAngle{\pgfmathresult}% +\pgfmathparse{#2}\xdef\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} + \xdef\tkz@FirstAngle{\pgfmathresult}% + \fi +\else + \pgfmathgreaterthan{\tkz@FirstAngle}{\tkz@SecondAngle} + \ifdim\pgfmathresult pt=1 pt\relax% + \pgfmathadd{\tkz@SecondAngle}{360} + \xdef\tkz@SecondAngle{\pgfmathresult}% + \fi +\fi + \endgroup + } +%<--------------------------------------------------------------------------–> +% Angle +% Recherche l'angle formé par #1 et #2 par rapport à l'horizontale +%<--------------------------------------------------------------------------–> +\def\tkzFindSlopeAngle(#1,#2){% +\begingroup + \pgfmathanglebetweenpoints{\pgfpointanchor{#1}{center}}{% + \pgfpointanchor{#2}{center}} + \global\let\tkzAngleResult\pgfmathresult +\endgroup +} +%<--------------------------------------------------------------------------–> +% Angle avec trois nodes +%<--------------------------------------------------------------------------–> +\def\tkzFindAngle(#1,#2,#3){% new code 2016 +\begingroup + \tkzFindSlopeAngle(#2,#1)\tkzGetAngle{tkz@FirstAngle} + \tkzFindSlopeAngle(#2,#3)\tkzGetAngle{tkz@SecondAngle} + \tkzNormalizeAngle(\tkz@FirstAngle,\tkz@SecondAngle) + \edef\tkz@Angle{\fpeval{\tkz@SecondAngle-\tkz@FirstAngle}} + \global\let\tkzAngleResult\tkz@Angle +\endgroup +} + +%<--------------------------------------------------------------------------–> +% Find angle +%<--------------------------------------------------------------------------–> +\def\tkzGetAngle#1{% + \global\expandafter\edef\csname #1\endcsname{\tkzAngleResult} +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex new file mode 100644 index 0000000000..2311703363 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex @@ -0,0 +1,89 @@ +% tkz-tools-eu-base.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-eu-base.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +\global\let\tkz@tmp@xa\tkz@init@xmin% modif 2016 +\global\let\tkz@tmp@xb\tkz@init@xmax% modif 2016 +\global\let\tkz@tmp@ya\tkz@init@ymin% modif 2016 +\global\let\tkz@tmp@yb\tkz@init@ymax% modif 2016 +%<--------------------------------------------------------------------------–> +\pgfkeys{ + /tkzInit/.cd, + xmin/.store in = \tkz@init@xmin, + xmax/.store in = \tkz@init@xmax, + xstep/.store in = \tkz@init@xstep, + ymin/.store in = \tkz@init@ymin, + ymax/.store in = \tkz@init@ymax, + ystep/.store in = \tkz@init@ystep, + NO/.is if = tkz@init@NO, + NO/.default = true, + xmin = 0, + xmax = 10, + xstep = 1, + ymin = 0, + ymax = 10, + ystep = 1, + NO = false + } + +\def\tkzInit{\pgfutil@ifnextchar[{\tkz@Init}{\tkz@Init[]}} +\def\tkz@Init[#1]{% + \pgfqkeys{/tkzInit}{#1} + \ifx\tkzfctloaded\undefined + \else + \tkz@tkzf@fct=0 % only if tkz-fct loaded + \fi + \xdef\tkz@init@xorigine{0} + \xdef\tkz@init@yorigine{0} + \edef\@xsgmin{\fpeval{sign(\tkz@init@xmin)}} % -> -1 or 1 + \edef\@xsgmax{\fpeval{sign(\tkz@init@xmax)}} + \edef\@ysgmin{\fpeval{sign(\tkz@init@ymin)}} + \edef\@ysgmax{\fpeval{sign(\tkz@init@ymax)}} + \let\tkz@tmp@xa\tkz@init@xmin %modif 2016 + \let\tkz@tmp@xb\tkz@init@xmax %modif 2016 + \let\tkz@tmp@ya\tkz@init@ymin %modif 2016 + \let\tkz@tmp@yb\tkz@init@ymax %modif 2016 + \tkz@init@NOfalse + \ifx\@xsgmin\@xsgmax \tkz@init@NOtrue \fi + \ifx\@ysgmin\@ysgmax \tkz@init@NOtrue \fi + \iftkz@init@NO% + \ifx\@xsgmin\@xsgmax + \edef\tkz@init@xmax{\fpeval{\tkz@init@xmax-\tkz@init@xmin}} + \edef\tkz@init@xorigine{\tkz@init@xmin} + \edef\tkz@init@xmin{0} + \fi + \ifx\@ysgmin\@ysgmax + \edef\tkz@init@ymax{\fpeval{\tkz@init@ymax-\tkz@init@ymin}} + \edef\tkz@init@yorigine{\tkz@init@ymin} + \edef\tkz@init@ymin{0} + \fi + \fi + \edef\tkz@xa{\fpeval{\tkz@init@xmin/\tkz@init@xstep}} + \edef\tkz@xb{\fpeval{\tkz@init@xmax/\tkz@init@xstep}} + \edef\tkz@ya{\fpeval{\tkz@init@ymin/\tkz@init@ystep}} + \edef\tkz@yb{\fpeval{\tkz@init@ymax/\tkz@init@ystep}} + \tkz@getdecimal{\tkz@init@xstep} % amélioration nb dec et integer + \xdef\tkz@init@xdec{\number\c@pgfmath@countb} + \tkz@getdecimal{\tkz@init@ystep} + \xdef\tkz@init@ydec{\number\c@pgfmath@countb} +}% +\def\tkzAddName{\pgfutil@ifnextchar[{\tkz@AddName}{\tkz@AddName[]}} +\def\tkz@AddName[#1]#2{% +\node[above left,#1] at (\pgf@path@lastx,\pgf@path@lasty){#2}; +}% +%<--------------------------------------------------------------------------–> +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex new file mode 100644 index 0000000000..94995906f9 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex @@ -0,0 +1,57 @@ +% tkz-tools-eu-colors +% 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-eu-colors} +\makeatletter + +%<------ Initialisation of the colors with tkzSetUpColors -----------------> +% Première macro SetUpColors %%%%%%%%%%%%%%%%%%%%% +%Possible +\pgfkeys{/tkzsucolor/.is family} +\def\setupcolorkeys#1{% + \pgfkeys{/tkzsucolor,#1}} +\setupcolorkeys{ + background/.estore in = \setupcolor@background, + text/.estore in = \setupcolor@text, + @initial/.style = {background=white,text=black}, + @apply/.code = {\pagecolor{\setupcolor@background}% + \color{\setupcolor@text}% + }, +} +\def\tkzSetUpColors{\pgfutil@ifnextchar[{\tkz@SetUpColors}{\tkz@SetUpColors[]}} +\def\tkz@SetUpColors[#1]{\setupcolorkeys{@initial,#1,@apply}} + +%<------ Initialisation of all colors -----------------> +\pgfkeys{/tkzsupallcol/.cd, + background/.store in = \tkz@suac@bkc, + text/.store in = \tkz@suac@txt, + background = \tkz@backgroundcolor,% see tkz-euclide.cfg + text = \tkz@textcolor% idem + } +\def\tkzSetUpAllColors{\pgfutil@ifnextchar[{\tkz@SetUpAllColors}{% + \tkz@SetUpAllColors[]}} +\def\tkz@SetUpAllColors[#1]{% + \pgfqkeys{/tkzsupallcol}{#1} % now we redine the based colors + \def\tkz@fillcolor{\tkz@suac@bkc} + \def\tkz@mainlinecolor{\tkz@suac@txt} + \def\tkz@textcolor{\tkz@suac@txt} + \def\tkz@otherlinecolor{\tkz@suac@txt!50} + \def\tkz@sua@color{\tkz@suac@txt} + \tkzSetUpAxis[color=\tkz@suac@txt] + \tkzSetUpGrid[color=\tkz@suac@txt] + \pagecolor{\tkz@suac@bkc} + \color{\tkz@suac@txt} +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex new file mode 100644 index 0000000000..bb741fc59e --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex @@ -0,0 +1,498 @@ +% tkz-tools-intersections.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. +% utf8 encoding + +\def\fileversion{5.00c} +\def\filedate{2023/01/23} +\typeout{2023/01/23 5.00c tkz-tools-eu-intersections.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% intersection de deux lignes +%<--------------------------------------------------------------------------–> +\def\tkzInterLL(#1,#2)(#3,#4){% méthode avec xfp +\tkz@InterLL(#1,#2)(#3,#4){tkzPointResult} +} + +\def\tkz@InterLL(#1,#2)(#3,#4)#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% +\edef\tkz@deltax{\fpeval{(\tkz@ax-\tkz@bx)/(28.45274)}} +\edef\tkz@deltaxx{\fpeval{(\tkz@cx-\tkz@dx)/(28.45274)}} +\edef\tkz@deltay{\fpeval{(\tkz@ay-\tkz@by)/(28.45274)}} +\edef\tkz@deltayy{\fpeval{(\tkz@cy-\tkz@dy)/(28.45274)}} +\edef\tkz@deltaxy{\fpeval{((\tkz@ax*\tkz@by)-(\tkz@ay*\tkz@bx))/(809.55841)}} +\edef\tkz@deltaxxyy{\fpeval{((\tkz@cx*\tkz@dy)-(\tkz@cy*\tkz@dx))/(809.55841)}} +\edef\tkz@div{\fpeval{(\tkz@deltax*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxx)}} +\edef\tkz@numx{\fpeval{(\tkz@deltaxy*\tkz@deltaxx)-(\tkz@deltax*\tkz@deltaxxyy)}} +\edef\tkz@numy{\fpeval{(\tkz@deltaxy*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxxyy)}} +\edef\tkz@xs{\fpeval{round(\tkz@numx/\tkz@div,5)}} +\edef\tkz@ys{\fpeval{round(\tkz@numy/\tkz@div,5)}} +\path[coordinate](\tkz@xs,\tkz@ys) coordinate (#5); +} + + +% méthode with coordinates +\def\tkzInterLLxy(#1,#2,#3,#4)(#5,#6,#7,#8){% +%\path (intersection of #1--#2 and #3--#4) coordinate(#5);% +\tkz@ax#1% +\tkz@ay#2% +\tkz@bx#3% +\tkz@by#4% +\tkz@cx#5% +\tkz@cy#6% +\tkz@dx#7% +\tkz@dy#8% +\edef\tkz@deltax{\fpeval{(\tkz@ax-\tkz@bx)/(28.45274)}} +\edef\tkz@deltaxx{\fpeval{(\tkz@cx-\tkz@dx)/(28.45274)}} +\edef\tkz@deltay{\fpeval{(\tkz@ay-\tkz@by)/(28.45274)}} +\edef\tkz@deltayy{\fpeval{(\tkz@cy-\tkz@dy)/(28.45274)}} +\edef\tkz@deltaxy{\fpeval{((\tkz@ax*\tkz@by)-(\tkz@ay*\tkz@bx))/(809.55841)}} +\edef\tkz@deltaxxyy{\fpeval{((\tkz@cx*\tkz@dy)-(\tkz@cy*\tkz@dx))/(809.55841)}} +\edef\tkz@div{\fpeval{(\tkz@deltax*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxx)}} +\edef\tkz@numx{\fpeval{(\tkz@deltaxy*\tkz@deltaxx)-(\tkz@deltax*\tkz@deltaxxyy)}} +\edef\tkz@numy{\fpeval{(\tkz@deltaxy*\tkz@deltayy)-(\tkz@deltay*\tkz@deltaxxyy)}} +\edef\tkz@xs{\fpeval{round(\tkz@numx/\tkz@div,5)}} +\edef\tkz@ys{\fpeval{round(\tkz@numy/\tkz@div,5)}} +\path[coordinate](\tkz@xs,\tkz@ys) coordinate (tkzPointResult); +} + +%<--------------------------------------------------------------------------–> +% 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); +% } +%<---------- test ------------------------------------------------------–> +\def\tkzTestInterLC(#1,#2)(#3,#4){% +\begingroup +\tkz@Projection(#1,#2)(#3){tkz@pth}% distance centre à la ligne +\tkz@@CalcLength(#3,tkz@pth){tkz@mathLen}% +\tkz@@CalcLength(#3,#4){tkzLengthResult}%calcul du rayon +\ifdim\tkz@mathLen pt>\tkzLengthResult pt\relax% +\global\tkzFlagLCfalse +\else +\global\tkzFlagLCtrue +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +\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}, + common/.store in = \tkz@common, + common = {}, + near/.is if = tkz@near, + near/.default = true, + near = false, + next to/.store in = \tkz@nextto, + next to/.initial = {}, + next/.default = {}, + next to = {}, + next to/.value required, + node + } +%<--------------------------------------------------------------------------–> +\def\tkzInterLC{\pgfutil@ifnextchar[{\tkz@InterLC}{\tkz@InterLC[]}} +\def\tkz@InterLC[#1](#2,#3)(#4,#5){% +\begingroup +\pgfqkeys{/linecircle}{#1} + \pgfinterruptboundingbox +\ifcase\tkz@numlc% + % first case 0 + \tkz@@CalcLength(#4,#5){tkzLengthResult} + \tkzInterLCR(#2,#3)(#4,\tkzLengthResult pt){tkzFirstPointResult}% + {tkzSecondPointResult} +\or% 1 + \tkzInterLCR(#2,#3)(#4,#5 cm){tkzFirstPointResult} + {tkzSecondPointResult}% +\or% 2 + \tkzInterLCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}% + {tkzSecondPointResult}% +\fi +\iftkz@near + \tkz@@CalcLength(#2,tkzFirstPointResult){tkzLengthFirst} + \tkz@@CalcLength(#2,tkzSecondPointResult){tkzLengthSecond} + \ifdim \tkzLengthFirst pt < \tkzLengthSecond pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi +\else + \ifx\tkz@common\tkzutil@empty + \ifx\tkz@nextto\tkzutil@empty + \tkzFindAngle(tkzSecondPointResult,tkzFirstPointResult,#4) + \tkzGetAngle{tkz@an} + \ifdim\tkz@an pt<180 pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \else + \tkz@@CalcLength(\tkz@nextto,tkzFirstPointResult){tkzLengthFirst} + \tkz@@CalcLength(\tkz@nextto,tkzSecondPointResult){tkzLengthSecond} + \ifdim \tkzLengthFirst pt < \tkzLengthSecond pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \fi + \else + \tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen} + \ifdim\tkz@mathLen pt<1pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \fi +\fi%near +\endpgfinterruptboundingbox +\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% + \pgfpointborderellipse{\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% + \pgfcoordinate{#6}{\pgfqpoint{\tkz@bx}{\tkz@by}} + \tkzCSym(#3)(#6){#5} + \else + \edef\pgfmathresult{\fpeval{\tkz@mathLen/\tkz@radi}} + % \edef\tkz@angle{\fpeval{acosd(\pgfmathresult)}} + \pgfmathacos@{\pgfmathresult}% + \let\tkz@angle\pgfmathresult% + \pgfpointdiff{\pgfpointanchor{#3}{center}}% + {\pgfpointanchor{tkz@pth}{center}}% + \tkz@ax=\pgf@x% + \tkz@ay=\pgf@y% + \pgfpointborderellipse{\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} + \pgfmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}% + {\pgfpoint{\tkz@ax}{\tkz@ay}}% + {\tkz@angle} + \pgfcoordinate{#5}{\pgfqpoint{\pgf@x}{\pgf@y}} + \pgfmathrotatepointaround{\pgfpoint{\tkz@bx}{\tkz@by}}% + {\pgfpoint{\tkz@ax}{\tkz@ay}}% + {-\tkz@angle} + \pgfcoordinate{#6}{\pgfqpoint{\pgf@x}{\pgf@y}} + +\fi +\endgroup +} +%<--------------------------------------------------------------------------–> +% intersection de Ligne Cercle +% #4 center #5 point sur le cercle +%<--------------------------------------------------------------------------–> +% \def\tkzInterLC(#1,#2)(#3,#4)#5#6{% +% \begingroup +% \tkz@@CalcLength(#3,#4){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 + \tkz@@CalcLength(#4,#5){tkz@radius} + \tkzInterLCR(#1,#2)(#3,\tkz@radius pt){#6}{#7} +\endgroup +} +%<--------------------------------------------------------------------------–> +% Intersection of 2 circles +%<--------------------------------------------------------------------------–> +%<--------------------------------------------------------------------------–> +% 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; +% } +%<--------------------------------------------------------------------------–> +% Intersection de deux cercles +%<--------------------------------------------------------------------------–> +%<---------- test ------------------------------------------------------–> +% test avec des nodes R-r <= d <= R+r +\def\tkzTestInterCC(#1,#2)(#3,#4){% +\begingroup +\tkz@@CalcLength(#1,#3){tkz@mathLen}% distance entre les centres +\tkz@@CalcLength(#2,#1){tkz@rA}%calcul du rayon +\tkz@@CalcLength(#4,#3){tkz@rB}%calcul du rayon +% test if d <= rA + rB ? +\edef\tkz@rS{\fpeval{\tkz@rA+\tkz@rB}} +\ifdim\tkz@mathLen pt > \tkz@rS pt\relax% +\global\tkzFlagCCfalse +\else +% now test if d>= rA - rB or rB-rA + \ifdim \tkz@rA pt > \tkz@rB pt\relax% + \edef\tkz@rD{\fpeval{\tkz@rA-\tkz@rB}} + \else + \edef\tkz@rD{\fpeval{\tkz@rB-\tkz@rA}} + \fi +\ifdim \tkz@rD pt > \tkz@mathLen pt\relax% + \global\tkzFlagCCfalse +\else +\global\tkzFlagCCtrue +\fi +\fi +\endgroup +} + +\def\tkz@numcc{0} +\pgfkeys{ +/circlecircle/.cd, + node/.code = \def\tkz@numcc{0}, + R/.code = \def\tkz@numcc{1}, + with nodes/.code = \def\tkz@numcc{2}, + common/.store in = \tkz@common, + common = {}, + node +} +%<--------------------------------------------------------------------------–> +\def\tkzInterCC{\pgfutil@ifnextchar[{\tkz@InterCC}{\tkz@InterCC[]}} +\def\tkz@InterCC[#1](#2,#3)(#4,#5){% +\begingroup +\pgfqkeys{/circlecircle}{#1} +\ifcase\tkz@numcc% + % first case 0 + \tkz@save@length + \tkz@@CalcLengthcm(#2,#3){tkz@rayA} + \tkz@@CalcLengthcm(#4,#5){tkz@rayB} + \tkz@restore@length + \tkzInterCCR(#2,\tkz@rayA)(#4,\tkz@rayB){tkzFirstPointResult}{tkzSecondPointResult} + \or% 1 + \tkzInterCCR(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult}% + \or%2 + \tkzInterCCWithNodes(#2,#3)(#4,#5){tkzFirstPointResult}{tkzSecondPointResult} +\fi + \ifx\tkz@common\tkzutil@empty + \tkzFindAngle(#2,tkzFirstPointResult,#4) \tkzGetAngle{tkz@an} + \ifdim\tkz@an pt<180 pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \else +\tkz@@CalcLength(\tkz@common,tkzSecondPointResult){tkz@mathLen} + \ifdim\tkz@mathLen pt<0.05pt\relax% + \else + \pgfnodealias{tkzPointTmp}{tkzSecondPointResult} + \pgfnodealias{tkzSecondPointResult}{tkzFirstPointResult} + \pgfnodealias{tkzFirstPointResult}{tkzPointTmp} + \fi + \fi +\endgroup +} +%<--------------------------------------------------------------------------–> + +\def\tkzInterCCR(#1,#2)(#3,#4)#5#6{% +\begingroup +\pgfinterruptboundingbox +\tkz@save@length +\tkz@@CalcLength(#1,#3){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#2cm % +\tkz@cy#4cm % +\edef\tkz@aa{\fpeval{((\tkz@cx+\tkz@cy)/(2*\tkz@dd))*(\tkz@cx-\tkz@cy)+\tkz@dd/2}} + \edef\tkz@xx{\fpeval{\tkz@ax+\tkz@aa/\tkz@dd*(\tkz@bx - \tkz@ax)}} +\edef\tkz@yy{\fpeval{\tkz@ay+\tkz@aa/\tkz@dd*(\tkz@by - \tkz@ay)}} +\path[coordinate](\tkz@xx pt,\tkz@yy pt) coordinate (tkzRadialCenter); +\edef\tkz@hh{\fpeval{sqrt(abs((\tkz@cx+\tkz@aa)*(\tkz@cx-\tkz@aa)))}}% abs !2023 +\edef\tkz@rx{\fpeval{\tkz@hh / \tkz@dd * (\tkz@ay - \tkz@by)}} +\edef\tkz@ry{\fpeval{\tkz@hh / \tkz@dd * (\tkz@bx - \tkz@ax)}} +\edef\tkz@xs{\fpeval{\tkz@xx + \tkz@rx}} +\edef\tkz@ys{\fpeval{\tkz@yy + \tkz@ry}} +\path[coordinate](\tkz@xs pt,\tkz@ys pt) coordinate (#5); +\edef\tkz@xss{\fpeval{\tkz@xx - \tkz@rx}} +\edef\tkz@yss{\fpeval{\tkz@yy - \tkz@ry}} +\path[coordinate](\tkz@xss pt,\tkz@yss pt) coordinate (#6); +\endpgfinterruptboundingbox +\endgroup +} +%<--------------------------------------------------------------------------–> +% #2 node #3 node #4 node #5 node +% \def\tkzInterCC(#1,#2)(#3,#4)#5#6{% +% \begingroup +% \tkz@@CalcLength(#1,#2){tkz@rayA} +% \tkz@@CalcLength(#3,#4){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 + \tkz@@CalcLengthcm(#2,#3){tkz@rayA} + \tkz@@CalcLengthcm(#5,#6){tkz@rayB} + \tkzInterCCR(#1,\tkz@rayA)(#4,\tkz@rayB){#7}{#8} +\endgroup +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex new file mode 100644 index 0000000000..9ec079f092 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex @@ -0,0 +1,256 @@ +% tkz-tools-eu-math.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-eu-math.tex} +\makeatletter +%<--------------------------------------------------------------------------> +% \tkzpointnormalised# +% tkzCalcLength +% \tkzGetLength +% \tkzpttocm +% \tkzcmtopt +% \tkzFindSlope +% option xfp + +% \tkzpointnormalised normalise un point A-->A' tq ||v(OA')=1|| +% équivalent de \pgfpointnormalised avec fp +% example +% \tkzpointnormalised{% +% \pgfpointdiff{\pgfpointanchor{A}{center}} +% {\pgfpointanchor{B}{center}}} + +% or +% \pgf@x=1 cm +% \pgf@y=12 cm +% \tkzpointnormalised{} +%<-------------------------------------------------------------------------- +\def\tkzpointnormalised#1{% +\pgf@process{#1}% +\edef\tkz@den{\fpeval{sqrt((\pgf@x)^2+(\pgf@y)^2)}} +\edef\tkz@coordx{\fpeval{\pgf@x/\tkz@den}} +\edef\tkz@coordx{\fpeval{round(\tkz@coordx,5)}} +\edef\tkz@coordy{\fpeval{\pgf@y/\tkz@den}} +\edef\tkz@coordy{\fpeval{round(\tkz@coordy,5)}} +\pgf@x = \tkz@coordx pt +\pgf@y = \tkz@coordy pt +} +%<--------------------------------------------------------------------------> +% restaure and save length +\def\tkz@save@length{\global\let\tkz@temp@length\tkzLengthResult}% +\def\tkz@restore@length{\global\let\tkzLengthResult\tkz@temp@length }% +%<--------------------------------------------------------------------------> +% \tkzCalcLength Distance entre deux points en pt ou en cm avec xfp +% \veclen mais avec fp +% option cm le résultat est en cm sinon en pt with cm=false +%<--------------------------------------------------------------------------> +\pgfkeys{tkzcalclen/.cd, + cm/.is if = tkzLengthIncm, + cm/.default = true, + cm = true} + +\def\tkzCalcLength{\pgfutil@ifnextchar[{\tkz@CalcLength}{\tkz@CalcLength[]}} +\def\tkz@CalcLength[#1](#2,#3){% +%\pgfkeys{tkzcalclen/.cd, cm = true} +\pgfqkeys{/tkzcalclen}{#1}% +\begingroup +\tkz@@CalcLength(#2,#3){tkzLengthResult} +\iftkzLengthIncm + \pgfmathparse{\tkzLengthResult pt/1cm} + \edef\tkz@xfpMathLen{\fpeval{round(\pgfmathresult,6)}} + \global\let\tkzLengthResult\tkz@xfpMathLen +\fi +\endgroup +}% +\def\tkz@@CalcLength(#1,#2)#3{% +\pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% +\edef\tkz@xfpMathLen{\fpeval{sqrt((\pgf@x)^2+(\pgf@y)^2)}} +\edef\tkz@xfpMathLen{\fpeval{round(\tkz@xfpMathLen,6)}} +\global\expandafter\edef\csname #3\endcsname{\tkz@xfpMathLen} +} +\def\tkz@@CalcLengthcm(#1,#2)#3{% +\pgfpointdiff{\pgfpointanchor{#1}{center}}% + {\pgfpointanchor{#2}{center}}% +\edef\tkz@xfpMathLen{\fpeval{sqrt((\pgf@x)^2+(\pgf@y)^2)}} +\edef\tkz@xfpMathLen{\fpeval{round(\tkz@xfpMathLen/28.45274,6)}} +\global\expandafter\edef\csname #3\endcsname{\tkz@xfpMathLen} +} +%<--------------------------------------------------------------------------> +\def\tkzGetLength#1{% +\global\expandafter\edef\csname #1\endcsname{\tkzLengthResult}} +%<--------------------------------------------------------------------------> +% \tkzpttocm passage de pt   cm div par 28.45274 +%<--------------------------------------------------------------------------> +\def\tkzpttocm(#1)#2{% +\begingroup + \pgfmathparse{#1/1cm} + \edef\tkz@mathresult{\fpeval{round(\pgfmathresult,5)}} + \global\let\tkz@mathresult\tkz@mathresult + \global\expandafter\edef\csname #2\endcsname{\tkz@mathresult}% +\endgroup +}% +%<--------------------------------------------------------------------------> +% \tkzcmtopt passage de cm   pt mul par 28.45274 +%<-------------------------------------------------------------------------- +\def\tkzcmtopt(#1)#2{% +\begingroup + \pgfmathparse{#1*1cm} + \edef\tkz@mathresult{\fpeval{round(\pgfmathresult,5)}} + \global\let\tkz@mathresult\tkz@mathresult + \global\expandafter\edef\csname #2\endcsname{\tkz@mathresult}% +\endgroup +}% + +% Schrodinger's cat idea 03/01/20 +\tikzset{veclen/.code={% +\pgfmathdeclarefunction*{veclen}{2}{% +\begingroup% + \pgfmath@x##1pt\relax% + \pgfmath@y##2pt\relax% + \edef\tkz@xfpMathLen{\fpeval{sqrt((\pgf@x)^2+(\pgf@y)^2)}} + \pgfmath@returnone\tkz@xfpMathLen pt% +\endgroup% +}}}% +%<---------------------------------------------------------–> +\def\tkzSwapPoints(#1,#2){ + \pgfnodealias{tkzPointTmp}{#2} + \pgfnodealias{#2}{#1} + \pgfnodealias{#1}{tkzPointTmp}} +%<---------------------------------------------------------–> +\def\tkzPermute(#1,#2,#3){ +\tkzURotateWithNodes(#1,#3,#2)(#3) \tkzGetPoint{tkzpt} +\tkzURotateWithNodes(#1,#2,#3)(#2) \tkzGetPoint{#2} +\tkzSwapPoints(tkzpt,#3)} +%<---------------------------------------------------------–> +\def\tkzDotProduct(#1,#2,#3){% +\begingroup +\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% +\edef\tkz@@dotprod{\fpeval{round(((\tkz@bx-\tkz@ax)*(\tkz@cx-\tkz@ax)+(\tkz@by-\tkz@ay)*(\tkz@cy-\tkz@ay))/(809.55841),5)}} +\global\let\tkzMathResult\tkz@@dotprod +\endgroup} +%<---------------------------------------------------------–> + \def\tkzGetResult#1{% + \global\expandafter\edef\csname #1\endcsname{\tkzMathResult}} +%<---------------------------------------------------------–> +% #1,#2 and #3 aligned +\def\tkzIsLinear(#1,#2,#3){% +\begingroup +\tkz@@CalcLengthcm(#1,#2){tkz@la} +\tkz@@CalcLengthcm(#1,#3){tkz@lb} +\tkzDotProduct(#1,#2,#3) +\edef\tkzResult{\fpeval{abs(\tkzMathResult)-(\tkz@la)*(\tkz@lb)}} +\ifdim \tkzResult pt < 0.01 pt\relax% +\global\tkzLineartrue +\else +\global\tkzLinearfalse +\fi +\endgroup +} +%<---------------------------------------------------------–> +% syntax : vec(#2,#1) ortho vec(#3,#1) +\def\tkzIsOrtho(#1,#2,#3){% +\begingroup +\tkzDotProduct(#1,#2,#3) +\edef\tkzResult{\fpeval{abs(\tkzMathResult)}} +\ifdim \tkzResult pt < 1 pt\relax% +\global\tkzOrthotrue +\else +\global\tkzOrthofalse +\fi +\endgroup +} +%<---------------------------------------------------------–> +%<---------------------------------------------------------–> +% \tkzPowerCircle(M)(O,A) --> OM^2-OA^2 +\def\tkzPowerCircle(#1)(#2,#3){% +\begingroup +\tkz@@CalcLengthcm(#2,#3){tkz@ra} +\tkz@@CalcLengthcm(#1,#2){tkz@om} +\gdef\tkzMathResult{\fpeval{round(\tkz@om*\tkz@om -\tkz@ra*\tkz@ra,5)}} +\endgroup +} +%<---------------------------------------------------------–> +\def\tkzDefRadicalAxis(#1,#2)(#3,#4){% +\begingroup +\tkz@@CalcLengthcm(#1,#3){tkz@d} +\tkz@@CalcLengthcm(#1,#2){tkz@ra} +\tkz@@CalcLengthcm(#3,#4){tkz@rb} +\edef\tkzMathResult{\fpeval{\tkz@d-(\tkz@ra+\tkz@rb)}} +\edef\tkzMathResultb{\fpeval{abs(\tkz@d-(\tkz@ra+\tkz@rb))}} +\edef\tkzMathResultc{\fpeval{abs(\tkz@d-abs(\tkz@ra-\tkz@rb))}} +\ifdim \tkzMathResultc pt < 0.1 pt\relax% + \tkzURotateAngle(#2,90)(#3) \tkzGetPoint{tkzFirstPointResult} + \tkzURotateAngle(#2,-90)(#3) \tkzGetPoint{tkzSecondPointResult} +\else +\ifdim \tkzMathResultb pt < 0.1 pt\relax% + \tkzURotateAngle(#2,90)(#3) \tkzGetPoint{tkzFirstPointResult} + \tkzURotateAngle(#2,-90)(#3) \tkzGetPoint{tkzSecondPointResult} + \else +\ifdim \tkzMathResult pt > 1 pt\relax% + \tkzURotateAngle(#1,60)(#3) \tkzGetPoint{tkz@aux} + \tkzInterCC(#1,#2)(tkz@aux,#1) \tkzGetPoints{tkz@pta}{tkz@ptb} + \tkzInterCC(#3,#4)(tkz@aux,#1) \tkzGetPoints{tkz@ptc}{tkz@ptd} + \tkzInterLL(tkz@pta,tkz@ptb)(tkz@ptc,tkz@ptd) \tkzGetPoint{tkz@pta} + \tkzUProjection(#1,#3)(tkz@pta) \tkzGetPoint{tkz@ptb} + \pgfnodealias{tkzSecondPointResult}{tkz@ptb} + \pgfnodealias{tkzFirstPointResult}{tkz@pta} +\else +\tkzInterCCR(#1,\tkz@ra)(#3,\tkz@rb){tkzFirstPointResult}{tkzSecondPointResult} +\fi +\fi +\fi +\endgroup +} +\def\tkzmathrotatepointaround#1#2#3{% + \pgf@process{% + \pgf@process{#1}% + \pgf@xc=\pgf@x% + \pgf@yc=\pgf@y% + \pgf@process{#2}% + \pgf@xa\pgf@x% + \pgf@ya\pgf@y% + \pgf@xb\pgf@x% + \pgf@yb\pgf@y% + \pgf@x=\pgf@xc% + \pgf@y=\pgf@yc% + \advance\pgf@x-\pgf@xa% + \advance\pgf@y-\pgf@ya% + \pgfmathsetmacro\angle{#3}% + \mathSin{\mathRad{\angle}}% + \let\sineangle\pgfmathresult% + \mathCos{\mathRad{\angle}}% + \let\cosineangle\pgfmathresult% + \pgf@xa\cosineangle\pgf@x% + \advance\pgf@xa-\sineangle\pgf@y% + \pgf@ya\sineangle\pgf@x% + \advance\pgf@ya\cosineangle\pgf@y% + \pgf@x\pgf@xb% + \pgf@y\pgf@yb% + \advance\pgf@x\pgf@xa% + \advance\pgf@y\pgf@ya% + }% +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex new file mode 100644 index 0000000000..eb0dae14e6 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex @@ -0,0 +1,67 @@ +% tkz-tools-modules +% 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-eu-utilities.tex} +\makeatletter +%<------------- % chargement des modules ----------------------------------> +\def\tkz@obj@all{angles,arcs,compass,defcircles,deflines,defpoints,defpointsby,defpointsrnd,defpointswith,polygons,protractor,sectors,show,triangles}% +\def\tkz@obj@txt{all} +\def\usetkzobj{\pgfutil@ifnextchar[{\use@usetkzobj}{\use@@usetkzobj}}%} +\def\use@usetkzobj[#1]{\use@@usetkzobj{#1}} +\def\use@@usetkzobj#1{% + \def\tkz@list{#1} + \ifx\tkz@obj@txt\tkz@list \edef\tkz@list{\tkz@obj@all}% + \else + \edef\tkz@list{#1}% + \fi + \pgfutil@for\tkz@temp:=\tkz@list\do{% + \expandafter\ifx\csname tkz@library@\tkz@temp @loaded\endcsname\relax% + \expandafter\global\expandafter\let\csname tkz@library@\tkz@temp @loaded\endcsname=\pgfutil@empty% + \expandafter\edef\csname tkz@obj@#1@atcode\endcsname{\the\catcode`\@} + \expandafter\edef\csname tkz@obj@#1@barcode\endcsname{\the\catcode`\|} + \catcode`\@=11 + \catcode`\|=12 + \input tkz-obj-\tkz@temp.tex + \catcode`\@=\csname tkz@obj@#1@atcode\endcsname + \catcode`\|=\csname tkz@obj@#1@barcode\endcsname + \fi% + }% +}% +%<---------------------------------------------------------–> +\def\tkz@tool@all{math-xfp} +\def\tkz@tool@txt{all} + +\def\usetkztool{\pgfutil@ifnextchar[{\use@usetkztool}{\use@@usetkztool}}%} +\def\use@usetkztool[#1]{\use@@usetkztool{#1}} +\def\use@@usetkztool#1{% + \def\tkz@list{#1} + \ifx\tkz@tool@txt\tkz@list \edef\tkz@list{\tkz@tool@all}% + \else + \edef\tkz@list{#1}% + \fi + \pgfutil@for\tkz@temp:=\tkz@list\do{% + \expandafter\ifx\csname tkz@library@\tkz@temp @loaded\endcsname\relax% + \expandafter\global\expandafter\let\csname tkz@library@\tkz@temp @loaded\endcsname=\pgfutil@empty% + \expandafter\edef\csname tkz@tool@#1@atcode\endcsname{\the\catcode`\@} + \expandafter\edef\csname tkz@tool@#1@barcode\endcsname{\the\catcode`\|} + \catcode`\@=11 + \catcode`\|=12 + \input tkz-tools-\tkz@temp.tex + \catcode`\@=\csname tkz@tool@#1@atcode\endcsname + \catcode`\|=\csname tkz@tool@#1@barcode\endcsname + \fi% + }% +}% +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex new file mode 100644 index 0000000000..3f52c84c28 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex @@ -0,0 +1,88 @@ +% tkz-tools-eu-text.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-eu-text.tex} +\makeatletter +%<--------------------------------------------------------------------------–> +% tkzText +%<--------------------------------------------------------------------------–> +\def\tkz@parsenode#1{% +\tkz@getvirg#1,\@nil +\iftkz@node +\else + \tkz@getfromcart#1\@nil +\fi +} +\def\tkz@getvirg#1,#2\@nil{% +\ifx\tkzempty#2\tkzempty% + \tkz@nodetrue +\else + \tkz@nodefalse +\fi +} +\def\tkzText{\pgfutil@ifnextchar[{\tkz@Text}{\tkz@Text[]}} +\def\tkz@Text[#1](#2)#3{% + \begingroup + \tkz@parsenode{#2} + \iftkz@node + \node[#1] at (#2){#3}; + \else + \edef\tkzpt@xa{\fpeval{(\tkz@absc-\tkz@init@xorigine)/\tkz@init@xstep}} + \edef\tkzpt@ya{\fpeval{(\tkz@ord-\tkz@init@yorigine)/\tkz@init@ystep}} + \node[#1] at (\tkzpt@xa,\tkzpt@ya){#3};% + \fi +\endgroup +}% +% %<--------------------------------------------------------------------------–> +% % légende +% %<--------------------------------------------------------------------------–> +\pgfkeys{/tkzlegend/.cd, + line/.is if = tkz@legend@line, + line/.default = true, + line = false, + /tkzlegend/.search also = {/tikz}, +} +\def\tkzLegend{\pgfutil@ifnextchar[{\tkz@Legend}{\tkz@Legend[]}} +\def\tkz@Legend[#1](#2,#3)#4{% +\pgfqkeys{/tkzlegend}{#1} +\begingroup + \c@pgfmath@counta=0 % + \edef\tkzpt@xa{\fpeval{(#2-\tkz@init@xorigine)/\tkz@init@xstep}} + \edef\tkzpt@ya{\fpeval{(#3-\tkz@init@yorigine)/\tkz@init@ystep}} + \node[/tkzlegend/.cd,#1] at (\tkzpt@xa,\tkzpt@ya) {% +\begin{tikzpicture} + \foreach \motif/\size/\col/\mtext in {#4}{% + \iftkz@legend@line + \draw[color = \col, + line width = \size, + style = \motif, + text = \tkz@mainlinecolor]% + (0cm ,\the\c@pgfmath@counta ex)--% + (\tkz@legend@line@len,\the\c@pgfmath@counta ex) + \else + \draw plot[mark size = \size,% + mark = \motif,% + mark options = {color=\col}]% + coordinates{(0 ex,\the\c@pgfmath@counta ex)}% + \fi + node[right=1ex] {\mtext}; + \global\advance\c@pgfmath@counta by 3 % + }% + +\end{tikzpicture}% +};% +\endgroup +} +\makeatother +\endinput \ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex new file mode 100644 index 0000000000..eb9c52317f --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex @@ -0,0 +1,178 @@ +% tkz-tools-eu-utilities +% 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-eu-utilities.tex} +\makeatletter +\pgfkeys{/tkzClip/.cd, +space/.store in = {\tkz@CLI@space}, +space = {}} + +\def\tkzClip{\pgfutil@ifnextchar[{\tkz@Clip}{\tkz@Clip[]}} +\def\tkz@Clip[#1]{% + +\pgfqkeys{/tkzClip}{#1} +\ifx\tkzutil@empty\tkz@CLI@space + \clip (\tkz@xa,\tkz@ya) rectangle (\tkz@xb,\tkz@yb); + \else + \edef\tkz@xxa{\fpeval{\tkz@xa-\tkz@CLI@space}} + \edef\tkz@yya{\fpeval{\tkz@ya-\tkz@CLI@space}} + \edef\tkz@xxb{\fpeval{\tkz@xb+\tkz@CLI@space}} % correction bug 2020 + \edef\tkz@yyb{\fpeval{\tkz@yb+\tkz@CLI@space}} + \clip (\tkz@xxa,\tkz@yya) rectangle (\tkz@xxb,\tkz@yyb); +\fi +} + +% for testing results +\def\extractxy#1{% +\pgfextractx{\pgf@x}{\pgfpointanchor{#1}{center}} +\pgfextracty{\pgf@y}{\pgfpointanchor{#1}{center}} +} +%<-------------- some tools -------------------------------------------------> +\def\tkzutil@empty{} +\def\tkzutil@firstofone#1{#1} +\def\tkzutil@firstoftwo#1#2{#1} +\def\tkzutil@secondoftwo#1#2{#2} +%<--------------------------------------------------------------------------–> +\long\def\tkzutil@ifundefined#1{% + \expandafter\ifx\csname#1\endcsname\relax + \expandafter\tkzutil@firstoftwo + \else + \expandafter\tkzutil@secondoftwo + \fi} +%<--------------------------------------------------------------------------–> +\long\def\iftkznodedefined#1#2#3{% + \tkzutil@ifundefined{pgf@sh@ns@#1}{#3}{#2}% +} +%<--------------------------------------------------------------------------–> +\gdef\tkzActivOff{% + \edef\tkzTwoPtCode{\the\catcode`\:} + \edef\tkzPtExCode{\the\catcode`\!} + \edef\tkzPtVirCode{\the\catcode`\;} + \catcode`\:=12 \catcode`\!=12 \catcode`\;=12 + }% +\gdef\tkzActivOn{% + \catcode`\:=\tkzTwoPtCode\relax + \catcode`\!=\tkzPtExCode\relax + \catcode`\;=\tkzPtVirCode\relax +}% +%<--------------------------------------------------------------------------–> +% Pour savoir le nombre de décimales d'un nombre +% le nombre dans #1 et le résultat dans \c@pgfmath@countb +%<--------------------------------------------------------------------------–> +\newcommand\tkz@getdecimal[1]{\expandafter\@getdecimal#1.\@nil} +\def\@getdecimal#1.#2\@nil{% + \ifx\empty#2\empty + % Si #2 est vide, c'est qu'il n'y avait pas de point + % dans la chaîne initiale + \c@pgfmath@countb0 % + \gdef\tkz@decpart{}% + \else + % sinon c'est la chaîne qui suit le point décimal... + \CountToken{#2}% + % ... y compris le point en trop ajouté par \tkz@getdecimal :-) + \advance\c@pgfmath@countb by-1 % + \@@getdecimal#2\@nil + \fi +} +\def\@@getdecimal#1.\@nil{\gdef\tkz@decpart{#1}} +%<---------------------------------------------------------–> +% code from JCC modifi +\newcommand\CountToken[1]{% + \c@pgfmath@countb0 % + \expandafter\C@untToken#1\@nil +%modifi ajout du expandafter +} +\newcommand\C@untToken{% + \afterassignment\C@untT@ken\let\CurrT@ken= +} +\newcommand\C@untT@ken{% + \ifx\CurrT@ken\@nil \else + \advance\c@pgfmath@countb by1 % + \expandafter\C@untToken + \fi +} +%<---------------------------------------------------------–> +\def\tkz@recuplast(#1,#2){\def\tkz@last{#1}} +\def\tkz@stop{\tkz@stop} +% end code from JCC +%<---------------------------------------------------------–> +% Tools +%<---------------------------------------------------------–> +%<–––––––– code from TeX in Practice ––––––––> +\def\SubStringConditional #1#2{% + TT\fi + \edef\@MainString{#1}% + \edef\@SubStringConditionalTemp{{#1}{#2}}% + \expandafter\@SubStringConditional\@SubStringConditionalTemp +} +\def\@SubStringConditional #1#2{% + \def\@TestSubS ##1#2##2\\{% + \def\@TestTemp{##1}% + }% + \@TestSubS #1#2\\ + \ifx\@MainString\@TestTemp + \tkz@TestSubStringfalse + \else + \tkz@TestSubStringtrue + \fi + \iftkz@TestSubString +} +\def\RecursionMacroEnd #1#2#3{% + #1\relax + \def\@RecursionMacroEndNext{#2}% + \else + \def\@RecursionMacroEndNext{#3}% + \fi + \@RecursionMacroEndNext +} +\def\ReplaceSubStrings #1#2#3#4{% + \def\@ReplaceResult{#1}% + \edef\@ReplaceMain{#2}% + \edef\@ReplaceSub{#3}% + \edef\@ReplaceSubRep{#4}% + \@ReplaceSubStrings +} +\def\@ReplaceSubStrings{% + \RecursionMacroEnd + {\if\SubStringConditional{\@ReplaceMain}{\@ReplaceSub}}% + {\@ReplaceSubStringsDo}{\expandafter\edef\@ReplaceResult{\@ReplaceMain}}% +} +\def\@ReplaceSubStringsDoX{% + \def\@ReplaceSubStringsDoA ##1% +}% +\def\@ReplaceSubStringsDo{% + \expandafter\@ReplaceSubStringsDoX \@ReplaceSub + ##2\@EndReplaceSubStrings{% + \edef\@ReplaceMain{##1\@ReplaceSubRep ##2}% + }% + \expandafter\@ReplaceSubStringsDoA\@ReplaceMain + \@EndReplaceSubStrings + \@ReplaceSubStrings +} +%<---------------------------------------------------------–> +\def\DisabledNumprint{% + \let\tkz@numprint\numprint + \let\numprint\relax + } +\def\EnabledNumprint{\let\numprint\tkz@numprint} +%<---------------------------------------------------------–> + +%<---------------------------------------------------------–> + \def\tkzHelpGrid{% + \draw[help lines] (current bounding box.south west) grid + (current bounding box.north east); + } + +\makeatother +\endinput \ No newline at end of file -- cgit v1.2.3