summaryrefslogtreecommitdiff
path: root/macros/latex/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib')
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/README.md25
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamercolorthemeSimplePlus.sty48
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerfontthemeSimplePlus.sty40
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerinnerthemeSimplePlus.sty98
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.pdfbin37296 -> 113274 bytes
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.tex29
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerthemeSimplePlus.sty25
-rw-r--r--macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/reference.bib9
-rw-r--r--macros/latex/contrib/fillpages/GFM-FP-LogoS.pdf69
-rw-r--r--macros/latex/contrib/fillpages/GFM-FP-LogoS.svg77
-rw-r--r--macros/latex/contrib/fillpages/README.md16
-rw-r--r--macros/latex/contrib/fillpages/fillpages-documentation.pdfbin0 -> 114627 bytes
-rw-r--r--macros/latex/contrib/fillpages/fillpages-documentation.tex201
-rw-r--r--macros/latex/contrib/fillpages/fillpages.sty192
-rw-r--r--macros/latex/contrib/reledmac/doc-more/page-typesetting-columns.pdfbin40803 -> 40806 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/1-criticalendnotes.pdfbin201562 -> 219395 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/1-criticalnotes.pdfbin197818 -> 217547 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/1-sidenotes.pdfbin295212 -> 317623 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/1-tabular.pdfbin285559 -> 302262 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/1-verses-doublenumbering.pdfbin198959 -> 218932 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/1-verses.pdfbin198796 -> 218765 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-antilabe.pdfbin210970 -> 226860 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-cross_referencing.pdfbin198303 -> 217557 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-footnote_spacing.pdfbin201445 -> 221183 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-glossaries.pdfbin285501 -> 304556 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-indexing.pdfbin278069 -> 293298 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-lemma_disambigution.pdfbin276219 -> 296361 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-line_numbers_in_header.pdfbin292435 -> 310971 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-linespacing.pdfbin286624 -> 308961 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-manuscript-apparatus.pdfbin288122 -> 311175 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-notes-width.pdfbin204669 -> 224507 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-one_series_per_pstart.pdfbin212239 -> 228665 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-performances.pdfbin284580 -> 304513 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-reledmac-right-to-left.pdfbin36941 -> 36941 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.pdfbin310601 -> 326572 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-titles_in_line_numbering_with_notes.pdfbin288795 -> 307141 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/2-titles_not_in_line_numbering.pdfbin199919 -> 215983 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_columns_different_languages.pdfbin23442 -> 23452 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_mwe.pdfbin175645 -> 192015 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdfbin32049 -> 32049 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdfbin289211 -> 308067 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted-nomax.pdfbin200045 -> 200045 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted.pdfbin199281 -> 199281 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_default.pdfbin177110 -> 177110 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax-shifted.pdfbin199684 -> 199684 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax.pdfbin198615 -> 198615 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nosync.pdfbin198673 -> 198673 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_shifted.pdfbin198798 -> 198798 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column-continuous-numbering.pdfbin214375 -> 231239 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column.pdfbin210491 -> 230473 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_columns_alignment.pdfbin204973 -> 221264 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdfbin298425 -> 316537 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_inside-outside-columns.pdfbin204015 -> 220259 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_one_series_per_pstart.pdfbin225554 -> 241756 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_pages_long_notes.pdfbin251039 -> 268264 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_pages_notes_leftpage.pdfbin202382 -> 222395 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdfbin198565 -> 218311 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_pages_titles_in_line_numbering_with_notes.pdfbin302779 -> 321302 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdfbin206948 -> 223098 bytes
-rw-r--r--macros/latex/contrib/reledmac/examples/4-reledpar_verse_text_between.pdfbin194201 -> 214060 bytes
-rw-r--r--macros/latex/contrib/reledmac/migration.pdfbin368426 -> 368426 bytes
-rw-r--r--macros/latex/contrib/reledmac/reledmac.dtx4
-rw-r--r--macros/latex/contrib/reledmac/reledmac.pdfbin2161963 -> 2162003 bytes
-rw-r--r--macros/latex/contrib/reledmac/reledpar.pdfbin1040784 -> 1040784 bytes
-rw-r--r--macros/latex/contrib/scrlayer-fancyhdr/README.md2
-rw-r--r--macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.dtx155
-rw-r--r--macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.pdfbin330252 -> 332539 bytes
-rw-r--r--macros/latex/contrib/tabularray-abnt/changelog.txt4
-rw-r--r--macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.pdfbin87407 -> 88342 bytes
-rw-r--r--macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.tex2
-rw-r--r--macros/latex/contrib/tabularray-abnt/tabularray-abnt.sty249
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/README.md19
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex1092
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex970
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex75
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex2
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex62
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex1
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex6
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex7
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex87
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex2
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex1079
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex239
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex2
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex2
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex365
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-news.tex8
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex64
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex5
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-theorems.tex747
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transfers.tex47
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/search_circle.lua29
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdfbin851403 -> 970429 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/search_circle.lua29
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.pdfbin20614 -> 20614 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdfbin16396 -> 16396 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.pdfbin17162 -> 17130 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.tex11
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.pdfbin11341 -> 11335 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.tex7
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_5.pdfbin0 -> 2432 bytes
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_5.tex28
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty12
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua328
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua153
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua259
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua116
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua35
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_matrices.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua43
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua159
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua578
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_matrices.lua51
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua86
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua161
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua4
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua66
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua20
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua94
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua119
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua4
129 files changed, 6163 insertions, 2387 deletions
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/README.md b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/README.md
index b39a3a0290..beacd9c471 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/README.md
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/README.md
@@ -1,24 +1,11 @@
-# SimplePlus Beamer Theme
+# 🍃 SimplePlus Beamer Theme
-A simple and clean beamer template.
+The **SimplePlus Beamer Theme** is a minimalist and elegant LaTeX template tailored for academic and scientific presentations.
-**Website:**
-
-https://github.com/PM25/SimplePlus-BeamerTheme
-
-**Overleaf:**
-
-https://www.overleaf.com/latex/templates/simpleplus-beamertheme/wfmfjhdcrdfx
-
-**Author:**
-
-Pin-Yen Huang (pyhuang97@gmail.com)
-
-**Compiled sample document:**
-
-beamertheme-simpleplus-sample.pdf
+- Overleaf: https://www.overleaf.com/latex/templates/simpleplus-beamertheme/wfmfjhdcrdfx
+- CTAN: https://ctan.org/pkg/beamertheme-simpleplus
+- Github: https://github.com/pm25/SimplePlus-BeamerTheme
## License
-This is free and unencumbered software released into the public domain.
-For more information, please see the file `LICENSE` or refer to <http://unlicense.org>. \ No newline at end of file
+This project is released under the **Unlicense License**, granting you complete freedom to use, modify, and distribute the template. For more details, see the [LICENSE](./LICENSE) file. \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamercolorthemeSimplePlus.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamercolorthemeSimplePlus.sty
index 906498e407..5ab1413ee0 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamercolorthemeSimplePlus.sty
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamercolorthemeSimplePlus.sty
@@ -1,33 +1,37 @@
-% !TEX TS-program = xelatex
-% !TEX encoding = UTF-8 Unicode
+%-------------------------------------------------------------
+% Package: beamertheme-SimplePlus
+% Author: Pin-Yen Huang (pyhuang97@gmail.com)
+% Version: 1.1, 2025-01-07
+% Link: https://github.com/pm25/SimplePlus-BeamerTheme
+% This is free and unencumbered software released into the
+% public domain; see <http://unlicense.org> for details.
+%-------------------------------------------------------------
-%----------------------------------------------------------------------------------------
-% Package: beamertheme-SimplePlus
-% Author: Pin-Yen Huang (pyhuang97@gmail.com)
-% Version: 1.0, 2021-12-16
-% Link: https://github.com/PM25/SimplePlus-BeamerTheme
-% This is free and unencumbered software released into the
-% public domain; see <http://unlicense.org> for details.
-%----------------------------------------------------------------------------------------
+%--------------------------------------
+% Color Settings
+%--------------------------------------
-% define color
-\definecolor{InvisibleRed}{rgb}{0.97, 0.92, 0.92}
-\definecolor{InvisibleGreen}{rgb}{0.92, 0.97, 0.92}
-\definecolor{InvisibleBlue}{rgb}{0.92, 0.92, 0.97}
+% define custom colors
+\definecolor{MutedRed}{rgb}{0.97, 0.92, 0.92}
+\definecolor{MutedGreen}{rgb}{0.92, 0.97, 0.92}
+\definecolor{MutedBlue}{rgb}{0.92, 0.92, 0.97}
+\definecolor{MutedBlack}{rgb}{0.95, 0.95, 0.95}
\definecolor{MediumRed}{rgb}{0.925, 0.345, 0.345}
\definecolor{MediumGreen}{rgb}{0.37, 0.7, 0.66}
\definecolor{MediumBlue}{rgb}{0.015, 0.315, 0.45}
+\definecolor{MediumBlack}{rgb}{0.219, 0.259, 0.349}
-\definecolor{DarkBlue}{rgb}{0.05, 0.15, 0.35}
+\definecolor{DarkBlue}{rgb}{0.05, 0.15, 0.35}
-% set color
+% set beamer color themes
\usecolortheme[named=DarkBlue]{structure}
+% customize colors for elements
\setbeamercolor{titlelike}{parent=structure}
-\setbeamercolor{block title}{bg=MediumBlue}
-\setbeamercolor{block body}{bg=InvisibleBlue}
-\setbeamercolor{block title example}{bg=MediumGreen}
-\setbeamercolor{block body example}{bg=InvisibleGreen}
-\setbeamercolor{block title alerted}{bg=MediumRed}
-\setbeamercolor{block body alerted}{bg=InvisibleRed} \ No newline at end of file
+\setbeamercolor{block title}{fg=white,bg=MediumBlue}
+\setbeamercolor{block body}{fg=black,bg=MutedBlue}
+\setbeamercolor{block title example}{fg=white,bg=MediumGreen}
+\setbeamercolor{block body example}{fg=black,bg=MutedGreen}
+\setbeamercolor{block title alerted}{fg=white,bg=MediumRed}
+\setbeamercolor{block body alerted}{fg=black,bg=MutedRed} \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerfontthemeSimplePlus.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerfontthemeSimplePlus.sty
index 9c57bc7cc3..840a09a679 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerfontthemeSimplePlus.sty
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerfontthemeSimplePlus.sty
@@ -1,38 +1,32 @@
-% !TEX TS-program = xelatex
-% !TEX encoding = UTF-8 Unicode
-
-%----------------------------------------------------------------------------------------
-% Package: beamertheme-SimplePlus
-% Author: Pin-Yen Huang (pyhuang97@gmail.com)
-% Version: 1.0, 2021-12-16
-% Link: https://github.com/PM25/SimplePlus-BeamerTheme
-% This is free and unencumbered software released into the
-% public domain; see <http://unlicense.org> for details.
-%----------------------------------------------------------------------------------------
-
-\mode<presentation>
-
-%%%%%%%%%%%% fonts
+%-------------------------------------------------------------
+% Package: beamertheme-SimplePlus
+% Author: Pin-Yen Huang (pyhuang97@gmail.com)
+% Version: 1.1, 2025-01-07
+% Link: https://github.com/pm25/SimplePlus-BeamerTheme
+% This is free and unencumbered software released into the
+% public domain; see <http://unlicense.org> for details.
+%-------------------------------------------------------------
+
+%--------------------------------------
+% Font Settings
+%--------------------------------------
\setbeamerfont{structure}{family=\sffamily,series=\mdseries}
-\setbeamerfont{title}{size=\huge,series=\bfseries,parent=structure}
+\setbeamerfont{title}{size=\LARGE,series=\bfseries,parent=structure}
\setbeamerfont{subtitle}{size=\normalsize,parent=title}
\setbeamerfont{date}{size=\scriptsize,series=\mdseries,parent=structure}
\setbeamerfont{author}{size=\large,series=\mdseries,parent=structure}
\setbeamerfont{institute}{size=\scriptsize,series=\mdseries,parent=structure}
-\setbeamerfont{section in toc}{size=\Large,series=\bfseries,parent=structure}
+\setbeamerfont{section in toc}{size=\large,series=\bfseries,parent=structure}
\setbeamerfont{section in head/foot}{size=\tiny,parent=structure}
\setbeamerfont{subsection in toc}{size=\small,series=\mdseries,parent={section in toc}}
-\setbeamerfont{frametitle}{size=\LARGE,series=\bfseries,parent=structure}
-\setbeamerfont{framesubtitle}{parent=frametitle,size=\Large}
+\setbeamerfont{frametitle}{size=\Large,series=\bfseries,parent=structure}
+\setbeamerfont{framesubtitle}{parent=frametitle,size=\large}
\setbeamerfont{caption}{size=\footnotesize}
\setbeamerfont{item}{parent=structure,series=\mdseries}
-\setbeamerfont{block title}{size=\large,series=\mdseries,parent={structure,block body}}
-
-\mode
-<all>
+\setbeamerfont{block title}{size=\large,series=\mdseries,parent={structure,block body}} \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerinnerthemeSimplePlus.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerinnerthemeSimplePlus.sty
index 43ab163d18..f6475f0948 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerinnerthemeSimplePlus.sty
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerinnerthemeSimplePlus.sty
@@ -1,60 +1,78 @@
-% !TEX TS-program = xelatex
-% !TEX encoding = UTF-8 Unicode
-
-%----------------------------------------------------------------------------------------
-% Package: beamertheme-SimplePlus
-% Author: Pin-Yen Huang (pyhuang97@gmail.com)
-% Version: 1.0, 2021-12-16
-% Link: https://github.com/PM25/SimplePlus-BeamerTheme
-% This is free and unencumbered software released into the
-% public domain; see <http://unlicense.org> for details.
-%----------------------------------------------------------------------------------------
+%-------------------------------------------------------------
+% Package: beamertheme-SimplePlus
+% Author: Pin-Yen Huang (pyhuang97@gmail.com)
+% Version: 1.1, 2025-01-07
+% Link: https://github.com/pm25/SimplePlus-BeamerTheme
+% This is free and unencumbered software released into the
+% public domain; see <http://unlicense.org> for details.
+%-------------------------------------------------------------
-\pgfdeclareverticalshading[lower.bg,upper.bg]{bmb@transition}{200cm}{%
- color(0pt)=(lower.bg); color(2pt)=(lower.bg); color(4pt)=(lower.bg)}
+%--------------------------------------
+% Inner Theme Settings
+%--------------------------------------
-\setbeamersize{text margin left=2em,text margin right=2em}
+\pgfdeclareverticalshading[lower.bg,upper.bg]{bmb@transition}{200cm}{%
+color(0pt)=(lower.bg); color(2pt)=(lower.bg); color(4pt)=(lower.bg)}
-% table of contents (overview)
-\setbeamertemplate{section in toc}[sections numbered]
-\setbeamertemplate{subsection in toc}{\leavevmode\leftskip=3.2em\rlap{\hskip-2em\inserttocsectionnumber.\inserttocsubsectionnumber}\inserttocsubsection\par}
+\setbeamersize{text margin left=2em,text margin right=2em}
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{navigation symbols}{}
+
\setbeamertemplate{blocks}[rounded][shadow=false]
+
\setbeamertemplate{enumerate items}[default]
+\setbeamertemplate{enumerate subitem}[default]
+\setbeamertemplate{itemize items}[circle]
+\setbeamertemplate{itemize subitem}[circle]
+
+% table of contents (overview) settings
+\setbeamertemplate{section in toc}[sections numbered]
+\setbeamertemplate{subsection in toc}{%
+ \leavevmode
+ \leftskip=3.2em
+ \rlap{\hskip-2em\inserttocsectionnumber.\inserttocsubsectionnumber}
+ \inserttocsubsection\par
+}
-\setbeamertemplate{frametitle}{\vspace*{0.5em}\bfseries\insertframetitle\par\vskip-6pt\hrulefill\vspace{-0.1em}}
+% frame title customization
+\setbeamertemplate{frametitle}{%
+ \vspace*{0.5em}
+ \bfseries\insertframetitle\par
+ \vskip-6pt
+ \hrulefill\vspace{-0.1em}
+}
-\setbeamertemplate{title page}{
- \vspace{7em}
+% title page customization
+\setbeamertemplate{title page}{%
+ \vspace{6em}
\begingroup
- \centering
- % ------------------------
- \begin{beamercolorbox}[sep=8pt,center]{title}
+ \centering
+ % ------------------------
+ \begin{beamercolorbox}[sep=10pt,center]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
- \vskip0.25em%
- {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
- \fi%
- \end{beamercolorbox}%
- \vskip0.5em\par
- % ------------------------
- \begin{beamercolorbox}[sep=8pt,center]{author}
+ \vskip0.25em%
+ {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
+ \fi%
+ \end{beamercolorbox}%
+ \vskip0.5em\par
+ % ------------------------
+ \begin{beamercolorbox}[sep=8pt,center]{author}
\usebeamerfont{author}\insertauthor
- \end{beamercolorbox}
- \vskip-1em
- % ------------------------
- \begin{beamercolorbox}[sep=8pt,center]{institute}
+ \end{beamercolorbox}
+ \vskip-1em
+ % ------------------------
+ \begin{beamercolorbox}[sep=8pt,center]{institute}
\usebeamerfont{institute}\insertinstitute
- \end{beamercolorbox}
- % ------------------------
- \begin{beamercolorbox}[sep=8pt,center]{date}
+ \end{beamercolorbox}
+ % ------------------------
+ \begin{beamercolorbox}[sep=8pt,center]{date}
\usebeamerfont{date}\insertdate
- \end{beamercolorbox}\vskip0.5em
- % ------------------------
- {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
+ \end{beamercolorbox}\vskip0.5em
+ % ------------------------
+ {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\endgroup
\vfill
} \ No newline at end of file
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.pdf
index 4f56de719a..db79862286 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.pdf
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.pdf
Binary files differ
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.tex
index 17e105a5b8..f4751b3107 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.tex
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamertheme-simpleplus-sample.tex
@@ -1,6 +1,7 @@
%----------------------------------------------------------------------------------------
-% PACKAGES AND THEMES
+% PACKAGES AND THEMES
%----------------------------------------------------------------------------------------
+
\documentclass[aspectratio=169,xcolor=dvipsnames]{beamer}
\usetheme{SimplePlus}
@@ -9,24 +10,23 @@
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
%----------------------------------------------------------------------------------------
-% TITLE PAGE
+% TITLE PAGE
%----------------------------------------------------------------------------------------
-\title[short title]{Simple Beamer Theme} % The short title appears at the bottom of every slide, the full title is only on the title page
+\title{Simple Beamer Theme}
\subtitle{Subtitle}
-\author[Pin-Yen] {Pin-Yen Huang}
+\author{Pin-Yen Huang}
-\institute[NTU] % Your institution as it will appear on the bottom of every slide, may be shorthand to save space
+\institute
{
Department of Computer Science and Information Engineering \\
National Taiwan University % Your institution for the title page
}
-\date{Dec 16, 2021} % Date, can be changed to a custom date
-
+\date{\today} % Date, can be changed to a custom date
%----------------------------------------------------------------------------------------
-% PRESENTATION SLIDES
+% PRESENTATION SLIDES
%----------------------------------------------------------------------------------------
\begin{document}
@@ -86,7 +86,7 @@
\item Example
\end{enumerate}
- \column{.5\textwidth} % Right column and width
+ \column{.45\textwidth} % Right column and width
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer lectus nisl, ultricies in feugiat rutrum, porttitor sit amet augue. Aliquam ut tortor mauris. Sed volutpat ante purus, quis accumsan dolor.
\end{columns}
@@ -140,14 +140,9 @@
%------------------------------------------------
\begin{frame}{References}
- % Beamer does not support BibTeX so references must be inserted manually as below
- \footnotesize{
- \begin{thebibliography}{99}
- \bibitem[Smith, 2012]{p1} John Smith (2012)
- \newblock Title of the publication
- \newblock \emph{Journal Name} 12(3), 45 -- 678.
- \end{thebibliography}
- }
+ \footnotesize
+ \bibliography{reference.bib}
+ \bibliographystyle{apalike}
\end{frame}
%------------------------------------------------
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerthemeSimplePlus.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerthemeSimplePlus.sty
index 5ff53a743e..01c94d97aa 100644
--- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerthemeSimplePlus.sty
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/beamerthemeSimplePlus.sty
@@ -1,21 +1,18 @@
-% !TEX TS-program = xelatex
-% !TEX encoding = UTF-8 Unicode
+%-------------------------------------------------------------
+% Package: beamertheme-SimplePlus
+% Author: Pin-Yen Huang (pyhuang97@gmail.com)
+% Version: 1.1, 2025-01-07
+% Link: https://github.com/pm25/SimplePlus-BeamerTheme
+% This is free and unencumbered software released into the
+% public domain; see <http://unlicense.org> for details.
+%-------------------------------------------------------------
-%----------------------------------------------------------------------------------------
-% Package: beamertheme-SimplePlus
-% Author: Pin-Yen Huang (pyhuang97@gmail.com)
-% Version: 1.0, 2021-12-16
-% Link: https://github.com/PM25/SimplePlus-BeamerTheme
-% This is free and unencumbered software released into the
-% public domain; see <http://unlicense.org> for details.
-%----------------------------------------------------------------------------------------
+%--------------------------------------
+% Beamer Settings
+%--------------------------------------
\mode<presentation>
-% Settings
-\usetheme{Madrid}
-\useinnertheme{circles}
-
\usefonttheme{SimplePlus}
\usecolortheme{SimplePlus}
\useinnertheme{SimplePlus}
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/reference.bib b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/reference.bib
new file mode 100644
index 0000000000..20a1e8119e
--- /dev/null
+++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-simpleplus/reference.bib
@@ -0,0 +1,9 @@
+@article{p1,
+ author = {John Smith},
+ title = {Title of the publication},
+ journal = {Journal Name},
+ year = {2012},
+ volume = {12},
+ number = {3},
+ pages = {45--678}
+} \ No newline at end of file
diff --git a/macros/latex/contrib/fillpages/GFM-FP-LogoS.pdf b/macros/latex/contrib/fillpages/GFM-FP-LogoS.pdf
new file mode 100644
index 0000000000..10a2f3bd4c
--- /dev/null
+++ b/macros/latex/contrib/fillpages/GFM-FP-LogoS.pdf
@@ -0,0 +1,69 @@
+%PDF-1.5
+%
+3 0 obj
+<< /Length 4 0 R
+ /Filter /FlateDecode
+>>
+stream
+x
+@ {^smVAp8Bء:j[ ߑ?_:Hu<zwj'xo]`?gEg4HD#NA1Gk=d@WX0482~`3ˮPo-(aҾh*I:R3K%IBKdՁi ){/&h3V'zM@
+endstream
+endobj
+4 0 obj
+ 172
+endobj
+2 0 obj
+<<
+ /ExtGState <<
+ /a0 << /CA 1 /ca 1 >>
+ >>
+>>
+endobj
+5 0 obj
+<< /Type /Page
+ /Parent 1 0 R
+ /MediaBox [ 0 0 10.2416 11.596 ]
+ /Contents 3 0 R
+ /Group <<
+ /Type /Group
+ /S /Transparency
+ /I true
+ /CS /DeviceRGB
+ >>
+ /Resources 2 0 R
+>>
+endobj
+1 0 obj
+<< /Type /Pages
+ /Kids [ 5 0 R ]
+ /Count 1
+>>
+endobj
+6 0 obj
+<< /Creator (cairo 1.14.1 (http://cairographics.org))
+ /Producer (cairo 1.14.1 (http://cairographics.org))
+>>
+endobj
+7 0 obj
+<< /Type /Catalog
+ /Pages 1 0 R
+>>
+endobj
+xref
+0 8
+0000000000 65535 f
+0000000579 00000 n
+0000000286 00000 n
+0000000015 00000 n
+0000000264 00000 n
+0000000358 00000 n
+0000000644 00000 n
+0000000771 00000 n
+trailer
+<< /Size 8
+ /Root 7 0 R
+ /Info 6 0 R
+>>
+startxref
+823
+%%EOF
diff --git a/macros/latex/contrib/fillpages/GFM-FP-LogoS.svg b/macros/latex/contrib/fillpages/GFM-FP-LogoS.svg
new file mode 100644
index 0000000000..d8737ce006
--- /dev/null
+++ b/macros/latex/contrib/fillpages/GFM-FP-LogoS.svg
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="12.802"
+ height="14.495"
+ viewBox="0 0 12.802 14.495"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="GFM-FP-LogoS.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="5.6"
+ inkscape:cx="-4.8038846"
+ inkscape:cy="14.476093"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ units="px"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="1920"
+ inkscape:window-height="1028"
+ inkscape:window-x="-8"
+ inkscape:window-y="-8"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Ebene 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1037.8672)">
+ <path
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.69999999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:6.0999999;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 6.2940256,1049.3204 5.3608584,0 -4.0000004,2.6918 -6.160715,0 z"
+ id="rect4140-8-3"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.69999999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:6.0999999;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 6.2940266,1047.0973 5.3608584,0 -4.0000004,2.6918 -6.160715,0 z"
+ id="rect4140-6-6"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ <path
+ style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:0.69999999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:6.0999999;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ d="m 6.1394976,1044.8746 5.3608584,0 -4.0000004,2.6918 -6.160715,0 z"
+ id="rect4140-0"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc" />
+ </g>
+</svg>
diff --git a/macros/latex/contrib/fillpages/README.md b/macros/latex/contrib/fillpages/README.md
new file mode 100644
index 0000000000..2aa88adffd
--- /dev/null
+++ b/macros/latex/contrib/fillpages/README.md
@@ -0,0 +1,16 @@
+# fillpages package
+This package fills your document with blank or predefined pages to match a page count, that is suitable for printing (i.e. dividable by 4).
+
+There are three commands:
+\pagesDividableBy{<most likely 4, 8 or 16>}[<some optional offset i.e. 2>]
+\setFillPage{<put something in here, if you don't like blank pages>}
+\insertFillPages
+
+The last one defines the insertion point. There can be an arbitrary number of insertion points. Before every insertFillPages command there should be a clearpage command to assert, that there is a page break before, and avoid strange behaviour.
+
+# license, version, author
+This work is published under the LaTeX project public license 1.3.
+
+2025-01-07: version 1.0.0
+
+Created by Gabriel Ruprecht. \ No newline at end of file
diff --git a/macros/latex/contrib/fillpages/fillpages-documentation.pdf b/macros/latex/contrib/fillpages/fillpages-documentation.pdf
new file mode 100644
index 0000000000..3ae14b806f
--- /dev/null
+++ b/macros/latex/contrib/fillpages/fillpages-documentation.pdf
Binary files differ
diff --git a/macros/latex/contrib/fillpages/fillpages-documentation.tex b/macros/latex/contrib/fillpages/fillpages-documentation.tex
new file mode 100644
index 0000000000..943a48acfe
--- /dev/null
+++ b/macros/latex/contrib/fillpages/fillpages-documentation.tex
@@ -0,0 +1,201 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Made by Gabriel Ruprecht %
+% %
+% This work is published under the %
+% LaTeX project public license 1.3 %
+% %
+% Package version 1.0.0 %
+% 2025-01-07 %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\documentclass[11pt,a4paper]{scrartcl}
+\usepackage[utf8]{inputenc}
+\usepackage[english]{babel}
+\usepackage{graphicx}
+\usepackage{listings}
+\lstset
+{ %Formatting for code in appendix
+ language=TeX,
+ numbers=left,
+ stepnumber=1,
+ showstringspaces=false,
+ tabsize=1,
+ breaklines=true,
+ breakatwhitespace=false,
+ basicstyle=\ttfamily}
+
+
+\usepackage{xcolor}
+\usepackage{hyperref}
+\usepackage{parskip}
+
+\makeatletter
+%\def\FillPages{\makebox{\vspace*{50pt} \includegraphics[height=\f@size pt]{./GFM-FP-Logo}} }
+\def\FillPagesTiny{\includegraphics[height=\f@size pt]{./GFM-FP-LogoTiny}\hspace*{-3pt}}
+\def\FillPagesS{\hspace*{3pt}\includegraphics[height=\f@size pt]{./GFM-FP-LogoS}\hspace*{3pt}}
+\makeatother
+\title{Fill\FillPagesS Pages\FillPagesS Package\vskip 9pt\relax}
+\subtitle{Version 1.0.0}
+\author{Gabriel Ruprecht}
+
+
+\begin{document}
+\maketitle
+\section{Introduction}
+\subsection{About}
+The \textsf{Fill\FillPagesS Pages\FillPagesS Package} can be used, if you create a book, booklet or similar. In these cases you often print something, where your page count must be dividable by 4, 8 or 16. This package fills your document with the needed pages. By default, they are blank, but they may also have a pre-defined content. If you use this package, you have to compile at least two times. The first run counts the pages and inserting positions. This information is then used in the second run, to calculate the number of pages to be inserted.
+
+\subsection{License}
+This package is subject to the LaTeX Project Public License 1.3. You may do whatever you want with. If you change the package and redistribute it, please keep the credits.
+
+\section{Example document}
+The fastest way to see, how it works, is copying this document and play around a little bit:
+
+\begin{lstlisting}[numbers=none]
+\documentclass{report}
+\usepackage[utf8]{inputenc}
+\usepackage[latin,english]{babel}
+\usepackage{lipsum}
+
+\usepackage{fillpages}
+
+\pagesDividableBy{4}
+%\pagesDividableBy{4}[2] % with optional offset
+
+\setFillPage{2}{
+ABC
+
+DEF
+}
+
+\setFillPage{3}{
+123
+
+456
+}
+
+
+\begin{document}
+
+\lipsum
+
+\clearpage
+\insertFillPages
+\insertFillPages
+
+\lipsum
+\lipsum
+\pagenumbering{Roman}
+\lipsum
+\lipsum
+
+\clearpage
+\insertFillPages
+
+\lipsum
+
+\end{document}
+\end{lstlisting}
+
+\section{Commands}
+You have to define the number which the total page number should be devideable by. Then you define the insertion points for the fill pages. You can define content for any of these pages. After that, you have to run the document at least two times for a proper result. In the first run, the insertion points are counted and the regular page number is collected. On the second run, the pages are inserted.\bigskip
+
+\noindent\verb&\insertFillPages&\\ This command must be placed at the points, where insertion is allowed (insertion points). This can be done at multiple points. The total number of pages to be inserted is divided by the number of insertion points. If there are three insertion points and five pages will be inserted, the insertion will be \verb#1 1 2#. Previous to every \verb+\inserFillPages+ there should be a \verb+\clearpage+. Otherwise the page count will be miscalculated and might toggle.
+
+\noindent\verb&\pagesDividableBy{number}[offset]&\\ This defines the number the page number must be dividable by (default~=~4). If \verb+number+ is 4 and page count is 13, 3 pages will be inserted~(4*4=16; 13+3=16). If \verb+number+ is~4 and \verb+offset+ is 2, the same example will lead to 1 inserted page (3*4=12; 12+2=14; 13+1=14). You can make the page numbers also dividable by 5 with an offset of 3. There is no limitation. The result will always be the minimal number of inserted pages. Dividable by 4, offset 1 has the same result as dividable by 4, offset 5.
+
+\noindent\verb&\setFillPage{pagenumber}{content}&\\
+This creates a custom page, which will be used, if needed. By default all inserted pages are white, but if they shouldn't be white, you can define a content. I.e.
+\begin{lstlisting}[numbers=none]
+ \setFillPage{3}{This is the insert page three}
+\end{lstlisting}\vskip -8pt\relax
+will create a page with the text ''This is the insert page three''. If only 2 pages are needed, it won't be used. If more than 2 are used, it will be. You can define as many fill pages as you want, but only the required amount will appear in your document. The command is defined as long, which means, you are allowed to use paragraphs inside. It behaves almost like any other page in \LaTeX .
+
+\section{What the package uses}
+The package relies solely on standard \LaTeX -core functions.
+
+\section{How it works}
+The principle is really straight forward. The difficulty was to implement it bug free and robust (especially the idempotency).
+
+\begin{enumerate}
+\item First run:
+\begin{enumerate}
+\item Count all places, where pages can be inserted.
+\end{enumerate}
+\item Second run:
+\begin{enumerate}
+\item Calculate the number of total pages without the fill pages, that were inserted.
+\item Do a modulo division on this page count by target divisor (offset must be considered). It is actually not a modulo operation, but this is the principle behind it. Page count is 15, must be dividable by 4 (offset 0), 15\%4=3 $\rightarrow$ 1 page too less.
+\item This number of pages to be inserted is distributed across all insertion points.\\Example 1: 3 insertion points and 3 pages, each gets one page.\\Example 2: 3 insertion points and 4 pages, first two get one page, third one gets two pages. This is done by the total limit. At the first point total limit is 1.33 $\rightarrow$ 1 inserted. At the second point, limit is 2.66, 1 already inserted $\rightarrow$ insert 1. At the third insertion point the total limit is 4, 2 already inserted $\rightarrow$ insert 2.
+\end{enumerate}
+\end{enumerate}
+
+\section{References and interferences}
+To avoid any interference with other packages, I listed the most probable causes for interference.
+
+The package uses the \verb+\AtBeginDocument+ and \verb+\AtEndDocument+ document hook. If there is some issue with them, it won't work. I experienced some weird behaviour in koma classes with a beta-version of this package, which I couldn't explain. Therefore, it is mentioned here.
+
+The package writes the following lines to the aux-file:\begin{lstlisting}[breaklines, numbers=none]
+ \global\GFM@FiPa@numberOfFillPagePositions=<Number of fill page positions>}
+
+ \global\GFM@FiPa@numberOfInsertedPages=<Page count of fill pages>}
+\end{lstlisting}\vskip -8pt\relax
+\noindent Make sure, that they don't interfere with anything of other packages or with any of your counters. Due to the naming this shouldn't happen at all.
+
+
+\section{Known problems}
+\subsection{Page number toggles}
+If you have i.e. 10 pages and define dividable by 4, it should be 12 pages, which makes 2 fill pages. If the page number toggles between 11 and 13 every two runs, there are two possible reasons:
+\begin{enumerate}
+\item You didn't put a clearpage before the \verb+\insertFillPages+
+\item You defined a custom fill page which is bigger than one page and will result in two fill pages, though one should be inserted
+\end{enumerate}
+
+
+\section{Bug reports}
+Nothing to say here. You can post any bug reports on bitbucket, if you find some:
+\begin{quote}
+\url{https://bitbucket.org/maestro-glanz/fillpages/src/main/}
+\end{quote}
+If you don't have a bitbucket account and don't want to create one, you can post an email to \mbox{text\color{white}.\color{black}\hspace*{-7.5pt} inkerer.1904$@$gmail.com} and hope, that I read it within 3 month. Note:~Copying the mail address will fail. This is for spam precautions. You have to type it off your screen. This is a good memory exercise to keep your mind vital a flexible.
+
+\section{Revision history}
+\noindent
+\begin{tabular}{l l}
+2017/11/01:& version 0.1.0\\
+2025/01/07:& version 1.0.0
+\end{tabular}
+
+
+\end{document}
+
+\section{Before upload}
+Is the license in
+- the sty- and tex-files?
+- readme?
+
+Is the author name in
+- the sty- and tex-files?
+- readme?
+
+Is the version number in
+- the docu text?
+- the sty- and tex-files (+provides package param)?
+- readme?
+
+Is the correct revision date in
+- the docu text?
+- the sty- and tex-files?
+- readme?
+
+Is the repo link in
+- the docu text?
+- the sty- and tex-files? -> no
+- readme? -> no
+
+
+
+
+
+\chapter{fillpages} \ No newline at end of file
diff --git a/macros/latex/contrib/fillpages/fillpages.sty b/macros/latex/contrib/fillpages/fillpages.sty
new file mode 100644
index 0000000000..c7c170a18e
--- /dev/null
+++ b/macros/latex/contrib/fillpages/fillpages.sty
@@ -0,0 +1,192 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% Made by Gabriel Ruprecht %
+% %
+% This work is published under the %
+% LaTeX project public license 1.3 %
+% %
+% Package version 1.0.0 %
+% 2025-01-07 %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\ProvidesPackage{fillpages}[version 1.0.0]
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Number definitions %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+% How many pages were inserted in the last run
+% (at begin document) and how many pages are already
+% inserted in this run (after begin document). The
+% default value is overwritten with the content from
+% the aux file (if there had ever be a run).
+\newcount\GFM@FiPa@numberOfInsertedPages\relax
+\GFM@FiPa@numberOfInsertedPages=0\relax
+
+% To distribute the fill pages on evenly on all
+% insertion points, they must be counted. Default
+% value must be 1 to avoid division by 0. It will
+% be overwritten by the aux file value.
+\newcount\GFM@FiPa@numberOfFillPagePositions\relax
+\GFM@FiPa@numberOfFillPagePositions=1\relax
+
+% Number of pages, if there weren't any fill pages.
+\newcount\GFM@FiPa@pageCountWithoutFillPages\relax
+\GFM@FiPa@pageCountWithoutFillPages=0\relax
+
+% Self-explaining. Will be calculated. It is a
+% float number, therefore realized as a length.
+\newdimen\GFM@FiPa@pagesPerFillPosition\relax
+\GFM@FiPa@pagesPerFillPosition=0pt\relax
+
+% The currentLimit defines, how many new fill pages
+% are inserted. If there were over all 3 and current
+% limit is 5, 2 fill pages will be inserted at the
+% current insertion point.
+\newdimen\GFM@FiPa@currentLimit\relax
+\GFM@FiPa@currentLimit=0pt\relax
+
+% The number, by which the page number must be
+% dividable.
+\newcount\GFM@FiPa@Divisor\relax
+\GFM@FiPa@Divisor=4\relax
+
+% An offset, if the numbers must be i.e. dividable
+% by 4 and have 2 extra pages.
+\newcount\GFM@FiPa@DivideableOffset\relax
+\GFM@FiPa@DivideableOffset=0\relax
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Set the number by which the %%%
+%%% page count must be dividable %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\NewDocumentCommand\pagesDividableBy{m O{0}}{%
+\GFM@FiPa@Divisor=#1\relax%
+\ifnum\GFM@FiPa@Divisor<1\relax%
+ \PackageError{fillpages.sty}{line 31: Illegal number}{You can't divide a page count by zero. Replaced with 1.}%
+ \GFM@FiPa@Divisor=1\relax%
+\fi%
+\ifnum\GFM@FiPa@Divisor>50\relax%
+ \PackageWarning{fillpages.sty}{Strange number. You want your pages dividable by a number greater than 50}%
+\fi%
+\GFM@FiPa@DivideableOffset=#2\relax%
+}
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Defines a custom fillpage %%%
+%%% %%%
+%%% i.e. \setFillPage{1}{custom Text} lets %%%
+%%% appear "custom Text" on fillpage no. 1 %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\long\def\setFillPage#1#2{
+\expandafter\global\expandafter\def\csname GFM@FiPa@AusgleichSeite#1\endcsname {
+#2%
+}%\def\csname...
+}%\def\setFillPage
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Do the calculations, after %%%
+%%% the aux file had been read. %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\AtBeginDocument{
+% From aux-file:
+% GFM@FiPa@numberOfFillPagePositions
+% GFM@FiPa@numberOfInsertedPages
+
+% Calculate pagesCountWithoutFillPages
+\GFM@FiPa@pageCountWithoutFillPages=\PreviousTotalPages\relax
+\advance\GFM@FiPa@pageCountWithoutFillPages by -\GFM@FiPa@numberOfInsertedPages\relax
+% Reset to 0 for the next counting round.
+\GFM@FiPa@numberOfInsertedPages=0\relax
+
+\GFM@FiPa@pagesPerFillPosition=\the\GFM@FiPa@pageCountWithoutFillPages pt\relax
+\advance\GFM@FiPa@pagesPerFillPosition by -\GFM@FiPa@DivideableOffset pt\relax
+
+\ifdim\GFM@FiPa@pagesPerFillPosition>0 pt%
+\loop%
+\advance\GFM@FiPa@pagesPerFillPosition by -\GFM@FiPa@Divisor pt\relax%
+\ifdim\GFM@FiPa@pagesPerFillPosition>0 pt\repeat%
+%loop%
+\fi
+
+\multiply\GFM@FiPa@pagesPerFillPosition by -1\relax%
+
+\divide\GFM@FiPa@pagesPerFillPosition by \GFM@FiPa@numberOfFillPagePositions\relax%
+
+\GFM@FiPa@numberOfFillPagePositions=0\relax
+}%AtBeginDocument
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% This defines an insertion point %%%
+%%% where the fill pages will appear. %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\def\insertFillPages{%
+% i++ for GFM@FiPa@numberOfFillPagePositions%
+\advance\GFM@FiPa@numberOfFillPagePositions by 1\relax%
+%
+% calculate the GFM@FiPa@currentLimit for insertion%
+\GFM@FiPa@currentLimit=\GFM@FiPa@pagesPerFillPosition\relax%
+\multiply\GFM@FiPa@currentLimit by \GFM@FiPa@numberOfFillPagePositions\relax%
+\advance\GFM@FiPa@currentLimit by -0.98pt\relax%
+%
+% insert pages%
+\ifdim\GFM@FiPa@numberOfInsertedPages pt<\GFM@FiPa@currentLimit%
+ \loop%
+ \advance\GFM@FiPa@numberOfInsertedPages by 1\relax%
+ \clearpage%
+ % choose the content of a predefined page. If it doesn't exist, csname expands to nothing.
+ \csname %
+ GFM@FiPa@AusgleichSeite\the\GFM@FiPa@numberOfInsertedPages
+ \endcsname%
+ \mbox{}%
+ \clearpage%
+ \ifnum\GFM@FiPa@numberOfInsertedPages>1000\relax%
+ \PackageError{fillpages.sty}{line 101: More than 1000 fill pages produced.}{You tried to insert more than 1000 fill pages. This must be an infinite loop.}%
+ \errmessage{Infinite loop detected}
+ \fi%
+ \ifdim\GFM@FiPa@numberOfInsertedPages pt<\GFM@FiPa@currentLimit\repeat%
+ %end loop%
+\fi%ifdim
+}%insertFillPages
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%% Do a calculation and write %%%
+%%% numbers to the aux file. %%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\AtEndDocument{
+% Write to aux
+\ifnum\GFM@FiPa@numberOfFillPagePositions > 0\relax
+ \write\@auxout{%
+ \noexpand\global%
+ \noexpand\GFM@FiPa@numberOfFillPagePositions=%
+ \the\GFM@FiPa@numberOfFillPagePositions%
+ \noexpand\relax}
+\fi
+
+\write\@auxout{%
+ \noexpand\global%
+ \noexpand\GFM@FiPa@numberOfInsertedPages=%
+ \the\GFM@FiPa@numberOfInsertedPages%
+ \noexpand\relax}
+
+% Write to log:
+\wlog{Number of fill page positions: \the\GFM@FiPa@pagesPerFillPosition\relax}%
+\wlog{Number of inserted fill pages: \the\GFM@FiPa@numberOfInsertedPages\relax}%
+
+}%AtEndDocument
+
diff --git a/macros/latex/contrib/reledmac/doc-more/page-typesetting-columns.pdf b/macros/latex/contrib/reledmac/doc-more/page-typesetting-columns.pdf
index fc1cf0d3af..bb035b5476 100644
--- a/macros/latex/contrib/reledmac/doc-more/page-typesetting-columns.pdf
+++ b/macros/latex/contrib/reledmac/doc-more/page-typesetting-columns.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/1-criticalendnotes.pdf b/macros/latex/contrib/reledmac/examples/1-criticalendnotes.pdf
index 7454d1cce0..8e8823eaf0 100644
--- a/macros/latex/contrib/reledmac/examples/1-criticalendnotes.pdf
+++ b/macros/latex/contrib/reledmac/examples/1-criticalendnotes.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/1-criticalnotes.pdf b/macros/latex/contrib/reledmac/examples/1-criticalnotes.pdf
index 51238cf571..8837cf96c5 100644
--- a/macros/latex/contrib/reledmac/examples/1-criticalnotes.pdf
+++ b/macros/latex/contrib/reledmac/examples/1-criticalnotes.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/1-sidenotes.pdf b/macros/latex/contrib/reledmac/examples/1-sidenotes.pdf
index fa4b8cdbb5..9b35be0ccc 100644
--- a/macros/latex/contrib/reledmac/examples/1-sidenotes.pdf
+++ b/macros/latex/contrib/reledmac/examples/1-sidenotes.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/1-tabular.pdf b/macros/latex/contrib/reledmac/examples/1-tabular.pdf
index 80a889d85b..29c2bf7618 100644
--- a/macros/latex/contrib/reledmac/examples/1-tabular.pdf
+++ b/macros/latex/contrib/reledmac/examples/1-tabular.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/1-verses-doublenumbering.pdf b/macros/latex/contrib/reledmac/examples/1-verses-doublenumbering.pdf
index 4881557ce0..5f66355d4d 100644
--- a/macros/latex/contrib/reledmac/examples/1-verses-doublenumbering.pdf
+++ b/macros/latex/contrib/reledmac/examples/1-verses-doublenumbering.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/1-verses.pdf b/macros/latex/contrib/reledmac/examples/1-verses.pdf
index 3caf07a14a..c9eb0a0fae 100644
--- a/macros/latex/contrib/reledmac/examples/1-verses.pdf
+++ b/macros/latex/contrib/reledmac/examples/1-verses.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-antilabe.pdf b/macros/latex/contrib/reledmac/examples/2-antilabe.pdf
index 7c94d43d13..4e7a5356b5 100644
--- a/macros/latex/contrib/reledmac/examples/2-antilabe.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-antilabe.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-cross_referencing.pdf b/macros/latex/contrib/reledmac/examples/2-cross_referencing.pdf
index 0278d89b9f..b001dcf5bd 100644
--- a/macros/latex/contrib/reledmac/examples/2-cross_referencing.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-cross_referencing.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-footnote_spacing.pdf b/macros/latex/contrib/reledmac/examples/2-footnote_spacing.pdf
index 542174e6f0..1da7f5a400 100644
--- a/macros/latex/contrib/reledmac/examples/2-footnote_spacing.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-footnote_spacing.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-glossaries.pdf b/macros/latex/contrib/reledmac/examples/2-glossaries.pdf
index 3ecab9d63b..4c5cac4773 100644
--- a/macros/latex/contrib/reledmac/examples/2-glossaries.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-glossaries.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-indexing.pdf b/macros/latex/contrib/reledmac/examples/2-indexing.pdf
index 607860d6e6..f57e55d740 100644
--- a/macros/latex/contrib/reledmac/examples/2-indexing.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-indexing.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-lemma_disambigution.pdf b/macros/latex/contrib/reledmac/examples/2-lemma_disambigution.pdf
index 26e21be7b9..bc0eb94b3c 100644
--- a/macros/latex/contrib/reledmac/examples/2-lemma_disambigution.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-lemma_disambigution.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-line_numbers_in_header.pdf b/macros/latex/contrib/reledmac/examples/2-line_numbers_in_header.pdf
index b1dca2b117..2fc1098da4 100644
--- a/macros/latex/contrib/reledmac/examples/2-line_numbers_in_header.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-line_numbers_in_header.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-linespacing.pdf b/macros/latex/contrib/reledmac/examples/2-linespacing.pdf
index 499104658b..463b921c2c 100644
--- a/macros/latex/contrib/reledmac/examples/2-linespacing.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-linespacing.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-manuscript-apparatus.pdf b/macros/latex/contrib/reledmac/examples/2-manuscript-apparatus.pdf
index f5f58e81d6..2eba776407 100644
--- a/macros/latex/contrib/reledmac/examples/2-manuscript-apparatus.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-manuscript-apparatus.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-notes-width.pdf b/macros/latex/contrib/reledmac/examples/2-notes-width.pdf
index abaf67b4f6..b989e8ca4f 100644
--- a/macros/latex/contrib/reledmac/examples/2-notes-width.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-notes-width.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-one_series_per_pstart.pdf b/macros/latex/contrib/reledmac/examples/2-one_series_per_pstart.pdf
index 3cda9762d0..c6935d4ee3 100644
--- a/macros/latex/contrib/reledmac/examples/2-one_series_per_pstart.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-one_series_per_pstart.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-performances.pdf b/macros/latex/contrib/reledmac/examples/2-performances.pdf
index c543daa168..5b0cd689f4 100644
--- a/macros/latex/contrib/reledmac/examples/2-performances.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-performances.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-reledmac-right-to-left.pdf b/macros/latex/contrib/reledmac/examples/2-reledmac-right-to-left.pdf
index 9030d23e94..962b25a4a2 100644
--- a/macros/latex/contrib/reledmac/examples/2-reledmac-right-to-left.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-reledmac-right-to-left.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.pdf b/macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.pdf
index 53b0429efc..9ae345af89 100644
--- a/macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-subdivision-number-in-header.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf b/macros/latex/contrib/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf
index 7872a6a918..ec7ce29b75 100644
--- a/macros/latex/contrib/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-titles_in_line_numbering_with_notes.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/2-titles_not_in_line_numbering.pdf b/macros/latex/contrib/reledmac/examples/2-titles_not_in_line_numbering.pdf
index d751ef78ff..9be7ef41a7 100644
--- a/macros/latex/contrib/reledmac/examples/2-titles_not_in_line_numbering.pdf
+++ b/macros/latex/contrib/reledmac/examples/2-titles_not_in_line_numbering.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_columns_different_languages.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_columns_different_languages.pdf
index d05683ac0a..44598e5077 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_columns_different_languages.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_columns_different_languages.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_mwe.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_mwe.pdf
index 71adb5d7bb..2887c4e28e 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_mwe.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_mwe.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf
index 3d12b5b07b..5c9a05d003 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_pages_different_languages_lualatex.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf
index 36e5904216..a7284c1a28 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_same_page_number_in_both_side.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted-nomax.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted-nomax.pdf
index df79382ca8..79eb6f8547 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted-nomax.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted-nomax.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted.pdf
index d68d98ff29..4f4080d62c 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_advancedshifted.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_default.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_default.pdf
index 448dea3da8..10d4db57ba 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_default.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_default.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax-shifted.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax-shifted.pdf
index 37ac4daee6..f80c8f0c0c 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax-shifted.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax-shifted.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax.pdf
index d69077e19b..447663b523 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nomax.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nosync.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nosync.pdf
index 692832cc52..1687788aef 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nosync.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_nosync.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_shifted.pdf b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_shifted.pdf
index bf85737443..a5d9a31af8 100644
--- a/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_shifted.pdf
+++ b/macros/latex/contrib/reledmac/examples/3-reledpar_sync_setting_shifted.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column-continuous-numbering.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column-continuous-numbering.pdf
index e9fb82d345..c635ad428a 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column-continuous-numbering.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column-continuous-numbering.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf
index 6136c9957b..5494c3e31f 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_column_mix_with_not_column.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_columns_alignment.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_columns_alignment.pdf
index 0fea810dc6..12697bfd9f 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_columns_alignment.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_columns_alignment.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf
index b492f69121..b93ac6382c 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_columns_titles_in_line_numbering_with_notes.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_inside-outside-columns.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_inside-outside-columns.pdf
index d4643edcb3..5930b9c800 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_inside-outside-columns.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_inside-outside-columns.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_one_series_per_pstart.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_one_series_per_pstart.pdf
index 09f3b72602..b6a80ca0ab 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_one_series_per_pstart.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_one_series_per_pstart.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_long_notes.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_long_notes.pdf
index 4ccf4308cd..d575d13b12 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_long_notes.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_long_notes.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf
index 000ffd301c..6e5c34815b 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_notes_leftpage.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf
index 3baa1de986..ddd3549b70 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_paragraph_separator_between.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_titles_in_line_numbering_with_notes.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_titles_in_line_numbering_with_notes.pdf
index 7a63bced17..65d9cd5e64 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_pages_titles_in_line_numbering_with_notes.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_pages_titles_in_line_numbering_with_notes.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf
index e68462600d..140600034e 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_titles_not_in_line_numbering.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/examples/4-reledpar_verse_text_between.pdf b/macros/latex/contrib/reledmac/examples/4-reledpar_verse_text_between.pdf
index 120bdeb43a..111add0bfa 100644
--- a/macros/latex/contrib/reledmac/examples/4-reledpar_verse_text_between.pdf
+++ b/macros/latex/contrib/reledmac/examples/4-reledpar_verse_text_between.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/migration.pdf b/macros/latex/contrib/reledmac/migration.pdf
index 1512a20fea..5390e6ff37 100644
--- a/macros/latex/contrib/reledmac/migration.pdf
+++ b/macros/latex/contrib/reledmac/migration.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/reledmac.dtx b/macros/latex/contrib/reledmac/reledmac.dtx
index 8b43d5b6be..acc99c12b3 100644
--- a/macros/latex/contrib/reledmac/reledmac.dtx
+++ b/macros/latex/contrib/reledmac/reledmac.dtx
@@ -605,6 +605,7 @@
% \changes{v2.40.1}{2024/05/11}{Reset \protect\cs{parfillskip} after paragraphed and columned footnote}
% \changes{v2.40.1}{2024/05/11}{Fix bug when using \protect\cs{edlabel} in \protect\env{edtabular} and related}
% \changes{v2.40.1}{2024/05/11}{Dealing with direction in \protect\cs{footnoteXtxt} when using LuaLaTeX}
+% \changes{v2.40.2}{2025/02/07}{Bug with right pstart number with continuousnumberingwithcolumns}
% Typeset scholarly editions with \LaTeX\thanks{This file (\dtxfilename)
% has version number \fileversion, last revised \filedate.}}
%
@@ -4531,7 +4532,7 @@
% \begin{macrocode}
%<*code>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{reledmac}[2024/05/11 v2.40.1 typesetting critical editions]%
+\ProvidesPackage{reledmac}[2025/01/07 v2.40.2 typesetting critical editions]%
% \end{macrocode}
%
% \subsection{Loading packages}
@@ -5698,6 +5699,7 @@
\ifl@dpairing%
\unless\ifl@dpaging%
\global\c@pstartL=\c@pstart%
+ \global\c@pstartR=\c@pstart%
\fi%
\fi%
\fi%
diff --git a/macros/latex/contrib/reledmac/reledmac.pdf b/macros/latex/contrib/reledmac/reledmac.pdf
index bf4c1a04d6..00cf870012 100644
--- a/macros/latex/contrib/reledmac/reledmac.pdf
+++ b/macros/latex/contrib/reledmac/reledmac.pdf
Binary files differ
diff --git a/macros/latex/contrib/reledmac/reledpar.pdf b/macros/latex/contrib/reledmac/reledpar.pdf
index 09730ec178..d9a20c2744 100644
--- a/macros/latex/contrib/reledmac/reledpar.pdf
+++ b/macros/latex/contrib/reledmac/reledpar.pdf
Binary files differ
diff --git a/macros/latex/contrib/scrlayer-fancyhdr/README.md b/macros/latex/contrib/scrlayer-fancyhdr/README.md
index b1776008e3..89dd0d1b10 100644
--- a/macros/latex/contrib/scrlayer-fancyhdr/README.md
+++ b/macros/latex/contrib/scrlayer-fancyhdr/README.md
@@ -4,7 +4,7 @@
LaTeX package `scrlayer-fancyhdr`
Copyright (c) 2008—2022 Markus Kohm
-Release: 2022-07-08 v0.2.2
+Release: 2025-01-07 v0.3
License: LPPL 1.3c (see LICENSE.md)
CTAN Location: https://ctan.org/pkg/scrlayer-fancyhdr
diff --git a/macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.dtx b/macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.dtx
index 972925cd1c..422a90ef7f 100644
--- a/macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.dtx
+++ b/macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.dtx
@@ -1,7 +1,7 @@
% \iffalse^^A meta-comment
% ======================================================================
% scrlayer-fancyhdr.dtx
-% Copyright (c) Markus Kohm, 2021–2022
+% Copyright (c) Markus Kohm, 2021–2025
%
% This file is part of the LaTeX2e package `scrlayer-fancyhdr'.
%
@@ -18,41 +18,27 @@
%
% This work consists of the files `scrlayer-fancyhdr.dtx' and
% `README.md'.
-% ----------------------------------------------------------------------
-% scrlayer-fancyhdr.dtx
-% Copyright (c) Markus Kohm, 2021
-%
-% Diese Datei ist Teil des LaTeX2e Pakets `scrlayer-fancyhdr'.
-%
-% Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz,
-% Version 1.3c.
-% Die neuste Version dieser Lizenz ist
-% http://www.latex-project.org/lppl.txt
-% und Version 1.3c ist Teil aller Verteilungen von LaTeX
-% Version 2005/12/01 und dieses Werks.
-%
-% Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained"
-% (allein durch den Autor verwaltet).
-%
-% Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm.
-%
-% Dieses Werk besteht aus den Dateien `scrlayer-fancyhdr.dtx' und
-% `README.md'.
% ======================================================================
%
%<identify>%%% docstrip run: identify
%<init>%%% docstrip run: init
%<options>%%% docstrip run: options
%<body>%%% docstrip run: body
+%\changes{v0.3}{2025-01-07}{needs at least \LaTeX{} 2020-10-01}
+%<identify>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
%<*dtx>
\ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
-\ProvidesFile{scrlayer-fancyhdr.dtx}[2022-07-08 v0.2.2
- source of package scrlayer-scrpage]
+\ProvidesFile{scrlayer-fancyhdr.dtx}
+%</dtx>
+%<package&identify>\ProvidesPackage{scrlayer-fancyhdr}
+%<*dtx|(package&identify)>
+ [2025-01-07 v0.3
+%</dtx|(package&identify)>
+%<*dtx>
+ source of package scrlayer-scrpage]
%</dtx>
%<*package>
-%<identify>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-%<identify>\ProvidesPackage{scrlayer-fancyhdr}[2022-07-08 v0.2.2
-%<identify> combining fancyhdr with KOMA-Script's scrlayer]
+%<identify> combining fancyhdr with KOMA-Script's scrlayer]
%</package>
%<*dtx>
\ifx\documentclass\undefined
@@ -82,10 +68,10 @@
author = {Piet van Oostrum},
title = {{\pkg{fancyhdr}}\,---\,Extensive control of page headers and
footers in {\LaTeXe}},
- date = {2022-05-18},
- edition = {4.0.3},
+ date = {2025-01-06},
+ edition = {5.1},
url = {https://www.ctan.org/pkg/fancyhdr},
- urldate = {2022-07-08}
+ urldate = {2025-01-07}
}
@Misc{ package:koma-script,
@@ -93,10 +79,10 @@
author = {Markus Kohm},
title = {{\pkg{koma-script}}\,---\,A bundle of versatile classes and
packages},
- date = {2022-07-04},
- edition = {3.37},
+ date = {2024-10-24},
+ edition = {3.43},
url = {https://www.ctan.org/pkg/koma-script},
- urldate = {2022-07-08}
+ urldate = {2025-01-07}
}
@Misc{ package:scrlayer,
@@ -104,10 +90,10 @@
author = {Markus Kohm},
title = {{\pkg{scrlayer}}\,---\,Manage text `layers' within
{\KOMAScript}},
- date = {2022-07-04},
- edition = {3.37},
+ date = {2024-10-24},
+ edition = {3.43},
url = {https://www.ctan.org/pkg/scrlayer},
- urldate = {2022-07-08}
+ urldate = {2025-01-07}
}
\end{filecontents}
@@ -427,6 +413,8 @@
% \pkg{fancyhdr}. This could be fixed by a modification of the
% layers \texttt{fancy.head.odd} and \texttt{fancy.head.even} using
% \opt{addvoffset}. More tests are needed.
+% \item
+% Not all ew features of \pkg{fancyhdr} v5 have been tested yet.
% \end{itemize}
% See \url{https://github.com/komascript/scrlayer-fancyhdr/issues} for more
% issues.
@@ -586,7 +574,7 @@
% \DescribePageStyle{empty}
% \DescribeiPageStyle{@empty}
% Hinweis: Der Seitenstil \pstyle{empty} ist etwas
-% speziell. \pkg{scrlayer} definiert dieses in einen
+% speziell. \pkg{scrlayer} definiert diesen in einen
% Ebenen-Seitenstil um. Und \pkg{fancyhdr}s interner Seitenstil
% \pstyle{@empty} ist ebenfalls identisch mit \pstyle{empty}. Daher
% verwendet auch \pstyle{@empty} die Ebenen von \pstyle{empty}, aber Sie
@@ -727,6 +715,8 @@
% verwendet wird. Dies kann durch leichte Modifikation der Ebenen
% \texttt{fancy.head.odd} und \texttt{fancy.head.even} mit Hilfe von
% \opt{addvoffset} behoben werden. Weitere Tests sind hier erforderlich.
+% \item
+% Noch nicht alle neuen Möglichkeiten von \pkg{fancyhdr} v5 sind getested.
% \end{itemize}
% Siehe \url{https://github.com/komascript/scrlayer-fancyhdr/issues} für
% weitere bekannte Probleme.
@@ -789,12 +779,14 @@
% or to load original \pkg{fancyhdr} and to only modify some things. First
% I'll try the second method. Currently we explicitly provide the options of
% \pkg{fancyhdr}.
+% \changes{v0.3}{2025-01-07}{new \pkg{fancyhdr} option \opt{twoside}}
% \begin{macrocode}
%<*options>
\DeclareOption{nocheck}{\PassOptionsToPackage{nocheck}{fancyhdr}}
\DeclareOption{compatV3}{\PassOptionsToPackage{compatV3}{fancyhdr}}
\DeclareOption{myheadings}{\PassOptionsToPackage{myheadings}{fancyhdr}}
\DeclareOption{headings}{\PassOptionsToPackage{headings}{fancyhdr}}
+\DeclareOption{twoside}{\PassOptionsToPackage{twoside}{fancyhdr}}
%</options>
% \end{macrocode}
% \begin{macrocode}
@@ -806,32 +798,73 @@
% We need at least one new layer for the new layer page style
% \pstyle{fancy}. However, it could be useful to have not only one but
% four layers (even side head, odd side head, even side foot, odd side foot).
+% \changes{v0.3}{2025-01-07}{\cs{f@nch@head} and \cs{f@nch@foot} have 8
+% arguments with \pkg{fancyhdr} v5}
% \begin{macrocode}
%<*body>
-\DeclareNewLayer[%
- background,oddpage,
- head,
- contents={\hb@xt@ \layerwidth{%
- \f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh}}
-]{fancy.head.odd}
-\DeclareNewLayer[%
- background,evenpage,
- head,
- contents={\hb@xt@ \layerwidth{%
- \f@nch@head\f@nch@Oelh\f@nch@elh\f@nch@ech\f@nch@erh\f@nch@Oerh}}
-]{fancy.head.even}
-\DeclareNewLayer[%
- foreground,oddpage,
- foot,
- contents={\hb@xt@ \layerwidth{%
- \f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf}}
-]{fancy.foot.odd}
-\DeclareNewLayer[%
- foreground,evenpage,
- foot,
- contents={\hb@xt@ \layerwidth{%
- \f@nch@foot\f@nch@Oelf\f@nch@elf\f@nch@ecf\f@nch@erf\f@nch@Oerf}}
-]{fancy.foot.even}
+\IfPackageAtLeastTF{fancyhdr}{2025/01/01}{%
+ \DeclareNewLayer[%
+ background,oddpage,
+ head,
+ contents={\hb@xt@ \layerwidth{%
+ \f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh
+ \f@nch@width@olh\f@nch@width@och\f@nch@width@orh
+ }}
+ ]{fancy.head.odd}
+ \DeclareNewLayer[%
+ background,evenpage,
+ head,
+ contents={\hb@xt@ \layerwidth{%
+ f@nch@head\f@nch@Oelh\f@nch@elh\f@nch@ech\f@nch@erh\f@nch@Oerh
+ \f@nch@width@elh\f@nch@width@ech\f@nch@width@erh
+ }}
+ ]{fancy.head.even}
+ \DeclareNewLayer[%
+ foreground,oddpage,
+ foot,
+ contents={\hb@xt@ \layerwidth{%
+ \f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf
+ \f@nch@width@olf\f@nch@width@ocf\f@nch@width@orf
+ }}
+ ]{fancy.foot.odd}
+ \DeclareNewLayer[%
+ foreground,evenpage,
+ foot,
+ contents={\hb@xt@ \layerwidth{%
+ f@nch@foot\f@nch@Oelf\f@nch@elf\f@nch@ecf\f@nch@erf\f@nch@Oerf
+ \f@nch@width@elf\f@nch@width@ecf\f@nch@width@erf
+ }}
+ ]{fancy.foot.even}
+}{%
+ \DeclareNewLayer[%
+ background,oddpage,
+ head,
+ contents={\hb@xt@ \layerwidth{%
+ \f@nch@head\f@nch@Oolh\f@nch@olh\f@nch@och\f@nch@orh\f@nch@Oorh
+ }}
+ ]{fancy.head.odd}
+ \DeclareNewLayer[%
+ background,evenpage,
+ head,
+ contents={\hb@xt@ \layerwidth{%
+ \f@nch@head\f@nch@Oelh\f@nch@elh\f@nch@ech\f@nch@erh\f@nch@Oerh
+ }}
+ ]{fancy.head.even}
+ \DeclareNewLayer[%
+ foreground,oddpage,
+ foot,
+ contents={\hb@xt@ \layerwidth{%
+ \f@nch@foot\f@nch@Oolf\f@nch@olf\f@nch@ocf\f@nch@orf\f@nch@Oorf
+ }}
+ ]{fancy.foot.odd}
+ \DeclareNewLayer[%
+ foreground,evenpage,
+ foot,
+ contents={\hb@xt@ \layerwidth{%
+ \f@nch@foot\f@nch@Oelf\f@nch@elf\f@nch@ecf\f@nch@erf\f@nch@Oerf
+ }}
+ ]{fancy.foot.even}
+}
% \end{macrocode}
% \begin{ipgstyle}{f@nch@fancycore}
% \changes{0.1.3558}{2021/02/15}{support for \pkg{fancyhdr} 4}
@@ -860,7 +893,7 @@
% manual) does also recognize the \pkg{fancyhdr} definition and copying
% this is more compatible with \pkg{fancyhdr}.
% \begin{macrocode}
-\@ifpackagelater{fancyhdr}{2019/03/21}{%
+\IfPackageAtLeastTF{fancyhdr}{2019/03/21}{%
\DeclarePageStyleByLayers[
onselect={\def\@mkboth{\protect\markboth}},
]{f@nch@fancycore}{%
diff --git a/macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.pdf b/macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.pdf
index 1ebb80f9a3..3108a3eb15 100644
--- a/macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.pdf
+++ b/macros/latex/contrib/scrlayer-fancyhdr/scrlayer-fancyhdr.pdf
Binary files differ
diff --git a/macros/latex/contrib/tabularray-abnt/changelog.txt b/macros/latex/contrib/tabularray-abnt/changelog.txt
index 9daa7e6ee1..fb8b1eaa39 100644
--- a/macros/latex/contrib/tabularray-abnt/changelog.txt
+++ b/macros/latex/contrib/tabularray-abnt/changelog.txt
@@ -1,2 +1,4 @@
+2025-01-06
+ - Added global counter for table/quadro to fix bug that mix page span status for table and quadro.
2025-01-03
-- first public release
+ - first public release
diff --git a/macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.pdf b/macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.pdf
index af64a6be54..f5730637c5 100644
--- a/macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.pdf
+++ b/macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.pdf
Binary files differ
diff --git a/macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.tex b/macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.tex
index 6ebf28dd5d..6881afce3f 100644
--- a/macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.tex
+++ b/macros/latex/contrib/tabularray-abnt/tabularray-abnt-pt-br.tex
@@ -77,7 +77,7 @@
\title{Tabularray-abnt: tema abnt para tabularray}
\author{Sadao Massago}
-\date{03/01/2025}
+\date{06/01/2025}
%%%%%%%%%%%%%%%%%%%%%
% INÍCIO DO DOCUMENTO
diff --git a/macros/latex/contrib/tabularray-abnt/tabularray-abnt.sty b/macros/latex/contrib/tabularray-abnt/tabularray-abnt.sty
index e29559ebac..14eb5a8611 100644
--- a/macros/latex/contrib/tabularray-abnt/tabularray-abnt.sty
+++ b/macros/latex/contrib/tabularray-abnt/tabularray-abnt.sty
@@ -16,8 +16,8 @@
%%% file name
\ProvidesFile{tabularray-abnt.sty}
- [2025/01/03 tabularray-abnt style (require tabularray package)]
-\typeout{tabularray-abnt style 2025-01-03 <January/2025>.}
+ [2025/01/06 tabularray-abnt style (require tabularray package)]
+\typeout{tabularray-abnt style 2025-01-06 <January/2025>.}
%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% It not works on older LaTeX compatibility mode (documentstyle)
@@ -51,6 +51,7 @@
%% Required package
\RequirePackage{tabularray}
+\UseTblrLibrary{hook}
%%% %----------------------
%%> \section{ABNT theme}
@@ -61,7 +62,10 @@
\SetTblrTemplate{firsthead-text,lasthead-text,conthead-text}{abnt}
\SetTblrTemplate{caption,lasthead,capcont}{abnt}
\DefTblrTemplate{firstfoot,middlefoot}{default}{}% disabling the first and middle footnote
- \SetTblrTemplate{lastfoot-text,lastfoot-text-note}{abnt}
+
+%%% \SetTblrTemplate{lastfoot-text,lastfoot-text-note}{abnt}
+
+ %% for abntexto, need to change lot write
\if@tabularray@abnt@using@abntexto
\SetTblrTemplate{caption-lot}{abnt}
\fi
@@ -87,10 +91,13 @@
\SetTblrTemplate{firsthead-text,lasthead-text,conthead-text}{abnt}
\SetTblrTemplate{caption,lasthead,capcont}{abnt}
\DefTblrTemplate{firstfoot,middlefoot}{default}{}% desabling first and middle footnote
- \SetTblrTemplate{lastfoot-text,lastfoot-text-note}{abnt}
- \if@tabularray@abnt@using@abntexto
- \SetTblrTemplate{caption-lot}{abnt}
- \fi
+
+%%% \SetTblrTemplate{lastfoot-text,lastfoot-text-note}{abnt}
+
+%%% %% for abntexto, need to change lot write
+%%% \if@tabularray@abnt@using@abntexto
+%%% %%\SetTblrTemplate{caption-lot}{abnt}
+%%% \fi
\SetTblrTemplate{remark-tag}{abnt}
\SetTblrTemplate{remark}{abnt}
@@ -100,8 +107,8 @@
\SetTblrStyle{lastfoot}{font=\footnotesize}
%% Change specific for ``quadro'
- \SetTblrTemplate{caption-tag}{quadro}
- \SetTblrTemplate{caption-lot}{quadro}
+ \SetTblrTemplate{caption-tag}{quadro} % caption change
+ \SetTblrTemplate{caption-lot}{quadro} % lot wire change
}
%%% -----------------------------
@@ -117,7 +124,22 @@
\fi
\fi
-%% additional texto for header
+%% counting table and quadro together
+
+%%% \ExplSyntaxOn
+\if@tabularray@abnt@using@abntexto
+
+%%% \newcommand{\tabularray@abnt@tblr@count@roman}{\romannumeral\inteval{\g__tblr_table_count_int + \countquadro}}
+ \newcommand{\tabularray@abnt@tblr@count@roman}{\romannumeral\inteval{\value{table} + \countquadro}}
+\else
+
+%%% \newcommand{\tabularray@abnt@tblr@count@roman}{\romannumeral\inteval{\g__tblr_table_count_int + \value{quadro}}}
+ \newcommand{\tabularray@abnt@tblr@count@roman}{\romannumeral\inteval{\value{table} + \value{quadro}}}
+\fi
+
+%%% \ExplSyntaxOff
+
+%% additional text for header
\DefTblrTemplate{firsthead-text}{abnt}{\par~\hfill(continua)} % first header
\DefTblrTemplate{lasthead-text}{abnt}{\par~\hfill(conclusão)} % last header
\DefTblrTemplate{conthead-text}{abnt}{\par~\hfill(continuação)} % middle header
@@ -128,8 +150,12 @@
\UseTblrTemplate{caption-text}{default}
%%% % like \ifdefined, but with csname
- \ifcsname tblr@abnt@spanpages@\roman{table}\endcsname % if span pages
- \UseTblrTemplate{firsthead-text}{abnt} % acrescentar o firsthead-text
+ \ifcsname tabularray@abnt@tblr@spanpages@\tabularray@abnt@tblr@count@roman\endcsname % if span pages
+ \UseTblrTemplate{firsthead-text}{abnt} % add the firsthead-text
+
+%%% DEBUG:\tabularray@abnt@tblr@count@roman
+%%% \else
+%%% DEBUG (no span pages): \roman{tabularray@abnt@global@tblr@counter}
\fi
}
@@ -151,50 +177,104 @@
%%% %-------------------------------------------------
%%> \section{To save ``page span'' status}
-\newif\if@tablular@abnt@mark@spanpages%
-\@tablular@abnt@mark@spanpagesfalse % initially false
+\newif\if@tablularray@abnt@mark@spanpages
-%%% % tblr with long optional option
-\AddToHook{env/tblr/before}
-{
- \@tablular@abnt@mark@spanpagestrue
-}
-\AddToHook{env/tblr/after}
-{
- \@tablular@abnt@mark@spanpagesfalse
- \DefTblrTemplate{lastfoot-text}{abnt}{}
- \DefTblrTemplate{lastfoot-text-note}{abnt}{}
-}
+%%% \AtBeginDocument{%
-%%% % longtblr
-\AddToHook{env/longtblr/before}
-{
- \@tablular@abnt@mark@spanpagestrue
-}
-\AddToHook{env/longtblr/after}
-{
- \@tablular@abnt@mark@spanpagesfalse
- \DefTblrTemplate{lastfoot-text}{abnt}{}
- \DefTblrTemplate{lastfoot-text-note}{abnt}{}
-}
+%%% % \@tablularray@abnt@mark@spanpagesfalse % initially false
+\global\let\if@tablularray@abnt@mark@spanpages\iffalse
+
+%%% } % \AtBeginDocument{%
+
+%%% hook tabularray not working as expected. Need more recente version of tabularray?
+%%% \AddToHook{tabularray/table/before}
+%%% {
+
+%%% % \@tablularray@abnt@mark@spanpagestrue
+%%% \global\let\if@tablularray@abnt@mark@spanpages\iftrue
+%%% }
+%%% \AddToHook{tabularray/table/after}
+%%% {
+
+%%%% \@tablularray@abnt@mark@spanpagesfalse
+%%% \global\let\if@tablularray@abnt@mark@spanpages\iffalse
+%%% }
+
+%%% % check page span status for longtblr
+\AddToHook{env/longtblr/after}{ \global\let\if@tablularray@abnt@mark@spanpages\iftrue }
+\AddToHook{env/longtblr/end}{ \global\let\if@tablularray@abnt@mark@spanpages\iffalse }
+
+%%% % check page span status for tblr (with possible long option)
+\AddToHook{env/tblr/after}{ \global\let\if@tablularray@abnt@mark@spanpages\iftrue }
+\AddToHook{env/tblr/end}{ \global\let\if@tablularray@abnt@mark@spanpages\iffalse }
+
+%%% % check page span status for tblr like env
+%%% % Not work as exprected
+%%% \AddToHook{tabularray/table/before}{ \global\let\if@tablularray@abnt@mark@spanpages\iftrue }
+%%% \AddToHook{tabularray/table/after}{ \global\let\if@tablularray@abnt@mark@spanpages\iffalse }
+
+%%% {
+
+
+%%% \AddToHook{env/longtblr/begin}
+%%% {
+
+%%% % \@tablularray@abnt@mark@spanpagestrue
+%%% \global\let\if@tablularray@abnt@mark@spanpages\iftrue
+%%% }
+
+%%% \AddToHook{env/longtblr/end}
+%%% {
+
+%%% \@tablularray@abnt@mark@spanpagesfalse
+%%% \global\let\if@tablularray@abnt@mark@spanpages\iffalse
+%%% }
+
+%%% % For tblr with long opcion
+%%% \AddToHook{env/tblr/begin}
+%%% {
+
+%%% % \@tablularray@abnt@mark@spanpagestrue
+%%% \global\let\if@tablularray@abnt@mark@spanpages\iftrue
+%%% }
+
+%%% \AddToHook{env/tblr/end}
+%%% {
+
+%%% % \@tablularray@abnt@mark@spanpagesfalse
+%%% \global\let\if@tablularray@abnt@mark@spanpages\iffalse
+%% }
+
+%%% talltblr fit in single page (no hook)
%% if change pages, mark as ``span pages'' on aux file
+
+%%% \AddToHook{shipout/after}
\AddToHook{shipout/after}
{
- \if@tablular@abnt@mark@spanpages
+ \if@tablularray@abnt@mark@spanpages
+ %% to the associated commands act globally
%% tip from https://tex.stackexchange.com/questions/115932/on-the-basics-of-writing-to-reading-from-auxiliary-files-aux-toc-etc
- \immediate\write\@auxout{\gdef\string\tblr@abnt@spanpages@\roman{table}{true}}
- \fi
+ \immediate\write\@auxout{\gdef\string\tabularray@abnt@tblr@spanpages@\tabularray@abnt@tblr@count@roman{true}}
+
+%%% \else % DEBUG
+%%% \immediate\write\@auxout{\gdef\string\tabularray@abnt@tblr@spanpages@\tabularray@abnt@tblr@count@roman{false}}
+
+\fi
%% to the associated commands act globally
%% tip from https://tex.stackexchange.com/questions/566884/setting-a-newif-to-false-ignored-on-first-check-in-custom-itemize-environment
- \global\let\if@tablular@abnt@mark@spanpages\iffalse
-}
+ \global\let\if@tablularray@abnt@mark@spanpages\iffalse
+
+%%% % DEBUG:
+%%% \immediate\write\@auxout{\gdef\string\tabularray@abnt@shipout@message{DEGUB: page=\thepage, tblrnum=\tabularray@abnt@tblr@count@roman}}
+}
%% For abntexto class, need change the form to write on ``lot''
+%% For others, only add global counter
\if@tabularray@abnt@using@abntexto
\ExplSyntaxOn
\DefTblrTemplate{caption-lot}{abnt}
- {
+ {
\tl_if_empty:NTF \lTblrEntryTl
{\tl_set_eq:NN \l__tblr_caption_short_tl \lTblrCaptionTl}
{\tl_set_eq:NN \l__tblr_caption_short_tl \lTblrEntryTl}
@@ -204,9 +284,22 @@
\addtoext{lot}{lofi}{\protect\lotlabelbox{\thetable}{\l__tblr_caption_short_tl}}
}
\ExplSyntaxOff
+%%%\else% \if@tabularray@abnt@using@abntexto
+%%% \ExplSyntaxOn
+%%% \DefTblrTemplate {caption-lot}{abnt}
+%%% {
+%%%
+%%% %% \stepcounter{tabularray@abnt@global@tblr@counter}% global table/quadro counter
+%%% \tl_if_empty:NTF \lTblrEntryTl
+%%% { \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrCaptionTl }
+%%% { \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrEntryTl }
+%%% \addcontentsline { lot } { table }
+%%% { \protect\numberline { \thetable } { \l__tblr_caption_short_tl } }
+%%% }
+%%% \ExplSyntaxOff
\fi% \if@tabularray@abnt@using@abntexto
-%% Change reamrk to use for source and note as ABNT
+%% Change remark to use for source and note as ABNT
\DefTblrTemplate{remark-tag}{abnt}{\InsertTblrRemarkTag}
%% Change left margin using tip from
@@ -230,6 +323,12 @@
\providecommand{\quadroname}{Quadro}
\providecommand{\listquadroname}{Lista de quadros}
\@ifpackageloaded{babel}{
+ \ifdefined\captionsportugese
+ \addto\captionsportugese{% portugese
+ \renewcommand{\quadroname}{Quadro}
+ \renewcommand{\listquadroname}{Lista de quadros}
+ }
+ \fi
\ifdefined\captionsbrazil
\addto\captionsbrazil{% brazilian portugese
\renewcommand{\quadroname}{Quadro}
@@ -237,7 +336,7 @@
}
\fi
\ifdefined\captionsbrazilian
- \addto\captionsbrazil{% brazilian portugese
+ \addto\captionsbrazilian{% brazilian portugese
\renewcommand{\quadroname}{Quadro}
\renewcommand{\listquadroname}{Lista de quadros}
}
@@ -257,20 +356,21 @@
%% using command from ABNTexto
\definelegendplace{quadro}{Quadro}{quad.\,}{loq} % new legend entry
-\ifdefined\chapter
- \newcommand{\listadequadros}{\notoc\nonum\chapter{\listquadroname}\makeloq}
-\else
- \newcommand{\listadequadros}{\notoc\nonum\section{\listquadroname}\makeloq}
-\fi
+ \ifdefined\chapter
+ \newcommand{\listadequadros}{\notoc\nonum\chapter{\listquadroname}\makeloq}
+ \else
+ \newcommand{\listadequadros}{\notoc\nonum\section{\listquadroname}\makeloq}
+ \fi
%% Caution: don't put space between braces and parameters
\DefTblrTemplate{caption-tag}{quadro}{\quadroname\hspace{0.25em}\the\countquadro}
\ExplSyntaxOn
- \DefTblrTemplate {caption-lot}{quadro}
+ \DefTblrTemplate{caption-lot}{quadro}
{
- \addtocounter{table}{-1}%Não contar como table
-
- %% counter created by \definelegendplace{quadro} is not \c@quadro+, but \countquadro, and is necessary to use TeX command to increase
+
+%%% \stepcounter{tabularray@abnt@global@tblr@counter}% global table/quadro counter
+ \addtocounter{table}{-1}%Não contar como table
+ %% counter created by \definelegendplace{quadro} is not \c@quadro+, but \countquadro, and is necessary to use TeX command to increase
\global\advance\countquadro by 1% count as ``quadro''
\tl_if_empty:NTF \lTblrEntryTl
{\tl_set_eq:NN \l__tblr_caption_short_tl \lTblrCaptionTl}
@@ -307,10 +407,12 @@
\DefTblrTemplate {caption-tag} {quadro} {\quadroname\hspace{0.25em}\thequadro}
\ExplSyntaxOn
- \DefTblrTemplate { caption-lot } { quadro }
+ \DefTblrTemplate{caption-lot}{quadro}
{
- \addtocounter{table}{-1}
- \stepcounter{quadro}
+
+%%% \stepcounter{tabularray@abnt@global@tblr@counter}% global table/quadro counter
+ \addtocounter{table}{-1}% not count as table
+ \stepcounter{quadro}% count as quadro
\tl_if_empty:NTF \lTblrEntryTl
{ \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrCaptionTl }
{ \tl_set_eq:NN \l__tblr_caption_short_tl \lTblrEntryTl }
@@ -327,29 +429,56 @@
%% To set table font for new envrronment
\NewDocumentCommand{\SetAbntTblrFont}{+m}
{
- \gdef\AbntTblrFont{#1}
+ \gdef\@tabularray@abnt@tblr@font{#1}
}
%%% % New environments for tables
\NewDocumentEnvironment{abnttblr}{+o +m +b}{
-\ifdefined\AbntTblrFont \AbntTblrFont \fi
+\ifdefined\@tabularray@abnt@tblr@font \@tabularray@abnt@tblr@font \fi
\begin{tblr}[theme=abnt,#1]{#2}
#3
\end{tblr}
}{}
\NewDocumentEnvironment{tallabnttblr}{+o +m +b}{
-\ifdefined\AbntTblrFont \AbntTblrFont \fi
+
+%%% tallabnttblr begin
+%%% \if@tablularray@abnt@mark@spanpages
+%%% DEBUG: mark span pages active
+%%% \fi
+%%% table+quadro counter = \tabularray@abnt@tblr@count@roman
+\ifdefined\@tabularray@abnt@tblr@font \@tabularray@abnt@tblr@font \fi
\begin{talltblr}[theme=abnt,#1]{#2}
#3
\end{talltblr}
+
+%%% tallabnttblr end
+%%% \if@tablularray@abnt@mark@spanpages
+%%% DEBUG: mark span pages active
+%%% \fi
+%%% table+quadro counter = \tabularray@abnt@tblr@count@roman
}{}
\NewDocumentEnvironment{longabnttblr}{+o +m +b}{
-\ifdefined\AbntTblrFont \AbntTblrFont \fi
+
+%%% longabnttblr begin
+%%% \if@tablularray@abnt@mark@spanpages
+%%% DEBUG: mark span pages active
+%%% \fi
+%%% table+quadro counter = \tabularray@abnt@tblr@count@roman
+%%% \global\let\if@tablularray@abnt@mark@spanpages\iftrue
+\ifdefined\@tabularray@abnt@tblr@font \@tabularray@abnt@tblr@font \fi
\begin{longtblr}[theme=abnt,#1]{#2}
#3
\end{longtblr}
+
+%%% \global\let\if@tablularray@abnt@mark@spanpages\iffalse
+
+%%% longabnttblr end
+%%% \if@tablularray@abnt@mark@spanpages
+%%% DEBUG: mark span pages active
+%%% \fi
+%%% table+quadro counter = \tabularray@abnt@tblr@count@roman
}{}
%% end: tabularray-abnt.sty
diff --git a/macros/latex/contrib/tkz/tkz-elements/README.md b/macros/latex/contrib/tkz/tkz-elements/README.md
index 3c53ea16eb..e1f8622bb0 100644
--- a/macros/latex/contrib/tkz/tkz-elements/README.md
+++ b/macros/latex/contrib/tkz/tkz-elements/README.md
@@ -1,10 +1,10 @@
# tkz-elements — for euclidean geometry
-Release 3.00c 2024/11/23
+Release 3.10c 2025/01/01
## Description
-`tkz-elements v.3.00c` is the new version of a library written in lua, allowing to make all the necessary calculations to define the objects of a Euclidean geometry figure. You need to compile with `LuaLaTeX`. With `tkz-elements`, the definitions and calculations are only done with `Lua`.
+`tkz-elements v.3.10c` is the new version of a library written in lua, allowing to make all the necessary calculations to define the objects of a Euclidean geometry figure. You need to compile with `LuaLaTeX`. With `tkz-elements`, the definitions and calculations are only done with `Lua`.
The main possibility of programmation proposed is oriented "object programming" with object classes like point, line, triangle, circle and ellipse. For the moment, once the calculations are done, it is `tkz-euclide` or `TikZ` which allows the drawings. You can use the option `mini` with `tkz-euclide` to load only the modules required for tracing.
@@ -55,13 +55,24 @@ your LaTeX document:
If you use the `xcolor` package, load that package before `tkz-euclide` to avoid
package conflicts.
+It's possible to use the environment `tkzelements` istead of the directive `\directlua` but in this case, you need to load the package `luacode`.
+
## Examples
Some examples will be stored on my site : [http://altermundus.fr](http://altermundus.fr).
-An important example `Golden Arbelos` using the package is on the site. All the files of the documentation
-are on the site.
+An important example `Golden Arbelos` using the package is on the site. All the files of the documentation are on the site.
## History
+ - version 3.10c
+ - Most of the functions have been optimized, and some have been commented on.
+ - Object classes have been enhanced with new attributes. For a triangle, you can directly access the semiperimeter, area, inradius and circumradius. In some classes, the `exradius` attribute is replaced by `circumradius`.
+ - For rectangle, square and circle, `perimeter` and `area` have been added.
+ - For line, new methods appear: `is_parallel`, `is_orthogonal` and `is_equidistant`. The latter allows you to determine whether a point is equidistant from the two points defining the line. The `swap` argument is available for all triangle creations. The result is now a single triangle, the second is obtained with `swap`.
+ - It is now possible to define an isosceles triangle from a straight line (segment) with length `isosceles_s`. You can use `isosceles_a` or the old `isosceles` method if you're using an angle. I've added a new test for triangles: `is_acute`. The `two_angles` method is identical to `asa`.
+ - The line , circle and triangle classes are complemented by methods with complicated names: `c_l_pp`, `c_ll_p`, `c_c_pp` and `c_cc_p`. These methods allow you to determine, from a line or circle, one or more circles tangent to lines or circles and passing through points. So `c_l_pp` means to create a circle tangent to a line (l) and passing through two points (pp). The first `c` reminds us that we're looking for a circle, the second group between `_` and `_` indicates the tangent objects (c or l) and the last indicates the points through which the circle passes.
+ - In the documentation, I've added a section on important geometry theorems (
+ Viviani, Reuschle, Thébault,Varignon, Wittenbauer, Soddy, Six circles ... to be completed ...). Examples of new methods and attributes have also been added.
+
- version 3.00c
- It is now possible to use the `directlua` primitive to perform `lua` code. In this case, tables and scaling can be reset using the `init_elements` function. You can still use the `tkzelements` environment, but only if you load the `luacode` package.
- Examples have been added to the `transfers` section.
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
index 2d5665f879..d1524ea008 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex
@@ -25,8 +25,10 @@ This class is defined by two points: the center and a point through which the ci
\Iattr{circle}{south} & |C.AB.south| & |z.S = C.OA.south| \\
\Iattr{circle}{east} & |C.AB.east| & |z.E = C.OA.east| \\
\Iattr{circle}{west} & |C.AB.west| & |z.W = C.OA.west| \\
-\Iattr{circle}{opp} & |z.Ap = C.AB.opp| & [\ref{ssub:example_circle_attributes}] \\
+\Iattr{circle}{opp} & |z.Ap = C.AB.opp| & [\ref{ssub:example_circle_attributes}] \\
\Iattr{circle}{ct} & |L = C.AB.ct| [ \ref{ssub:example_circle_attributes} ] \\
+\Iattr{circle}{perimeter} & |p = C.AB.perimeter| [\ref{ssub:attributes_perimeter_and_area}] \\
+\Iattr{circle}{area} & |a = C.AB.area| [\ref{ssub:attributes_perimeter_and_area}] \\
\bottomrule %
\end{tabular}
\egroup
@@ -85,6 +87,41 @@ init_elements ()
\end{minipage}
% subsubsection example_circle_attributes (end)
+
+\subsubsection{Attributes perimeter and area} % (fold)
+\label{ssub:attributes_perimeter_and_area}
+
+ \pgfkeys{/pgf/number format/.cd,std,precision=4}
+ \let\pmpn\pgfmathprintnumber
+
+\begin{mybox}
+\begin{Verbatim}
+ \directlua{
+ z.A = point : new (1, 2)
+ z.B = point : new (4, 3)
+ C.AB = circle : new (z.A,z.B)
+ p = C.AB.perimeter
+ a = C.AB.area
+ }
+Let be two points $A$ and $B$. The circle of center $A$ passing
+through $B$ has perimeter \pmpn{\tkzUseLua{p}} $cm$
+and area \pmpn{\tkzUseLua{a} }$cm^2$.
+
+\end{Verbatim}
+
+\end{mybox}
+
+\directlua{
+z.A = point : new (1, 2)
+z.B = point : new (4, 3)
+C.AB = circle : new (z.A,z.B)
+p = C.AB.perimeter
+a = C.AB.area
+}
+Let be two points $A$ and $B$.
+The circle of center $A$ passing through $B$ has perimeter \pmpn{\tkzUseLua{p}} $cm$ and area \pmpn{\tkzUseLua{a} }$cm^2$.
+
+% subsubsection attributes_perimeter_and_area (end)
% subsection attributes_of_a_circle (end)
\newpage
@@ -102,6 +139,19 @@ init_elements ()
\Igfct{circle}{radius(O,r)} & |C.OA = circle : radius (z.O,2)| & center $O$ radius =2 cm; [\ref{ssub:method_imeth_circle_radius}]\\
\Igfct{circle}{diameter(A,B)} & |C.OA = circle :diameter(z.A,z.B)| & diameter $[AB]$; [\ref{ssub:method_imeth_circle_diameter}] \\
\midrule
+ \textbf{Reals} &&\\
+\midrule
+\Imeth{circle}{power (pt)} &| r = C.OA: power (z.M)| & [\ref{ssub:power_v1} ; \ref{ssub:power_v2} ; \ref{sub:apollonius_circle_v1_with_inversion} ] \\
+\midrule
+ \textbf{Strings} &&\\
+ \midrule
+ \Imeth{circle}{circles\_position (C1)} & result = string & [\ref{ssub:circles_position}] \\
+ \midrule
+ \textbf{Booleans} &&\\
+\midrule
+\Imeth{circle}{in\_out (pt)} & |C.OA : in_out (z.M)| & [\ref{ssub:in_out_for_circle_and_disk}] \\
+\Imeth{circle}{in\_out\_disk (pt)} & |C.OA : in_out_disk (z.M)| & [\ref{ssub:in_out_for_circle_and_disk}] \\
+\Imeth{circle}{is\_tangent (L)} & |C.OA : is_tangent (L.CD)| & [\ref{ssub:method_imeth_circle_is__tangent}] \\
\textbf{Points} &&\\
\midrule
\Imeth{circle}{antipode (pt)} & |z.C = C.OA: antipode (z.B)| & $[BC]$ = diameter; [\ref{ssub:method_imeth_circle_antipode}] \\
@@ -126,14 +176,9 @@ init_elements ()
\Imeth{circle}{orthogonal\_through(pta,ptb)}&|C=C.OA:orthogonal_through (z.z1,z.z2)| & [\ref{ssub:method_imeth_circle_orthogonal_through}]\\
\Imeth{circle}{midcircle (C)} & |C.inv = C.OA: midcircle (C.EF)| & [\ref{ssub:midcircle}] \\
\Imeth{circle}{radical\_circle (C1<,C2>)} & or only (C1) & [\ref{ssub:radical_circle}] \\
-\midrule
- \textbf{Miscellaneous} &&\\
-\midrule
-\Imeth{circle}{power (pt)} &| r = C.OA: power (z.M)| & [\ref{ssub:power_v1} ; \ref{ssub:power_v2} ; \ref{sub:apollonius_circle_v1_with_inversion} ] \\
-\Imeth{circle}{in\_out (pt)} & |C.OA : in_out (z.M)| & [\ref{ssub:in_out_for_circle_and_disk}] \\
-\Imeth{circle}{in\_out\_disk (pt)} & |C.OA : in_out_disk (z.M)| & [\ref{ssub:in_out_for_circle_and_disk}] \\
-\Imeth{circle}{draw ()} & for further use &\\
-\Imeth{circle}{circles\_position (C1)} & result = string & [\ref{ssub:circles_position}] \\
+\Imeth{circle}{c\_c\_pp(pt,pt)} &|C1,C2=C.A:c_cc_p (z.P,z.Q)| & [\ref{ssub:method_c__c__pp}] \\
+\Imeth{circle}{c\_cc\_p(C,pt)} &|C1,C2=C.A:c_cc_p (C.B,z.P)| & [\ref{ssub:method_c_cc_p}] \\
+\Imeth{circle}{c\_lc\_p(L,pt,<inside>)} &|C1,C2=C.A:c_cc_p (L.AB,z.P)| & [\ref{ssub:method_c_lc_p}] \\
\bottomrule
\end{tabular}
\egroup
@@ -268,6 +313,60 @@ z.T = C.through
\end{minipage}
% subsubsection method_imeth_circle_diameter (end)
+\subsubsection{Method \Imeth{circle}{is\_tangent}} % (fold)
+\label{ssub:method_imeth_circle_is__tangent}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+ z.A = point: new (0,0)
+ z.B = point: new (0,2)
+ C.AB = circle: new (z.A,z.B)
+ z.C = point: new (2,-2)
+ z.D = point: new (2,3)
+ L.CD = line : new (z.C,z.D)
+ if C.AB : is_tangent (L.CD)
+ then tex.print("L.CD tangent to C.AB")
+ else
+ tex.print("L.CD no tangent to C.AB")
+ end
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircle(A,B)
+\tkzDrawLines(C,D)
+\tkzDrawPoints(A,...,D)
+\tkzLabelPoints[below left](A,C)
+\tkzLabelPoints[above right](B,D)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{
+ z.A = point: new (0,0)
+ z.B = point: new (0,2)
+ C.AB = circle: new (z.A,z.B)
+ z.C = point: new (2,-2)
+ z.D = point: new (2,3)
+ L.CD = line : new (z.C,z.D)
+ if C.AB : is_tangent (L.CD) then
+ tex.print("L.CD tangent to C.AB")
+ else
+ tex.print("L.CD no tangent to C.AB")
+ end
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircle(A,B)
+ \tkzDrawLines(C,D)
+ \tkzDrawPoints(A,...,D)
+ \tkzLabelPoints[below left](A,C)
+ \tkzLabelPoints[above right](B,D)
+ \end{tikzpicture}
+\end{minipage}
+
+
+% subsubsection method_imeth_circle_is__tangent (end)
\subsubsection{Method \Imeth{circle}{antipode}} % (fold)
\label{ssub:method_imeth_circle_antipode}
This method is used to define a point that is diametrically opposed to a point on a given circle.
@@ -703,7 +802,7 @@ z.A2 = L.TA2.pb
\end{minipage}
% subsubsection method_imeth_circle_external__similitude (end)
-
+\newpage
\subsubsection{Method \Imeth{circle}{radical\_center (C1,C2)}} % (fold)
\label{ssub:radical_center}
@@ -781,88 +880,97 @@ z.H = L.OOp : projection (z.X)
\end{minipage}
% subsubsection radical_center (end)
+\newpage
\subsubsection{Method \Imeth{circle}{radical\_axis}(C)} % (fold)
\label{ssub:method_imeth_circle_radical__axis_c}
The radical line, also called the radical axis, is the locus of points of equal circle power with respect to two nonconcentric circles. By the chordal theorem, it is perpendicular to the line of centers (Dörrie 1965). [\href{https://mathworld.wolfram.com/RadicalLine.html}{Weisstein, Eric W. "Radical Line." From MathWorld--A Wolfram Web Resource.} ]
\vspace{6pt}
-\paragraph{Radical axis v1} % (fold)
+Radical axis v1
\label{par:radical_axis_v1}
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
\begin{Verbatim}
\directlua{%
init_elements ()
-scale = .75
-z.X = point : new (0,0)
-z.B = point : new (2,2)
-z.Y = point : new (7,1)
-z.Ap = point : new (8,-1)
-L.XY = line : new (z.X,z.Y)
-C.XB = circle : new (z.X,z.B)
-C.YAp = circle : new (z.Y,z.Ap)
-z.E,z.F = get_points (C.XB : radical_axis (C.YAp))
-z.A = C.XB : point (0.4)
-T.ABAp = triangle: new (z.A,z.B,z.Ap)
-z.O = T.ABAp.circumcenter
-C.OAp = circle : new (z.O,z.Ap)
-_,z.Bp = intersection (C.OAp,C.YAp)
-L.AB = line : new (z.A,z.B)
-L.ApBp = line : new (z.Ap,z.Bp)
-z.M = intersection (L.AB,L.ApBp)
-z.H = L.XY : projection (z.M)
+scale = .75
+z.X = point: new (0,0)
+z.B = point: new (2,2)
+z.Y = point: new (7,1)
+z.Ap = point: new (8,-1)
+L.XY = line : new (z.X,z.Y)
+C.XB = circle : new (z.X,z.B)
+C.YAp = circle : new (z.Y,z.Ap)
+z.E,z.F= get_points(C.XB:radical_axis(C.YAp))
+z.A = C.XB : point (0.4)
+T.ABAp = triangle: new (z.A,z.B,z.Ap)
+z.O = T.ABAp.circumcenter
+C.OAp = circle : new (z.O,z.Ap)
+_,z.Bp = intersection (C.OAp,C.YAp)
+L.AB = line : new (z.A,z.B)
+L.ApBp = line : new (z.Ap,z.Bp)
+z.M = intersection (L.AB,L.ApBp)
+z.H = L.XY : projection (z.M)
}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(X,B Y,A')
- \tkzDrawArc[dashed,delta=30](O,A')(A)
- \tkzDrawPoints(A,B,A',B',M,H,X,Y,O,E,F)
- \tkzDrawLines[red](A,M A',M X,Y E,F)
- \tkzDrawLines[red,add=1 and 3](M,H)
-\end{tikzpicture}
\end{Verbatim}
-
-\directlua{%
-init_elements ()
-scale = .75
-z.X = point : new (0,0)
-z.B = point : new (2,2)
-z.Y = point : new (7,1)
-z.Ap = point : new (8,-1)
-L.XY = line : new (z.X,z.Y)
-C.XB = circle : new (z.X,z.B)
-C.YAp = circle : new (z.Y,z.Ap)
-z.E,z.F = get_points (C.XB : radical_axis (C.YAp))
-z.A = C.XB : point (0.4)
-T.ABAp = triangle: new (z.A,z.B,z.Ap)
-z.O = T.ABAp.circumcenter
-C.OAp = circle : new (z.O,z.Ap)
-_,z.Bp = intersection (C.OAp,C.YAp)
-L.AB = line : new (z.A,z.B)
-L.ApBp = line : new (z.Ap,z.Bp)
-z.M = intersection (L.AB,L.ApBp)
-z.H = L.XY : projection (z.M)
-}
-
-\begin{center}
- \begin{tikzpicture}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles(X,B Y,A')
\tkzDrawArc[dashed,delta=30](O,A')(A)
\tkzDrawPoints(A,B,A',B',M,H,X,Y,O,E,F)
\tkzDrawLines[red](A,M A',M X,Y E,F)
\tkzDrawLines[red,add=1 and 3](M,H)
- \end{tikzpicture}
-\end{center}
-% paragraph radical_axis_v1 (end)
+\end{tikzpicture}
+\end{Verbatim}
+
+ \directlua{%
+ init_elements ()
+ scale = .4
+ z.X = point : new (0,0)
+ z.B = point : new (2,2)
+ z.Y = point : new (7,1)
+ z.Ap = point : new (8,-1)
+ L.XY = line : new (z.X,z.Y)
+ C.XB = circle : new (z.X,z.B)
+ C.YAp = circle : new (z.Y,z.Ap)
+ z.E,z.F = get_points (C.XB : radical_axis (C.YAp))
+ z.A = C.XB : point (0.4)
+ T.ABAp = triangle: new (z.A,z.B,z.Ap)
+ z.O = T.ABAp.circumcenter
+ C.OAp = circle : new (z.O,z.Ap)
+ _,z.Bp = intersection (C.OAp,C.YAp)
+ L.AB = line : new (z.A,z.B)
+ L.ApBp = line : new (z.Ap,z.Bp)
+ z.M = intersection (L.AB,L.ApBp)
+ z.H = L.XY : projection (z.M)
+ }
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(X,B Y,A')
+ \tkzDrawArc[dashed,delta=30](O,A')(A)
+ \tkzDrawPoints(A,B,A',B',M,H,X,Y,O,E,F)
+ \tkzDrawLines[red](A,M A',M X,Y E,F)
+ \tkzDrawLines[red,add=1 and 3](M,H)
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
-\paragraph{Radical axis v2} % (fold)
+\vspace{6pt}
+Radical axis v2
\label{par:radical_axis_v2}
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
\begin{Verbatim}
\directlua{%
init_elements ()
-scale = 1.25
+scale = .5
z.O = point : new (-1,0)
z.Op = point : new (4,-1)
z.B = point : new (0,2)
@@ -879,38 +987,42 @@ L.MK,L.MKp = C.OpD : tangent_from (z.M)
_,z.K = get_points (L.MK)
_,z.Kp = get_points (L.MKp)
}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(O,B O',D)
- \tkzDrawLine(E,F)
- \tkzDrawLine[add=.25 and .25](O,O')
- \tkzDrawLines[add = 0 and .5](M,T M,T' M,K M,K')
- \tkzDrawCircle(M,T)
- \tkzDrawPoints(O,O',T,M,T',K,K')
- \tkzLabelPoints(O,O',T,T',K,K',M)
+ \tkzGetNodes
+ \tkzDrawCircles(O,B O',D)
+ \tkzDrawLine(E,F)
+ \tkzDrawLine[add=.25 and .25](O,O')
+ \tkzDrawLines[add = 0 and .5](M,T M,T'
+ M,K M,K')
+ \tkzDrawCircle(M,T)
+ \tkzDrawPoints(O,O',T,M,T',K,K')
+ \tkzLabelPoints(O,O',T,T',K,K',M)
\end{tikzpicture}
\end{Verbatim}
-
-\directlua{%
-init_elements ()
-scale =1.25
-z.O = point : new (-1,0)
-z.Op = point : new (4,-1)
-z.B = point : new (0,2)
-z.D = point : new (4,0)
-C.OB = circle : new (z.O,z.B)
-C.OpD = circle : new (z.Op,z.D)
-L.EF = C.OB : radical_axis (C.OpD)
-z.E,z.F = get_points (L.EF)
-z.M = L.EF : point (.75)
-L.MT,L.MTp = C.OB : tangent_from (z.M)
-_,z.T = get_points (L.MT)
-_,z.Tp = get_points (L.MTp)
-L.MK,L.MKp = C.OpD : tangent_from (z.M)
-_,z.K = get_points (L.MK)
-_,z.Kp = get_points (L.MKp)
-}
-
+
+ \directlua{%
+ init_elements ()
+ scale =.5
+ z.O = point : new (-1,0)
+ z.Op = point : new (4,-1)
+ z.B = point : new (0,2)
+ z.D = point : new (4,0)
+ C.OB = circle : new (z.O,z.B)
+ C.OpD = circle : new (z.Op,z.D)
+ L.EF = C.OB : radical_axis (C.OpD)
+ z.E,z.F = get_points (L.EF)
+ z.M = L.EF : point (.75)
+ L.MT,L.MTp = C.OB : tangent_from (z.M)
+ _,z.T = get_points (L.MT)
+ _,z.Tp = get_points (L.MTp)
+ L.MK,L.MKp = C.OpD : tangent_from (z.M)
+ _,z.K = get_points (L.MK)
+ _,z.Kp = get_points (L.MKp)
+ }
\begin{center}
\begin{tikzpicture}
\tkzGetNodes
@@ -923,41 +1035,49 @@ _,z.Kp = get_points (L.MKp)
\tkzLabelPoints(O,O',T,T',K,K',M)
\end{tikzpicture}
\end{center}
-% paragraph radical_axis_v2 (end)
+\end{minipage}
-\paragraph{Radical axis v3} % (fold)
+
+
+Radical axis v3
\label{par:radical_axis_v3}
+\begin{minipage}{.5\textwidth}
\begin{Verbatim}
- \directlua{%
+\directlua{%
init_elements ()
- z.O = point : new (0,0)
- z.B = point : new (4,0)
- z.Op = point : new (6,0)
- C.OB = circle : new (z.O,z.B)
- C.OpB = circle : new (z.Op,z.B)
- L.EF = C.OB : radical_axis (C.OpB)
- z.E,z.F = get_points(L.EF)
- z.M = L.EF : point (0.2)
- L = C.OB : tangent_from (z.M)
- _,z.T = get_points (L)
- L = C.OpB : tangent_from (z.M)
- _,z.Tp = get_points (L)
+scale =.5
+z.O = point : new (0,0)
+z.B = point : new (4,0)
+z.Op = point : new (6,0)
+C.OB = circle : new (z.O,z.B)
+C.OpB = circle : new (z.Op,z.B)
+L.EF = C.OB : radical_axis (C.OpB)
+z.E,z.F = get_points(L.EF)
+z.M = L.EF : point (0.2)
+L = C.OB : tangent_from (z.M)
+_,z.T = get_points (L)
+L = C.OpB : tangent_from (z.M)
+_,z.Tp = get_points (L)
}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(O,B O',B)
- \tkzDrawSegments(M,T M,T')
- \tkzDrawSegments(E,F)
- \tkzDrawLine[add=.5 and .5](O,O')
- \tkzDrawPoints(O,B,O',E,F,M,T,T')
- \tkzLabelPoints(O,O',B,E,F,T,T')
- \tkzDrawArc(M,T')(T)
+ \tkzGetNodes
+ \tkzDrawCircles(O,B O',B)
+ \tkzDrawSegments(M,T M,T')
+ \tkzDrawSegments(E,F)
+ \tkzDrawLine[add=.5 and .5](O,O')
+ \tkzDrawPoints(O,B,O',E,F,M,T,T')
+ \tkzLabelPoints(O,O',B,E,F,T,T')
+ \tkzDrawArc(M,T')(T)
\end{tikzpicture}
\end{Verbatim}
-
\directlua{%
init_elements ()
+scale =.5
z.O = point : new (0,0)
z.B = point : new (4,0)
z.Op = point : new (6,0)
@@ -971,7 +1091,6 @@ _,z.T = get_points (L)
L = C.OpB : tangent_from (z.M)
_,z.Tp = get_points (L)
}
-
\begin{center}
\begin{tikzpicture}
\tkzGetNodes
@@ -984,42 +1103,49 @@ _,z.Tp = get_points (L)
\tkzDrawArc(M,T')(T)
\end{tikzpicture}
\end{center}
+\end{minipage}
% paragraph radical_axis_v3 (end)
-\paragraph{Radical axis v4} % (fold)
+Radical axis v4
\label{par:radical_axis_v4}
+\begin{minipage}{.5\textwidth}
\begin{Verbatim}
\directlua{%
init_elements ()
- z.O = point : new (0,0)
- z.B = point : new (5,0)
- z.Op = point : new (3,0)
- C.OB = circle : new (z.O,z.B)
- C.OpB = circle : new (z.Op,z.B)
- L.EF = C.OB : radical_axis (C.OpB)
- z.E,z.F = get_points(L.EF)
- z.H = L.EF.mid
- z.M = L.EF : point (.8)
- _,L = C.OB : tangent_from (z.M)
- _,z.T = get_points (L)
- _,L = C.OpB : tangent_from (z.M)
- _,z.Tp = get_points (L)
-}
+scale =.5
+z.O = point : new (0,0)
+z.B = point : new (5,0)
+z.Op = point : new (3,0)
+C.OB = circle : new (z.O,z.B)
+C.OpB = circle : new (z.Op,z.B)
+L.EF = C.OB : radical_axis (C.OpB)
+z.E,z.F = get_points(L.EF)
+z.H = L.EF.mid
+z.M = L.EF : point (.8)
+_,L = C.OB : tangent_from (z.M)
+_,z.T = get_points (L)
+_,L = C.OpB : tangent_from (z.M)
+_,z.Tp = get_points (L)}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(O,B O',B)
- \tkzDrawSegments(M,T M,T')
- \tkzDrawSegments(E,F)
- \tkzDrawLine[add=.3 and .3](O,H)
- \tkzDrawPoints(O,O',B,E,H,M)
- \tkzLabelPoints[below right](O,O',E,F,M,T,T')
- \tkzDrawArc(M,B)(T)
+ \tkzGetNodes
+ \tkzDrawCircles(O,B O',B)
+ \tkzDrawSegments(M,T M,T')
+ \tkzDrawSegments(E,F)
+ \tkzDrawLine[add=.3 and .3](O,H)
+ \tkzDrawPoints(O,O',B,E,H,M)
+ \tkzLabelPoints[below right](O,O',E,F,M,T,T')
+ \tkzDrawArc(M,B)(T)
\end{tikzpicture}
\end{Verbatim}
\directlua{%
init_elements ()
+scale =.5
z.O = point : new (0,0)
z.B = point : new (5,0)
z.Op = point : new (3,0)
@@ -1047,6 +1173,7 @@ init_elements ()
\tkzDrawArc(M,B)(T)
\end{tikzpicture}
\end{center}
+\end{minipage}
% paragraph radical_axis_v4 (end)
% subsubsection method_imeth_circle_radical__axis_c (end)
@@ -1189,61 +1316,65 @@ In geometry, two circles are said to be orthogonal if their respective tangent l
This method determines a circle with a given centre, orthogonal to a circle that is also given.
-\begin{Verbatim}
-\directlua{%
-init_elements ()
- scale = .6
- z.C_1 = point: new (0,0)
- z.C_2 = point: new (8,0)
- z.A = point: new (5,0)
- C = circle: new (z.C_1,z.A)
- z.S,z.T = get_points (C: orthogonal_from (z.C_2))
-}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(C_1,T C_2,T)
- \tkzDrawSegments(C_1,T C_2,T)
- \tkzDrawLine(C_1,C_2)
- \tkzMarkRightAngle[fill=teal,%
- opacity=.2,size=1](C_1,T,C_2)
- \tkzDrawPoints(C_1,C_2,T)
- \tkzLabelPoints(C_1,C_2)
- \tkzLabelPoints[above](T)
- \tkzLabelSegment[left](C_1,T){r}
- \tkzLabelSegments[right](C_2,T){$\gamma$}
- \tkzLabelSegment[below](C_1,C_2){d}
- \tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
- \tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
-\end{tikzpicture}
-\end{Verbatim}
-
-\directlua{%
-init_elements ()
-scale = .6
-z.C_1 = point: new (0,0)
-z.C_2 = point: new (8,0)
-z.A = point: new (5,0)
-C = circle: new (z.C_1,z.A)
-z.S,z.T = get_points (C: orthogonal_from (z.C_2))
-}
-
-\begin{center}
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+ \begin{Verbatim}
+ \directlua{%
+ init_elements ()
+ scale = .6
+ z.C_1 = point: new (0,0)
+ z.C_2 = point: new (8,0)
+ z.A = point: new (5,0)
+ C = circle: new (z.C_1,z.A)
+ z.S,z.T = get_points (C: orthogonal_from (z.C_2))
+ }
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(C_1,T C_2,T)
- \tkzDrawSegments(C_1,T C_2,T)
- \tkzDrawLine(C_1,C_2)
- \tkzMarkRightAngle[fill=teal,opacity=.2,size=.5](C_1,T,C_2)
- \tkzDrawPoints(C_1,C_2,T)
- \tkzLabelPoints(C_1,C_2)
- \tkzLabelPoints[above](T)
- \tkzLabelSegment[left](C_1,T){r}
- \tkzLabelSegments[right](C_2,T){$\gamma$}
- \tkzLabelSegment[below](C_1,C_2){d}
- \tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
- \tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
+ \tkzGetNodes
+ \tkzDrawCircles(C_1,T C_2,T)
+ \tkzDrawSegments(C_1,T C_2,T)
+ \tkzDrawLine(C_1,C_2)
+ \tkzMarkRightAngle[fill=teal,%
+ opacity=.2,size=1](C_1,T,C_2)
+ \tkzDrawPoints(C_1,C_2,T)
+ \tkzLabelPoints(C_1,C_2)
+ \tkzLabelPoints[above](T)
+ \tkzLabelSegment[left](C_1,T){r}
+ \tkzLabelSegments[right](C_2,T){$\gamma$}
+ \tkzLabelSegment[below](C_1,C_2){d}
+ \tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
+ \tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
\end{tikzpicture}
-\end{center}
+ \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{%
+ init_elements ()
+ scale = .25
+ z.C_1 = point: new (0,0)
+ z.C_2 = point: new (8,0)
+ z.A = point: new (5,0)
+ C = circle: new (z.C_1,z.A)
+ z.S,z.T = get_points (C: orthogonal_from (z.C_2))
+ }
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(C_1,T C_2,T)
+ \tkzDrawSegments(C_1,T C_2,T)
+ \tkzDrawLine(C_1,C_2)
+ \tkzMarkRightAngle[fill=teal,opacity=.2,size=.5](C_1,T,C_2)
+ \tkzDrawPoints(C_1,C_2,T)
+ \tkzLabelPoints(C_1,C_2)
+ \tkzLabelPoints[above](T)
+ \tkzLabelSegment[left](C_1,T){r}
+ \tkzLabelSegments[right](C_2,T){$\gamma$}
+ \tkzLabelSegment[below](C_1,C_2){d}
+ \tkzLabelCircle[left=10pt](C_1,T)(180){Circle 1}
+ \tkzLabelCircle[right=10pt](C_2,T)(180){Circle 2}
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
+
% subsubsection method_imeth_circle_orthogonal__from_pt (end)
@@ -1294,7 +1425,7 @@ init_elements ()
\end{minipage}
% subsubsection method_imeth_circle_orthogonal__through (end)
-\subsubsection{midcircle} % (fold)
+\subsubsection{Method \Imeth{circle}{mmidcircle}} % (fold)
\label{ssub:midcircle}
\begin{minipage}{0.95\linewidth }
@@ -1906,8 +2037,7 @@ init_elements ()
if position == "inside tangent"
then color = "orange"
else color = "blue" end
-}
-
+}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircle(A,a)
@@ -1936,6 +2066,568 @@ if position == "inside tangent" then color = "orange" else color = "blue" end
\end{minipage}
% subsubsection circles__position (end)
+
+\subsubsection{Method \Imeth{circle}{c\_c\_pp}} % (fold)
+\label{ssub:method_c__c__pp}
+
+Find a circle tangent to a circle and passing through two given points. If one of the points is on the inside and the other on the outside, then there's no solution.
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+ init_elements ()
+ scale =.75
+ z.A = point: new (5,4)
+ z.B = point: new (3,0)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircle[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+ \tkzDrawCircles[cyan](O1,T1 O2,T2)
+ \tkzDrawPoints(O1,O2,T1,T2)
+ \tkzLabelPoints(O1,O2,T1,T2,A,B)
+ \tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ init_elements ()
+ scale =.75
+ z.A = point: new (5,4)
+ z.B = point: new (3,0)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircle[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+ \tkzDrawCircles[cyan](O1,T1 O2,T2)
+ \tkzDrawPoints(O1,O2,T1,T2)
+ \tkzLabelPoints(O1,O2,T1,T2,A,B)
+ \tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{minipage}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+ init_elements ()
+ z.A = point: new (3,0)
+ z.B = point: new (0,-3)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircle[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+ \tkzDrawCircles[cyan](O1,T1 O2,T2)
+ \tkzDrawPoints(T1,T2)
+ \tkzLabelPoints(O1,O2,T1,T2,A,B)
+ \tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ init_elements ()
+ z.A = point: new (3,0)
+ z.B = point: new (0,-3)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircle[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+ \tkzDrawCircles[cyan](O1,T1 O2,T2)
+ \tkzDrawPoints(T1,T2)
+ \tkzLabelPoints(O1,O2,T1,T2,A,B)
+ \tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{minipage}
+
+Special case: the two points are equidistant from the center of the circle
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+ init_elements ()
+ scale =.5
+ z.A = point: new (2,3)
+ z.B = point: new (2,-3)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ init_elements ()
+ scale =.5
+ z.A = point: new (2,3)
+ z.B = point: new (2,-3)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircles[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+\tkzDrawCircles[cyan](O1,T1 O2,T2)
+\tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{minipage}
+
+The line $(AB)$ is tangent to the circle. Only one circle answers the question.
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+ \directlua{
+ init_elements ()
+ scale =.5
+ z.A = point: new (1,5)
+ z.B = point: new (1,-3)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+ }
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ init_elements ()
+ scale =.5
+ z.A = point: new (1,5)
+ z.B = point: new (1,-3)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines[red](A,B)
+\tkzDrawCircles[red](O,C)
+\tkzDrawPoints(A,B,C,O)
+\tkzDrawCircles[cyan](O1,T1 O2,T2)
+\tkzLabelPoints(O,C,A,B)
+\end{tikzpicture}
+\end{minipage}
+Another special case occurs when the straight line $(AB)$ is tangent to the initial circle, and it's even possible for points $A$ and $B$ to be equidistant from the center and for the straight line to be tangent to the circle. Here too, a single circle answers the question
+
+
+\begin{minipage}{.5\textwidth}
+ \begin{Verbatim}
+ \directlua{
+ init_elements ()
+ z.A = point: new (1,3)
+ z.B = point: new (1,-3)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+ }
+ \end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+ \directlua{
+ init_elements ()
+ z.A = point: new (1,3)
+ z.B = point: new (1,-3)
+ z.O = point: new (0,0)
+ z.C = point: new (1,0)
+ L.AB = line: new ( z.A,z.B )
+ C.OC = circle: new (z.O,z.C)
+ C1,C2 = C.OC: c_c_pp (z.A,z.B)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines[red](A,B)
+ \tkzDrawCircles[red](O,C)
+ \tkzDrawPoints(A,B,C,O)
+ \tkzDrawCircles[cyan](O1,T1 O2,T2)
+ \tkzLabelPoints(O,C,A,B)
+ \end{tikzpicture}
+\end{minipage}
+
+% subsubsection method_c__c__pp (end)
+
+\subsubsection{Method \Imeth{circle}{c\_cc\_p}} % (fold)
+\label{ssub:method_c_cc_p}
+Circle tangent to two circles passing through a point
+
+Let's begin with the general case. The two circles are disjoint, and point
+$P$ lies outside both of them. Notice that the two solution circles intersect at two points, one of which is the given point $P$. To determine the second intersection point, I used a similitude. This approach leads to an intriguing special case known as the Arbelos configuration. In this arrangement, the solution circles are also tangent at point $P$. One of the circles, in this case, is the Pappus circle.
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale =.75
+z.A = point : new ( 0 , 0 )
+z.TA = point : new ( 3 , 0 )
+z.B = point : new ( 6 , 2 )
+z.TB = point : new ( 6 , 1 )
+z.P = point : new ( 3 , 6 )
+C.A = circle : new (z.A,z.TA)
+C.B = circle : new (z.B,z.TB)
+C1,C2= C.A : c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzLabelPoints(A,B)
+\tkzDrawPoints[size=3](P)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.TA = point : new ( 3 , 0 )
+z.B = point : new ( 6 , 2 )
+z.TB = point : new ( 6 , 1 )
+z.P = point : new ( 3 , 6 )
+C.A = circle : new (z.A,z.TA)
+C.B = circle : new (z.B,z.TB)
+C1,C2= C.A : c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzLabelPoints(A,B)
+\tkzDrawPoints[size=3](P)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+The first special case involves two given tangent circles. The point $P$ is not the point of tangency of the Pappus circle.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A = point : new ( 0 , 0 )
+z.TA = point : new ( 2 , 0 )
+z.B = point : new ( 3 , 0 )
+z.TB = point : new ( 2 , 0 )
+z.P = point : new ( 3 , 4 )
+C.A = circle : new (z.A,z.TA)
+C.B = circle : new (z.B,z.TB)
+C1,C2 = C.A : c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+z.A = point : new ( 0 , 0 )
+z.TA = point : new ( 2 , 0 )
+z.B = point : new ( 3 , 0 )
+z.TB = point : new ( 2 , 0 )
+z.P = point : new ( 3 , 4 )
+C.A = circle : new (z.A,z.TA)
+C.B = circle : new (z.B,z.TB)
+C1,C2 = C.A : c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzDrawPoints[size = 3](P)
+\tkzLabelPoints(A,B)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+
+Here's the Arbelos configuration
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A = point : new ( 0 , 0 )
+z.TA = point : new ( 2 , 0 )
+z.B = point : new ( 3 , 0 )
+z.TB = point : new ( 2 , 0 )
+C.A = circle : new (z.A,z.TA)
+C.B = circle : new (z.B,z.TB)
+z.I = C.A: external_similitude (C.B)
+z.t1,z.t2 = C.A : common_tangent (C.B)
+z.TD = C.B : antipode(z.TB)
+z.TE = C.A : antipode(z.TA)
+z.O = midpoint(z.TD,z.TE)
+C.O = circle : new (z.O,z.TD)
+z.P = C.O : tangent_from (z.I).pb
+C1,C2 = C.A : c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+z.A = point : new ( 0 , 0 )
+z.TA = point : new ( 2 , 0 )
+z.B = point : new ( 3 , 0 )
+z.TB = point : new ( 2 , 0 )
+C.A = circle : new (z.A,z.TA)
+C.B = circle : new (z.B,z.TB)
+z.I = C.A: external_similitude (C.B)
+z.t1,z.t2 = C.A : common_tangent (C.B)
+z.TD = C.B : antipode(z.TB)
+z.TE = C.A : antipode(z.TA)
+z.O = midpoint(z.TD,z.TE)
+C.O = circle : new (z.O,z.TD)
+z.P = C.O : tangent_from (z.I).pb
+C1,C2 = C.A : c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzLabelPoints(A,B)
+\tkzDrawPoints[size=3](P)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+If the point $P$ is not the contact point of the Pappus circle, we return to the general case.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A = point : new ( 0 , 0 )
+z.TA = point : new ( 2 , 0 )
+z.B = point : new ( 3 , 0 )
+z.TB = point : new ( 2 , 0 )
+C.A = circle : new (z.A,z.TA)
+C.B = circle : new (z.B,z.TB)
+z.I = C.A: external_similitude (C.B)
+z.t1,z.t2 = C.A : common_tangent (C.B)
+z.TD = C.B : antipode(z.TB)
+z.TE = C.A : antipode(z.TA)
+z.O = midpoint(z.TD,z.TE)
+C.O = circle : new (z.O,z.TD)
+z.P = C.O : tangent_from (z.I).pb
+C1,C2 = C.A : c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+z.A = point : new ( 0 , 0 )
+z.TA = point : new ( 2 , 0 )
+z.B = point : new ( 3 , 0 )
+z.TB = point : new ( 2 , 0 )
+C.A = circle : new (z.A,z.TA)
+C.B = circle : new (z.B,z.TB)
+z.I = C.A: external_similitude (C.B)
+z.t1,z.t2 = C.A : common_tangent (C.B)
+z.TD = C.B : antipode(z.TB)
+z.TE = C.A : antipode(z.TA)
+z.O = midpoint(z.TD,z.TE)
+C.O = circle : new (z.O,z.TD)
+z.P = C.O : tangent_from (z.I).pb
+C1,C2 = C.A : c_cc_p (C.B,z.P)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawCircles[thick](A,TA B,TB)
+\tkzDrawCircles[red](O1,T1 O2,T2)
+\tkzDrawPoints(A,B,O1,O2)
+\tkzLabelPoints(A,B)
+\tkzDrawPoints[size=3](P)
+\tkzLabelPoints[above](P)
+\end{tikzpicture}
+\end{minipage}
+% subsubsection method_c_cc_p (end)
+
+\subsubsection{Method c\_lc\_p} % (fold)
+\label{ssub:method_c_lc_p}
+
+Circle tangent to a line and a circle passing through a given point.
+
+First, let's look at the general case. The point and the circle are in the same half-plane with respect to the line.
+The point is neither on the line nor on the circle.
+
+There are 4 circles verifying the conditions. Two are tangent externally, and two internally to the initial circle. The latter two are obtained with the \code{inside} argument.
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+ \directlua{
+ z.A = point : new (0 , 0)
+ z.B = point : new (4 , 0 )
+ L.AB = line : new (z.A,z.B)
+ z.O = point : new (3 , 3)
+ z.T = point : new (3 , 2)
+ z.P = point : new (2 , .25)
+ C.OT = circle : new (z.O , z.T)
+ C1,C2 = C.OT : c_lc_p (L.AB , z.P)
+ z.O1 = C1.center
+ z.O2 = C2.center
+ C3,C4 = C.OT : c_lc_p (L.AB , z.P,inside)
+ z.O3 = C3.center
+ z.O4 = C4.center
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles[thick](O,T)
+ \tkzDrawCircles[red](O1,P O2,P)
+ \tkzDrawCircles[cyan](O3,P O4,P)
+ \tkzDrawLines[thick](A,B)
+ \tkzDrawPoints[size = 2](P)
+ \tkzDrawPoints(A,B,O,O1,O2,O3,O4)
+ \tkzLabelPoints(A,B,O,O1,O2,O3,O4)
+ \tkzLabelPoints[above](P)
+ \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+ \directlua{
+ init_elements()
+ z.A = point : new (0 , 0)
+ z.B = point : new (4 , 0 )
+ L.AB = line : new (z.A,z.B)
+ z.O = point : new (3 , 3)
+ z.T = point : new (3 , 2)
+ z.P = point : new (2 , .25)
+ C.OT = circle : new (z.O , z.T)
+ C1,C2 = C.OT : c_lc_p (L.AB , z.P)
+ z.O1 = C1.center
+ z.O2 = C2.center
+ C3,C4 = C.OT : c_lc_p (L.AB , z.P,inside)
+ z.O3 = C3.center
+ z.O4 = C4.center
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles[thick](O,T)
+ \tkzDrawCircles[red](O1,P O2,P)
+ \tkzDrawCircles[cyan](O3,P O4,P)
+ \tkzDrawLines[thick](A,B)
+ \tkzDrawPoints[size = 2](P)
+ \tkzDrawPoints(A,B,O,O1,O2,O3,O4)
+ \tkzLabelPoints(A,B,O,O1,O2,O3,O4)
+ \tkzLabelPoints[above](P)
+ \end{tikzpicture}
+\end{minipage}
+% subsubsection method_c_lc_p (end)
% subsection methods_of_the_class_circle (end)
% section class_circle (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
index 3d46a029b5..91eda32430 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex
@@ -30,11 +30,11 @@ The attributes are :
\Iattr{line}{slope} & Slope of the line & [\ref{ssub:example_class_line}] \\
\Iattr{line}{length} &|l = L.AB.length|& [\ref{sub:transfer_from_lua_to_tex} ; \ref{ssub:example_class_line}] \\
\Iattr{line}{north\_pa} & & [\ref{ssub:example_class_line}] \\
-\Iattr{line}{north\_pb} & &\\
-\Iattr{line}{south\_pa} & &\\
-\Iattr{line}{south\_pb} & & [\ref{ssub:example_class_line}] \\
-\Iattr{line}{east} & &\\
-\Iattr{line}{west} & &\\
+\Iattr{line}{north\_pb} & & \\
+\Iattr{line}{south\_pa} & & \\
+\Iattr{line}{south\_pb} & & \\
+\Iattr{line}{east} & & \\
+\Iattr{line}{west} & & \\
\Iattr{line}{vec} & |V.AB = L.AB.vec|& defines $\overrightarrow{AB}$ [\ref{sec:class_vector}] \\
\bottomrule
\end{tabular}
@@ -53,8 +53,8 @@ z.m = L.ab.mid
z.w = L.ab.west
z.e = L.ab.east
z.r = L.ab.north_pa
-z.s = L.ab.south_pb
-sl = L.ab.slope
+z.s = L.ab.south_pb
+sl = L.ab.slope
len = L.ab.length
}
@@ -172,6 +172,17 @@ Here's the list of methods for the \tkzNameObj{line} object. The results can be
\midrule
\Igfct{line}{new(pt, pt)} & |L.AB = line : new(z.A,z.B)| & Create line $(AB)$ ; [\ref{sub:altshiller}] \\
\midrule
+\textbf{Real} &&\\
+\midrule
+\Imeth{line}{distance (pt)} & |d = L.AB : distance (z.C)| & [\ref{ssub:method_imeth_line_distance}; \ref{ssub:example_distance_and_projection}] \\
+\Imeth{line}{slope ()} & |a = L.AB : slope()| & better is L.AB.slope; [\ref{ssub:example_class_line}]\\
+\textbf{Boolean} &&\\
+\midrule
+\Imeth{line}{in\_out (pt)} & |b = L.AB: in_out(z.C)| & b=true if $C\in (AB)$ ; [\ref{ssub:method_imeth};\ref{ssub:in_out_for_a_line}] \\
+\Imeth{line}{in\_out\_segment(pt)} & |b = L.AB:in_out_segment(z.C)| & b=true if $C\in [AB$] [\ref{ssub:method_imeth_line_in__in__out__segment}] \\
+\Imeth{line}{is\_parallel(L)} & & \\
+\Imeth{line}{is\_orthogonal(L)} & & \\
+\Imeth{line}{is\_equidistant(pt)} & & \\\midrule
\textbf{Points} &&\\
\midrule
\Imeth{line}{gold\_ratio ()} & |z.C=L.AB : gold_ratio()| & [\ref{sub:gold_ratio_with_segment} ; \ref{sub:the_figure_pappus_circle} ; \ref{sub:bankoff_circle} ] \\
@@ -193,25 +204,26 @@ Here's the list of methods for the \tkzNameObj{line} object. The results can be
\Imeth{line}{report(d,pt)} &|z.M=L.AB: report(2,z.N)| &|MN=2|; $AB\parallel MN$ ; [ex. \ref{ssub:method_report}]\\
\Imeth{line}{colinear\_at(pt,k)} &|z.D=L.AB: colinear_at(z.C,2)| &|CD=2AB|; $AB\parallel CD$ ; [ex. \ref{ssub:method_imeth_line_colinear__at}]\\
\midrule
+
\textbf{Lines} &&\\
\midrule
\Imeth{line}{ll\_from ( pt )} &|L.CD=L.AB: ll_from(z.C)| &$(CD) \parallel (AB)$; [\ref{ssub:new_line_from_a_defined_line}] \\
\Imeth{line}{ortho\_from ( pt )} &|L.CD=L.AB: ortho_from(z.C)|&$(CD) \perp (AB)$; [\ref{ssub:newline_ortho_from}] \\
\Imeth{line}{mediator ()} & |L.uv=L.AB: mediator()| & perpendicular bisector of $(A,B)$ \footnote{You can use |perpendicular_bisector| intead of \tkzname{mediator}.}; [\ref{ssub:method_imeth_line_mediator}]\\
\midrule
+
\textbf{Triangles}&&\\
\midrule
\Imeth{line}{equilateral (<swap>)} & |T.ABC=L.AB:equilateral()| & $(\overrightarrow{AB},\overrightarrow{AC})>0$ or $<0$ with swap \footnote{Triangles are defined in the direct sense of rotation, unless the "swap" option is present.}; [\ref{ssub:object_rotation}] \\
\Imeth{line}{isosceles (an<,swap>)}&|T.ABC=L.AB:isosceles(math.pi/6)|& [\ref{ssub:method_imeth_line_isosceles}]\\
+\Imeth{line}{isosceles\_a (an<,swap>)}& same as |isosceles| & \\
+\Imeth{line}{isosceles\_s (an<,swap>)}&|T.ABC=L.AB:isosceles_s(4)| AC=BC = 4& \\
\Imeth{line}{two\_angles (an,an)} &|T.ABC=L.AB:two_angles(an,an)|&note \footnote{The given side is between the two angles} [\ref{ssub:triangle_with_two__angles}] \\
\Imeth{line}{school ()} & 30°,60°, 90° & \\
-\Imeth{line}{sss (r,r)} & $AC=r$ $BC=r$ & [\ref{ssub:triangle_with_three_given_sides}] \\
-\Imeth{line}{sas (r,an)} & $AC =r$ $\widehat{BAC} = an$ & [\ref{ssub:triangle_with_three_given_sides}] \\
-\Imeth{line}{ssa (r,an)} & $AC =r$ $\widehat{ABC} = an$& [\ref{ssub:triangle_with_three_given_sides}]\\
-\midrule
-\textbf{Squares}&&\\
-\midrule
-\Imeth{line}{square ()} &|S.AB=L.AB : square () | & create a square |S.AB|.\footnote{ |_,_,z.C,z.D = get_points(S.AB)|}; [\ref{ssub:object_rotation}] \\
+\Imeth{line}{half (<swap>)} & T.ABC = L.AB:half() $\widehat{B}$ = 90° and 2BC = AB& \\
+\Imeth{line}{sss (r,r<,swap>)} & $AC=r$ $BC=r$ & [\ref{ssub:triangle_with_three_given_sides}] \\
+\Imeth{line}{sas (r,an<,swap>)} & $AC =r$ $\widehat{BAC} = an$ & [\ref{ssub:triangle_with_three_given_sides}] \\
+\Imeth{line}{ssa (r,an<,swap>)} & $AC =r$ $\widehat{ABC} = an$& [\ref{ssub:triangle_with_three_given_sides}]\\
\bottomrule
\end{tabular}
\egroup
@@ -227,20 +239,30 @@ Here's the list of methods for the \tkzNameObj{line} object. The results can be
\toprule
\textbf{Methods} & \textbf{Comments} & \\
\midrule
+\textbf{Squares}&&\\
+\midrule
+\Imeth{line}{square ()} &|S.AB=L.AB : square () | & create a square |S.AB|.\footnote{ |_,_,z.C,z.D = get_points(S.AB)|}; [\ref{ssub:object_rotation}] \\
+\midrule
\textbf{Sacred triangles}&&\\
\midrule
\Imeth{line}{gold (<swap>)} &|T.ABC=L.AB:gold()| & right in $B$ and $AC = \varphi \times AB $; [\ref{line:met}] \\
\Imeth{line}{euclide (<swap>)} &|T.ABC=L.AB:euclide()| &$AB=AC$ ; $(\overrightarrow{AB},\overrightarrow{AC}) = \pi/5$; [\ref{line:met}] \\
\Imeth{line}{golden (<swap>)} &|T.ABC=L.AB:golden()| &
$(\overrightarrow{AB},\overrightarrow{AC}) = 2\times \pi/5$ ; [\ref{line:met}] \\
-\Imeth{line}{divine ()} & & [\ref{line:met}] \\
-\Imeth{line}{egyptian ()} & & [\ref{line:met}] \\
-\Imeth{line}{cheops ()} & & [\ref{line:met}] \\
+\Imeth{line}{sublime (<swap>)} & = golden & [\ref{line:met}] \\
+\Imeth{line}{divine (<swap>)} & & [\ref{line:met}] \\
+\Imeth{line}{golden\_gnomon (<swap>)} & = devine & [\ref{line:met}] \\
+\Imeth{line}{egyptian (<swap>)} & & [\ref{line:met}] \\
+\Imeth{line}{pythagoras (<swap>)} & = egyptian & [\ref{line:met}] \\
+\Imeth{line}{isis (<swap>)} & = egyptian & [\ref{line:met}] \\
+\Imeth{line}{cheops (<swap>)} & & [\ref{line:met}] \\
\midrule
\textbf{Circles} &&\\
\midrule
\Imeth{line}{circle ()} & |C.AB = L.AB : circle ()| & center pa through pb \\
\Imeth{line}{apollonius (r)} & |C.apo = L.AB : apollonius (2)|& Set of points tq. |MA/MB = 2|; [\ref{ssub:apollonius_circle_ma_mb_k}] \\
+\Imeth{line}{c\_l\_pp (pt,pt)} & |C1,C2 = L.AB : c_l_pp(z.M,z.N)| & [\ref{ssub:c_l_pp}] \\
+\Imeth{line}{c\_ll\_p (pt,pt)} & |C1,C2 = L.AB : c_ll_p(z.C,z.P)| & [\ref{ssub:method_c__ll__p}] \\
\midrule
\textbf{Transformations} &&\\
\midrule
@@ -248,51 +270,380 @@ Here's the list of methods for the \tkzNameObj{line} object. The results can be
\Imeth{line}{translation ( obj )} & |new obj = L.AB : translation (obj)|& [\ref{ssub:example_translation}] \\
\Imeth{line}{projection ( obj )} & |z.H = L.AB : projection (z.C)| & $CH \perp (AB)$ and $H\in (AB)$; [\ref{ssub:example_projection_of_several_points}; \ref{ssub:example_combination_of_methods}]\\
... & & [ \ref{ssub:example_projection_of_several_points}; \ref{ssub:example_combination_of_methods}]\\
-\midrule
-\textbf{Miscellaneous} &&\\
-\midrule
-\Imeth{line}{distance (pt)} & |d = L.Ab : distance (z.C)| & [\ref{ssub:example_distance_and_projection}] \\
-\Imeth{line}{in\_out (pt)} & |b = L.AB: in_out(z.C)| & b=true if $C\in (AB)$ ; [\ref{ssub:in_out_for_a_line}] \\
-\Imeth{line}{slope ()} & |a = L.AB : slope()| & better is L.AB.slope; [\ref{ssub:example_class_line}]\\
-\Imeth{line}{in\_out\_segment (pt)} & |b = L.AB : in_out_segment(z.C)| & b=true if $C\in [AB$] \\
\bottomrule
\end{tabular}
\egroup
\end{minipage}
+\subsubsection{Method \Imeth{line}{distance}} % (fold)
+\label{ssub:method_imeth_line_distance}
+
+This method gives the distance from a point to a straight line.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+function calc_distance (L,p)
+ if L : in_out (p)
+ then
+ return point.abs(p-L.pa)/L.length
+ else
+ return 0
+ end
+end
+z.A = point: new (0,0)
+z.B = point: new (2,4)
+z.X = point: new (3,6)
+z.Y = point: new (2,0)
+L.AB = line : new (z.A,z.B)
+dx = calc_distance (L.AB,z.X)
+dy = calc_distance (L.AB,z.Y)
+}
+\tkzUseLua{k}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPoints(A,B,X,Y)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoint(X){X : \tkzUseLua{dx}}
+ \tkzLabelPoint(Y){Y : \tkzUseLua{dy}}
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ z.A = point : new (0 , 0)
+ z.B = point : new (4 , 3)
+ z.C = point : new (1 , 5)
+ L.AB = line : new (z.A,z.B)
+ d = L.AB : distance (z.C)
+ l = L.AB.length
+ z.H = L.AB : projection (z.C)
+}
+\begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B C,H)
+ \tkzDrawPoints(A,B,C,H)
+ \tkzLabelPoints(A,B,C,H)
+ \tkzLabelSegment[above right=2em,draw](C,H){$CH = \tkzUseLua{d}$}
+ \tkzLabelSegment[below right=1em,draw](A,B){$AB = \tkzUseLua{l}$}
+ \end{tikzpicture}
+\end{center}
+
+\end{minipage}
+% subsubsection method_imeth_line_distance (end)
+
+\subsubsection{Method \Imeth{line}{in\_out}} % (fold)
+\label{ssub:method_imeth}
+
+This method shows whether a point belongs to a straight line.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+function calc_ratio (L,p)
+ if L : in_out (p)
+ then
+ return point.abs(p-L.pa)/L.length
+ else
+ return 0
+ end
+end
+z.A = point: new (0,0)
+z.B = point: new (2,4)
+z.X = point: new (3,6)
+z.Y = point: new (2,0)
+L.AB = line : new (z.A,z.B)
+dx = calc_ratio (L.AB,z.X)
+dy = calc_ratio (L.AB,z.Y)
+}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPoints(A,B,X,Y)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoint(X){X : \tkzUseLua{dx}}
+ \tkzLabelPoint(Y){Y : \tkzUseLua{dy}}
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+function calc_distance (L,p)
+ if L : in_out (p)
+ then
+ return point.abs(p-L.pa)/L.length
+ else
+ return 0
+ end
+end
+z.A = point: new (0,0)
+z.B = point: new (2,4)
+z.X = point: new (3,6)
+z.Y = point: new (2,0)
+L.AB = line : new (z.A,z.B)
+dx = calc_distance (L.AB,z.X)
+dy = calc_distance (L.AB,z.Y)
+}
+\begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPoints(A,B,X,Y)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoint(X){X : \tkzUseLua{dx}}
+ \tkzLabelPoint(Y){Y : \tkzUseLua{dy}}
+ \end{tikzpicture}
+\end{center}
+\end{minipage}
+
+% subsubsection method_imeth (end)
+
+\subsubsection{Method \Imeth{line}{in\_in\_out\_segment}} % (fold)
+\label{ssub:method_imeth_line_in__in__out__segment}
+
+Variant of the previous method; indicates whether a point is on or off a segment.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+ \directlua{
+ function foo (L,p)
+ if L : in_out_segment (p)
+ then
+ return "in"
+ else
+ return "out"
+ end
+ end
+ z.A = point: new (0,0)
+ z.B = point: new (2,4)
+ z.X = point: new (-1,-2)
+ z.Y = point: new (1,2)
+ L.AB = line : new (z.A,z.B)
+ bx = foo(L.AB,z.X)
+ by = foo(L.AB,z.Y)
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPoints(A,B,X,Y)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoint(X){X : \tkzUseLua{bx}}
+ \tkzLabelPoint(Y){Y : \tkzUseLua{by}}
+ \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{
+ function foo (L,p)
+ if L : in_out_segment (p)
+ then
+ return "in"
+ else
+ return "out"
+ end
+ end
+ z.A = point: new (0,0)
+ z.B = point: new (2,4)
+ z.X = point: new (-1,-2)
+ z.Y = point: new (1,2)
+ L.AB = line : new (z.A,z.B)
+ bx = foo(L.AB,z.X)
+ by = foo(L.AB,z.Y)
+ }
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLine(A,B)
+ \tkzDrawPoints(A,B,X,Y)
+ \tkzLabelPoints(A,B)
+ \tkzLabelPoint(X){X : \tkzUseLua{bx}}
+ \tkzLabelPoint(Y){Y : \tkzUseLua{by}}
+ \end{tikzpicture}
+ \end{center}
+
+\end{minipage}
+
+% subsubsection method_imeth_line_in__in__out__segment (end)
+
+\subsubsection{Method \Imeth{line}{is\_parallel}} % (fold)
+\label{ssub:method_imeth_line_is__parallel}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 2 )
+L.AB = line : new (z.A,z.B)
+z.C = point : new ( 1 , 2 )
+z.D = point : new ( 5 , 4 )
+L.CD = line : new (z.C,z.D)
+if L.AB:is_parallel (L.CD)
+then tex.print("parallel")
+else tex.print("no parallel")
+end
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B C,D)
+\tkzDrawPoints(A,B,C,D)
+\tkzLabelPoints(A,B,C,D)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 4 , 2 )
+ L.AB = line : new (z.A,z.B)
+ z.C = point : new ( 1 , 2 )
+ z.D = point : new ( 5 , 4 )
+ L.CD = line : new (z.C,z.D)
+ if L.AB:is_parallel (L.CD) then tex.print("parallel") else tex.print("no parallel") end
+ }
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B C,D)
+ \tkzDrawPoints(A,B,C,D)
+ \tkzLabelPoints(A,B,C,D)
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
+
+% subsubsection method_imeth_line_is__parallel (end)
+
+\subsubsection{Method \Imeth{line}{is\_orthogonal}} % (fold)
+\label{ssub:method_imeth_line_is__orthogonal}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+ \directlua{
+ z.A = point : new (0 , 0 )
+ z.B = point : new (0 , 4 )
+ L.AB = line : new (z.A,z.B)
+ z.C = point : new (3 , 4 )
+ L.BC = line : new (z.B,z.C)
+ if L.AB:is_orthogonal (L.BC)
+ then tex.print("orthogonal")
+ else tex.print("no orthogonal")
+ end
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B B,C A,C)
+ \tkzDrawPoints(A,B,C)
+ \tkzLabelPoints(A,B,C)
+ \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 0 , 4 )
+ L.AB = line : new (z.A,z.B)
+ z.C = point : new ( 3 , 4 )
+ L.BC = line : new (z.B,z.C)
+ if L.AB:is_orthogonal (L.BC) then
+ tex.print("orthogonal") else
+ tex.print("no orthogonal")
+ end
+ }
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B B,C A,C)
+ \tkzDrawPoints(A,B,C)
+ \tkzLabelPoints(A,B,C)
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
+% subsubsection method_imeth_line_is__orthogonal (end)
+
+\subsubsection{Method \Imeth{line}{is\_equidistant}} % (fold)
+\label{ssub:method_imeth_line_is__equidistant}
+
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+ z.A = point : new (0 , 0 )
+ z.B = point : new (0 , 4 )
+ z.C = point : new (4 , 4 )
+ L.AC = line : new (z.A,z.C)
+ if L.AC:is_equidistant (z.B)
+ then tex.print("equidistant")
+ else tex.print("no equidistant")
+ end
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B B,C A,C)
+ \tkzDrawPoints(A,B,C)
+ \tkzLabelPoints(A,B,C)
+ \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+ z.A = point : new (0 , 0 )
+ z.B = point : new (0 , 4 )
+ z.C = point : new (4 , 4 )
+ L.AC = line : new (z.A,z.C)
+ if L.AC:is_equidistant (z.B)
+ then tex.print("equidistant")
+ else tex.print("no equidistant")
+ end
+ }
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B B,C A,C)
+ \tkzDrawPoints(A,B,C)
+ \tkzLabelPoints(A,B,C)
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
+
+% subsubsection method_imeth_line_is__equidistant (end)
+
\subsubsection{Method \Imeth{line}{report}} % (fold)
\label{ssub:method_report}
|report (d,pt)| If the point is absent, the transfer is made from the first point that defines the line.
+\vspace{6pt}
\begin{minipage}{.5\textwidth}
\begin{Verbatim}
\directlua{%
init_elements ()
- z.A = point : new (1,-1)
- z.B = point : new (5,0)
- L.AB = line : new ( z.A , z.B )
- z.M = point : new (2,3)
- z.N = L.AB : report (3,z.M)
- z.O = L.AB : report (3)
- }
- \begin{tikzpicture}
+z.A = point : new (0,0)
+z.B = point : new (4,3)
+L.AB = line : new ( z.A , z.B )
+z.M = point : new (0,2)
+z.N = L.AB : report (2.5,z.M)
+z.O = L.AB : report (2.5)
+}
+\begin{tikzpicture}
\tkzGetNodes
\tkzDrawSegments(A,B M,N)
\tkzDrawPoints(A,B,M,N,O)
\tkzLabelPoints(A,B,M,N,O)
- \end{tikzpicture}
- \end{Verbatim}
+\end{tikzpicture}
+\end{Verbatim}
\end{minipage}
\begin{minipage}{.5\textwidth}
\directlua{%
init_elements ()
-z.A = point : new (1,-1)
-z.B = point : new (5,0)
-L.AB = line : new ( z.A , z.B )
-z.M = point : new (2,3)
-z.N = L.AB : report (3,z.M)
-z.O = L.AB : report (3)
+z.A = point : new (0,0)
+z.B = point : new (4,3)
+L.AB = line : new ( z.A , z.B )
+z.M = point : new (0,2)
+z.N = L.AB : report (2.5,z.M)
+z.O = L.AB : report (2.5)
}
\begin{tikzpicture}
\tkzGetNodes
@@ -320,7 +671,7 @@ init_elements ()
}
\begin{tikzpicture}
\tkzGetNodes
- \tkzDrawPolygons(A,B,C)
+ \tkzDrawPolygons(A,B,C)
\tkzDrawPoints(A,B,C)
\tkzLabelPoints(A,B)
\tkzLabelPoints[above](C)
@@ -344,7 +695,7 @@ init_elements ()
\begin{center}
\begin{tikzpicture}
\tkzGetNodes
- \tkzDrawPolygons(A,B,C)
+ \tkzDrawPolygons(A,B,C)
\tkzDrawPoints(A,B,C)
\tkzLabelPoints(A,B)
\tkzLabelPoints[above](C)
@@ -374,7 +725,7 @@ init_elements ()
T.SY = T.abc : symmedian ()
z.Ka,z.Kb,z.Kc = get_points (T.SY)
L.Kb = T.abc : symmedian_line (1)
- _,z.Kb = get_points(L.Kb)
+ _,z.Kb = get_points(L.Kb)
}
\begin{tikzpicture}
\tkzGetNodes
@@ -400,7 +751,7 @@ init_elements ()
z.Ka,z.Kb,
z.Kc = get_points (T.SY)
L.Kb = T.abc : symmedian_line (1)
- _,z.Kb = get_points(L.Kb)
+ _,z.Kb = get_points(L.Kb)
}
\begin{tikzpicture}
\tkzGetNodes
@@ -434,10 +785,10 @@ init_elements ()
z.D = T.ABD.pc
z.E = T.ABE.pc
}
-\hspace{\fill}
+\hspace{\fill}
\begin{tikzpicture}[gridded]
\tkzGetNodes
- \tkzDrawPolygons(A,B,C A,B,D A,B,E)
+ \tkzDrawPolygons(A,B,C A,B,D A,B,E)
\tkzDrawPoints(A,B,C,D,E)
\tkzLabelPoints(A,B)
\tkzLabelPoints[above](C,D,E)
@@ -461,7 +812,7 @@ init_elements ()
\begin{center}
\begin{tikzpicture}[gridded]
\tkzGetNodes
- \tkzDrawPolygons(A,B,C A,B,D A,B,E)
+ \tkzDrawPolygons(A,B,C A,B,D A,B,E)
\tkzDrawPoints(A,B,C,D,E)
\tkzLabelPoints(A,B)
\tkzLabelPoints[above](C,D,E)
@@ -474,7 +825,6 @@ init_elements ()
\subsubsection{Triangle with side between side and angle} % (fold)
\label{ssub:triangle_with_side_between_side_and_angle}
-In some cases, two solutions are possible.
\begin{minipage}{.4\textwidth}
\begin{Verbatim}
@@ -484,13 +834,14 @@ init_elements ()
z.A = point : new ( 0 , 0 )
z.B = point : new ( 5 , 0 )
L.AB = line : new ( z.A , z.B )
- T.ABC,T.ABD = L.AB : ssa (value(3),math.pi/6)
+ T.ABC = L.AB : ssa (value(3),math.pi/6)
+ T.ABD = L.AB : ssa (value(3),math.pi/6,swap)
z.C = T.ABC.pc
z.D = T.ABD.pc
}
\begin{tikzpicture}[gridded]
\tkzGetNodes
- \tkzDrawPolygons(A,B,C A,B,D)
+ \tkzDrawPolygons(A,B,C A,B,D)
\tkzDrawPoints(A,B,C,D)
\tkzLabelPoints(A,B)
\tkzLabelPoints[above](C,D)
@@ -507,7 +858,8 @@ init_elements ()
z.A = point : new ( 0 , 0 )
z.B = point : new ( 5 , 0 )
L.AB = line : new ( z.A , z.B )
- T.ABC,T.ABD = L.AB : ssa (value(3),math.pi/6)
+ T.ABC = L.AB : ssa (value(3),math.pi/6)
+ T.ABD = L.AB : ssa (value(3),math.pi/6,swap)
z.C = T.ABC.pc
z.D = T.ABD.pc
}
@@ -515,7 +867,7 @@ init_elements ()
\begin{center}
\begin{tikzpicture}[gridded]
\tkzGetNodes
- \tkzDrawPolygons(A,B,C A,B,D)
+ \tkzDrawPolygons(A,B,C A,B,D)
\tkzDrawPoints(A,B,C,D)
\tkzLabelPoints(A,B)
\tkzLabelPoints[above](C,D)
@@ -537,10 +889,10 @@ The side lengths are proportional to the lengths given in the table. They depend
\begin{tabular}{ll}
\toprule
\textbf{Name} & \textbf{definition} \\
-\midrule
+\midrule
\Imeth{line}{gold (<swap>)} & Right triangle with $a=\varphi$, $b=1$ and $c=\sqrt{\varphi}$\\
\Imeth{line}{golden (<swap>)} & Right triangle $b=\varphi$, $c=1$ ; half of gold rectangle \\
-\Imeth{line}{divine ()} & Isosceles $a=\varphi$, $b=c=1$ and $\beta = \gamma=\pi/5$ \\
+\Imeth{line}{divine ()} & Isosceles $a=\varphi$, $b=c=1$ and $\beta = \gamma=\pi/5$ \\
\Imeth{line}{pythagoras ()} & $a=5$, $b=4$, $c=3$ and other names: isis or egyptian\\
\Imeth{line}{sublime ()} & Isosceles $a=1$, $b=c=\varphi$ and $\beta =\gamma=2\pi/5$ ; other name: euclid\\
\Imeth{line}{cheops ()} & Isosceles $a=2$, $b=c=\varphi$ and height = $\sqrt{\varphi}$ \\
@@ -569,7 +921,7 @@ init_elements ()
}
\begin{tikzpicture}
\tkzGetNodes
- \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H)
+ \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H)
\tkzDrawPoints(A,...,H)
\tkzLabelPoints(A,...,H)
\end{tikzpicture}
@@ -596,7 +948,7 @@ init_elements ()
}
\begin{tikzpicture}
\tkzGetNodes
- \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H)
+ \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H)
\tkzDrawPoints(A,...,H)
\tkzLabelPoints(A,...,H)
\end{tikzpicture}
@@ -891,7 +1243,7 @@ init_elements ()
\subsubsection{Method \Imeth{line}{mediator}} % (fold)
\label{ssub:method_imeth_line_mediator}
-In Mathworld, the mediator is the plane through the midpoint of a line segment and perpendicular to that segment, also called a mediating plane. The term "mediator" was introduced by J. Neuberg (Altshiller-Court 1979, p. 298). Here, I have adopted the French term and the mediator or
+In Mathworld, the mediator is the plane through the midpoint of a line segment and perpendicular to that segment, also called a mediating plane. The term "mediator" was introduced by J. Neuberg (Altshiller-Court 1979, p. 298). Here, I have adopted the French term and the mediator or
the perpendicular bisector of a line segment, is a line segment perpendicular to the segment and passing through the midpoint of this segment.
\begin{minipage}{.5\textwidth}
\begin{Verbatim}
@@ -1166,10 +1518,10 @@ init_elements ()
\begin{Verbatim}
\directlua{%
init_elements ()
- z.A = point : new ( 0 , 0 )
+ z.A = point : new ( 0 , 0 )
z.B = point : new ( 4 , 1 )
- z.E = point : new ( 0 , 2 )
- z.F = point : new ( 3 , 3 )
+ z.E = point : new ( 0 , 2 )
+ z.F = point : new ( 3 , 3 )
z.G = point : new ( 4 , 2 )
L.AB = line : new ( z.A , z.B )
T.EFG = triangle : new (z.E,z.F,z.G)
@@ -1188,10 +1540,10 @@ init_elements ()
\begin{minipage}{.5\textwidth}
\directlua{%
init_elements ()
- z.A = point : new ( 0 , 0 )
+ z.A = point : new ( 0 , 0 )
z.B = point : new ( 4 , 1 )
- z.E = point : new ( 0 , 2 )
- z.F = point : new ( 3 , 3 )
+ z.E = point : new ( 0 , 2 )
+ z.F = point : new ( 3 , 3 )
z.G = point : new ( 4 , 2 )
L.AB = line : new ( z.A , z.B )
T.EFG = triangle : new (z.E,z.F,z.G)
@@ -1256,8 +1608,6 @@ init_elements ()
\tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$}
\end{tikzpicture}
\end{center}
-
-
\end{minipage}
% \caption{Method distance with line object}
@@ -1271,10 +1621,10 @@ init_elements ()
\directlua{%
init_elements ()
z.A = point : new ( 0 , 0 )
- z.B = point : new ( 6 , 0 )
+ z.B = point : new ( 6 , 0 )
L.AB =line: new (z.A,z.B)
C.apo = L.AB : apollonius (2)
- z.O,z.C = get_points ( C.apo )
+ z.O,z.C = get_points ( C.apo )
z.D = C.apo : antipode (z.C)
z.P = C.apo : point (0.30)
}
@@ -1299,10 +1649,10 @@ init_elements ()
\directlua{%
init_elements ()
z.A = point : new ( 0 , 0 )
-z.B = point : new ( 6 , 0 )
+z.B = point : new ( 6 , 0 )
L.AB =line: new (z.A,z.B)
C.apo = L.AB : apollonius (2)
-z.O,z.C = get_points ( C.apo )
+z.O,z.C = get_points ( C.apo )
z.D = C.apo : antipode (z.C)
z.P = C.apo : point (0.30)
}
@@ -1330,6 +1680,488 @@ z.P = C.apo : point (0.30)
Remark: |\tkzUseLua{length(z.P,z.A)/length(z.P,z.B)}| = \tkzUseLua{length(z.P,z.A)/length(z.P,z.B)}
% subsubsection apollonius_circle_ma_mb_k (end)
+\subsubsection{Method \Imeth{line}{c\_l\_pp}} % (fold)
+\label{ssub:c_l_pp}
+Circle tangent to a line passing through two points.
+
+First, consider the general case: a straight line $(AB)$ and two points, $M$ and $N$. We are tasked with finding the circle that is tangent to the line and passes through the two points. We will focus on the straight line $(AB)$ and apply a specific method designed for such cases.
+The method takes into account the following special cases:
+\begin{itemize}
+ \item line $(MN)$ is perpendicular to the line $(AB)$;
+ \item line $(MN)$ is parallel to line $(AB)$;
+ \item these points are on either side of the line $(AB)$;
+ \item one of the points lies on the line $(AB)$.
+\end{itemize}
+
+\vspace{6pt}
+\begin{minipage}{0.4\textwidth}
+\begin{Verbatim}
+ \directlua{
+ init_elements ()
+ scale = .75
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 8 , 0 )
+ z.M = point : new ( 1 , 1 )
+ z.N = point : new ( 2 , 5 )
+ L.AB = line:new(z.A,z.B)
+ C1,C2 = L.AB : c_l_pp (z.M,z.N)
+ z.O1 = C1.center
+ z.O2 = C2.center
+ z.T1 = C1.through
+ z.T2 = C2.through
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B M,N)
+ \tkzDrawCircles(O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,M,N)
+ \tkzLabelPoints(A,B,M,N)
+ \tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+ \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.6\textwidth}
+\directlua{
+init_elements ()
+scale =.75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 6 , 0 )
+z.M = point : new ( 1 , 1 )
+z.N = point : new ( 2 , 5 )
+L.AB = line:new(z.A,z.B)
+C1,C2 = L.AB : c_l_pp(z.M,z.N)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1 O2,T2)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+Let's look at the impossible case: the points are on either side of the line. The method returns \code{nil} and \code{nil}.
+
+\begin{minipage}{0.4\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+scale =.75
+z.A = point :new (0, 0)
+z.B = point :new (6, 0)
+z.M = point :new (1, 1)
+z.N = point :new (3 ,-5)
+L.AB = line:new(z.A,z.B)
+L.MN = line:new(z.M,z.N)
+z.I = intersection(L.AB,L.MN)
+C1,C2 = L.AB : c_l_pp(z.M,z.N)
+if C1 == nil
+ then
+ tex.print('\\message{Error: Argument is nil}')
+ tex.print('Error: Argument is nil')
+else
+ z.C = C1.center
+ z.Cp = C2.center
+ z.T = C1.through
+ z.Tp = C2.through
+end
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.6\textwidth}
+\directlua{
+init_elements ()
+scale =.75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 6 , 0 )
+z.M = point : new ( 1 , 1 )
+z.N = point : new ( 3 , -5 )
+L.AB = line:new(z.A,z.B)
+L.MN = line:new(z.M,z.N)
+z.I = intersection(L.AB,L.MN)
+C1,C2 = L.AB : c_l_pp(z.M,z.N)
+if C1 == nil
+ then
+ tex.print('\\message{Error: Argument is nil}')
+ tex.print('Error: Argument is nil')
+else
+ z.C = C1.center
+ z.Cp = C2.center
+ z.T = C1.through
+ z.Tp = C2.through
+end
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{6pt}
+Let's look at the case where the line $(MN)$ is parallel to the initial line.
+
+
+\begin{minipage}{0.4\textwidth}
+\begin{Verbatim}
+ \directlua{
+ init_elements ()
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 8 , 0 )
+ z.M = point : new ( 0 , 3 )
+ z.N = point : new ( 5 , 3 )
+ L.AB = line:new(z.A,z.B)
+ C1,C2 = L.AB : c_l_pp(z.M,z.N)
+ z.O1 = C1.center
+ z.O2 = C2.center
+ z.T1 = C1.through
+ z.T2 = C2.through
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B M,N)
+ \tkzDrawCircles(O1,T1)
+ \tkzDrawPoints(A,B,M,N)
+ \tkzDrawPoints(A,B,M,N)
+ \tkzLabelPoints(A,B,M,N)
+ \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.4\textwidth}
+\directlua{
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+z.M = point : new ( 0 , 3 )
+z.N = point : new ( 5 , 3 )
+L.AB = line:new(z.A,z.B)
+C1,C2 = L.AB : c_l_pp(z.M,z.N)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1)
+\tkzDrawPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\end{tikzpicture}
+\end{minipage}
+
+
+\vspace{6pt}
+Where the line is perpendicular to the initial line.
+
+\vspace{6pt}
+\begin{minipage}{0.4\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+scale = .75
+z.A = point : new(0, 0 )
+z.B = point : new(6, 0 )
+z.M = point : new(1, 1 )
+z.N = point : new(1, 5 )
+L.AB = line:new(z.A,z.B)
+C1,C2 = L.AB : c_l_pp(z.M,z.N)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.6\textwidth}
+\directlua{
+init_elements ()
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 6 , 0 )
+z.M = point : new ( 1 , 1 )
+z.N = point : new ( 1 , 5 )
+L.AB = line:new(z.A,z.B)
+C1,C2 = L.AB : c_l_pp(z.M,z.N)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1 O2,T2)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+\end{tikzpicture}
+\end{minipage}
+
+The last special case is when one of the points is on the initial line. In this case, there's only one solution.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 5 , 0 )
+z.M = point : new ( 1 , 0 )
+z.N = point : new ( 3 , 5 )
+L.AB = line:new(z.A,z.B)
+L.MN = line:new(z.M,z.N)
+z.I = intersection(L.AB,L.MN)
+C1,C2 = L.AB : c_l_pp(z.M,z.N)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1 O2,T2)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 5 , 0 )
+z.M = point : new ( 1 , 0 )
+z.N = point : new ( 3 , 5 )
+L.AB = line:new(z.A,z.B)
+L.MN = line:new(z.M,z.N)
+z.I = intersection(L.AB,L.MN)
+C1,C2 = L.AB : c_l_pp(z.M,z.N)
+z.O1 = C1.center
+z.O2 = C2.center
+z.T1 = C1.through
+z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B M,N)
+\tkzDrawCircles(O1,T1 O2,T2)
+\tkzDrawPoints(A,B,M,N)
+\tkzLabelPoints(A,B,M,N)
+\tkzDrawPoints(A,B,M,N,O1,T1,O2,T2)
+\end{tikzpicture}
+\end{minipage}
+% subsubsection c_l_pp (end)
+
+\subsubsection{Method \Imeth{line}{c\_ll\_p}} % (fold)
+\label{ssub:method_c__ll__p}
+
+
+
+Let's consider two straight lines $(AB)$ and $(AC)$ and a point $P$ not belonging to these lines.
+Is there a circle through $P$ tangent to these two lines?
+
+The following example shows that there are two solutions using the method linked to the line. A more natural method, linked to the $ABC$ triangle, can also be used.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+ \directlua{
+ init_elements()
+ scale =.75
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 6 , 0 )
+ L.AB = line : new ( z.A,z.B )
+ z.C = point : new ( 6 , 4 )
+ L.AC = line : new ( z.A,z.C )
+ T = triangle : new (z.A,z.B,z.C)
+ z.P = point : new ( 3 , 1 )
+ C1,C2 = L.AB : c_ll_p (z.C,z.P)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+ }
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines[thick](A,B A,C)
+ \tkzDrawCircles[red](O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+ \end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+ scale = .75
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 6 , 0 )
+ L.AB = line : new ( z.A,z.B )
+ z.C = point : new ( 6 , 4 )
+ L.AC = line : new ( z.A,z.C )
+ T = triangle : new (z.A,z.B,z.C)
+ z.P = point : new ( 3 , 1 )
+ C1,C2 = L.AB : c_ll_p (z.C,z.P)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines[thick](A,B A,C)
+ \tkzDrawCircles[red](O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+ \end{tikzpicture}
+\end{center}
+\end{minipage}
+
+\vspace{6pt}
+
+The first special case is where the point $P$ lies on the bisector of $A$.
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale =.75
+ z.A = point : new (0 , 0)
+ z.B = point : new (6 , 0)
+ L.AB = line : new ( z.A,z.B)
+ z.C = point : new ( 6 , 4)
+ L.AC = line : new ( z.A,z.C )
+ T = triangle : new (z.A,z.B,z.C)
+ L.bi = bisector(z.A,z.B,z.C)
+ z.P = L.bi :point (0.4)
+ C1,C2 = L.AB : c_ll_p (z.C,z.P)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B A,C A,P)
+ \tkzDrawCircles(O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+ z.A = point : new (0 , 0)
+ z.B = point : new (6 , 0)
+ L.AB = line : new ( z.A,z.B)
+ z.C = point : new ( 6 , 4)
+ L.AC = line : new ( z.A,z.C )
+ T = triangle : new (z.A,z.B,z.C)
+ L.bi = bisector(z.A,z.B,z.C)
+ z.P = L.bi :point (0.4)
+ C1,C2 = L.AB : c_ll_p (z.C,z.P)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{center}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B A,C A,P)
+ \tkzDrawCircles(O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+\end{tikzpicture}
+\end{center}
+\end{minipage}
+
+
+\vspace{6pt}
+A first special case is when the point $P$ lies on one of the lines
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale =.75
+ z.A = point:new(0, 0)
+ z.B = point:new(6, 0)
+ L.AB = line:new(z.A,z.B)
+ z.C = point:new(6, 4)
+ L.AC = line:new(z.A,z.C)
+ T = triangle:new(z.A,z.B,z.C)
+ z.P = point:new(3, 2)
+ L.bi = bisector(z.A,z.B,z.C)
+ z.I = L.bi:point(0.4)
+ C1,C2 = L.AB : c_ll_p (z.C,z.P)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawLines(A,B A,C A,I)
+ \tkzDrawCircles(O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P,I)
+ \tkzLabelPoints(A,B,C,P,I)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 6 , 0 )
+ L.AB = line : new ( z.A,z.B )
+ z.C = point : new ( 6 , 4 )
+ L.AC = line : new ( z.A,z.C )
+ T = triangle : new (z.A,z.B,z.C)
+ z.P = point : new ( 3 , 2 )
+ L.bi = bisector(z.A,z.B,z.C)
+ z.I = L.bi.pb
+ C1,C2 = L.AB : c_ll_p (z.C,z.P)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines(A,B A,C A,I)
+ \tkzDrawCircles(O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P,I)
+ \tkzLabelPoints(A,B,C,P,I)
+ \end{tikzpicture}
+\end{center}
+\end{minipage}
+
+%subsubsection method_c__ll__p (end)
+
% subsection methods_from_class_line (end)
% section class_line (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
index 0266a2feb5..ac2641f52c 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex
@@ -21,9 +21,9 @@
\Igfct{math}{islinear (z1,z2,z3) } & Are the points aligned? (z2-z1) $\parallel$ (z3-z1) ? \\
\Igfct{math}{isortho (z1,z2,z3)} & (z2-z1) $\perp$ (z3-z1) ? boolean\\
\Igfct{math}{get\_angle (z1,z2,z3)} & the vertex is z1 [\ref{sub:get_angle}] \\
-\Igfct{math}{bisector (z1,z2,z3)} & L.Aa = bisector (z.A,z.B,z.C) from A [\ref{sub:get_angle}] \\
-\Igfct{math}{bisector\_ext (z1,z2,z3)} & L.Aa = bisector_ext (z.A,z.B,z.C) from A \\
-\Igfct{math}{altitude (z1,z2,z3)} & altitude from z1 \\
+\Igfct{misc}{bisector (z1,z2,z3)} & L.Aa = bisector (z.A,z.B,z.C) from A [\ref{sub:get_angle}] \\
+\Igfct{misc}{bisector\_ext (z1,z2,z3)} & L.Aa = bisector_ext (z.A,z.B,z.C) from A \\
+\Igfct{misc}{altitude (z1,z2,z3)} & altitude from z1 \\
\Igfct{package}{set\_lua\_to\_tex (list)} & set\_lua\_to\_tex('a','n') defines |\a| and |\n| \\
%parabola (a,b,c) & to get \\
\Igfct{math}{value (v) } & apply |scale * value | \\
@@ -31,6 +31,8 @@
\Igfct{math}{angle\_normalize (an) } & to get a value between 0 and $2\pi$ \\
\Igfct{misc}{barycenter (\{z1,n1\},\{z2,n2\}, ...)} & barycenter of list of points \\
\Igfct{math}{solve\_quadratic (a,b,c) } & gives the solution of $ax^2+bx+c =0$ a,b,c real or complex [\ref{ssub:function_solve__quadratic}] \\
+\Igfct{misc}{midpoint (z1,z2)} & midpoint of the segment [\ref{ssub:euler_ellipse}] \\
+\Igfct{misc}{midpoints (z1,z2,...,zn)} & midpoints of z1z2, z2z3 etc. z1zn [\ref{sub:varignon_s_theorem}]\\
\bottomrule
\end{tabular}
\egroup
@@ -38,9 +40,33 @@
\subsection{Length of a segment} % (fold)
\label{sub:length_of_a_segment}
|length(z.A,z.B)| is a shortcut for |point.abs(z.A-z.B)|. This avoids the need to use complexes.
+It's also a shortcut for L.AB = line:new(z.A,z.B) and l = L.AB.length. Depending on the context, you'll need to choose the most appropriate method.
% subsection length_of_a_segment (end)
+\subsection{Midpoint and midpoints} % (fold)
+\label{sub:midpoint_and_midpoints}
+As with length, a shortcut is available, e.g. |z.M = midpoint(z.A,z.B)|. If a straight line is required, then use: |z.M = L.AB.mid|.
+
+The aim here is to determine the midpoints of a polygon. For example, considering a triangle $abc$, we can obtain the middles of the sides, after defining the triangle |T.abc = triangle:new(z.a,z.b,z.c)|, the middles are the vertices of the medial triangle |z.ma,z.mb,z.mc = T.abc : medial()|.
+
+\code{midpoints} is a shortcut for defining midpoints without using triangles:
+
+ |z.mc,z.ma,z.mb = midpoints(z.a,z.b,z.c)|.
+
+ The medial triangle can be omitted with |z.mc,z.ma,z.mb = midpoints(get_points(T.abc))|.
+% subsection midpoint_and_midpoints (end)
+
+\subsection{Bisector} % (fold)
+\label{sub:bisector}
+As shown in the previous table, |bisector (z1,z2,z3)| defines the bisector of vertex |z1|.
+% subsection bisector (end)
+
+\subsection{Barycenter} % (fold)
+\label{sub:misc_barycenter}
+
+Explanations are given here: \ref{sub:barycenter}
+% subsection barycenter (end)
\subsection{Harmonic division with tkzphi } % (fold)
\label{sub:harmonic_division_with_tkzphi}
@@ -80,7 +106,7 @@ init_elements ()
\hspace*{\fill}
% subsection harmonic_division_with_tkzphi (end)
-\subsection{Function islinear} % (fold)
+\subsection{Function islinear or is\_linear} % (fold)
\label{sub:function_islinear}
\begin{minipage}{0.5\textwidth}
\begin{Verbatim}
@@ -210,14 +236,9 @@ init_elements ()
tex.print('slope normalized of (ac) : '..tostring(angle\_normalize(angle))..'\\\\')
angle = point.arg (z.d-z.a)
tex.print('slope of (ad) : '..tostring(angle)..'\\\\')
- tex.print('slope normalized of (acd) : '..tostring(angle\_normalize(angle))..'\\\\')
+ tex.print('slope normalized of (ad) : '..tostring(angle\_normalize(angle))..'\\\\')
}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawLines[red](a,b a,c a,d)
- \tkzDrawPoints(a,b,c,d)
- \tkzLabelPoints(a,b,c,d)
-\end{tikzpicture}
+
\end{Verbatim}
\directlua{%
init_elements ()
@@ -237,14 +258,30 @@ tex.print('slope of (ad) : '..tostring(angle)..'\\\\')
tex.print('slope normalized of (ad) : '..tostring(angle_normalize(angle))..'\\\\')
}
- \hspace*{\fill}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawLines[red](a,b a,c a,d)
- \tkzDrawPoints(a,b,c,d)
- \tkzLabelPoints(a,b,c,d)
-\end{tikzpicture}
- \hspace*{\fill}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines[red](a,b a,c a,d)
+ \tkzDrawPoints(a,b,c,d)
+ \tkzLabelPoints(a,b,c,d)
+ \end{tikzpicture}
+\end{Verbatim}
+
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawLines[red](a,b a,c a,d)
+ \tkzDrawPoints(a,b,c,d)
+ \tkzLabelPoints(a,b,c,d)
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
+
+
+
% subsection normalized_angles (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
index d6a1187ff3..3ff936a8a8 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-parallelogram.tex
@@ -105,7 +105,7 @@ z.I = P.new.center
\end{tabular}
\egroup
-\subsubsection{parallelogram with fourth method} % (fold)
+\subsubsection{Parallelogram with fourth method} % (fold)
\label{ssub:parallelogram_with_fourth_method}
% subsubsection parallelogram_with_fourth_method (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
index 7dba1b8022..5dcea5febc 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
@@ -3,7 +3,7 @@
\section{Class \Iclass{point}} % (fold)
\label{sec:class_point}
-The foundation of the entire framework is the \Iclass{point} class. This class is hybrid in the sense that it deals with both points in a plane and complex numbers. The principle is as follows: the plane is equipped with an orthonormal basis, which allows us to determine the position of a point using its abscissa and ordinate coordinate. Similarly, any complex number can be viewed simply as a pair of real numbers (its real part and its imaginary part). We can then designate the plane as the complex plane, and the complex number $x+iy$ is represented by the point of the plane with coordinates $(x,y)$. Thus the point $A$ will have coordinates stored in the object $z.A$. Coordinates are attributes of the "point" object, along with type, argument, and modulus.
+The foundation of the entire framework is the \Iclass{point} class. This class is hybrid in the sense that it deals with both points in a plane and complex numbers. The principle is as follows: the plane is equipped with an orthonormal basis, which allows us to determine the position of a point using its abscissa and ordinate coordinate. Similarly, any complex number can be viewed simply as a pair of real numbers (its real part and its imaginary part). We can then designate the plane as the complex plane, and the complex number $x+iy$ is represented by the point of the plane with coordinates $(x,y)$. Thus the point $A$ will have coordinates stored in the object $z.A$. Coordinates are attributes of the \code{point} object, along with type, argument, and modulus.
@@ -19,13 +19,14 @@ The creation of a point is done using the following method, but there are other
\tikz\node[minimum width=\size,font=\small,
draw, fill=cyan!10,
- rectangle split, rectangle split parts=5
+ rectangle split, rectangle split parts=6
] {
\texttt{re (real)}
\nodepart{two}\texttt{im (real)}
\nodepart{three}\texttt{type = 'point'}
\nodepart{four}\texttt{argument (rad)}
\nodepart{five}\texttt{modulus (cm)}
+ \nodepart{six}\texttt{mtx (matrix)}
};
\hspace{\fill} \texttt{Methods}\hspace{\fill}
@@ -51,13 +52,14 @@ The creation of a point is done using the following method, but there are other
\tikz\node[minimum width=\size,font=\small,
draw, fill=cyan!10,
- rectangle split, rectangle split parts=5
+ rectangle split, rectangle split parts=6
] {
\texttt{re = 1}
\nodepart{two}\texttt{im = 2}
\nodepart{three}\texttt{type = 'point'}
\nodepart{four}\texttt{argument = atan(2)}
\nodepart{five}\texttt{modulus = $\sqrt{5}$}
+ \nodepart{six}\texttt{mtx = \{\{1\},\{2\}\}}
};
\hspace{\fill} \texttt{Methods}\hspace{\fill}
@@ -106,6 +108,7 @@ This is the creation of a fixed point with coordinates 1 and 2 and which is name
\Iattr{point}{type} & |z.A.type = 'point'| & \\
\Iattr{point}{argument} & |z.A.argument| $\approx$ |0.78539816339745| & [\ref{ssub:example_point_attributes}] \\
\Iattr{point}{modulus} & |z.A.modulus| $\approx$ |2.2360...| =$\sqrt{5}$ & [\ref{ssub:example_point_attributes}] \\
+ \Iattr{point}{mtx} & |z.A.mtx = = {{1},{2}}| & [\ref{ssub:example_point_attributes}] \\
\bottomrule
\end{tabular}
\egroup
@@ -181,9 +184,9 @@ Attributes of \texttt{z.M}
\item \texttt{z.M.type} = 'point'
\item \texttt{z.M.argument} = $\theta \approx \pmpn{\tkzUseLua{z.M.argument}}$ rad
\item \texttt{z.M.modulus} = $|z_M| =\sqrt{5}\approx \pmpn{\tkzUseLua{z.M.modulus}}$ cm
+ \item \texttt{z.M.mtx} = \tkzUseLua{z.M.mtx : print ()}
\end{itemize}
\end{mybox}
-
};
\end{scope}
\end{tikzpicture}
@@ -191,10 +194,33 @@ Attributes of \texttt{z.M}
\MakeShortVerb{\|}
-% \caption{Class Point}
+\subsubsection{Attribute \Iattr{point}{mtx}} % (fold)
+\label{ssub:attribute_iattr_point_mtx}
+
+This method allows the point to be used in conjunction with matrices.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+ \directlua{
+ z.A = point : new (2,-1)
+ z.A.mtx : print ()
+ }
+\end{Verbatim}
+\end{minipage}
+ \begin{minipage}{.5\textwidth}
+ \begin{center}
+ \directlua{
+ z.A = point : new (2,-1)
+ z.A.mtx : print ()
+ }
+ \end{center}
+ \end{minipage}
+% subsubsection attribute_iattr_point_mtx (end)
% subsubsection example_point_attributes (end)
% subsection attributes_of_a_point (end)
+
\subsubsection{Argand diagram} % (fold)
\label{ssub:argand_diagram}
\normalsize
@@ -445,7 +471,7 @@ init_elements ()
\subsubsection{Method \Imeth{point}{orthogonal (d)}} % (fold)
\label{ssub:orthogonal_method}
-Let $O$ be the origin of the plane. The "orthogonal (d)" method is used to obtain a point $B$ from a point $A$ such that $\overrightarrow{OB}\perp \overrightarrow{OA}$ with $OB=OA$ if $d$ is empty, otherwise $OB = d$.
+Let $O$ be the origin of the plane. The \code{orthogonal (d)} method is used to obtain a point $B$ from a point $A$ such that $\overrightarrow{OB}\perp \overrightarrow{OA}$ with $OB=OA$ if $d$ is empty, otherwise $OB = d$.
\begin{minipage}{.6\textwidth}
\begin{Verbatim}
@@ -588,22 +614,24 @@ Rotate a triangle by an angle of $\pi/6$ around $O$.
\directlua{%
init_elements ()
scale = .75
- z.O = point : new ( -1 , -1 )
- z.A = point : new ( 2 , 0 )
- z.B = point : new ( 5 , 0 )
- L.AB = line : new (z.A,z.B)
- T.ABC = L.AB : equilateral ()
- S.fig = L.AB : square ()
- _,_,z.E,z.F = get_points ( S.fig )
- S.new = z.O : rotation (math.pi/3,S.fig)
- _,_,z.Ep,z.Fp = get_points ( S.new )
+ z.O = point: new(-1, -1)
+ z.A = point: new(2, 0)
+ z.B = point: new(5, 0)
+ L.AB = line: new(z.Az.B)
+ T.ABC = L.AB: equilateral()
+ S.fig = L.AB: square ()
+ _,_,
+ z.E,z.F = get_points(S.fig)
+ S.new = z.O : rotation(math.pi/3,S.fig)
+ _,_,z.Ep,z.Fp = get_points( S.new )
z.C = T.ABC.pc
- T.ApBpCp = z.O : rotation (math.pi/3,T.ABC)
+ T.ApBpCp = z.O : rotation(math.pi/3,T.ABC)
z.Ap,z.Bp,z.Cp = get_points ( T.ApBpCp)
}
\begin{tikzpicture}
\tkzGetNodes
- \tkzDrawPolygons(A,B,C A',B',C' A,B,E,F A',B',E',F')
+ \tkzDrawPolygons(A,B,C A',B',C'%
+ A,B,E,F A',B',E',F')
\tkzDrawPoints (A,B,C,A',B',C',O)
\tkzLabelPoints (A,B,C,A',B',C',O)
\tkzDrawArc[delta=0,->](O,A)(A')
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
index 55484fa41a..ec9765ea6d 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-quadrilateral.tex
@@ -161,4 +161,5 @@ end
\end{minipage}
% subsubsection inscribed_quadrilateral (end)
+
% subsection quadrilateral_methods (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
index b4034f9245..51cf6fff5d 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-regular.tex
@@ -1,7 +1,7 @@
\newpage
\section{Class \Iclass{regular polygon}} % (fold)
-\subsection{regular\_polygon attributes} % (fold)
+\subsection{Regular\_polygon attributes} % (fold)
\label{sub:regular_polygon_attributes}
\begin{mybox}
@@ -21,7 +21,7 @@ Creation | RP.IA = regular_polygon : new (z.I,z.A,6)|
\Iattr{regular}{circle} & defines the circle with center I passing through A \\
\Iattr{regular}{type} & |RP.IA.type= 'regular\_polygon'| \\
\Iattr{regular}{side} & |s = RP.IA.side| ; s = length of side\\
-\Iattr{regular}{exradius}& |S.AB.exradius| ; radius of the circumscribed circle \\
+\Iattr{regular}{circumradius}& |S.AB.circumradius| ; radius of the circumscribed circle \\
\Iattr{regular}{inradius}& |S.AB.inxradius| ; radius of the inscribed circle \\
\Iattr{regular}{proj} & |RP.IA.proj| ; projection of the center on one side \\
\Iattr{regular}{angle} & |RP.IA.angle| ; angle formed by the center and 2 consecutive vertices \\
@@ -80,7 +80,7 @@ scale = .75
% subsubsection pentagon (end)
% subsection regular_polygon_attributes (end)
-\subsection{regular\_polygon methods} % (fold)
+\subsection{Regular\_polygon methods} % (fold)
\label{sub:regular_polygon_methods}
\bgroup
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
index 1a5b69bba5..edfdaca474 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
@@ -24,7 +24,7 @@ Creation | S.AB = square : new (z.A,z.B,z.C,z.D)|
\Iattr{square}{type} & |S.AB.type= 'square'| & \\
\Iattr{square}{side} & |s = S.AB.center| & s = length of side \\
\Iattr{square}{center} & |z.I = S.AB.center| & center of the square \\
-\Iattr{square}{exradius} & |S.AB.exradius| & radius of the circumscribed circle \\
+\Iattr{square}{circumradius} & |S.AB.circumradius| & radius of the circumscribed circle \\
\Iattr{square}{inradius} & |S.AB.inxradius| & radius of the inscribed circle \\
\Iattr{square}{proj} & |S.AB.proj| & projection of the center on one side \\
\Iattr{square}{ab} & |S.AB.ab| & line passing through two vertices \\
@@ -59,7 +59,7 @@ z.H = S.new.proj
\tkzLabelPoints(A,B,H,I)
\tkzLabelPoints[above](C,D)
\tkzDrawSegments(I,B I,H)
-\tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.exradius}}}
+\tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.circumradius}}}
\tkzLabelSegment[sloped](I,H){\pmpn{\tkzUseLua{S.new.inradius}}}
\tkzLabelSegment[sloped](D,C){\pmpn{\tkzUseLua{S.new.side}}}
\end{tikzpicture}
@@ -85,7 +85,7 @@ init_elements ()
\tkzLabelPoints(A,B,H,I)
\tkzLabelPoints[above](C,D)
\tkzDrawSegments(I,B I,H)
- \tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.exradius}}}
+ \tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.circumradius}}}
\tkzLabelSegment[sloped](I,H){\pmpn{\tkzUseLua{S.new.inradius}}}
\tkzLabelSegment[sloped](D,C){\pmpn{\tkzUseLua{S.new.side}}}
\end{tikzpicture}
@@ -162,6 +162,7 @@ z.I = S.side.center
\end{tikzpicture}
\end{minipage}
% subsubsection square_with_side_method (end)
+
% subsubsection example_square_attributes (end)
% subsection square_methods (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
index af4dac7c7b..1ca2f6e069 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex
@@ -37,6 +37,10 @@ The triangle object is created using the \Imeth{triangle}{new} method, for examp
\Iattr{triangle}{ab}& Line defined by the first two points of the triangle\\
\Iattr{triangle}{bc}& Line defined by the last two points \\
\Iattr{triangle}{ca}& Line defined by the last and the first points of the triangle\\
+\Iattr{triangle}{semiperimeter}& semiperimeter of the triangle \\
+\Iattr{triangle}{area}& area of the triangle \\
+\Iattr{triangle}{inradius}& radius of the incircle\\
+\Iattr{triangle}{circumradius}& radius of the circumcircle \\
\bottomrule %
\end{tabular}
\egroup
@@ -170,6 +174,17 @@ init_elements ()
\midrule
\Imeth{triangle}{new} (a, b ,c) & |T.ABC = triangle : new (z.A,z.B,z.C)|& [\ref{sub:triangle_attributes_angles}] \footnote{|T| or |T.name| with what you want for name, is possible.} \\
\midrule
+\textbf{Booleans}&&\\
+\midrule
+\Imeth{triangle}{in\_out (pt)} & Boolean. Test if |pt| is inside the triangle\\
+\Imeth{triangle}{check\_equilateral ()} & Boolean. Test if the triangle is equilateral\\
+\Imeth{triangle}{check\_acutangle ()} & Boolean. Test if the triangle is acutangle\\
+\midrule
+ \textbf{Reals} &&\\
+ \midrule
+ \Imeth{triangle}{area ()} & $ \mathcal{A}$| = T.ABC: area ()| better T.ABC.area\\
+ \Imeth{triangle}{barycentric\_coordinates(pt)} & Triples of numbers corresponding to masses placed at the vertices\\
+ \midrule
\textbf{Points} &&\\
\midrule
\Imeth{triangle}{lemoine\_point ()} & |T.ABC : lemoine_point ()| intersection of the symmedians & [\ref{ssub:method_imeth_line_isosceles}]\\
@@ -203,6 +218,7 @@ init_elements ()
\Imeth{triangle}{nine\_points () } & 9 Points of the euler circle & [\ref{ssub:method_imeth_triangle_nine__points}] \\
\Imeth{triangle}{parallelogram ()} & |z.D = T.ABC : parallelogram ()| \tkzar ABCD parallelogram& [\ref{sub:director_circle}]\\
+
\midrule
\textbf{Lines} &&\\
\midrule
@@ -220,6 +236,7 @@ init_elements ()
\Imeth{triangle}{antiparallel(pt,n)} & n=0 antiparallel through pt to $(BC)$, n=1 to $(AC)$ etc.& [\ref{sub:antiparallel_through_lemoine_point}]\\
\midrule
+
\textbf{Circles} &&\\
\midrule
\Imeth{triangle}{euler\_circle ()} & C.|NP = T.ABC : euler_circle ()| \tkzar $N$ euler point
@@ -248,6 +265,8 @@ init_elements ()
\Imeth{triangle}{pedal\_circle ()} & Circumscribed circle of the podar triangle & [\ref{ssub:method_imeth_triangle_pedal}]\\
\Imeth{triangle}{conway\_circle ()} & Circumscribed circle of Conway points & [\ref{ssub:method_imeth_triangle_conway}]\\
+
+\Imeth{triangle}{c\_ll\_p (pt)} & circle tgt to two side through pt [\ref{ssub:tr_method_c__ll__p}]\\
\bottomrule
\end{tabular}
\end{minipage}
@@ -304,13 +323,6 @@ init_elements ()
\Imeth{triangle}{steiner\_circumellipse ()} & [ex. \ref{ssub:steiner_inellipse_and_circumellipse}] \\
\Imeth{triangle}{euler\_ellipse ()} & [ex. (\ref{ssub:euler_ellipse}]\\
- \midrule
- \textbf{Miscellaneous} &\\
-\midrule
-\Imeth{triangle}{area ()} & $ \mathcal{A}$| = T.ABC: area ()|\\
-\Imeth{triangle}{barycentric\_coordinates(pt)}& Triples of numbers corresponding to masses placed at the vertices\\
-\Imeth{triangle}{in\_out (pt)} & Boolean. Test if |pt| is inside the triangle\\
-\Imeth{triangle}{check\_equilateral ()} & Boolean. Test if the triangle is equilateral\\
\bottomrule
\end{tabular}
\end{center}
@@ -2484,8 +2496,67 @@ init_elements ()
\end{Verbatim}
% subsubsection harmonic_division_and_bisector (end)
+\subsubsection{Method \Imeth{triangle}{c\_ll\_p}} % (fold)
+\label{ssub:tr_method_c__ll__p}
+
+See [\ref{ssub:method_c__ll__p}] for special cases. Please note that the arguments are not the same as for the \code{line} class.
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+ \begin{Verbatim}
+\directlua{
+init_elements()
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 8 , 0 )
+ L.AB = line : new ( z.A,z.B )
+ z.C = point : new ( 6 , 4 )
+ L.AC = line : new ( z.A,z.C )
+ T = triangle : new (z.A,z.B,z.C)
+ z.P = point : new ( 3 , 1 )
+ C1,C2 = T : c_ll_p (z.P)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+\begin{tikzpicture}
+\tkzGetNodes
+ \tkzDrawLines[thick](A,B A,C B,C)
+ \tkzDrawCircles[red](O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+\end{tikzpicture}
+ \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+init_elements()
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 8 , 0 )
+ L.AB = line : new ( z.A,z.B )
+ z.C = point : new ( 6 , 4 )
+ L.AC = line : new ( z.A,z.C )
+ T = triangle : new (z.A,z.B,z.C)
+ z.P = point : new ( 3 , 1 )
+ C1,C2 = T : c_ll_p (z.P)
+ z.O1 = C1.center
+ z.T1 = C1.through
+ z.O2 = C2.center
+ z.T2 = C2.through
+}
+ \begin{center}
+\begin{tikzpicture}
+\tkzGetNodes
+ \tkzDrawLines[thick](A,B A,C B,C)
+ \tkzDrawCircles[red](O1,T1 O2,T2)
+ \tkzDrawPoints(A,B,C,P)
+ \tkzLabelPoints(A,B,C,P)
+\end{tikzpicture}
+ \end{center}
+
+\end{minipage}
-%
+% subsubsection method_c__ll__p (end)
% % subsection methods_of_the_class_triangle (end)
% % section class_triangle (end)
\endinput
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex
index 49afe50798..bc7b8f223f 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex
@@ -39,7 +39,7 @@ At present, the only obligation is to store the points in the table |z| \footno
As for the conventions for designating |name| you must adhere to Lua conventions in particular cases.
\begin{enumerate}
- \item The use of prime can be problematic. If the point name contains more than one symbol and ends with |p| then when passing into \pkg{TikZ} or \pkg{tkz-euclide}, the letters |p| will be replaced by |'| using the macro \tkzcname{tkzGetNodes}; \index{prime}
+ \item The use of prime can be problematic. If the point name contains more than one symbol and ends with |p| then when passing into \pkg{tkz-euclide}, the letters |p| will be replaced by |'| using the macro \tkzcname{tkzGetNodes}; \index{prime}
\item Alternatively, for a more explicit code, suppose you want to designate a point as "euler". You could, for example, write |euler = ...|, and at the end of the code for the transfer, |z.E = euler|. It is also possible to use a temporary name |euler| and to replace it in \TIKZ{}. Either at the time of placing the labels, or for example by using |pgfnodealias{E}{euler}|. This possibility also applies in other cases: prime, double prime, etc.
\end{enumerate}
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
index bb5d40e372..4672d6982e 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex
@@ -1320,6 +1320,7 @@ z.K = L.K.pb
\subsection{Gold division} % (fold)
\label{sub:gold_division}
+\begin{minipage}{.5\textwidth}
\begin{Verbatim}
\directlua{%
init_elements ()
@@ -1339,50 +1340,54 @@ L.EG = line:new (z.E,z.G)
z.C = intersection (L.EG,L.AB)
z.O = C.AB: antipode (z.B)
}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawArc[delta=5](O,B)(G)
- \tkzDrawCircles(A,B B,A)
- \tkzDrawSegments(A,E B,E O,I)
- \tkzDrawSegments[purple](J,E A,G G,I K,G E,G)
- \tkzMarkSegments[mark=s||](A,E B,E O,A)
- \tkzDrawPoints(A,B,C,E,I,J,G,O,K)
- \tkzLabelPoints(A,B,C,E,I,J,G,O,K)
- \end{tikzpicture}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawArc[delta=5](O,B)(G)
+\tkzDrawCircles(A,B B,A)
+\tkzDrawSegments(A,E B,E O,I)
+\tkzDrawSegments[purple](J,E A,G G,I K,G E,G)
+\tkzMarkSegments[mark=s||](A,E B,E O,A)
+\tkzDrawPoints(A,B,C,E,I,J,G,O,K)
+\tkzLabelPoints(A,B,C,E,I,J,G,O,K)
+\end{tikzpicture}
\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{%
+ init_elements ()
+ scale = .75
+ z.A = point: new (0,0)
+ z.B = point: new (2.5,0)
+ L.AB = line: new (z.A,z.B)
+ C.AB = circle: new (z.A,z.B)
+ C.BA = circle: new (z.B,z.A)
+ z.J = L.AB: midpoint ()
+ L.JB = line:new (z.J,z.B)
+ z.F,z.E = intersection (C.AB , C.BA)
+ z.I,_ = intersection (L.AB , C.BA)
+ z.K = L.JB : midpoint ()
+ L.mediator = L.JB: mediator ()
+ z.G = intersection (L.mediator,C.BA)
+ L.EG = line:new (z.E,z.G)
+ z.C = intersection (L.EG,L.AB)
+ z.O = C.AB: antipode (z.B)
+ }
-\directlua{%
-init_elements ()
-z.A = point: new (0,0)
-z.B = point: new (2.5,0)
-L.AB = line: new (z.A,z.B)
-C.AB = circle: new (z.A,z.B)
-C.BA = circle: new (z.B,z.A)
-z.J = L.AB: midpoint ()
-L.JB = line:new (z.J,z.B)
-z.F,z.E = intersection (C.AB , C.BA)
-z.I,_ = intersection (L.AB , C.BA)
-z.K = L.JB : midpoint ()
-L.mediator = L.JB: mediator ()
-z.G = intersection (L.mediator,C.BA)
-L.EG = line:new (z.E,z.G)
-z.C = intersection (L.EG,L.AB)
-z.O = C.AB: antipode (z.B)
-}
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawArc[delta=5](O,B)(G)
+ \tkzDrawCircles(A,B B,A)
+ \tkzDrawSegments(A,E B,E O,I)
+ \tkzDrawSegments[purple](J,E A,G G,I K,G E,G)
+ \tkzMarkSegments[mark=s||](A,E B,E O,A)
+ \tkzDrawPoints(A,B,C,E,I,J,G,O,K)
+ \tkzLabelPoints(A,B,C,E,I,J,G,O,K)
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
-\begin{center}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawArc[delta=5](O,B)(G)
- \tkzDrawCircles(A,B B,A)
- \tkzDrawSegments(A,E B,E O,I)
- \tkzDrawSegments[purple](J,E A,G G,I K,G E,G)
- \tkzMarkSegments[mark=s||](A,E B,E O,A)
- \tkzDrawPoints(A,B,C,E,I,J,G,O,K)
- \tkzLabelPoints(A,B,C,E,I,J,G,O,K)
- \end{tikzpicture}
-\end{center}
% subsection gold_division (end)
@@ -1562,7 +1567,7 @@ z.G = L.tb.pb
\subsection{Euler relation} % (fold)
\label{sub:euler_relation}
-\begin{minipage}{.5\textwidth}
+
\begin{Verbatim}
\directlua{%
init_elements ()
@@ -1593,8 +1598,7 @@ init_elements ()
\tkzMarkRightAngles[fill=gray!20,opacity=.4](C,H,I A,K,J)
\end{tikzpicture}
\end{Verbatim}
-\end{minipage}
-\begin{minipage}{.5\textwidth}
+
\directlua{%
init_elements ()
z.A = point: new (0 , 0)
@@ -1626,8 +1630,6 @@ _,z.E = intersection (L.Ow, C.OA)
\end{tikzpicture}
\end{center}
-
-\end{minipage}
% subsection euler_relation (end)
\subsection{External angle} % (fold)
@@ -1636,7 +1638,7 @@ _,z.E = intersection (L.Ow, C.OA)
\begin{Verbatim}
\directlua{%
init_elements ()
- scale = .75
+ scale = .5
z.A = point: new (0 , 0)
z.B = point: new (5 , 0)
z.C = point: new (-2 , 4)
@@ -1689,8 +1691,6 @@ z.E = z.C: symmetry (z.B)
\tkzLabelPoints(A,B,D)
\end{tikzpicture}
\end{center}
-
-
\end{minipage}
% subsection external_angle (end)
@@ -1762,35 +1762,36 @@ z.E = intersection (L.LL,L.AD)
\subsection{Feuerbach theorem} % (fold)
\label{sub:nine_points}
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+
+
\begin{Verbatim}
\directlua{%
init_elements ()
- scale = 1.5
- z.A = point: new (0 , 0)
- z.B = point: new (5 , -.5)
- z.C = point: new (-.5 , 3)
- T.ABC = triangle: new (z.A,z.B,z.C)
- z.O = T.ABC.circumcenter
- z.N = T.ABC.eulercenter
- z.I,z.K = get_points(T.ABC: in_circle())
- z.H = T.ABC.ab : projection (z.I)
- z.Ap,
- z.Bp,
- z.Cp = get_points (T.ABC : medial ())
- C.IH = circle:new (z.I,z.H)
- C.NAp = circle:new (z.N,z.Ap)
- C.OA = circle:new (z.O,z.A)
- z.U = C.OA.south
- z.L = C.NAp.south
- z.M = C.NAp.north
- z.X = T.ABC.ab: projection (z.C)
- L.CU = line: new (z.C,z.U)
- L.ML = line: new (z.M,z.L)
- z.P = L.CU: projection (z.A)
- z.Q = L.CU: projection (z.B)
- L.LH = line: new (z.L,z.H)
- z.F = intersection (L.LH,C.IH) % feuerbach
+scale = .75
+ z.A = point: new (0 , 0)
+ z.B = point: new (5 , -.5)
+ z.C = point: new (-.5 , 3)
+ T.ABC = triangle: new (z.A,z.B,z.C)
+ z.O = T.ABC.circumcenter
+ z.N = T.ABC.eulercenter
+ z.I,z.K = get_points(T.ABC: in_circle())
+ z.H = T.ABC.ab : projection (z.I)
+ z.Ap,
+ z.Bp,
+ z.Cp = get_points (T.ABC : medial ())
+ C.IH = circle:new (z.I,z.H)
+ C.NAp = circle:new (z.N,z.Ap)
+ C.OA = circle:new (z.O,z.A)
+ z.U = C.OA.south
+ z.L = C.NAp.south
+ z.M = C.NAp.north
+ z.X = T.ABC.ab: projection (z.C)
+ L.CU = line: new (z.C,z.U)
+ L.ML = line: new (z.M,z.L)
+ z.P = L.CU: projection (z.A)
+ z.Q = L.CU: projection (z.B)
+ L.LH = line: new (z.L,z.H)
+ z.F = intersection (L.LH,C.IH) % feuerbach
}
\begin{tikzpicture}
@@ -1805,11 +1806,10 @@ init_elements ()
\tkzLabelPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I)
\end{tikzpicture}
\end{Verbatim}
-\end{minipage}
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+
\directlua{%
init_elements ()
-scale = 1
+scale =1.25
z.A = point: new (0 , 0)
z.B = point: new (5 , -.5)
z.C = point: new (-.5 , 3)
@@ -1848,7 +1848,7 @@ z.F = intersection (L.LH,C.IH) % feuerbach
\end{tikzpicture}
\end{center}
-\end{minipage}
+
% subsection nine_points (end)
\subsection{Gold ratio with segment} % (fold)
@@ -2529,11 +2529,11 @@ init_elements ()
z.Jc,z.Xc = get_points (C.exC)
L.OL = line: new (z.O,z.L)
L.NS = line: new (z.N,z.S)
- z.o = intersection (L.OL,L.NS) -- center of Apollonius circle
+ z.o = intersection (L.OL,L.NS) % center of Apollonius circle
L.NMa = line: new (z.N,z.Ma)
L.ox = L.NMa: ll_from (z.o)
L.MaS = line: new (z.Ma,z.S)
- z.t = intersection (L.ox,L.MaS) -- through
+ z.t = intersection (L.ox,L.MaS) % through
}
\begin{tikzpicture}
@@ -2571,18 +2571,18 @@ C.exC = T.ABC : ex_circle (2)
z.Jc,z.Xc = get_points (C.exC)
L.OL = line: new (z.O,z.L)
L.NS = line: new (z.N,z.S)
-z.o = intersection (L.OL,L.NS) -- center of Apollonius circle
+z.o = intersection (L.OL,L.NS) % center of Apollonius circle
L.NMa = line: new (z.N,z.Ma)
L.ox = L.NMa: ll_from (z.o)
L.MaS = line: new (z.Ma,z.S)
-z.t = intersection (L.ox,L.MaS) -- through
+z.t = intersection (L.ox,L.MaS) % through
}
\begin{center}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawLines[add=1 and 1](A,B A,C B,C)
- \tkzDrawCircles(Ja,Xa Jb,Xb Jc,Xc o,t N,Ma) %
+ \tkzDrawCircles(Ja,Xa Jb,Xb Jc,Xc o,t N,Ma)
\tkzClipCircle(o,t)
\tkzDrawLines[red](o,L N,o Ma,t)
\tkzDrawLines[cyan,add=4 and 4](Ma,N o,t)
@@ -2598,78 +2598,82 @@ z.t = intersection (L.ox,L.MaS) -- through
\subsection{Orthogonal circles} % (fold)
\label{sub:orthogonal_circles_v2}
-\begin{Verbatim}
-\directlua{%
-init_elements ()
-scale = .75
-z.O = point: new (2,2)
-z.Op = point: new (-4,1)
-z.P = point: polar (4,0)
-C.OP = circle: new (z.O,z.P)
-C.Oz1 = C.OP : orthogonal_from (z.Op)
-z.z1 = C.Oz1.through
-L.OP = line : new (z.O,z.P)
-C.Opz1 = circle: new (z.Op,z.z1)
-L.T,L.Tp = C.Opz1 : tangent_from (z.O)
-z.T = L.T.pb
-z.Tp = L.Tp.pb
-L.OOp = line : new (z.O,z.Op)
-z.M = L.OOp.mid
-}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircle[red](O,P)
- \tkzDrawCircle[purple](O',z1)
- \tkzDrawCircle[cyan](M,T)
- \tkzDrawSegments(O',T O,T' O',T')
- \tkzDrawSegment[purple](O',T)
- \tkzDrawSegments[red](O,T O,O')
- \tkzDrawPoints(O,O',T,T',M)
- \tkzMarkRightAngle[fill=gray!10](O',T,O)
- \tkzLabelPoint[below](O){$O$}
- \tkzLabelPoint[above](T){$T$}
- \tkzLabelPoint[above](M){$M$}
- \tkzLabelPoint[below](T'){$T'$}
- \tkzLabelPoint[above left](O'){$O'$}
-\end{tikzpicture}
-\end{Verbatim}
-
-\directlua{%
-init_elements ()
-scale = .75
-z.O = point: new (2,2)
-z.Op = point: new (-4,1)
-z.P = point: polar (4,0)
-C.OP = circle: new (z.O,z.P)
-C.Oz1 = C.OP : orthogonal_from (z.Op)
-z.z1 = C.Oz1.through
-L.OP = line : new (z.O,z.P)
-C.Opz1 = circle: new (z.Op,z.z1)
-L.T,L.Tp = C.Opz1 : tangent_from (z.O)
-z.T = L.T.pb
-z.Tp = L.Tp.pb
-L.OOp = line : new (z.O,z.Op)
-z.M = L.OOp.mid
-}
-
-\begin{center}
+\begin{minipage}{.5\textwidth}
+ \begin{Verbatim}
+ \directlua{%
+ init_elements ()
+ scale = .5
+ z.O = point: new (2,2)
+ z.Op = point: new (-4,1)
+ z.P = point: polar (4,0)
+ C.OP = circle: new (z.O,z.P)
+ C.Oz1 = C.OP : orthogonal_from (z.Op)
+ z.z1 = C.Oz1.through
+ L.OP = line : new (z.O,z.P)
+ C.Opz1 = circle: new (z.Op,z.z1)
+ L.T,L.Tp = C.Opz1 : tangent_from (z.O)
+ z.T = L.T.pb
+ z.Tp = L.Tp.pb
+ L.OOp = line : new (z.O,z.Op)
+ z.M = L.OOp.mid
+ }
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircle[red](O,P)
- \tkzDrawCircle[purple](O',z1)
- \tkzDrawCircle[cyan](M,T)
- \tkzDrawSegments(O',T O,T' O',T')
- \tkzDrawSegment[purple](O',T)
- \tkzDrawSegments[red](O,T O,O')
- \tkzDrawPoints(O,O',T,T',M)
- \tkzMarkRightAngle[fill=gray!10](O',T,O)
- \tkzLabelPoint[below](O){$O$}
- \tkzLabelPoint[above](T){$T$}
- \tkzLabelPoint[above](M){$M$}
- \tkzLabelPoint[below](T'){$T'$}
- \tkzLabelPoint[above left](O'){$O'$}
+ \tkzGetNodes
+ \tkzDrawCircle[red](O,P)
+ \tkzDrawCircle[purple](O',z1)
+ \tkzDrawCircle[cyan](M,T)
+ \tkzDrawSegments(O',T O,T' O',T')
+ \tkzDrawSegment[purple](O',T)
+ \tkzDrawSegments[red](O,T O,O')
+ \tkzDrawPoints(O,O',T,T',M)
+ \tkzMarkRightAngle[fill=gray!10](O',T,O)
+ \tkzLabelPoint[below](O){$O$}
+ \tkzLabelPoint[above](T){$T$}
+ \tkzLabelPoint[above](M){$M$}
+ \tkzLabelPoint[below](T'){$T'$}
+ \tkzLabelPoint[above left](O'){$O'$}
\end{tikzpicture}
-\end{center}
+ \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{%
+ init_elements ()
+ scale = .5
+ z.O = point: new (2,2)
+ z.Op = point: new (-4,1)
+ z.P = point: polar (4,0)
+ C.OP = circle: new (z.O,z.P)
+ C.Oz1 = C.OP : orthogonal_from (z.Op)
+ z.z1 = C.Oz1.through
+ L.OP = line : new (z.O,z.P)
+ C.Opz1 = circle: new (z.Op,z.z1)
+ L.T,L.Tp = C.Opz1 : tangent_from (z.O)
+ z.T = L.T.pb
+ z.Tp = L.Tp.pb
+ L.OOp = line : new (z.O,z.Op)
+ z.M = L.OOp.mid
+ }
+
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircle[red](O,P)
+ \tkzDrawCircle[purple](O',z1)
+ \tkzDrawCircle[cyan](M,T)
+ \tkzDrawSegments(O',T O,T' O',T')
+ \tkzDrawSegment[purple](O',T)
+ \tkzDrawSegments[red](O,T O,O')
+ \tkzDrawPoints(O,O',T,T',M)
+ \tkzMarkRightAngle[fill=gray!10](O',T,O)
+ \tkzLabelPoint[below](O){$O$}
+ \tkzLabelPoint[above](T){$T$}
+ \tkzLabelPoint[above](M){$M$}
+ \tkzLabelPoint[below](T'){$T'$}
+ \tkzLabelPoint[above left](O'){$O'$}
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
+
% subsection orthogonal_circles_v2 (end)
@@ -2677,24 +2681,26 @@ z.M = L.OOp.mid
\subsection{Orthogonal circle to two circles} % (fold)
\label{sub:orthogonal_circle_to_two_circles}
+\begin{minipage}{.5\textwidth}
\begin{Verbatim}
\directlua{%
init_elements ()
- z.O = point : new (-1,0)
- z.B = point : new (0,2)
- z.Op = point : new (4,-1)
- z.D = point : new (4,0)
- C.OB = circle : new (z.O,z.B)
- C.OpD = circle : new (z.Op,z.D)
- z.E,z.F = get_points (C.OB : radical_axis (C.OpD))
- L.EF = line : new (z.E,z.F)
- z.M = L.EF : point (.25)
- L.T,L.Tp = C.OB : tangent_from (z.M)
- L.K,L.Kp = C.OpD : tangent_from (z.M)
- z.T = L.T.pb
- z.K = L.K.pb
- z.Tp = L.Tp.pb
- z.Kp = L.Kp.pb
+scale =.75
+ z.O = point : new (-1,0)
+ z.B = point : new (0,2)
+ z.Op = point : new (4,-1)
+ z.D = point : new (4,0)
+ C.OB = circle : new (z.O,z.B)
+ C.OpD = circle : new (z.Op,z.D)
+ z.E,z.F = get_points (C.OB : radical_axis (C.OpD))
+ L.EF = line : new (z.E,z.F)
+ z.M = L.EF : point (.25)
+ L.T,L.Tp = C.OB : tangent_from (z.M)
+ L.K,L.Kp = C.OpD : tangent_from (z.M)
+ z.T = L.T.pb
+ z.K = L.K.pb
+ z.Tp = L.Tp.pb
+ z.Kp = L.Kp.pb
}
\begin{tikzpicture}
\tkzGetNodes
@@ -2706,11 +2712,12 @@ init_elements ()
\tkzDrawPoints(O,O',T,M,T',K,K')
\tkzLabelPoints(O,O',T,T',M,K,K')
\end{tikzpicture}
-\end{Verbatim}
-
+ \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\directlua{%
init_elements ()
- scale = 1.25
+ scale = .75
z.O = point : new (-1,0)
z.B = point : new (0,2)
z.Op = point : new (4,-1)
@@ -2727,8 +2734,6 @@ z.K = L.K.pb
z.Tp = L.Tp.pb
z.Kp = L.Kp.pb
}
-
-
\begin{center}
\begin{tikzpicture}
\tkzGetNodes
@@ -2741,7 +2746,7 @@ z.Kp = L.Kp.pb
\tkzLabelPoints(O,O',T,T',M,K,K')
\end{tikzpicture}
\end{center}
-
+\end{minipage}
% subsection Orthogonal to two circles (fold)
@@ -2934,16 +2939,6 @@ init_elements ()
z.xp,z.yp = get_points (C.C0A : orthogonal_from (z.M_1))
z.O = L.BA.mid
}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(C_0,A C_1,A C_3,A C_5,A)
- \tkzDrawCircles[thick,color=red](M_0,x M_1,x')
- \tkzDrawCircles[thick,color=blue](O,A)
- \tkzDrawLines(C_0,C_1 B,M_1)
- \tkzDrawPoints(A,B,C_0,C_1,M_0,M_1,x,y)
- \tkzLabelPoints[below right](A,B,C_0,C_1,M_0,M_1,x,y)
- \tkzLabelLine[pos=1.25,right]( M_0,M_1){$(\Delta)$}
-\end{tikzpicture}
\end{Verbatim}
\directlua{%
@@ -2977,6 +2972,18 @@ z.O = L.BA.mid
\end{tikzpicture}
\end{center}
+\begin{Verbatim}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(C_0,A C_1,A C_3,A C_5,A)
+ \tkzDrawCircles[thick,color=red](M_0,x M_1,x')
+ \tkzDrawCircles[thick,color=blue](O,A)
+ \tkzDrawLines(C_0,C_1 B,M_1)
+ \tkzDrawPoints(A,B,C_0,C_1,M_0,M_1,x,y)
+ \tkzLabelPoints[below right](A,B,C_0,C_1,M_0,M_1,x,y)
+ \tkzLabelLine[pos=1.25,right]( M_0,M_1){$(\Delta)$}
+ \end{tikzpicture}
+\end{Verbatim}
% subsection pencil_v1 (end)
@@ -3003,15 +3010,6 @@ init_elements ()
z.v = C.orth1.through
z.t = C.orth2.through
}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(C_0,A C_1,B)
- \tkzDrawCircles[thick,color=red](M_0,u M_1,v M_2,t)
- \tkzDrawLines[add= .75 and .75](C_0,C_1 M_0,M_1)
- \tkzDrawPoints(A,B,C_0,C_1,M_0,M_1,M_2)
- \tkzLabelPoints[below right](A,B,C_0,C_1,M_0,M_1,M_2)
- \tkzLabelLine[pos=2,right]( M_0,M_1){$(\Delta)$}
-\end{tikzpicture}
\end{Verbatim}
\directlua{%
@@ -3047,234 +3045,257 @@ init_elements ()
\end{tikzpicture}
\end{center}
+\begin{Verbatim}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(C_0,A C_1,B)
+ \tkzDrawCircles[thick,color=red](M_0,u M_1,v M_2,t)
+ \tkzDrawLines[add= .75 and .75](C_0,C_1 M_0,M_1)
+ \tkzDrawPoints(A,B,C_0,C_1,M_0,M_1,M_2)
+ \tkzLabelPoints[below right](A,B,C_0,C_1,M_0,M_1,M_2)
+ \tkzLabelLine[pos=2,right]( M_0,M_1){$(\Delta)$}
+\end{tikzpicture}
+\end{Verbatim}
+
%subsection pencil_v2 (end)
\subsection{Reim v1} % (fold)
\label{sub:reim_v1}
+
+\begin{minipage}{.5\textwidth}
\begin{Verbatim}
\directlua{%
init_elements ()
- z.A = point: new (0,0)
- z.E = point: new (-2,2)
- C.AE = circle : new (z.A,z.E)
- z.C = C.AE : point (0.65)
- z.D = C.AE : point (0.5)
- z.F = C.AE : point (0.30)
- L.EC = line: new (z.E,z.C)
- z.H = L.EC : point (1.5)
- T.CDH = triangle : new (z.C,z.D,z.H)
- z.B = T.CDH.circumcenter
- C.BD = circle : new (z.B,z.D)
- L.FD = line: new (z.F,z.D)
- z.G = intersection (L.FD,C.BD)
- z.O = intersection (L.EC,L.FD)
+ z.A = point: new (0,0)
+ z.E = point: new (-2,2)
+ C.AE = circle : new (z.A,z.E)
+ z.C = C.AE : point (0.65)
+ z.D = C.AE : point (0.5)
+ z.F = C.AE : point (0.30)
+ L.EC = line: new (z.E,z.C)
+ z.H = L.EC : point (1.5)
+ T.CDH = triangle : new (z.C,z.D,z.H)
+ z.B = T.CDH.circumcenter
+ C.BD = circle : new (z.B,z.D)
+ L.FD = line: new (z.F,z.D)
+ z.G = intersection (L.FD,C.BD)
+ z.O = intersection (L.EC,L.FD)
}
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(A,E B,H)
- \tkzDrawSegments(E,D C,F)
- \tkzDrawLines(E,O F,O)
- \tkzDrawLines[red](E,F H,G)
- \tkzDrawPoints(A,...,H,O)
- \tkzLabelPoints(A,B,D,F,G,O)
- \tkzLabelPoints[above](E,C,H)
- \tkzMarkAngles[size=.5](E,C,F E,D,F)
- \tkzFillAngles[green!40,opacity=.4,size=.5](E,C,F E,D,F)
- \tkzMarkAngles[size=.5](F,C,H G,D,E)
- \tkzFillAngles[red!40,opacity=.4,size=.5](F,C,H G,D,E)
+ \tkzGetNodes
+ \tkzDrawCircles(A,E B,H)
+ \tkzDrawSegments(E,D C,F)
+ \tkzDrawLines(E,O F,O)
+ \tkzDrawLines[red](E,F H,G)
+ \tkzDrawPoints(A,...,H,O)
+ \tkzLabelPoints(A,B,D,F,G,O)
+ \tkzLabelPoints[above](E,C,H)
+ \tkzMarkAngles[size=.5](E,C,F E,D,F)
+ \tkzFillAngles[green!40,opacity=.4,size=.5](E,C,F E,D,F)
+ \tkzMarkAngles[size=.5](F,C,H G,D,E)
+ \tkzFillAngles[red!40,opacity=.4,size=.5](F,C,H G,D,E)
\end{tikzpicture}
\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{%
+ init_elements ()
+ scale = .5
+ z.A = point: new (0,0)
+ z.E = point: new (-2,2)
+ C.AE = circle : new (z.A,z.E)
+ z.C = C.AE : point (0.65)
+ z.D = C.AE : point (0.5)
+ z.F = C.AE : point (0.30)
+ L.EC = line: new (z.E,z.C)
+ z.H = L.EC : point (1.5)
+ T.CDH = triangle : new (z.C,z.D,z.H)
+ z.B = T.CDH.circumcenter
+ C.BD = circle : new (z.B,z.D)
+ L.FD = line: new (z.F,z.D)
+ z.G = intersection (L.FD,C.BD)
+ z.O = intersection (L.EC,L.FD)
+ }
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(A,E B,H)
+ \tkzDrawSegments(E,D C,F)
+ \tkzDrawLines(E,O F,O)
+ \tkzDrawLines[red](E,F H,G)
+ \tkzDrawPoints(A,...,H,O)
+ \tkzLabelPoints(A,B,D,F,G,O)
+ \tkzLabelPoints[above](E,C,H)
+ \tkzMarkAngles[size=.5](E,C,F E,D,F)
+ \tkzFillAngles[green!40,opacity=.4,size=.5](E,C,F E,D,F)
+ \tkzMarkAngles[size=.5](F,C,H G,D,E)
+ \tkzFillAngles[red!40,opacity=.4,size=.5](F,C,H G,D,E)
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
-\directlua{%
-init_elements ()
- z.A = point: new (0,0)
- z.E = point: new (-2,2)
- C.AE = circle : new (z.A,z.E)
- z.C = C.AE : point (0.65)
- z.D = C.AE : point (0.5)
- z.F = C.AE : point (0.30)
- L.EC = line: new (z.E,z.C)
- z.H = L.EC : point (1.5)
- T.CDH = triangle : new (z.C,z.D,z.H)
- z.B = T.CDH.circumcenter
- C.BD = circle : new (z.B,z.D)
- L.FD = line: new (z.F,z.D)
- z.G = intersection (L.FD,C.BD)
- z.O = intersection (L.EC,L.FD)
-}
-
-
-\begin{center}
- \begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(A,E B,H)
- \tkzDrawSegments(E,D C,F)
- \tkzDrawLines(E,O F,O)
- \tkzDrawLines[red](E,F H,G)
- \tkzDrawPoints(A,...,H,O)
- \tkzLabelPoints(A,B,D,F,G,O)
- \tkzLabelPoints[above](E,C,H)
- \tkzMarkAngles[size=.5](E,C,F E,D,F)
- \tkzFillAngles[green!40,opacity=.4,size=.5](E,C,F E,D,F)
- \tkzMarkAngles[size=.5](F,C,H G,D,E)
- \tkzFillAngles[red!40,opacity=.4,size=.5](F,C,H G,D,E)
- \end{tikzpicture}
-\end{center}
% subsection reim_v1 (end)
\subsection{Reim v2} % (fold)
\label{sub:reim_v2}
+
+\begin{minipage}{.5\textwidth}
\begin{Verbatim}
\directlua{%
init_elements ()
- scale = .6
- z.A = point: new (0,0)
- z.B = point: new (10,0)
- z.C = point: new (4,0)
- C.AC = circle: new (z.A,z.C)
- z.c,z.cp = get_points (C.AC: tangent_at (z.C))
- z.M = C.AC: point (0.6)
- L.MC = line: new (z.M,z.C)
- C.BC = circle: new (z.B,z.C)
- z.N = intersection (L.MC,C.BC)
- z.m,z.mp = get_points (C.AC: tangent_at (z.M))
- z.n,z.np = get_points (C.BC: tangent_at (z.N))
+ scale = .4
+ z.A = point: new (0,0)
+ z.B = point: new (10,0)
+ z.C = point: new (4,0)
+ C.AC = circle: new (z.A,z.C)
+ z.c,z.cp = get_points (C.AC: tangent_at (z.C))
+ z.M = C.AC: point (0.6)
+ L.MC = line: new (z.M,z.C)
+ C.BC = circle: new (z.B,z.C)
+ z.N = intersection (L.MC,C.BC)
+ z.m,z.mp = get_points (C.AC: tangent_at (z.M))
+ z.n,z.np = get_points (C.BC: tangent_at (z.N))
}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(A,C B,C)
- \tkzDrawLines[new,add=1 and 1](M,m N,n C,c)
- \tkzDrawSegment(M,N)
- \tkzDrawPoints(A,B,C,M,N)
- \tkzLabelPoints[below right](A,B,C,M,N)
- \tkzFillAngles[blue!30,opacity=.3](m',M,C N,C,c' M,C,c n',N,C)
- \tkzLabelCircle[below=4pt,font=\scriptsize](A,C)(90){$(\alpha)$}
- \tkzLabelCircle[left=4pt,font=\scriptsize](B,C)(-90){$(\beta)$}
-\end{tikzpicture}
-\end{Verbatim}
+ \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{%
+ init_elements ()
+ scale = .25
+ z.A = point: new (0,0)
+ z.B = point: new (10,0)
+ z.C = point: new (4,0)
+ C.AC = circle: new (z.A,z.C)
+ z.c,z.cp = get_points (C.AC: tangent_at (z.C))
+ z.M = C.AC: point (0.6)
+ L.MC = line: new (z.M,z.C)
+ C.BC = circle: new (z.B,z.C)
+ z.N = intersection (L.MC,C.BC)
+ z.m,z.mp = get_points (C.AC: tangent_at (z.M))
+ z.n,z.np = get_points (C.BC: tangent_at (z.N))
+ }
-\directlua{%
-init_elements ()
-scale = .4
-z.A = point: new (0,0)
-z.B = point: new (10,0)
-z.C = point: new (4,0)
-C.AC = circle: new (z.A,z.C)
-z.c,z.cp = get_points (C.AC: tangent_at (z.C))
-z.M = C.AC: point (0.6)
-L.MC = line: new (z.M,z.C)
-C.BC = circle: new (z.B,z.C)
-z.N = intersection (L.MC,C.BC)
-z.m,z.mp = get_points (C.AC: tangent_at (z.M))
-z.n,z.np = get_points (C.BC: tangent_at (z.N))
-}
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(A,C B,C)
+ \tkzDrawLines[new,add=1 and 1](M,m N,n C,c)
+ \tkzDrawSegment(M,N)
+ \tkzDrawPoints(A,B,C,M,N)
+ \tkzLabelPoints[below right](A,B,C,M,N)
+ \tkzFillAngles[blue!30,opacity=.3](m',M,C N,C,c' M,C,c n',N,C)
+ \tkzLabelCircle[below=4pt,font=\scriptsize](A,C)(90){$(\alpha)$}
+ \tkzLabelCircle[left=4pt,font=\scriptsize](B,C)(-90){$(\beta)$}
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
-\begin{center}
+\begin{Verbatim}
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(A,C B,C)
- \tkzDrawLines[new,add=1 and 1](M,m N,n C,c)
- \tkzDrawSegment(M,N)
- \tkzDrawPoints(A,B,C,M,N)
- \tkzLabelPoints[below right](A,B,C,M,N)
- \tkzFillAngles[blue!30,opacity=.3](m',M,C N,C,c' M,C,c n',N,C)
- \tkzLabelCircle[below=4pt,font=\scriptsize](A,C)(90){$(\alpha)$}
- \tkzLabelCircle[left=4pt,font=\scriptsize](B,C)(-90){$(\beta)$}
+ \tkzGetNodes
+ \tkzDrawCircles(A,C B,C)
+ \tkzDrawLines[new,add=1 and 1](M,m N,n C,c)
+ \tkzDrawSegment(M,N)
+ \tkzDrawPoints(A,B,C,M,N)
+ \tkzLabelPoints[below right](A,B,C,M,N)
+ \tkzFillAngles[blue!30,opacity=.3](m',M,C N,C,c' M,C,c n',N,C)
+ \tkzLabelCircle[below=4pt,font=\scriptsize](A,C)(90){$(\alpha)$}
+ \tkzLabelCircle[left=4pt,font=\scriptsize](B,C)(-90){$(\beta)$}
\end{tikzpicture}
-\end{center}
-
+\end{Verbatim}
% subsection reim_v2 (end)
\subsection{Reim v3} % (fold)
\label{sub:reim_v3}
-\begin{Verbatim}
-\directlua{%
-init_elements ()
- z.A = point: new (0,0)
- z.B = point: new (8,0)
- z.C = point: new (2,6)
- L.AB = line : new (z.A,z.B)
- L.AC = line : new (z.A,z.C)
- L.BC = line : new (z.B,z.C)
- z.I = L.BC : point (0.75)
- z.J = L.AC : point (0.4)
- z.K = L.AB : point (0.5)
- T.AKJ = triangle : new (z.A,z.K,z.J)
- T.BIK = triangle : new (z.B,z.I,z.K)
- T.CIJ = triangle : new (z.C,z.I,z.J)
- z.x = T.AKJ.circumcenter
- z.y = T.BIK.circumcenter
- z.z = T.CIJ.circumcenter
- C.xK = circle: new (z.x,z.K)
- C.yK = circle: new (z.y,z.K)
- z.O,_ = intersection (C.xK,C.yK)
- C.zO = circle: new (z.z,z.O)
- L.KO = line: new (z.K,z.O)
- z.D = intersection (L.KO,C.zO)
-}
-
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawSegments(K,D D,C)
- \tkzDrawPolygon[teal](A,B,C)
- \tkzDrawCircles[orange](x,A y,B z,C)
- \tkzDrawPoints[fill=white](A,B,C,I,J,K,D)
- \tkzLabelPoints[below](A,B,J,K,O)
- \tkzLabelPoints[above](C,D,I)
- \tkzDrawPoints[fill=black](O)
- \tkzLabelCircle[below=4pt,font=\scriptsize](x,A)(20){$(\alpha)$}
- \tkzLabelCircle[left=4pt,font=\scriptsize](y,B)(60){$(\beta)$}
- \tkzLabelCircle[below=4pt,font=\scriptsize](z,C)(60){$(\gamma)$}
-\end{tikzpicture}
-\end{Verbatim}
-\directlua{%
-init_elements ()
- scale = .75
- z.A = point: new (0,0)
- z.B = point: new (8,0)
- z.C = point: new (2,6)
- L.AB = line : new (z.A,z.B)
- L.AC = line : new (z.A,z.C)
- L.BC = line : new (z.B,z.C)
- z.I = L.BC : point (0.75)
- z.J = L.AC : point (0.4)
- z.K = L.AB : point (0.5)
- T.AKJ = triangle : new (z.A,z.K,z.J)
- T.BIK = triangle : new (z.B,z.I,z.K)
- T.CIJ = triangle : new (z.C,z.I,z.J)
- z.x = T.AKJ.circumcenter
- z.y = T.BIK.circumcenter
- z.z = T.CIJ.circumcenter
- C.xK = circle: new (z.x,z.K)
- C.yK = circle: new (z.y,z.K)
- z.O,_ = intersection (C.xK,C.yK)
- C.zO = circle: new (z.z,z.O)
- L.KO = line: new (z.K,z.O)
- z.D = intersection (L.KO,C.zO)
-}
-
-\begin{center}
+\begin{minipage}{.5\textwidth}
+ \begin{Verbatim}
+ \directlua{%
+ init_elements ()
+ z.A = point: new (0,0)
+ z.B = point: new (8,0)
+ z.C = point: new (2,6)
+ L.AB = line : new (z.A,z.B)
+ L.AC = line : new (z.A,z.C)
+ L.BC = line : new (z.B,z.C)
+ z.I = L.BC : point (0.75)
+ z.J = L.AC : point (0.4)
+ z.K = L.AB : point (0.5)
+ T.AKJ = triangle : new (z.A,z.K,z.J)
+ T.BIK = triangle : new (z.B,z.I,z.K)
+ T.CIJ = triangle : new (z.C,z.I,z.J)
+ z.x = T.AKJ.circumcenter
+ z.y = T.BIK.circumcenter
+ z.z = T.CIJ.circumcenter
+ C.xK = circle: new (z.x,z.K)
+ C.yK = circle: new (z.y,z.K)
+ z.O,_ = intersection (C.xK,C.yK)
+ C.zO = circle: new (z.z,z.O)
+ L.KO = line: new (z.K,z.O)
+ z.D = intersection (L.KO,C.zO)
+ }
\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawSegments(K,D D,C)
- \tkzDrawPolygon[teal](A,B,C)
- \tkzDrawCircles[orange](x,A y,B z,C)
- \tkzDrawPoints[fill=white](A,B,C,I,J,K,D)
- \tkzLabelPoints[below](A,B,J,K,O)
- \tkzLabelPoints[above](C,D,I)
- \tkzDrawPoints[fill=black](O)
- \tkzLabelCircle[below=4pt,font=\scriptsize](x,A)(20){$(\alpha)$}
- \tkzLabelCircle[left=4pt,font=\scriptsize](y,B)(60){$(\beta)$}
- \tkzLabelCircle[below=4pt,font=\scriptsize](z,C)(60){$(\gamma)$}
+ \tkzGetNodes
+ \tkzDrawSegments(K,D D,C)
+ \tkzDrawPolygon[teal](A,B,C)
+ \tkzDrawCircles[orange](x,A y,B z,C)
+ \tkzDrawPoints[fill=white](A,B,C,I,J,K,D)
+ \tkzLabelPoints[below](A,B,J,K,O)
+ \tkzLabelPoints[above](C,D,I)
+ \tkzDrawPoints[fill=black](O)
+ \tkzLabelCircle[below=4pt,font=\scriptsize](x,A)(20){$(\alpha)$}
+ \tkzLabelCircle[left=4pt,font=\scriptsize](y,B)(60){$(\beta)$}
+ \tkzLabelCircle[below=4pt,font=\scriptsize](z,C)(60){$(\gamma)$}
\end{tikzpicture}
-\end{center}
-
+ \end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+ \directlua{%
+ init_elements ()
+ scale = .75
+ z.A = point: new (0,0)
+ z.B = point: new (8,0)
+ z.C = point: new (2,6)
+ L.AB = line : new (z.A,z.B)
+ L.AC = line : new (z.A,z.C)
+ L.BC = line : new (z.B,z.C)
+ z.I = L.BC : point (0.75)
+ z.J = L.AC : point (0.4)
+ z.K = L.AB : point (0.5)
+ T.AKJ = triangle : new (z.A,z.K,z.J)
+ T.BIK = triangle : new (z.B,z.I,z.K)
+ T.CIJ = triangle : new (z.C,z.I,z.J)
+ z.x = T.AKJ.circumcenter
+ z.y = T.BIK.circumcenter
+ z.z = T.CIJ.circumcenter
+ C.xK = circle: new (z.x,z.K)
+ C.yK = circle: new (z.y,z.K)
+ z.O,_ = intersection (C.xK,C.yK)
+ C.zO = circle: new (z.z,z.O)
+ L.KO = line: new (z.K,z.O)
+ z.D = intersection (L.KO,C.zO)
+ }
+ \begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawSegments(K,D D,C)
+ \tkzDrawPolygon[teal](A,B,C)
+ \tkzDrawCircles[orange](x,A y,B z,C)
+ \tkzDrawPoints[fill=white](A,B,C,I,J,K,D)
+ \tkzLabelPoints[below](A,B,J,K,O)
+ \tkzLabelPoints[above](C,D,I)
+ \tkzDrawPoints[fill=black](O)
+ \tkzLabelCircle[below=4pt,font=\scriptsize](x,A)(20){$(\alpha)$}
+ \tkzLabelCircle[left=4pt,font=\scriptsize](y,B)(60){$(\beta)$}
+ \tkzLabelCircle[below=4pt,font=\scriptsize](z,C)(60){$(\gamma)$}
+ \end{tikzpicture}
+ \end{center}
+\end{minipage}
% subsection reim_v3 (end)
@@ -3385,19 +3406,19 @@ z.C,z.D = z.E : homothety(2,z.A,z.B)
\begin{Verbatim}
\directlua{%
init_elements ()
- scale = .8
- z.A = point: new (0 , 0)
- z.B = point: new (6 , 0)
- z.C = point: new (1 , 5)
- z.Bp = point: new (2 , 0)
- T.ABC = triangle: new (z.A,z.B,z.C)
- L.AB = line: new (z.A,z.B)
- z.O = T.ABC.circumcenter
- C.OA = circle: new (z.O,z.A)
- z.D = C.OA: point (4.5)
- L.AO = line: new (z.A,z.O)
- z.b1,z.b2 = get_points (C.OA: tangent_at (z.B))
- z.H = L.AB: projection (z.O)
+ scale = .75
+ z.A = point: new (0 , 0)
+ z.B = point: new (6 , 0)
+ z.C = point: new (1 , 5)
+ z.Bp = point: new (2 , 0)
+ T.ABC = triangle: new (z.A,z.B,z.C)
+ L.AB = line: new (z.A,z.B)
+ z.O = T.ABC.circumcenter
+ C.OA = circle: new (z.O,z.A)
+ z.D = C.OA: point (4.5)
+ L.AO = line: new (z.A,z.O)
+ z.b1,z.b2 = get_points(C.OA: tangent_at(z.B))
+ z.H = L.AB: projection (z.O)
}
\begin{tikzpicture}
\tkzGetNodes
@@ -3415,7 +3436,7 @@ init_elements ()
\begin{minipage}{.5\textwidth}
\directlua{%
init_elements ()
-scale = 0.75
+scale = 0.75
z.A = point: new (0 , 0)
z.B = point: new (6 , 0)
z.C = point: new (1 , 5)
@@ -3426,18 +3447,16 @@ z.O = T.ABC.circumcenter
C.OA = circle: new (z.O,z.A)
z.D = C.OA: point (4.5)
L.AO = line: new (z.A,z.O)
-z.b1,z.b2 = get_points (C.OA: tangent_at (z.B))
+z.b1,z.b2 = get_points (C.OA: tangent_at (z.B))
z.H = L.AB: projection (z.O)
}
-
-
\begin{center}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircle(O,A)
\tkzDrawPolygon(A,B,C)
\tkzDrawSegments[new](A,O B,O O,H A,D D,B)
- \tkzDrawLine(b1,b2)
+ \tkzDrawSegment(b1,b2)
\tkzDrawPoints(A,B,C,D,H,O)
\tkzFillAngles[green!20,opacity=.3](H,O,B A,C,B A,B,b1)
\tkzFillAngles[teal!20,opacity=.3](A,D,B b2,B,A)
@@ -3452,7 +3471,6 @@ z.H = L.AB: projection (z.O)
\subsection{Three chords} % (fold)
\label{sub:three_chords}
-\begin{Verbatim}
\directlua{%
init_elements ()
z.O = point: new (0 , 0)
@@ -3483,9 +3501,9 @@ z.Ap = intersection (L.GB,C.xB)
z.Ep,_ = intersection (L.GE,C.xF)
z.Cp,_ = intersection (L.GD,C.xD)
}
-\end{Verbatim}
-
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
\directlua{%
init_elements ()
z.O = point: new (0 , 0)
@@ -3516,30 +3534,9 @@ z.Ap = intersection (L.GB,C.xB)
z.Ep,_ = intersection (L.GE,C.xF)
z.Cp,_ = intersection (L.GD,C.xD)
}
-
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
-\begin{Verbatim}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircles(O,B)
- \tkzDrawCircles[cyan](P,B)
- \tkzDrawCircles[red](w,E)
- \tkzDrawCircles[new](x,F)
- \tkzDrawSegments(A,G E,G C,G)
- \tkzDrawPolygons[new](A,E,C A',E',C')
- \tkzDrawPoints(A,...,G,A',E',C',O,P)
- \begin{scope}[font=\scriptsize]
- \tkzLabelPoints(A,...,F)
- \tkzLabelPoints[above left](G,A',E',C')
- \tkzLabelCircle[left](O,B)(30){$(\beta)$}
- \tkzLabelCircle[below](P,A)(40){$(\gamma)$}
- \tkzLabelCircle[right](w,C)(90){$(\alpha)$}
- \tkzLabelCircle[left](x,B)(-230){$((\delta))$}
- \end{scope}
-\end{tikzpicture}
\end{Verbatim}
\end{minipage}
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{minipage}{.5\textwidth}
\begin{center}
\begin{tikzpicture}[scale=.75]
\tkzGetNodes
@@ -3561,6 +3558,29 @@ z.Cp,_ = intersection (L.GD,C.xD)
\end{tikzpicture}
\end{center}
\end{minipage}
+
+\begin{Verbatim}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircles(O,B)
+ \tkzDrawCircles[cyan](P,B)
+ \tkzDrawCircles[red](w,E)
+ \tkzDrawCircles[new](x,F)
+ \tkzDrawSegments(A,G E,G C,G)
+ \tkzDrawPolygons[new](A,E,C A',E',C')
+ \tkzDrawPoints(A,...,G,A',E',C',O,P)
+ \begin{scope}[font=\scriptsize]
+ \tkzLabelPoints(A,...,F)
+ \tkzLabelPoints[above left](G,A',E',C')
+ \tkzLabelCircle[left](O,B)(30){$(\beta)$}
+ \tkzLabelCircle[below](P,A)(40){$(\gamma)$}
+ \tkzLabelCircle[right](w,C)(90){$(\alpha)$}
+ \tkzLabelCircle[left](x,B)(-230){$((\delta))$}
+ \end{scope}
+\end{tikzpicture}
+\end{Verbatim}
+
+
% subsection three_chords (end)
\subsection{Three tangents} % (fold)
@@ -3768,7 +3788,8 @@ Draw lines through the symmedian point $L$ and parallel to the sides of the tria
[\href{https://mathworld.wolfram.com/FirstLemoineCircle.html}{Weisstein, Eric W. "First Lemoine Circle." From MathWorld--A Wolfram Web Resource.}]
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\vspace{6pt}
+\begin{minipage}[t]{.35\textwidth}\vspace{0pt}%
\directlua{%
init_elements ()
z.A = point: new (1,1)
@@ -3795,23 +3816,21 @@ init_elements ()
\end{tikzpicture}
\end{center}
\end{minipage}
-
-\begin{minipage}[t]{.5\textwidth}\vspace{0pt}%
+\begin{minipage}[t]{.65\textwidth}\vspace{0pt}%
\begin{Verbatim}
\directlua{%
init_elements ()
- z.A = point: new (1,1)
- z.B = point: new (5,1)
- z.C = point: new (2.2,4)
- T = triangle: new (z.A,z.B,z.C)
- z.O = T.circumcenter
- C.first_lemoine = T:first_lemoine_circle()
- z.o,z.w = get_points( C.first_lemoine )
- z.y1,z.y2 = intersection (T.ab,C.first_lemoine)
- z.y5,z.y6 = intersection (T.bc,C.first_lemoine)
- z.y3,z.y4 = intersection (T.ca,C.first_lemoine)
- z.L = T : lemoine_point ()
-}
+ z.A = point: new (1,1)
+ z.B = point: new (5,1)
+ z.C = point: new (2.2,4)
+ T = triangle:new(z.A,z.B,z.C)
+ z.O = T.circumcenter
+ C.first_lemoine = T:first_lemoine_circle()
+ z.o,z.w = get_points( C.first_lemoine )
+ z.y1,z.y2= intersection (T.ab,C.first_lemoine)
+ z.y5,z.y6= intersection (T.bc,C.first_lemoine)
+ z.y3,z.y4= intersection (T.ca,C.first_lemoine)
+ z.L = T:lemoine_point ()
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawPolygons(A,B,C)
@@ -4046,177 +4065,6 @@ z.z_0,z.z_1 = get_points (L.anti)
\end{minipage}
% subsection antiparallel_through_lemoine_point (end)
-\subsection{Soddy circle without function} % (fold)
-\label{sub:soddy}
-
-\begin{Verbatim}
-\directlua{%
-init_elements ()
-z.A = point : new ( 0 , 0 )
-z.B = point : new ( 5 , 0 )
-z.C = point : new ( 0.5 , 4 )
-T.ABC = triangle : new ( z.A,z.B,z.C )
-z.I = T.ABC.incenter
-z.E,z.F,z.G = T.ABC : projection (z.I)
-C.ins = circle : new (z.I,z.E)
-T.orthic = T.ABC : orthic ()
-z.Ha,z.Hb,z.Hc = get_points (T.orthic)
-C.CF = circle : new ( z.C , z.F )
-C.AG = circle : new ( z.A , z.G )
-C.BE = circle : new ( z.B , z.E )
-L.Ah = line : new ( z.A , z.Ha )
-L.Bh = line : new ( z.B , z.Hb )
-L.Ch = line : new ( z.C , z.Hc )
-z.X,z.Xp = intersection (L.Ah,C.AG)
-z.Y,z.Yp = intersection (L.Bh,C.BE)
-z.Z,z.Zp = intersection (L.Ch,C.CF)
-L.XpE = line : new (z.Xp,z.E)
-L.YpF = line : new (z.Yp,z.F)
-L.ZpG = line : new (z.Zp,z.G)
-z.S = intersection (L.XpE,L.YpF)
-z.Xi = intersection(L.XpE,C.AG)
-z.Yi = intersection(L.YpF,C.BE)
-_,z.Zi = intersection(L.ZpG,C.CF)
-z.S = triangle : new (z.Xi,z.Yi,z.Zi).circumcenter
-C.soddy_int = circle : new (z.S,z.Xi)
-C.soddy_ext = C.ins : inversion (C.soddy_int)
-z.w = C.soddy_ext.center
-z.s = C.soddy_ext.through
-z.Xip,z.Yip,z.Zip = C.ins : inversion (z.Xi,z.Yi,z.Zi)
-}
-
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawPolygon(A,B,C)
-\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,X,Y,Z,X',Y',Z',Xi,Yi,Zi,I)
-\tkzDrawPoints(Xi',Yi',Zi',S)
-\tkzLabelPoints(A,B,C,E,F,G,X,Y,Z,X',Y',Z')
-\tkzDrawCircles(A,G B,E C,F I,E S,Xi w,s)
-\tkzDrawLines(X',Ha Y',Hb Z',Hc)
-\tkzDrawLines(X',E Y',F Z',G)
-\end{tikzpicture}
-\end{Verbatim}
-
-\directlua{%
-init_elements ()
-z.A = point : new ( 0 , 0 )
-z.B = point : new ( 5 , 0 )
-z.C = point : new ( 0.5 , 4 )
-T.ABC = triangle : new ( z.A,z.B,z.C )
-z.I = T.ABC.incenter
-z.E,z.F,z.G = T.ABC : projection (z.I)
-C.ins = circle : new (z.I,z.E)
-T.orthic = T.ABC : orthic ()
-z.Ha,z.Hb,z.Hc = get_points (T.orthic)
-C.CF = circle : new ( z.C , z.F )
-C.AG = circle : new ( z.A , z.G )
-C.BE = circle : new ( z.B , z.E )
-L.Ah = line : new ( z.A , z.Ha )
-L.Bh = line : new ( z.B , z.Hb )
-L.Ch = line : new ( z.C , z.Hc )
-z.X,z.Xp = intersection (L.Ah,C.AG)
-z.Y,z.Yp = intersection (L.Bh,C.BE)
-z.Z,z.Zp = intersection (L.Ch,C.CF)
-L.XpE = line : new (z.Xp,z.E)
-L.YpF = line : new (z.Yp,z.F)
-L.ZpG = line : new (z.Zp,z.G)
-z.S = intersection (L.XpE,L.YpF)
-z.Xi = intersection(L.XpE,C.AG)
-z.Yi = intersection(L.YpF,C.BE)
-_,z.Zi = intersection(L.ZpG,C.CF)
-z.S = triangle : new (z.Xi,z.Yi,z.Zi).circumcenter
-C.soddy_int = circle : new (z.S,z.Xi)
-C.soddy_ext = C.ins : inversion (C.soddy_int)
-z.w = C.soddy_ext.center
-z.s = C.soddy_ext.through
-z.Xip,z.Yip,z.Zip = C.ins : inversion (z.Xi,z.Yi,z.Zi)
-}
-
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawPolygon(A,B,C)
-\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,X,Y,Z,X',Y',Z',Xi,Yi,Zi,I)
-\tkzDrawPoints(Xi',Yi',Zi',S)
-\tkzLabelPoints(A,B,C,E,F,G,X,Y,Z,X',Y',Z')
-\tkzDrawCircles(A,G B,E C,F I,E S,Xi w,s)
-\tkzDrawLines(X',Ha Y',Hb Z',Hc)
-\tkzDrawLines(X',E Y',F Z',G)
-\end{tikzpicture}
-% subsection soddy (end)
-
-\subsection{Soddy circle with function} % (fold)
-\label{sub:soddy_circle_with_function}
-
-\directlua{%
-init_elements ()
-z.A = point : new ( 0 , 0 )
-z.B = point : new ( 5 , 0 )
-z.C = point : new (4 , 4 )
-T.ABC = triangle : new ( z.A,z.B,z.C )
-z.I = T.ABC.incenter
-z.E,z.F,z.G = T.ABC : projection (z.I)
-T.orthic = T.ABC : orthic ()
-z.Ha,z.Hb,z.Hc = get_points (T.orthic)
-C.ins = circle : new (z.I,z.E)
-z.s,z.xi,z.yi,z.zi = T.ABC : soddy_center ()
-C.soddy_int = circle : new (z.s,z.xi)
-C.soddy_ext = C.ins : inversion (C.soddy_int)
-z.w = C.soddy_ext.center
-z.t = C.soddy_ext.through
-z.Xip,z.Yip,z.Zip = C.ins : inversion (z.xi,z.yi,z.zi)
-}
-
-\begin{minipage}{.5\textwidth}
- \begin{Verbatim}
- \directlua{%
-init_elements ()
- z.A = point : new ( 0 , 0 )
- z.B = point : new ( 5 , 0 )
- z.C = point : new (4 , 4 )
- T.ABC = triangle : new ( z.A,z.B,z.C )
- z.I = T.ABC.incenter
- z.E,z.F,z.G = T.ABC : projection (z.I)
- T.orthic = T.ABC : orthic ()
- z.Ha,z.Hb,z.Hc = get_points (T.orthic)
- C.ins = circle : new (z.I,z.E)
- z.s,z.xi,z.yi,
- z.zi = T.ABC : soddy_center ()
- C.soddy_int = circle : new (z.s,z.xi)
- C.soddy_ext = C.ins : inversion (C.soddy_int)
- z.w = C.soddy_ext.center
- z.t = C.soddy_ext.through
- z.Xip,z.Yip,
- z.Zip = C.ins : inversion (z.xi,z.yi,z.zi)
- }
-\end{Verbatim}
-\end{minipage}
-\begin{minipage}{.5\textwidth}
-\begin{tikzpicture}[scale=.6]
-\tkzGetNodes
-\tkzDrawPolygon(A,B,C)
-\tkzDrawCircles(A,G B,E C,F I,E s,xi w,t)
-\tkzDrawPoints(A,B,C,E,F,G,s,w,xi,t)
-\tkzLabelPoints(A,B,C)
-\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,xi,yi,zi,I)
-\tkzDrawPoints(Xi',Yi',Zi')
-\tkzLabelPoints(A,B,C,E,F,G)
-\end{tikzpicture}
-\end{minipage}
-
-\begin{Verbatim}
-\begin{tikzpicture}
-\tkzGetNodes
-\tkzDrawPolygon(A,B,C)
-\tkzDrawCircles(A,G B,E C,F I,E s,xi w,t)
-\tkzDrawPoints(A,B,C,E,F,G,s,w,xi,t)
-\tkzLabelPoints(A,B,C)
-\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,xi,yi,zi,I)
-\tkzDrawPoints(Xi',Yi',Zi')
-\tkzLabelPoints(A,B,C,E,F,G)
-\end{tikzpicture}
-\end{Verbatim}
-% subsection soddy_circle_with_function (end)
-
\subsection{Pappus chain} % (fold)
\label{sub:pappus_chain}
@@ -4368,8 +4216,7 @@ end
\end{minipage}
% subsection three_circles (end)
-\subsection{p
-Pentagons in a golden arbelos} % (fold)
+\subsection{Pentagons in a golden arbelos} % (fold)
\label{sub:golden_arbelos}
\directlua{%
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
index e49c7892af..e40f88e431 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex
@@ -300,7 +300,7 @@ init_elements ()
z.e = z.a * z.b
z.f = z.a / z.b
z.ap = point.conj (z.a)
- -- = z.a : conj ()
+ % = z.a : conj ()
z.g = z.b* point(math.cos(math.pi/2),
math.sin(math.pi/2))
}
@@ -329,7 +329,7 @@ init_elements ()
z.e = z.a * z.b
z.f = z.a / z.b
z.ap = point.conj (z.a)
- -- = z.a : conj ()
+ % = z.a : conj ()
z.g = z.b* point(math.cos(math.pi/2),math.sin(math.pi/2))
}
@@ -472,8 +472,235 @@ init_elements ()
\end{tikzpicture}
\end{minipage}
+\begin{Verbatim}
+ \begin{tikzpicture}
+ \pgfkeys{/pgf/number format/.cd,use comma}
+ \let\pmpn\pgfmathprintnumber
+ \tkzGetNodes
+ \tkzDrawPolygon[cyan](A_1,A_...,A_\tkzUseLua{max})
+ \tkzDrawCircle[red](O,A_1)
+ \tkzDrawPoints[color=black](A_1,A_...,A_\tkzUseLua{max},O)
+ \tkzDrawSegments(O,A_1 O,A_2)
+ \tkzMarkAngle[size=2](A_1,O,A_2)
+ \tkzLabelAngle[pos=3.4](A_1,O,A_2){$\pmpn{\tkzUseLua{a}}^\circ$}
+ \end{tikzpicture}
+\end{Verbatim}
+
+
+
% subsection loop_and_table_notation (end)
+\subsection{Use of tables} % (fold)
+\label{sub:use_of_tables}
+
+\subsubsection{Working with tables} % (fold)
+\label{ssub:working_with_tables}
+In this example, we search for circles that are tangent to both a given circle and a line, demonstrating that their centers lie on a parabola.
+
+The \code{points} table contains the coordinates of the centers of the identified circles. \TIKZ only requires a list of coordinate pairs enclosed in brackets.
+The table that defines the circles is slightly more complex. It contains the centers and the tangency points between the circles and the given elements. These are sequences of four coordinates, stored in the table. Finally, the sequences are concatenated into a string using a comma (",") as the separator. Coordinates are read with the \tkzcname{foreach} macro, utilizing the |expand list| option.
+
+
+\begin{Verbatim}
+\makeatletter
+\def\tkzPlotCoordinates{\pgfutil@ifnextchar[{\tkz@PlotCoordinates}{\tkz@PlotCoordinates[]}}
+\def\tkz@PlotCoordinates[#1]#2{%
+\draw[#1] plot coordinates {\directlua{tex.print(#2)}};}
+\makeatother
+
+
+\directlua{
+scale =.5
+z.O = point : new (0,0)
+z.P = point : new (0,6)
+z.M = point : new (0,3)
+z.I = point : new (1,0)
+C.PM = circle : new (z.P,z.M)
+list = {}
+points = {}
+ for t = -0.24, 0.24, 0.004 do
+ if (t> - 0.002 and t< 0.002) then else
+ z.A = C.PM : point (t)
+ L.OI = line : new (z.O,z.I)
+ L.PA = line : new (z.P,z.A)
+ z.C = intersection (L.OI,L.PA)
+ L.tgt = C.PM : tangent_at (z.A)
+ z.X = intersection (L.tgt,L.OI)
+ z.o = bisector (z.X,z.A,z.C).pb
+ table.insert (points, "("..z.o.re..","..z.o.im..")")
+ table.insert (list,z.o.re.."/"..z.o.im.."/"..z.A.re.."/"..z.A.im)
+ end
+ end
+ list = table.concat(list,",")
+ }
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzPlotCoordinates[smooth,blue]{points}
+ \foreach[expand list] \r/\s/\u/\v in {\tkzUseLua{list}}
+{
+ \tkzDefPoint(\u,\v){A}
+ \tkzDefPoint(\r,\s){o}
+ \tkzDrawCircle(o,A)
+ \tkzDrawPoints[red,size=.2pt](o,A)
+}
+\tkzDrawCircles(P,M)
+\tkzDrawPoints(P,M)
+\end{tikzpicture}
+\end{Verbatim}
+
+\makeatletter
+\def\tkzPlotCoordinates{\pgfutil@ifnextchar[{\tkz@PlotCoordinates}{\tkz@PlotCoordinates[]}}
+\def\tkz@PlotCoordinates[#1]#2{%
+\draw[#1] plot coordinates {\directlua{tex.print(#2)}};}
+\makeatother
+
+
+\directlua{
+scale =.5
+z.O = point : new (0,0)
+z.P = point : new (0,6)
+z.M = point : new (0,3)
+z.I = point : new (1,0)
+C.PM = circle : new (z.P,z.M)
+list = {}
+points = {}
+ for t = -0.24, 0.24, 0.004 do
+ if (t> - 0.002 and t< 0.002) then else
+ z.A = C.PM : point (t)
+ L.OI = line : new (z.O,z.I)
+ L.PA = line : new (z.P,z.A)
+ z.C = intersection (L.OI,L.PA)
+ L.tgt = C.PM : tangent_at (z.A)
+ z.X = intersection (L.tgt,L.OI)
+ z.o = bisector (z.X,z.A,z.C).pb
+ table.insert (points, "("..z.o.re..","..z.o.im..")")
+ table.insert (list,z.o.re.."/"..z.o.im.."/"..z.A.re.."/"..z.A.im)
+ end
+ end
+ list = table.concat(list,",")
+ }
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzPlotCoordinates[smooth,blue]{points}
+ \foreach[expand list] \r/\s/\u/\v in {\tkzUseLua{list}}
+{
+ \tkzDefPoint(\u,\v){A}
+ \tkzDefPoint(\r,\s){o}
+ \tkzDrawCircle(o,A)
+ \tkzDrawPoints[red,size=.2pt](o,A)
+}
+\tkzDrawCircles(P,M)
+\tkzDrawPoints(P,M)
+\end{tikzpicture}
+
+% subsubsection working_with_tables (end)
+
+
+\subsubsection{Plotting a curve} % (fold)
+\label{ssub:plotting_a_curve}
+In this example, we'll use lua to plot the representative curve of the function
+\[ y = f(x) = x*exp(-x^2)+1\].
+
+We'll use a table called “points” to store the coordinates of the points on the curve.
+
+
+\makeatletter\let\percentchar\@percentchar\makeatother
+\directlua{
+function checknumber(x)
+ if string.find(x, "e") then
+ return string.format("\percentchar.12f",x)
+ else
+ return x
+ end
+end
+}
+
+\def\val#1{%
+\directlua{%
+ local expr = [[\tkzfct]]
+ local f = load (("
+ return function (x)
+ return (\percentchar s)
+ end"):format (expr), nil, 't', math) ()
+tex.print(f(#1))
+}}
+
+\def\calcval(#1,#2,#3,#4){%
+\directlua{
+local min, max, nb = #2, #3, #4
+local expr = [[#1]]
+local points = {}
+
+local f = load (("return function (x) return (\percentchar s) end"):format (expr), nil, 't', math) ()
+
+for t = min,max,(max-min)/nb do
+local x = checknumber(t)
+local y = checknumber(f(t))
+ table.insert (points, "("..x..","..y..")")
+ end
+ tex.print(points)
+ }
+}
+
+\def\tkzfct{x*exp(-x^2)+1}
+
+\begin{tikzpicture}[scale = 2]
+ \tkzInit[xmin=-3,xmax=3,ymin=-2,ymax=2]
+ \tkzDrawX\tkzDrawY
+ \draw[smooth] plot coordinates {\calcval(\tkzfct,-3,2,100)};
+ \tkzDrawPoint(-3,\val{-3})
+ \tkzDrawPoint(1,\val{1})
+ \tkzDrawPoint(2,\val{2})
+\end{tikzpicture}
+
+\begin{Verbatim}
+\makeatletter\let\percentchar\@percentchar\makeatother
+\directlua{
+function checknumber(x)
+ if string.find(x, "e") then
+ return string.format("\percentchar.12f",x)
+ else
+ return x
+ end
+end}
+\def\val#1{\directlua{%
+ local expr = [[\tkzfct]]
+ local f = load (("return function (x)
+ return (\percentchar s) end"):format (expr), nil, 't', math) ()
+tex.print(f(#1))
+}}
+\def\calcval(#1,#2,#3,#4){%
+\directlua{%
+ local min, max, nb = #2, #3, #4
+ local expr = [[#1]]
+ local points = {}
+ local f = load (("return function (x)
+ return (\percentchar s) end"):format (expr), nil, 't', math) ()
+for t = min,max,(max-min)/nb do
+ local x = checknumber(t)
+ local y = checknumber(f(t))
+ if (y==math.huge or y==-math.huge ) then tex.print("problem") end
+ table.insert (points, "("..x..","..y..")")
+ end
+ tex.print(points)
+}}
+\def\tkzfct{x*exp(-x^2)+1}
+\begin{tikzpicture}
+ \tkzInit[xmin=-3,xmax=3,ymin=-2,ymax=2]
+ \tkzDrawX\tkzDrawY
+ \draw[smooth] plot coordinates {\calcval(\tkzfct,-3,2,100)};
+ \tkzDrawPoint(-3,\val{-3})
+ \tkzDrawPoint(1,\val{1})
+ \tkzDrawPoint(2,\val{2})
+\end{tikzpicture}
+\end{Verbatim}
+
+% subsubsection plotting_a_curve (end)
+
+% ssubsection use_of_tables (end)
+
\subsection{In\_out method} % (fold)
\label{sub:in_out_method}
@@ -586,10 +813,10 @@ We've just seen how to use |^| to obtain the determinant associated with two vec
Here's the definition and transformation of the power of a complex number.
\begin{Verbatim}
- -- determinant is '^' ad - bc
+ % determinant is '^' ad - bc
function point.__pow(z1,z2)
local z
- z = point.conj(z1) * z2 -- (a-ib) (c+id) = ac+bd + i(ad - bc)
+ z = point.conj(z1) * z2 % (a-ib) (c+id) = ac+bd + i(ad - bc)
return z.im
end
\end{Verbatim}
@@ -602,10 +829,10 @@ Here's the definition and transformation of the power of a complex number.
Here's the definition of the dot product between two affixes and the concatenation transformation.
\begin{Verbatim}
--- dot product is '..' result ac + bd
+% dot product is '..' result ac + bd
function point.__concat(z1,z2)
local z
- z = z1 * point.conj(z2) -- (a+ib) (c-id) = ac+bd + i(bc-ad)
+ z = z1 * point.conj(z2) % (a+ib) (c-id) = ac+bd + i(bc-ad)
return z.re
end
\end{Verbatim}
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex
index 53eff14d51..acf50a22a1 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex
@@ -200,7 +200,7 @@ init_elements ()
z.e = L.ab: point (-.2)
E = ellipse: foci (z.a,z.b,z.e)
z.u,z.v = intersection (E,L.mn)
- -- transfer to tex
+ % transfer to tex
a = E.Rx
b = E.Ry
ang = math.deg(E.slope)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex
index bb067244d4..bba30de71a 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-inversion.tex
@@ -1,4 +1,4 @@
\section{Inversion} % (fold)
\label{sec:inversion}
-midcircless
+midcircles
% section inversion (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
index 427dfe3c2d..b520f6d058 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex
@@ -1,6 +1,6 @@
% !TEX TS-program = lualatex
% encoding : utf8
-% Documentation of tkz-elements v3.00c
+% Documentation of tkz-elements v3.10c
% Copyright 2024 Alain Matthes
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -21,10 +21,10 @@
headings = small
]{tkz-doc}
\gdef\tkznameofpack{tkz-elements}
-\gdef\tkzversionofpack{3.00c}
+\gdef\tkzversionofpack{3.10c}
\gdef\tkzdateofpack{\today}
\gdef\tkznameofdoc{tkz-elements.pdf}
-\gdef\tkzversionofdoc{3.00c}
+\gdef\tkzversionofdoc{3.10c}
\gdef\tkzdateofdoc{\today}
\gdef\tkzauthorofpack{Alain Matthes}
\gdef\tkzadressofauthor{}
@@ -66,6 +66,8 @@
\usepackage{fontspec}
\setmainfont{texgyrepagella}[
+ UprightFont = texgyrepagella-regular.otf,
+ SmallCapsFeatures={FakeSmallCaps},
Extension = .otf,
UprightFont = *-regular ,
ItalicFont = *-italic ,
@@ -78,7 +80,8 @@
ItalicFont = *-italic ,
BoldFont = *-bold ,
BoldItalicFont = *-bolditalic ,
-]
+ BoldItalicFeatures = {RawFeature=-smcp} % Désactiver smcp
+ ]
\setmonofont{lmmono10-regular.otf}[
Numbers={Lining,SlashedZero},
@@ -178,10 +181,11 @@ sharp corners
\tkzTitleFrame{tkz-elements \tkzversionofpack\\Euclidean Geometry}
\clearpage
-\defoffile{\lefthand\
+
+\defoffile{\lefthand\ \\
This document compiles some notes about \tkzname{\tkznameofpack}, the initial version of a \code{Lua} library designed to perform all the necessary calculations for defining objects in Euclidean geometry figures. Your document must be compiled using Lua\LaTeX.\\
With \pkg{tkz-elements}, definitions and calculations are exclusively conducted using \pkg{Lua}. \\
- The primary programming approach offered is oriented towards \code{object programming}, utilizing object classes such as point, line, triangle, circle, and ellipse. Currently, after the calculations are completed, \pkg{tkz-euclide} or \pkg{TikZ} is used for drawing purposes.\\
+ The primary programming approach offered is oriented towards object programming, utilizing object classes such as point, line, triangle, circle, and ellipse. Currently, after the calculations are completed, \pkg{tkz-euclide} is used for drawing purposes. (but you can use \TIKZ)\\
I discovered Lua and object-oriented programming while developing this package, so it's highly likely that I've made a few mistakes. If you'd like to contribute to the development of this package or provide advice on how to proceed, please contact me via email.
}
@@ -236,6 +240,7 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
\input{TKZdoc-elements-classes-misc.tex}
\input{TKZdoc-elements-intersection.tex}
\input{TKZdoc-elements-indepthstudy.tex}
+\input{TKZdoc-elements-theorems.tex}
\input{TKZdoc-elements-examples.tex}
\clearpage\newpage
@@ -246,7 +251,7 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
\label{sec:cheat_sheet}
% section cheat_sheet (end)
-|r| denotes a real number, |cx| complex number, |d| a positive real number, |n| an integer, |an| an angle, |b| a boolean, |s| a character string, |pt| a point, |t| a table, |m| a matrix, |v| variable, |L| a straight line, |C| a circle, |T| a triangle, |E| an ellipse, |V| a vector,|Q| a quadrilateral, |P| a parallelogram, |R| a rectangle, |S| a square, |RP| a regular polygon, |M| a matrix, |O| an object (pt, L,C,T), . . a list of points or an object, < > optional argument.
+|r| denotes a real number, |cx| complex number, |d| a positive real number, |n| an integer, |an| an angle, |b| a boolean, |s| a character string, |p| a point, |t| a table, |m| a matrix, |v| variable, |L| a straight line, |C| a circle, |T| a triangle, |E| an ellipse, |V| a vector,|Q| a quadrilateral, |P| a parallelogram, |R| a rectangle, |S| a square, |RP| a regular polygon, |M| a matrix, |O| an object (p, L,C,T), . . a list of points or an object, < > optional argument.
\begin{multicols}{3}
\fbox{\textbf{point}}\\
@@ -257,82 +262,87 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
|argument -> r| \\
|modulus -> d| \\
\textbf{Functions} table(\ref{point:att}) \\
-|new -> pt| \\
-|polar -> pt| \\
-|polar_deg -> pt| \\
+|new -> p| \\
+|polar -> p| \\
+|polar_deg -> p| \\
\textbf{Methods} table(\ref{complex:meta}) \\
-|+ - * / (pt,pt) -> pt| \\
-|.. (pt,pt) -> r| \\
-|^ (pt,pt) -> r| \\
+|+ - * / (p,p) -> p| \\
+|.. (p,p) -> r| \\
+|^ (p,p) -> r| \\
|= -> b| \\
|tostring -> s| \\
\textbf{Methods} table(\ref{point:met}) table(\ref{complex:met}) \\
-|conj -> pt| \\
+|conj -> p| \\
|abs -> r| \\
|mod -> d| \\
|norm -> d| \\
|arg -> d| \\
|get -> r,r| \\
-|sqrt -> pt| \\
-|north(d) -> pt| \\
-|south(d) -> pt| \\
-|east(d) -> pt| \\
-|west(d) -> pt| \\
-|normalize(pt) -> pt| \\
+|sqrt -> p| \\
+|north(d) -> p| \\
+|south(d) -> p| \\
+|east(d) -> p| \\
+|west(d) -> p| \\
+|normalize(p) -> p| \\
|symmetry (...) -> O| \\
|rotation (an , ...) -> O| \\
|homothety (r , ...) -> O| \\
-|orthogonal(d) -> pt| \\
-|at() -> pt| \\
+|orthogonal(d) -> p| \\
+|at() -> p| \\
|print() -> s| \\
\\
\fbox{\textbf{line}} \\
\textbf{Attributes} table(\ref{line:att}) \\
-|pa,pb -> pt| \\
+|pa,pb -> p| \\
|type -> s| \\
-|mid -> pt| \\
-|north_pa -> pt| \\
-|north_pb -> pt| \\
-|south_pa -> pt| \\
-|south_pb -> pt| \\
-|east -> pt| \\
-|west -> pt| \\
+|mid -> p| \\
+|north_pa -> p| \\
+|north_pb -> p| \\
+|south_pa -> p| \\
+|south_pb -> p| \\
+|east -> p| \\
+|west -> p| \\
|slope -> r| \\
|length -> d| \\
|vec -> V| \\
\textbf{Methods} table(\ref{line:met}) \\
-|new (pt,pt) -> d| \\
-|distance (pt) -> d| \\
+|new (p,p) -> d| \\
+|distance (p) -> d| \\
|slope () -> r| \\
-|in_out (pt) -> b| \\
-|in_out_segment (pt) -> b| \\
-|barycenter (r,r) -> pt| \\
-|point (t) -> pt| \\
-|midpoint () -> pt| \\
-|harmonic_int (pt) -> pt| \\
-|harmonic_ext (pt) -> pt| \\
-|harmonic_both (d) -> pt| \\
-|gold_ratio() -> pt| \\
-|normalize () -> pt| \\
-|normalize_inv () -> pt| \\
-|_north_pa (d) -> pt| \\
-|_north_pb (d) -> pt| \\
-|_south_pa (d) -> pt| \\
-|_south_pb (d) -> pt| \\
-|_east (d) -> pt| \\
-|_west (d) -> pt| \\
-|report (r,pt) -> pt| \\
-|colinear_at (pt,k) -> pt| \\
+|in_out (p) -> b| \\
+|in_out_segment (p) -> b| \\
+|is_parallel (l) -> b| \\
+|is_orthogonal (l) -> b| \\
+|is_equidistant (p) -> b| \\
+|barycenter (r,r) -> p| \\
+|point (t) -> p| \\
+|midpoint () -> p| \\
+|harmonic_int (p) -> p| \\
+|harmonic_ext (p) -> p| \\
+|harmonic_both (d) -> p| \\
+|gold_ratio() -> p| \\
+|normalize () -> p| \\
+|normalize_inv () -> p| \\
+|_north_pa (d) -> p| \\
+|_north_pb (d) -> p| \\
+|_south_pa (d) -> p| \\
+|_south_pb (d) -> p| \\
+|_east (d) -> p| \\
+|_west (d) -> p| \\
+|report (r,p) -> p| \\
+|colinear_at (p,k) -> p| \\
|translation (...) -> O| \\
|projection (...) -> O| \\
|reflection (...) -> O| \\
-|ll_from ( pt ) -> L| \\
-|ortho_from ( pt ) -> L| \\
+|ll_from ( p ) -> L| \\
+|ortho_from ( p ) -> L| \\
|mediator () -> L| \\
|circle () -> C| \\
|circle_swap () -> C| \\
|diameter () -> C| \\
-|apollonius (r) -> C| \\
+|apollonius (r) -> C| \\
+|c_ll_p (p,p) -> C| \\
+|c_l_pp (p,p) -> C| \\
|equilateral (<swap>) -> T| \\
|isosceles (an,<swap>) -> T| \\
|school () -> T| \\
@@ -353,13 +363,13 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
\\
\fbox{\textbf{triangle}} \\
\textbf{Attributes} table(\ref{triangle:att}) \\
-|pa,pb,pc -> pt| \\
-|circumcenter -> pt| \\
-|centroid -> pt| \\
-|incenter -> pt| \\
-|eulercenter -> pt| \\
-|orthocenter -> pt| \\
-|spiekercenter -> pt| \\
+|pa,pb,pc -> p| \\
+|circumcenter -> p| \\
+|centroid -> p| \\
+|incenter -> p| \\
+|eulercenter -> p| \\
+|orthocenter -> p| \\
+|spiekercenter -> p| \\
|type -> s| \\
|a -> d| \\
|b -> d| \\
@@ -371,30 +381,30 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
|beta -> r| \\
|gamma -> r| \\
\textbf{Methods} table(\ref{triangle:met}) \\
-|new (pt,pt,pt) -> pt| \\
-|trilinear (r,r,r) -> pt| \\
-|barycentric (r,r,r) -> pt| \\
-|bevan_point () -> pt| \\
-|mittenpunkt_point () -> pt| \\
-|gergonne_point () -> pt| \\
-|nagel_point () -> pt| \\
-|feuerbach_point () -> pt| \\
-|lemoine_point() -> pt| \\
-|symmedian_point() -> pt| \\
-|spieker_center() -> pt| \\
-|barycenter (r,r,r) -> pt| \\
-|base (u,v) -> pt| \\
-|euler_points () -> pt| \\
-|nine_points () -> pt| \\
-|point (t) -> pt| \\
-|soddy_center () -> pt| \\
-|conway_points () -> pts| \\
+|new (p,p,p) -> p| \\
+|trilinear (r,r,r) -> p| \\
+|barycentric (r,r,r) -> p| \\
+|bevan_point () -> p| \\
+|mittenpunkt_point () -> p| \\
+|gergonne_point () -> p| \\
+|nagel_point () -> p| \\
+|feuerbach_point () -> p| \\
+|lemoine_point() -> p| \\
+|symmedian_point() -> p| \\
+|spieker_center() -> p| \\
+|barycenter (r,r,r) -> p| \\
+|base (u,v) -> p| \\
+|euler_points () -> p| \\
+|nine_points () -> p| \\
+|point (t) -> p| \\
+|soddy_center () -> p| \\
+|conway_points () -> pts| \\
|euler_line () -> L| \\
|symmedian_line (n) -> L| \\
|altitude (n) -> L| \\
|bisector (n) -> L| \\
|bisector_ext(n) -> L| \\
-|antiparallel(pt,n) -> L| \\
+|antiparallel(p,n) -> L| \\
|euler_circle () -> C| \\
|circum_circle() -> C| \\
|in_circle () -> C| \\
@@ -406,6 +416,7 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
|conway_circle () -> C| \\
|pedal_circle () -> C| \\
|cevian_circle () -> C| \\
+|c_ll_p (p) -> C| \\
|orthic() -> T| \\
|medial() -> T| \\
|incentral() -> T| \\
@@ -416,155 +427,160 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
|feuerbach() -> T| \\
|anti () -> T| \\
|tangential () -> T| \\
-|cevian (pt) -> T| \\
+|cevian (p) -> T| \\
|symmedian () -> T| \\
|euler () -> T| \\
-|pedal (pt) -> T| \\
-|projection (pt) -> pt,pt,pt| \\
-|parallelogram () -> pt| \\
+|pedal (p) -> T| \\
+|projection (p) -> p,p,p| \\
+|parallelogram () -> p| \\
|area () -> d| \\
-|barycentric_coordinates(pt)| \\
+|barycentric_coordinates(p)| \\
|-> r,r,r| \\
-|in_out (pt) -> pt| \\
+|in_out (p) -> p| \\
|check_equilateral () -> b| \\
\\
\fbox{\textbf{circle}} \\
\textbf{Attributes} table(\ref{circle:att}) \\
-|center -> pt| \\
-|through -> pt| \\
-|north -> pt| \\
-|south -> pt| \\
-|east -> pt| \\
-|west -> pt| \\
-|opp -> pt| \\
+|center -> p| \\
+|through -> p| \\
+|north -> p| \\
+|south -> p| \\
+|east -> p| \\
+|west -> p| \\
+|opp -> p| \\
|type -> s| \\
|radius -> d| \\
|ct -> L| \\
+|perimeter -> r| \\
+|area -> r| \\
\textbf{Methods} table(\ref{circle:met}) \\
-|new (pt,pt) -> C| \\
-|radius (pt, r) -> C| \\
-|diameter (pt,pt) -> C| \\
-|in_out (pt) -> b| \\
-|in_out_disk (pt) -> b| \\
-|circles_position (C) -> s| \\
-|power (pt) -> r| \\
-|antipode (pt) -> pt| \\
-|midarc (pt,pt) -> pt| \\
-|point (r) -> pt| \\
-|random_pt (lower, upper) -> pt| \\
-|internal_similitude (C) -> pt| \\
-|external_similitude (C) -> pt| \\
-|radical_center(C,<C>) -> pt| \\
-|tangent_at (pt) -> L| \\
-|radical_axis (C) -> L| \\
-|radical_circle(C,<C>) -> C| \\
-|orthogonal_from (pt) -> C| \\
-|orthogonal_through(pt,pt) -> C| \\
+|new (p,p) -> C| \\
+|radius (p, r) -> C| \\
+|diameter (p,p) -> C| \\
+|in_out (p) -> b| \\
+|in_out_disk (p) -> b| \\
+|circles_position (C) -> s| \\
+|power (p) -> r| \\
+|antipode (p) -> p| \\
+|midarc (p,p) -> p| \\
+|point (r) -> p| \\
+|random_pt (lower, upper) -> p| \\
+|internal_similitude (C) -> p| \\
+|external_similitude (C) -> p| \\
+|radical_center(C,<C>) -> p| \\
+|tangent_at (p) -> L| \\
+|radical_axis (C) -> L| \\
+|radical_circle(C,<C>) -> C| \\
+|orthogonal_from (p) -> C| \\
+|orthogonal_through(p,p) -> C| \\
+|c_lc_p (L,p,inside) -> C| \\
+|c_c_pp(a,b)(p,p) -> C| \\
+|c_cc_p (C,p) -> C| \\
|midcircle(C) -> C| \\
|external_tangent(C) -> L,L| \\
|internal_tangent(C) -> L,L| \\
|common_tangent(C) -> L,L| \\
-|tangent_from (pt) -> L,L| \\
+|tangent_from (p) -> L,L| \\
|inversion (...) -> O | \\
\\
\fbox{\textbf{ellipse}} \\
-\textbf{Attributes} table(\ref{ellipse:met}) \\
-|center -> pt| \\
-|vertex -> pt| \\
-|covertex -> pt| \\
-|Fa -> pt| \\
-|Fb -> pt| \\
-|north -> pt| \\
-|south -> pt| \\
-|east -> pt| \\
-|west -> pt| \\
+\textbf{Attributes} table(\ref{ellipse:met}) \\
+|center -> p| \\
+|vertex -> p| \\
+|covertex -> p| \\
+|Fa -> p| \\
+|Fb -> p| \\
+|north -> p| \\
+|south -> p| \\
+|east -> p| \\
+|west -> p| \\
|Rx -> d| \\
|Ry -> d| \\
|slope -> r| \\
|type -> s| \\
\textbf{Methods} table(\ref{ellipse:met}) \\
-|new (pt,pt,pt) -> E| \\
-|foci (pt,pt,pt) -> E| \\
-|radii (pt,r,r,an) -> E| \\
-|in_out (pt) -> b| \\
-|tangent_at (pt) -> L| \\
-|tangent_from (pt) -> L| \\
-|point (r) -> pt| \\
+|new (p,p,p) -> E| \\
+|foci (p,p,p) -> E| \\
+|radii (p,r,r,an) -> E| \\
+|in_out (p) -> b| \\
+|tangent_at (p) -> L| \\
+|tangent_from (p) -> L| \\
+|point (r) -> p| \\
\\
-\fbox{\textbf{square}} \\
- \textbf{Attributes} table(\ref{square:att}) \\
-|pa,pb,pc,pd -> pt| \\
+\fbox{\textbf{square}} \\
+ \textbf{Attributes} table(\ref{square:att}) \\
+|pa,pb,pc,pd -> p| \\
|type -> s| \\
|side -> d| \\
-|center -> pt| \\
-|exradius -> d| \\
+|center -> p| \\
+|circumradius -> d| \\
|inradius -> d| \\
|diagonal -> d| \\
-|proj -> pt| \\
+|proj -> p| \\
|ab bc cd da -> L| \\
|ac bd -> L| \\
- \textbf{Methods} table(\ref{square:met}) \\
-|new (pt,pt,pt,pt) -> S| \\
-|rotation (pt,pt) -> S| \\
-|side (pt,pt,<swap>) -> S| \\
+ \textbf{Methods} table(\ref{square:met}) \\
+|new (p,p,p,p) -> S| \\
+|rotation (p,p) -> S| \\
+|side (p,p,<swap>) -> S| \\
\\
\fbox{\textbf{rectangle}} \\
\textbf{Attributes} table(\ref{rectangle:att}) \\
-|pa,pb,pc,pd -> pt| \\
+|pa,pb,pc,pd -> p| \\
|type -> s| \\
-|center -> pt| \\
-|exradius -> d| \\
+|center -> p| \\
+|circumradius -> d| \\
|length -> r| \\
|width -> r| \\
|diagonal -> d| \\
|ab bc cd da -> L| \\
|ac bd -> L| \\
\textbf{Methods} table(\ref{rectangle:met}) \\
-|new (pt,pt,pt,pt) -> R| \\
-|angle (pt,pt,an) -> R| \\
-|gold (pt,pt,<swap>) -> R| \\
-|diagonal (pt,pt,<swap>) -> R| \\
-|side (pt,pt,r,<swap>) -> R| \\
+|new (p,p,p,p) -> R| \\
+|angle (p,p,an) -> R| \\
+|gold (p,p,<swap>) -> R| \\
+|diagonal (p,p,<swap>) -> R| \\
+|side (p,p,r,<swap>) -> R| \\
|get_lengths () ->r,r| \\
\\
\fbox{\textbf{quadrilateral} } \\
\textbf{Attributes} table(\ref{quadrilateral:att}) \\
-|pa,pb,pc,pd -> pt| \\
+|pa,pb,pc,pd -> p| \\
|ab bc cd da -> L | \\
|ac bd -> L | \\
|type -> s | \\
-|i -> pt| \\
-|g -> pt| \\
+|i -> p| \\
+|g -> p| \\
|a b c d -> r| \\
\textbf{Methods} table(\ref{quadrilateral:met}) \\
-|new (pt,pt,pt,pt) -> Q| \\
+|new (p,p,p,p) -> Q| \\
|iscyclic () -> b| \\
\\
\fbox{\textbf{parallelogram}} \\
\textbf{Attributes} table(\ref{parallelogram:att}) \\
-|pa,pb,pc,pd -> pt| \\
+|pa,pb,pc,pd -> p| \\
|ab bc cd da -> L | \\
|ac bd -> L | \\
|type -> s | \\
-|center -> pt| \\
+|center -> p| \\
\textbf{Methods} table(\ref{parallelogram:met}) \\
-|new (pt,pt,pt,pt) ->| \\
-|fourth (pt,pt,pt) ->| \\
+|new (p,p,p,p) ->| \\
+|fourth (p,p,p) ->| \\
\\
\fbox{\textbf{Regular\_polygon}} \\
\textbf{Attributes} table(\ref{regular:att}) \\
-|center -> pt| \\
-|through -> pt | \\
+|center -> p| \\
+|through -> p | \\
|circle -> C | \\
|type -> s | \\
|side -> d| \\
-|exradius -> d| \\
+|circumradius -> d| \\
|inradius -> d| \\
-|proj -> pt| \\
+|proj -> p| \\
|nb -> i| \\
|angle -> an| \\
\textbf{Methods} table(\ref{regular:met}) \\
-|new (pt,pt,n) -> PR| \\
+|new (p,p,n) -> PR| \\
|incircle () -> C| \\
|name (s) -> ?| \\
\\
@@ -575,12 +591,12 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
|slope -> r| \\
|mtx -> M| \\
\textbf{Methods} table(\ref{vector:met}) \\
-|new (pt,pt) -> V| \\
-|+ - * -> pt| \\
+|new (p,p) -> V| \\
+|+ - * -> p| \\
|normalize (V) -> V| \\
|orthogonal (d) -> V| \\
|scale (r) -> V| \\
-|at (pt) -> V| \\
+|at (p) -> V| \\
\fbox{\textbf{matrix}} \\
\textbf{Attributes} table(\ref{matrix:att}) \\
|set -> t| \\
@@ -617,23 +633,24 @@ Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ arch
|tkzsqrtphi -> r| \\
|tkz_epsilon (default=1e-8)-> r| \\
|length -> d| \\
-|islinear(pt,pt,pt) -> b| \\
-|isortho(pt,pt,pt) -> b| \\
+|islinear(p,p,p) -> b| \\
+|isortho(p,p,p) -> b| \\
|value{r} -> r| \\
|real -> r| \\
|angle_normalize (an) -> an| \\
-|barycenter (...) -> pt| \\
-|bisector (pt,pt,pt) -> L| \\
-|bisector_ext (pt,pt,pt) -> L| \\
-|altitude (pt,pt,pt) -> L| \\
-|midpoint (pt,pt) -> pt| \\
-|equilateral (pt,pt) -> T| \\
+|barycenter (...) -> p| \\
+|bisector (p,p,p) -> L| \\
+|bisector_ext (p,p,p) -> L| \\
+|altitude (p,p,p) -> L| \\
+|midpoint (p,p) -> p| \\
+|midpoints (...) -> list of pts| \\
+|equilateral (p,p) -> T| \\
|format_number(r,n) -> r| \\
-|solve_quadratic(cx,cx,cx) -> cx,cx| \\
+|solve_quadratic(cx,cx,cx)-> cx,cx|\\
|\tkzUseLua{v} -> s| \\
\\
\fbox{\textbf{Macros}} \\
|\tkzDN[n]{r} -> r| \\
-|\tkzDrawLuaEllipse((pt,pt,pt))| \\
+|\tkzDrawLuaEllipse((p,p,p))| \\
\end{multicols}
\end{document} \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-news.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-news.tex
index 9eb6544054..c84a94b397 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-news.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-news.tex
@@ -1,11 +1,9 @@
\section{News} % (fold)
\label{sec:news}
-The documentation you are reading corresponds to the latest version 3.0 of \tkzNamePack{tkz-elements}. This version introduces an important new feature: the code \code{Lua} part of the code can now be processed using the \Iprimitive{directlua} primitive of \Iengine{Lua\LaTeX}. See the examples given in the Transfers section.
-
-This introduces a slight complication whatever the method used to execute the \code{Lua} code. If you want to use the \tkzNameEnv{tkzelements} environment, then you need to load the \pkg{luacode} package. If you prefer to use the |\directlua| primitive, you'll need to delete and reset the tables and \Igfct{tkz-elements}{scale} with the \Igfct{tkz-elements}{init\_elements} function.
-
-Some complex examples require the use of the \Iprimitive{directlua} primitive.
+The documentation you are reading corresponds to the latest version (3.10c) of \tkzNamePack{tkz-elements}.
+One significant feature introduced in version 3.0 was the use of the \Iprimitive{directlua} macro, replacing the \tkzNameEnv{tkzelements} environment.
+In this new version , most functions have been optimized and quelques méthodes apparaissent. In particular, methods for determining a circle tangent to different objects. (see \ref{ssub:c_l_pp}; \ref{ssub:method_c__ll__p}; \ref{ssub:method_c__c__pp}; \ref{ssub:method_c_cc_p}; \ref{ssub:method_c_lc_p}; and \ref{ssub:tr_method_c__ll__p})
% section news (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex
index 22025d1146..480b9d834d 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-organization.tex
@@ -18,11 +18,10 @@ Another advantage is that you don't have to incorrectly comment the code. For Lu
A third advantage is that the code can be reused.
-
+\begin{minipage}{.5\textwidth}
\begin{Verbatim}
% !TEX TS-program = lualatex
% Created by Alain Matthes on 2024-01-09.
-
\documentclass[margin = 12pt]{standalone}
\usepackage[mini]{tkz-euclide}
\usepackage{tkz-elements,ifthen}
@@ -32,7 +31,6 @@ A third advantage is that the code can be reused.
scale = 1.25
dofile ("sangaku.lua")
}
-
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircle(I,F)
@@ -42,37 +40,45 @@ A third advantage is that the code can be reused.
\end{tikzpicture}
\end{document}
\end{Verbatim}
-
-And here is the code for the \code{Lua} part: the file |ex_sangaku.lua|
-
-\begin{Verbatim}
-z.A = point : new ( 0,0 )
-z.B = point : new ( 8,0 )
-L.AB = line : new ( z.A , z.B )
-S = L.AB : square ()
-_,_,z.C,z.D = get_points (S)
-z.F = S.ac : projection (z.B)
-L.BF = line : new (z.B,z.F)
-T.ABC = triangle : new ( z.A , z.B , z.C )
-L.bi = T.ABC : bisector (2)
-z.c = L.bi.pb
-L.Cc = line : new (z.C,z.c)
-z.I = intersection (L.Cc,L.BF)
-\end{Verbatim}
-
+\end{minipage}
+\begin{minipage}{.5\textwidth}
\directlua{
init_elements ()
- scale = 1.25
+ scale = .75
dofile ("sangaku.lua")
}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzDrawCircle(I,F)
- \tkzFillPolygon[color = purple](A,C,D)%
- \tkzFillPolygon[color = blue!50!black](A,B,C)%
- \tkzFillCircle[color = orange](I,F)%
-\end{tikzpicture}
+\begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawCircle(I,F)
+ \tkzFillPolygon[color = purple](A,C,D)%
+ \tkzFillPolygon[color = blue!50!black](A,B,C)%
+ \tkzFillCircle[color = orange](I,F)%
+ \end{tikzpicture}
+\end{center}
+
+\end{minipage}
+And here is the code for the \code{Lua} part: the file |ex_sangaku.lua|
+
+\begin{minipage}{.5\textwidth}
+\begin{mybox}
+ \begin{Verbatim}
+ z.A = point : new ( 0,0 )
+ z.B = point : new ( 8,0 )
+ L.AB = line : new ( z.A , z.B )
+ S = L.AB : square ()
+ _,_,z.C,z.D = get_points (S)
+ z.F = S.ac : projection (z.B)
+ L.BF = line : new (z.B,z.F)
+ T.ABC = triangle : new ( z.A , z.B , z.C )
+ L.bi = T.ABC : bisector (2)
+ z.c = L.bi.pb
+ L.Cc = line : new (z.C,z.c)
+ z.I = intersection (L.Cc,L.BF)
+ \end{Verbatim}
+\end{mybox}
+\end{minipage}
\subsection{Scale problem} % (fold)
\label{sub:scale_problem}
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex
index 195a691064..3a6a66bf51 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex
@@ -186,7 +186,7 @@ Here's another example with comments
C.ins = T.ABC: in_circle () % we get the incircle of this triangle
z.I = C.ins.center % center is an attribute of the circle
z.T = C.ins.through % through is also an attribute
- -- z.I,z.T = get_points (C.ins) % get_points is a shortcut
+ % z.I,z.T = get_points (C.ins) % get_points is a shortcut
C.cir = T.ABC : circum_circle () % we get the circumscribed circle
z.W = C.cir.center % we get the center of this circle
z.O = C.cir.south % now we get the south pole of this circle
@@ -228,7 +228,8 @@ Here's another example with comments
\tkzLabelPoints[above](A)
\end{tikzpicture}
\hspace*{\fill}
-%
+
+\vspace{12pt}
Here's the tikzpicture environment to obtain the drawing:
\begin{Verbatim}
\begin{tikzpicture}
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-theorems.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-theorems.tex
new file mode 100644
index 0000000000..681bae5392
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-theorems.tex
@@ -0,0 +1,747 @@
+\newpage
+
+\section{Some theorems} % (fold)
+\label{sec:some_theorems}
+
+\subsection{Viviani's Theorem} % (fold)
+\label{sub:viviani_s_theorem}
+Viviani's theorem, named after Vincenzo Viviani, states that the sum of the shortest distances from any interior point to the sides of an equilateral triangle equals the length of the triangle's altitude.
+[Wikipedia].
+
+Here's the visual demonstration I gave at the CAPES oral exam in 1989 to become a teacher.
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+z.A = point: new (0 , 0)
+z.B = point: new (8 , 0)
+L.AB = line: new (z.A,z.B)
+T.equ = L.AB:equilateral ()
+z.C = T.equ.pc
+z.I = point:new (3,2)
+L.IAB = T.equ.ab:ll_from(z.I)
+L.IBC = T.equ.bc:ll_from(z.I)
+L.ICA = T.equ.ca:ll_from(z.I)
+z.b = intersection(L.IAB,T.equ.ca)
+z.a = intersection(L.IAB,T.equ.bc)
+z.c = intersection(L.IBC,T.equ.ab)
+z.d = intersection(L.IBC,T.equ.ca)
+z.e = intersection(L.ICA,T.equ.ab)
+z.f = intersection(L.ICA,T.equ.bc)
+L.last = T.equ.ab:ll_from(z.f)
+z.g = intersection(L.last,T.equ.ca)
+z.pC = L.last:projection(z.C)
+z.pIca = T.equ.ca:projection(z.I)
+z.pIbc = T.equ.bc:projection(z.I)
+z.pIAB = L.IAB:projection(z.f)
+z.pIab = T.equ.ab:projection(z.I)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygons(A,B,C)
+\tkzDrawSegments(a,b c,d e,f f,g)
+\tkzDrawSegments[red,thick](C,pC I,pIab f,pIAB)
+\tkzDrawSegments[red, dashed](I,pIbc I,pIca)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+z.A = point: new (0 , 0)
+z.B = point: new (8 , 0)
+L.AB = line: new (z.A,z.B)
+T.equ = L.AB:equilateral ()
+z.C = T.equ.pc
+z.I = point:new (3,2)
+L.IAB = T.equ.ab:ll_from(z.I)
+L.IBC = T.equ.bc:ll_from(z.I)
+L.ICA = T.equ.ca:ll_from(z.I)
+z.b = intersection(L.IAB,T.equ.ca)
+z.a = intersection(L.IAB,T.equ.bc)
+z.c = intersection(L.IBC,T.equ.ab)
+z.d = intersection(L.IBC,T.equ.ca)
+z.e = intersection(L.ICA,T.equ.ab)
+z.f = intersection(L.ICA,T.equ.bc)
+L.last = T.equ.ab:ll_from(z.f)
+z.g = intersection(L.last,T.equ.ca)
+z.pC = L.last:projection(z.C)
+z.pIca = T.equ.ca:projection(z.I)
+z.pIbc = T.equ.bc:projection(z.I)
+z.pIAB = L.IAB:projection(z.f)
+z.pIab = T.equ.ab:projection(z.I)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygons(A,B,C)
+\tkzDrawSegments(a,b c,d e,f f,g)
+\tkzDrawSegments[red,thick](C,pC I,pIab f,pIAB)
+\tkzDrawSegments[red, dashed](I,pIbc I,pIca)
+\end{tikzpicture}
+\end{minipage}
+
+% subsection viviani_s_theorem (end)
+
+
+\subsection{Reuschle's theorem} % (fold)
+\label{sub:reuschle_s_theorem}
+In elementary geometry, Reuschle's theorem describes a property of the cevians of a triangle intersecting in a common point and is named after the German mathematician Karl Gustav Reuschle (1812–1875). It is also known as Terquem's theorem after the French mathematician Olry Terquem (1782–1862), who published it in 1842.
+
+\vspace{6pt}
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+z.A = point:new(0, 0)
+z.B = point:new(8, 0)
+z.C = point:new(5, 5)
+z.P = point:new(4, 2)
+T.ABC = triangle:new(z.A,z.B,z.C)
+T.cev = T.ABC:cevian (z.P)
+z.D,
+z.E,
+z.F = get_points(T.cev)
+C.cev = T.ABC :cevian_circle (z.P)
+z.O = C.cev.center
+z.T = C.cev.through
+z.G = intersection(C.cev,T.ABC.ca)
+_,z.H = intersection(C.cev,T.ABC.ab)
+z.I = intersection(C.cev,T.ABC.bc)
+L.AI = line:new(z.A,z.I)
+L.BG = line:new(z.B,z.G)
+z.K = intersection(L.AI,L.BG)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygons(A,B,C)
+\tkzDrawPoints(A,...,I,P,K)
+\tkzDrawSegments(A,D B,E C,F A,I B,G C,H)
+\tkzDrawCircle(O,T)
+\tkzLabelPoints[below](A,B)
+\tkzLabelPoints[above](C,I,E,D,G,K)
+\tkzLabelPoints[below](F,P,H)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+z.C = point : new ( 5 , 5 )
+z.P = point : new ( 4 , 2 )
+T.ABC = triangle : new (z.A,z.B,z.C)
+T.cev = T.ABC : cevian (z.P)
+z.D,
+z.E,
+z.F = get_points(T.cev)
+C.cev = T.ABC :cevian_circle (z.P)
+z.O = C.cev.center
+z.T = C.cev.through
+z.G = intersection(C.cev,T.ABC.ca)
+_,z.H = intersection(C.cev,T.ABC.ab)
+z.I = intersection(C.cev,T.ABC.bc)
+L.AI = line:new(z.A,z.I)
+L.BG = line:new(z.B,z.G)
+z.K = intersection(L.AI,L.BG)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygons(A,B,C)
+\tkzDrawPoints(A,...,I,P,K)
+\tkzDrawSegments(A,D B,E C,F A,I B,G C,H)
+\tkzDrawCircle(O,T)
+\tkzLabelPoints[below](A,B)
+\tkzLabelPoints[above](C,I,E,D,G,K)
+\tkzLabelPoints[below](F,P,H)
+\end{tikzpicture}
+\end{minipage}
+
+% subsection reuschle_s_theorem (end)
+
+\subsection{Thébault's problem III} % (fold)
+\label{sub:thebault_s_problemIII}
+Given any triangle ABC, and any point M on BC, construct the incircle and circumcircle of the triangle. Then construct two additional circles, each tangent to AM, BC, and to the circumcircle. Then their centers and the center of the incircle are collinear.[wikipedia]
+\vspace{6pt}
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new(0, 0)
+z.B = point : new(8, 0)
+z.C = point : new(1, 6)
+z.M = point : new(5, 0)
+L.CM = line:new(z.C,z.M)
+T.ABC = triangle:new(z.A,z.B,z.C)
+C.circ = T.ABC:circum_circle()
+z.O = C.circ.center
+C.ins = T.ABC:in_circle()
+z.I = C.ins.center
+z.T = C.ins.through
+L.ll = T.ABC.ab: ll_from(z.I)
+z.Q = intersection(L.ll,L.CM)
+C.QI = circle:new(z.Q,z.I)
+z.R,z.S= intersection(C.QI,L.CM)
+L.BMC = bisector(z.M,z.B,z.C)
+z.x = L.BMC.pb
+L.CMA = bisector(z.M,z.C,z.A)
+z.y = L.CMA.pb
+L.pS = L.CM:ortho_from(z.S)
+L.pR = L.CM:ortho_from(z.R)
+z.J = intersection(L.pS,L.CMA)
+z.K = intersection(L.pR,L.BMC)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawSegments(C,M)
+\tkzDrawLines(J,K I,Q)
+\tkzDrawCircles(O,A I,T Q,I J,S K,R)
+\tkzDrawPoints(A,B,C,M,Q,I,R,S,J,K)
+\tkzLabelPoints(A,B,C,M,Q,I,R,S,J,K)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+z.C = point : new (1 , 6 )
+z.M = point : new (5 , 0 )
+L.CM = line:new(z.C,z.M)
+T.ABC = triangle:new(z.A,z.B,z.C)
+C.circ = T.ABC:circum_circle()
+z.O = C.circ.center
+C.ins = T.ABC:in_circle()
+z.I = C.ins.center
+z.T = C.ins.through
+L.ll = T.ABC.ab: ll_from(z.I)
+z.Q =intersection(L.ll,L.CM)
+C.QI = circle:new(z.Q,z.I)
+z.R,z.S = intersection(C.QI,L.CM)
+L.BMC = bisector(z.M,z.B,z.C)
+z.x = L.BMC.pb
+L.CMA = bisector(z.M,z.C,z.A)
+z.y = L.CMA.pb
+L.pS = L.CM:ortho_from(z.S)
+L.pR = L.CM:ortho_from(z.R)
+z.J = intersection(L.pS,L.CMA)
+z.K = intersection(L.pR,L.BMC)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawSegments(C,M)
+\tkzDrawLines(J,K I,Q)
+\tkzDrawCircles(O,A I,T Q,I J,S K,R)
+\tkzDrawPoints(A,B,C,M,Q,I,R,S,J,K)
+\tkzLabelPoints(A,B,C,M,Q,I,R,S,J,K)
+\end{tikzpicture}
+\end{minipage}
+
+% subsection thebault_s_problemIII (end)
+
+\subsection{Thebault's problem II} % (fold)
+\label{sub:thebault_s_problemII}
+
+Given a square, construct equilateral triangles on two adjacent edges, either both inside or both outside the square. Then the triangle formed by joining the vertex of the square distant from both triangles and the vertices of the triangles distant from the square is equilateral.[wikipedia]
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+L.AB = line:new (z.A,z.B)
+S.ABCD = L.AB:square()
+z.C = S.ABCD.pc
+z.D = S.ABCD.pd
+z.E = S.ABCD.ab:equilateral().pc
+z.F = S.ABCD.bc:equilateral().pc
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPolygons[cyan](A,B,E B,C,F)
+\tkzFillPolygon[fill=orange!20](D,E,F)
+\tkzDrawPolygons[orange,thick](D,E,F)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+L.AB = line:new (z.A,z.B)
+S.ABCD = L.AB:square()
+z.C = S.ABCD.pc
+z.D = S.ABCD.pd
+z.E = S.ABCD.ab:equilateral().pc
+z.F = S.ABCD.bc:equilateral().pc
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPolygons[cyan](A,B,E B,C,F)
+\tkzFillPolygon[fill=orange!20](D,E,F)
+\tkzDrawPolygons[orange,thick](D,E,F)
+\end{tikzpicture}
+\end{minipage}
+
+
+% subsection thebault_s_problemII (end)
+
+\subsection{Varignon's Theorem} % (fold)
+\label{sub:varignon_s_theorem}
+In Euclidean geometry, Varignon's theorem holds that the midpoints of the sides of an arbitrary quadrilateral form a parallelogram, called the Varignon parallelogram. It is named after Pierre Varignon, whose proof was published posthumously in 1731. [Wikipedia]
+
+\vspace{6pt}
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 0 , 8 )
+z.C = point : new ( 5 , 3 )
+z.D = point : new ( -1 , 6 )
+Q.ABCD = quadrilateral:new(z.A, z.B, z.C, z.D)
+z.E,z.F,z.G,z.H = midpoints(z.A,z.B,z.C,z.D)
+ }
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,C,D)
+ \tkzDrawPolygon[red](E,F,G,H)
+ \tkzDrawPoints(A,B,C,D)
+ \tkzDrawPoints[red](E,F,G,H)
+ \tkzLabelPoints(A,C)
+ \tkzLabelPoints[above right](B,D)
+ \tkzLabelPoints[red](G,H)
+ \tkzLabelPoints[red,above right](E,F)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 0 , 8 )
+z.C = point : new ( 5 , 3 )
+z.D = point : new ( -1 , 6 )
+Q.ABCD = quadrilateral:new(z.A, z.B, z.C, z.D)
+z.E,z.F,z.G,z.H = midpoints(z.A,z.B,z.C,z.D)
+}
+\begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,C,D)
+ \tkzDrawPolygon[red](E,F,G,H)
+ \tkzDrawPoints(A,B,C,D)
+ \tkzDrawPoints[red](E,F,G,H)
+ \tkzLabelPoints(A,C)
+ \tkzLabelPoints[above right](B,D)
+ \tkzLabelPoints[red](G,H)
+ \tkzLabelPoints[red,above right](E,F)
+ \end{tikzpicture}
+\end{center}
+
+\end{minipage}
+
+% subsection varignon_s_theorem (end)
+
+
+\subsection{Wittenbauer's Parallelogram} % (fold)
+\label{sub:wittenbauer_s_parallelogram}
+
+Divide the sides of a quadrilateral into three equal parts. The figure formed by connecting and extending adjacent points on either side of a polygon vertex is a parallelogram known as Wittenbauer's parallelogram.
+[\href{https://mathworld.wolfram.com/WittenbauersParallelogram.html}{Weisstein, Eric W. "Wittenbauer's Parallelogram." From MathWorld--A Wolfram Web Resource.}]
+
+\vspace{6pt}
+
+\begin{minipage}{0.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.C = point : new ( 5 , 3 )
+z.D = point : new ( -1 , 4 )
+Q.ABCD = quadrilateral:new (z.A, z.B, z.C, z.D)
+z.P_1 = Q.ABCD.ab:point(1/3)
+z.P_2 = Q.ABCD.ab:point(2/3)
+z.P_3 = Q.ABCD.bc:point(1/3)
+z.P_4 = Q.ABCD.bc:point(2/3)
+z.P_5 = Q.ABCD.cd:point(1/3)
+z.P_6 = Q.ABCD.cd:point(2/3)
+z.P_7 = Q.ABCD.da:point(1/3)
+z.P_8 = Q.ABCD.da:point(2/3)
+L.P18 = line:new(z.P_1,z.P_8)
+L.P23 = line:new(z.P_2,z.P_3)
+L.P45 = line:new(z.P_4,z.P_5)
+L.P67 = line:new(z.P_6,z.P_7)
+z.K = intersection(L.P18,L.P23)
+z.L = intersection(L.P23,L.P45)
+z.M = intersection(L.P45,L.P67)
+z.N = intersection(L.P67,L.P18)
+}
+\begin{tikzpicture}
+ \tkzGetNodes
+ \tkzDrawPolygon(A,B,C,D)
+ \tkzDrawPolygon[red](K,L,M,N)
+ \tkzDrawSegments(A,C B,D)
+ \tkzDrawPoints(A,B,C,D)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{0.5\textwidth}
+\directlua{
+init_elements()
+scale = .75
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 4 , 0 )
+z.C = point : new ( 5 , 3 )
+z.D = point : new ( -1 , 4 )
+Q.ABCD = quadrilateral : new ( z.A , z.B , z.C , z.D )
+z.P_1 = Q.ABCD.ab:point(1/3)
+z.P_2 = Q.ABCD.ab:point(2/3)
+z.P_3 = Q.ABCD.bc:point(1/3)
+z.P_4 = Q.ABCD.bc:point(2/3)
+z.P_5 = Q.ABCD.cd:point(1/3)
+z.P_6 = Q.ABCD.cd:point(2/3)
+z.P_7 = Q.ABCD.da:point(1/3)
+z.P_8 = Q.ABCD.da:point(2/3)
+L.P18 = line:new(z.P_1,z.P_8)
+L.P23 = line:new(z.P_2,z.P_3)
+L.P45 = line:new(z.P_4,z.P_5)
+L.P67 = line:new(z.P_6,z.P_7)
+z.K = intersection(L.P18,L.P23)
+z.L = intersection(L.P23,L.P45)
+z.M = intersection(L.P45,L.P67)
+z.N = intersection(L.P67,L.P18)
+}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C,D)
+\tkzDrawPolygon[red](K,L,M,N)
+\tkzDrawSegments(A,C B,D)
+\tkzDrawPoints(A,B,C,D)
+\end{tikzpicture}
+\end{minipage}
+% subsection wittenbauer_s_parallelogram (end)
+
+\subsection{Soddy circles of a triangle} % (fold)
+\label{sub:soddy_circles_of_a_triangle}
+
+In geometry, the Soddy circles of a triangle are two circles associated with any triangle in the plane.[wikipedia]
+
+ Given three noncollinear points, construct three tangent circles such that one is centered at each point and the circles are pairwise tangent to one another. Then there exist exactly two nonintersecting circles that are tangent to all three circles. These are called the inner and outer Soddy circles, and their centers are called the inner and outer Soddy centers, respectively.
+
+[\href{https://mathworld.wolfram.com/SoddyCircles.html}{ Weisstein, Eric W. "Soddy Circles." From MathWorld--A Wolfram Web Resource}]
+
+
+\subsubsection{Soddy circle without function} % (fold)
+\label{ssub:soddy}
+
+\begin{Verbatim}
+\directlua{%
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 5 , 0 )
+z.C = point : new ( 0.5 , 4 )
+T.ABC = triangle : new ( z.A,z.B,z.C )
+z.I = T.ABC.incenter
+z.E,z.F,z.G = T.ABC : projection (z.I)
+C.ins = circle : new (z.I,z.E)
+T.orthic = T.ABC : orthic ()
+z.Ha,z.Hb,z.Hc = get_points (T.orthic)
+C.CF = circle : new ( z.C , z.F )
+C.AG = circle : new ( z.A , z.G )
+C.BE = circle : new ( z.B , z.E )
+L.Ah = line : new ( z.A , z.Ha )
+L.Bh = line : new ( z.B , z.Hb )
+L.Ch = line : new ( z.C , z.Hc )
+z.X,z.Xp = intersection (L.Ah,C.AG)
+z.Y,z.Yp = intersection (L.Bh,C.BE)
+z.Z,z.Zp = intersection (L.Ch,C.CF)
+L.XpE = line : new (z.Xp,z.E)
+L.YpF = line : new (z.Yp,z.F)
+L.ZpG = line : new (z.Zp,z.G)
+z.S = intersection (L.XpE,L.YpF)
+z.Xi = intersection(L.XpE,C.AG)
+z.Yi = intersection(L.YpF,C.BE)
+_,z.Zi = intersection(L.ZpG,C.CF)
+z.S = triangle : new (z.Xi,z.Yi,z.Zi).circumcenter
+C.soddy_int = circle : new (z.S,z.Xi)
+C.soddy_ext = C.ins : inversion (C.soddy_int)
+z.w = C.soddy_ext.center
+z.s = C.soddy_ext.through
+z.Xip,z.Yip,z.Zip = C.ins : inversion (z.Xi,z.Yi,z.Zi)
+}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,X,Y,Z,X',Y',Z',Xi,Yi,Zi,I)
+\tkzDrawPoints(Xi',Yi',Zi',S)
+\tkzLabelPoints(A,B,C,E,F,G,X,Y,Z,X',Y',Z')
+\tkzDrawCircles(A,G B,E C,F I,E S,Xi w,s)
+\tkzDrawLines(X',Ha Y',Hb Z',Hc)
+\tkzDrawLines(X',E Y',F Z',G)
+\end{tikzpicture}
+\end{Verbatim}
+
+\directlua{%
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 5 , 0 )
+z.C = point : new ( 0.5 , 4 )
+T.ABC = triangle : new ( z.A,z.B,z.C )
+z.I = T.ABC.incenter
+z.E,z.F,z.G = T.ABC : projection (z.I)
+C.ins = circle : new (z.I,z.E)
+T.orthic = T.ABC : orthic ()
+z.Ha,z.Hb,z.Hc = get_points (T.orthic)
+C.CF = circle : new ( z.C , z.F )
+C.AG = circle : new ( z.A , z.G )
+C.BE = circle : new ( z.B , z.E )
+L.Ah = line : new ( z.A , z.Ha )
+L.Bh = line : new ( z.B , z.Hb )
+L.Ch = line : new ( z.C , z.Hc )
+z.X,z.Xp = intersection (L.Ah,C.AG)
+z.Y,z.Yp = intersection (L.Bh,C.BE)
+z.Z,z.Zp = intersection (L.Ch,C.CF)
+L.XpE = line : new (z.Xp,z.E)
+L.YpF = line : new (z.Yp,z.F)
+L.ZpG = line : new (z.Zp,z.G)
+z.S = intersection (L.XpE,L.YpF)
+z.Xi = intersection(L.XpE,C.AG)
+z.Yi = intersection(L.YpF,C.BE)
+_,z.Zi = intersection(L.ZpG,C.CF)
+z.S = triangle : new (z.Xi,z.Yi,z.Zi).circumcenter
+C.soddy_int = circle : new (z.S,z.Xi)
+C.soddy_ext = C.ins : inversion (C.soddy_int)
+z.w = C.soddy_ext.center
+z.s = C.soddy_ext.through
+z.Xip,z.Yip,z.Zip = C.ins : inversion (z.Xi,z.Yi,z.Zi)
+}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,X,Y,Z,X',Y',Z',Xi,Yi,Zi,I)
+\tkzDrawPoints(Xi',Yi',Zi',S)
+\tkzLabelPoints(A,B,C,E,F,G,X,Y,Z,X',Y',Z')
+\tkzDrawCircles(A,G B,E C,F I,E S,Xi w,s)
+\tkzDrawLines(X',Ha Y',Hb Z',Hc)
+\tkzDrawLines(X',E Y',F Z',G)
+\end{tikzpicture}
+% subsubsection soddy (end)
+
+\subsubsection{Soddy circle with function} % (fold)
+\label{ssub:soddy_circle_with_function}
+
+\directlua{%
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 5 , 0 )
+z.C = point : new (4 , 4 )
+T.ABC = triangle : new ( z.A,z.B,z.C )
+z.I = T.ABC.incenter
+z.E,z.F,z.G = T.ABC : projection (z.I)
+T.orthic = T.ABC : orthic ()
+z.Ha,z.Hb,z.Hc = get_points (T.orthic)
+C.ins = circle : new (z.I,z.E)
+z.s,z.xi,z.yi,z.zi = T.ABC : soddy_center ()
+C.soddy_int = circle : new (z.s,z.xi)
+C.soddy_ext = C.ins : inversion (C.soddy_int)
+z.w = C.soddy_ext.center
+z.t = C.soddy_ext.through
+z.Xip,z.Yip,z.Zip = C.ins : inversion (z.xi,z.yi,z.zi)
+}
+
+\begin{minipage}{.5\textwidth}
+ \begin{Verbatim}
+ \directlua{%
+init_elements ()
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 5 , 0 )
+ z.C = point : new (4 , 4 )
+ T.ABC = triangle : new ( z.A,z.B,z.C )
+ z.I = T.ABC.incenter
+ z.E,z.F,z.G = T.ABC : projection (z.I)
+ T.orthic = T.ABC : orthic ()
+ z.Ha,z.Hb,z.Hc = get_points (T.orthic)
+ C.ins = circle : new (z.I,z.E)
+ z.s,z.xi,z.yi,
+ z.zi = T.ABC : soddy_center ()
+ C.soddy_int = circle : new (z.s,z.xi)
+ C.soddy_ext = C.ins : inversion (C.soddy_int)
+ z.w = C.soddy_ext.center
+ z.t = C.soddy_ext.through
+ z.Xip,z.Yip,
+ z.Zip = C.ins : inversion (z.xi,z.yi,z.zi)
+ }
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\begin{tikzpicture}[scale=.6]
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawCircles(A,G B,E C,F I,E s,xi w,t)
+\tkzDrawPoints(A,B,C,E,F,G,s,w,xi,t)
+\tkzLabelPoints(A,B,C)
+\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,xi,yi,zi,I)
+\tkzDrawPoints(Xi',Yi',Zi')
+\tkzLabelPoints(A,B,C,E,F,G)
+\end{tikzpicture}
+\end{minipage}
+
+\begin{Verbatim}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzDrawPolygon(A,B,C)
+\tkzDrawCircles(A,G B,E C,F I,E s,xi w,t)
+\tkzDrawPoints(A,B,C,E,F,G,s,w,xi,t)
+\tkzLabelPoints(A,B,C)
+\tkzDrawPoints(A,B,C,E,F,G,Ha,Hb,Hc,xi,yi,zi,I)
+\tkzDrawPoints(Xi',Yi',Zi')
+\tkzLabelPoints(A,B,C,E,F,G)
+\end{tikzpicture}
+\end{Verbatim}
+% subsubsection soddy_circle_with_function (end)
+
+
+% subsection soddy_circles_of_a_triangle (end)
+
+\subsection{Six circles in a triangle} % (fold)
+\label{sub:six_circles_in_a_triangle}
+In geometry, the six circles theorem relates to a chain of six circles together with a triangle, such that each circle is tangent to two sides of the triangle and also to the preceding circle in the chain. The chain closes, in the sense that the sixth circle is always tangent to the first circle.[1][2] It is assumed in this construction that all circles lie within the triangle, and all points of tangency lie on the sides of the triangle. [Wikipedia]
+
+\vspace{6pt}
+The file \code{search\_circle.lua} used in this example:
+
+\begin{mybox}
+ \begin{Verbatim}
+ local r =...
+
+ function newcircle (T,C)
+ local NT,L,NC,c,t
+ NT = T.incenter : homothety ((1+C.radius/T.inradius),T)
+ L = line : new (NT.pb,NT.pa)
+ _,NC = L : c_ll_p(NT.pc,C.center)
+ return NC.center,T.bc:projection(NC.center)
+ end
+
+ z.A = point : new ( 0 , 0 )
+ z.B = point : new ( 8 , 0 )
+ z.C = point : new ( 2 , 6 )
+ T.ABC = triangle : new (z.A,z.B,z.C)
+ L.bA = T.ABC : bisector ()
+ z.c1 = L.bA : report(r)
+ z.t1 = T.ABC.ab : projection(z.c1)
+ C.last = circle : new(z.c1,z.t1)
+
+ local vertices = {"A", "B", "C"}
+ for i = 2, 6 do
+ T.used = triangle : new(
+ z[vertices[math.fmod(i - 2, 3) + 1]],
+ z[vertices[math.fmod(i - 1, 3) + 1]],
+ z[vertices[math.fmod(i, 3) + 1]] )
+ z["c" .. i], z["t" .. i] = newcircle(T.used, C.last)
+ C.last = circle : new(z["c" .. i], z["t" .. i])
+ end
+ \end{Verbatim}
+\end{mybox}
+
+
+\vspace{6pt}
+\begin{minipage}{.5\textwidth}
+\begin{Verbatim}
+\directlua{
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+z.C = point : new ( 2 , 6 )
+loadfile ("search_circle.lua")(1.4)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzFillPolygon[lightgray!30](A,B,C)
+\foreach \n/\c in {1/red,2/orange,%
+3/yellow,4/green,5/blue,6/violet}
+ {\tkzFillCircle[\c!30,opacity=.4](c\n,t\n)
+ \tkzDrawCircle[thick,\c](c\n,t\n)}
+\tkzDrawPolygon[thick](A,B,C)
+\tkzDrawPoints(A,B,C)
+\end{tikzpicture}
+\end{Verbatim}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+z.C = point : new ( 2 , 6 )
+loadfile ("search_circle.lua")(1.4)
+}
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzFillPolygon[lightgray!30](A,B,C)
+\foreach \n/\c in {1/red,2/orange,3/yellow,4/green,5/blue,6/violet}
+ {\tkzFillCircle[\c!30,opacity=.4](c\n,t\n)
+ \tkzDrawCircle[thick,\c](c\n,t\n) }
+\tkzDrawPolygon[thick](A,B,C)
+\tkzDrawPoints(A,B,C)
+\end{tikzpicture}
+\end{minipage}
+
+\vspace{12pt}
+When the first circle is the incircle then you get only 4 circles.
+
+\begin{minipage}{.5\textwidth}
+\begin{mybox}
+ \begin{Verbatim}
+ T.ABC = triangle : new (z.A,z.B,z.C)
+ R = T.ABC.inradius/math.sin((T.ABC.alpha)/2)
+ loadfile ("search_circle.lua")(R)
+ }
+ \end{Verbatim}
+\end{mybox}
+\end{minipage}
+\begin{minipage}{.5\textwidth}
+\directlua{
+scale =1.5
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+z.C = point : new ( 2 , 6 )
+T.ABC = triangle : new (z.A,z.B,z.C)
+R = T.ABC.inradius/math.sin((T.ABC.alpha)/2)
+ loadfile ("search_circle.lua")(R)
+ }
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzFillPolygon[lightgray!30](A,B,C)
+\foreach \n/\c in {1/red,2/orange,3/yellow,4/green,5/blue,6/violet}
+ {\tkzFillCircle[\c!30,opacity=.4](c\n,t\n)
+ \tkzDrawCircle[thick,\c](c\n,t\n) }
+\tkzDrawPolygon[thick](A,B,C)
+\tkzDrawPoints(A,B,C)
+\end{tikzpicture}
+\end{minipage}
+
+
+% subsection six_circles_in_a_triangle (end)
+% section some_theorems (end) \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transfers.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transfers.tex
index 1b65e4dabe..1459bdfb42 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transfers.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-transfers.tex
@@ -116,18 +116,18 @@ a point whose affix is: \tkzUseLua{x}
\begin{minipage}{0.5\textwidth}
\begin{Verbatim}
\directlua{
- init_elements ()
- z.b = point: new (1,1)
- z.a = point: new (4,2)
- z.c = point: new (2,2)
- z.d = point: new (5,1)
- L.ab = line : new (z.a,z.b)
- L.cd = line : new (z.c,z.d)
- det = (z.b-z.a)^(z.d-z.c)
- if det == 0 then bool = true
- else bool = false
- end
- x = intersection (L.ab,L.cd)
+ init_elements ()
+ z.b = point: new (1,1)
+ z.a = point: new (4,2)
+ z.c = point: new (2,2)
+ z.d = point: new (5,1)
+ L.ab = line : new (z.a,z.b)
+ L.cd = line : new (z.c,z.d)
+ det = (z.b-z.a)^(z.d-z.c)
+ if det == 0 then bool = true
+ else bool = false
+ end
+ x = intersection (L.ab,L.cd)
}
The intersection of the two lines lies at
a point whose affix is:\tkzUseLua{x}
@@ -295,6 +295,7 @@ This consists in passing a number (the number of sides) from \TeX\ to \code{Lua}
This time, the transfer will be carried out using an external file. The following example is based on this one, but using a table.
\directlua{
+init_elements()
z.a = point: new (1,0)
z.b = point: new (3,2)
z.c = point: new (0,2)
@@ -314,6 +315,7 @@ This time, the transfer will be carried out using an external file. The followin
\begin{minipage}{0.5\textwidth}
\begin{Verbatim}
\directlua{
+ init_elements()
z.a = point: new (1,0)
z.b = point: new (3,2)
z.c = point: new (0,2)
@@ -331,7 +333,7 @@ This time, the transfer will be carried out using an external file. The followin
}
\begin{tikzpicture}
\tkzGetNodes
- \tkzInit[xmin=-1,xmax=5,ymin=0,ymax=6]
+ \tkzInit[xmin=-1,xmax=5,ymin=0,ymax=5]
\tkzDrawX\tkzDrawY
\tkzDrawPoints[red,size=2](a,b,c)
\directlua{f(-1,3,100)}%
@@ -340,14 +342,17 @@ This time, the transfer will be carried out using an external file. The followin
\end{Verbatim}
\end{minipage}
\begin{minipage}{0.5\textwidth}
-\begin{tikzpicture}
- \tkzGetNodes
- \tkzInit[xmin=-1,xmax=5,ymin=0,ymax=6]
- \tkzDrawX\tkzDrawY
- \tkzDrawPoints[red,size=2](a,b,c)
- \directlua{f(-1,3,100)}%
- \draw[domain=-1:3] plot[smooth] file {tmp.table};
-\end{tikzpicture}
+\begin{center}
+ \begin{tikzpicture}
+ \tkzGetNodes
+ \tkzInit[xmin=-1,xmax=5,ymin=0,ymax=5]
+ \tkzDrawX\tkzDrawY
+ \tkzDrawPoints[red,size=2](a,b,c)
+ \directlua{f(-1,3,100)}%
+ \draw[domain=-1:3] plot[smooth] file {tmp.table};
+ \end{tikzpicture}
+\end{center}
+
\end{minipage}
% subsubsection example_3 (end)
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/search_circle.lua b/macros/latex/contrib/tkz/tkz-elements/doc/latex/search_circle.lua
new file mode 100644
index 0000000000..6ca5eff6b9
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/search_circle.lua
@@ -0,0 +1,29 @@
+-- search_circle.lua
+local r =...
+
+function newcircle (T,C)
+ local NT,L,NC,c,t
+ NT = T.incenter : homothety ((1+C.radius/T.inradius),T)
+ L = line : new (NT.pb,NT.pa)
+ _,NC = L : c_ll_p(NT.pc,C.center)
+ return NC.center,T.bc:projection(NC.center)
+end
+
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+z.C = point : new ( 2 , 6 )
+T.ABC = triangle : new (z.A,z.B,z.C)
+L.bA = T.ABC : bisector ()
+z.c1 = L.bA : report(r)
+z.t1 = T.ABC.ab : projection(z.c1)
+C.last = circle : new(z.c1,z.t1)
+
+local vertices = {"A", "B", "C"}
+ for i = 2, 6 do
+ T.used = triangle : new(
+ z[vertices[math.fmod(i - 2, 3) + 1]],
+ z[vertices[math.fmod(i - 1, 3) + 1]],
+ z[vertices[math.fmod(i, 3) + 1]] )
+ z["c" .. i], z["t" .. i] = newcircle(T.used, C.last)
+ C.last = circle : new(z["c" .. i], z["t" .. i])
+ end
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf b/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
index f7ba1922c0..940aba4ce3 100644
--- a/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
+++ b/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/search_circle.lua b/macros/latex/contrib/tkz/tkz-elements/examples/search_circle.lua
new file mode 100644
index 0000000000..6ca5eff6b9
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/search_circle.lua
@@ -0,0 +1,29 @@
+-- search_circle.lua
+local r =...
+
+function newcircle (T,C)
+ local NT,L,NC,c,t
+ NT = T.incenter : homothety ((1+C.radius/T.inradius),T)
+ L = line : new (NT.pb,NT.pa)
+ _,NC = L : c_ll_p(NT.pc,C.center)
+ return NC.center,T.bc:projection(NC.center)
+end
+
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+z.C = point : new ( 2 , 6 )
+T.ABC = triangle : new (z.A,z.B,z.C)
+L.bA = T.ABC : bisector ()
+z.c1 = L.bA : report(r)
+z.t1 = T.ABC.ab : projection(z.c1)
+C.last = circle : new(z.c1,z.t1)
+
+local vertices = {"A", "B", "C"}
+ for i = 2, 6 do
+ T.used = triangle : new(
+ z[vertices[math.fmod(i - 2, 3) + 1]],
+ z[vertices[math.fmod(i - 1, 3) + 1]],
+ z[vertices[math.fmod(i, 3) + 1]] )
+ z["c" .. i], z["t" .. i] = newcircle(T.used, C.last)
+ C.last = circle : new(z["c" .. i], z["t" .. i])
+ end
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.pdf b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.pdf
index 6b1998eb80..8263a89b79 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.pdf
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.tex b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.tex
index 15046d83a3..5f4fec8415 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.tex
@@ -5,7 +5,7 @@
\usepackage{tkz-elements}
\begin{document}
-\begin{tkzelements}
+\directlua{
z.A = point: new (0 , 0)
z.B = point: new (10 , 0)
L.AB = line: new ( z.A, z.B)
@@ -30,7 +30,7 @@
_,z.P_2 = intersection (C.QA,C.CB)
T = triangle: new ( z.P_0, z.P_1, z.P_2)
z.O_3 = T.circumcenter
-\end{tkzelements}
+}
\begin{tikzpicture}
\tkzGetNodes
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf
index 6ff5f444c8..5a56a13dfa 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex
index 2ee7b4c4d9..a9cf6032e2 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex
@@ -7,7 +7,7 @@
The Feuerbach triangle is the triangle formed by the three points of tangency of the nine-point circle with the excircles
-\begin{tkzelements}
+\directlua{
scale = .6
z.A = point: new (0,0)
z.B = point: new (6,0)
@@ -26,7 +26,7 @@
C.apo = C.ortho : inversion (C.euler)
z.O = C.apo.center
z.xa,z.xb,z.xc = C.ortho : inversion (z.Ea,z.Eb,z.Ec)
-\end{tkzelements}
+}
\vspace*{2em}
\hfill
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.pdf b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.pdf
index 5f1ded6e31..7762c969a3 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.pdf
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.tex b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.tex
index a95ae05b08..0e9fe3de97 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.tex
@@ -5,7 +5,7 @@
\usepackage{tkz-elements}
\begin{document}
-\begin{tkzelements}
+\directlua{
scale = 2
z.A = point: new (0 , 0)
z.B = point: new (5 , 1)
@@ -42,7 +42,7 @@
_,z.V = intersection (L.YO,E)
_,z.W = intersection (L.ZO,E)
set_lua_to_tex {'a','b','ang'}
- \end{tkzelements}
+ }
\begin{tikzpicture}
\tkzGetNodes
@@ -50,13 +50,14 @@
\tkzDrawCircles[red](N,Ma O,A)
\tkzDrawSegments(A,X B,Y C,Z B,Hb C,Hc X,O Y,O Z,O)
\tkzDrawPolygon[red](U,V,W)
- \tkzLabelPoints[red](U,V,W)
- \tkzLabelPoints(A,B,C,X,Y,Z)
\tkzDrawLine[blue](I,J)
- \tkzLabelPoints[blue,right](O,N,G,H,I,J)
\tkzDrawPoints(I,J,U,V,W)
\tkzDrawPoints(A,B,C,N,G,H,O,X,Y,Z,Ma,Mb,Mc,Ha,Hb,Hc)
\tkzDrawEllipse[blue](N,\a,\b,\ang)
+ \tkzLabelPoints[blue,right](O,N,G,H,I,J)
+ \tkzLabelPoints[red](U,V,W)
+ \tkzLabelPoints(A,B,Z)
+ \tkzLabelPoints[above](C,X,Y)
\end{tikzpicture}
\end{document}
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.pdf b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.pdf
index 1428fd1d4f..c84806e978 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.pdf
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.tex b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.tex
index 5dcf23e1ba..de8e4d335d 100644
--- a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.tex
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_4.tex
@@ -7,7 +7,7 @@
\usepackage{tkz-elements}
\begin{document}
-\begin{tkzelements}
+\directlua{
scale = 2
z.A = point: new(0,0)
z.B = point: new(5,0)
@@ -17,13 +17,14 @@
z.E,z.F,z.G = get_points (T.EFG)
z.S = T.ABC: medial (): circum_circle ().south
z.O = T.ABC: medial ().circumcenter
-\end{tkzelements}
+}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawPolygons(A,B,C E,F,G)
\tkzDrawCircle(O,E)
\tkzDrawPoints(A,B,C,O,S,E,F,G)
- \tkzLabelPoints(A,B,O,S,E,F,G)
+ \tkzLabelPoints(A,B,O,S,G)
+ \tkzLabelPoints[above](E,F)
\tkzLabelPoints[above](C)
\end{tikzpicture}
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_5.pdf b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_5.pdf
new file mode 100644
index 0000000000..15a9a28b6c
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_5.pdf
Binary files differ
diff --git a/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_5.tex b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_5.tex
new file mode 100644
index 0000000000..3356bf311f
--- /dev/null
+++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_5.tex
@@ -0,0 +1,28 @@
+% !TEX TS-program = lualatex
+% Created by Alain Matthes on 2024-12-25.
+% Copyright (c) 2024 AlterMundus.
+\documentclass[margin = 12pt]{standalone}
+\usepackage{tkz-euclide}
+\usepackage{tkz-elements}
+
+\begin{document}
+
+\directlua{
+init_elements ()
+z.A = point : new ( 0 , 0 )
+z.B = point : new ( 8 , 0 )
+z.C = point : new ( 2 , 6 )
+loadfile ("search_circle.lua")(1.4)
+}
+
+\begin{tikzpicture}
+\tkzGetNodes
+\tkzFillPolygon[lightgray!30](A,B,C)
+\foreach \n/\c in {1/red,2/orange,3/yellow,4/green,5/blue,6/violet}
+ {\tkzFillCircle[\c!30,opacity=.4](c\n,t\n)
+ \tkzDrawCircle[thick,\c](c\n,t\n) }
+\tkzDrawPolygon[thick](A,B,C)
+\tkzDrawPoints(A,B,C)
+\end{tikzpicture}
+\end{document}
+
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty b/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
index 821fe56225..f0b32574e1 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty
@@ -11,14 +11,15 @@
% This work has the LPPL maintenance status “maintained”.
% The Current Maintainer of this work is Alain Matthes.
-\ProvidesPackage{tkz-elements}[2024/07/16 version 3.00 Graphic Object Library]
+\ProvidesPackage{tkz-elements}[2025/01/06 version 3.10 Graphic Object Library]
%\RequirePackage{luacode}
\directlua{
require "tkz_elements_main"
- tkz_epsilon=1e-8
- tkz_dc=2
- indirect = true
+ tkz_epsilon = 1e-8
+ tkz_dc = 2
+ indirect = true
+ inside = true
init_elements()}%
\newenvironment{tkzelements}
@@ -52,7 +53,7 @@
tex.sprint("\string\\coordinate ("..K..") at ("..V.re..","..V.im..") ; \string\r")
end}}
-\def\tkzUseLua#1{\directlua{tex.print(tostring(#1))}}
+\def\tkzUseLua#1{\directlua{tex.print(#1)}}
\makeatletter
\def\tkzDrawLuaEllipse{\pgfutil@ifnextchar[{\tkz@DrawLuaEllipse}{\tkz@DrawLuaEllipse[]}}
\def\tkz@DrawLuaEllipse[#1](#2,#3,#4){%
@@ -67,6 +68,7 @@ end}}
\pgfmathprintnumber{#2}
\endgroup
}
+\let\percentchar\@percentchar
\makeatother
\endinput
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
index 6bb0c7c4f0..7ed5e1839f 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circle.lua
@@ -1,6 +1,6 @@
-- tkz_elements-circles.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -24,6 +24,8 @@ function circle: new (c, t) -- c --> center t --> through
local east = c + point (radius,0)
local north = c + point (0,radius)
local west = c - point (radius,0)
+ local perimeter = 2*math.pi*radius
+ local area = 4*math.pi*radius*radius
local o = { center = c,
through = t,
ct = ct,
@@ -33,7 +35,9 @@ function circle: new (c, t) -- c --> center t --> through
east = east,
north = north,
west = west,
- type = type}
+ type = type,
+ perimeter = perimeter,
+ area = area}
setmetatable(o, self)
self.__index = self
return o
@@ -51,26 +55,12 @@ end
-----------------------
-- boolean --
-----------------------
-function circle: in_out (pt)
- local d
- d = point.abs (pt - self.center)
- if math.abs(d-self.radius) < tkz_epsilon
- then
- return true
- else
- return false
- end
+function circle:in_out(pt)
+ return math.abs(point.abs(pt - self.center) - self.radius) < tkz_epsilon
end
-function circle: in_out_disk (pt)
- local d
- d = point.abs (pt - self.center)
- if d <= self.radius
- then
- return true
- else
- return false
- end
+function circle:in_out_disk(pt)
+ return point.abs(pt - self.center) <= self.radius
end
-- new version 1.80 added
@@ -78,6 +68,16 @@ function circle : circles_position (C)
return circles_position_ (self.center,self.radius,C.center,C.radius)
end
+function circle:is_tangent(l)
+ local a, b = intersection(self, l)
+ -- Checks whether the intersection produces valid points
+ if not a or not b then
+ return false
+ end
+ -- Checks whether the distance between the two intersection points is less than a given tolerance
+ return (point.abs(b - a) < tkz_epsilon)
+end
+
-----------------------
-- real --
-----------------------
@@ -131,59 +131,64 @@ end
-----------------------
-- lines --
-----------------------
-function circle: tangent_at (pt)
- return line : new ( rotation_ (pt,math.pi/2,self.center),rotation_ (pt,-math.pi/2,self.center))
+function circle:tangent_at(pt)
+ return line:new(
+ rotation_(pt, math.pi / 2, self.center),
+ rotation_(pt, -math.pi / 2, self.center)
+ )
+end
+
+
+ function circle:tangent_from(pt)
+ local t1, t2 = tangent_from_(self.center, self.through, pt)
+ return line:new(pt, t1), line:new(pt, t2)
end
-function circle: tangent_from (pt)
- local t1,t2
- t1,t2 = tangent_from_ (self.center,self.through,pt)
- return line :new (pt,t1),line : new (pt,t2)
+ function circle:radical_axis(C)
+ local t1, t2
+ if self.radius > C.radius then
+ t1, t2 = radical_axis_(self.center, self.through, C.center, C.through)
+ else
+ t1, t2 = radical_axis_(C.center, C.through, self.center, self.through)
+ end
+ return line:new(t1, t2)
end
- function circle: radical_axis (C)
- local t1,t2
- if self.radius > C.radius then
- t1,t2 = radical_axis_ (self.center,self.through,C.center,C.through)
- else
- t1,t2 = radical_axis_ (C.center,C.through,self.center,self.through)
- end
- return line :new (t1,t2)
- end
-function circle: radical_center (C1,C2)
-if C2 == nil then
- if self.radius > C1.radius then
- return radical_center_ (self.center,self.through,C1.center,C1.through)
- else
- return radical_center_ (C1.center,C1.through,self.center,self.through)
- end
-else
- return radical_center3 (self,C1,C2)
-end
-end
+ function circle:radical_center(C1, C2)
+ if C2 == nil then
+ if self.radius > C1.radius then
+ return radical_center_(self.center, self.through, C1.center, C1.through)
+ else
+ return radical_center_(C1.center, C1.through, self.center, self.through)
+ end
+ else
+ return radical_center3(self, C1, C2)
+ end
+ end
-function circle : radical_circle (C1,C2)
- local rc
- if C2 == nil then
- rc = self : radical_center (C1)
- return self : orthogonal_from (rc)
- else
- rc = self : radical_center (C1,C2)
- return C1 : orthogonal_from (rc)
- end
-end
+ function circle : radical_circle (C1,C2)
+ local rc
+ if C2 == nil then
+ rc = self : radical_center (C1)
+ return self : orthogonal_from (rc)
+ else
+ rc = self : radical_center (C1,C2)
+ return C1 : orthogonal_from (rc)
+ end
+ end
- function circle : external_tangent(C)
- local i,t1,t2,k,T1,T2
- i = barycenter_ ({C.center,self.radius},{self.center,-C.radius})
- t1,t2 = tangent_from_ (self.center,self.through,i)
- k = point.mod((C.center-i)/(self.center-i))
- T1 = homothety_(i,k,t1)
- T2 = homothety_(i,k,t2)
- return line : new (t1,T1),line : new (t2,T2)
+ function circle:external_tangent(C)
+ local i, t1, t2, k, T1, T2
+ i = barycenter_({C.center, self.radius}, {self.center, -C.radius})
+ t1, t2 = tangent_from_(self.center, self.through, i)
+ k = point.mod((C.center - i) / (self.center - i))
+ T1 = homothety_(i, k, t1)
+ T2 = homothety_(i, k, t2)
+ return line:new(t1, T1), line:new(t2, T2)
end
+
function circle : internal_tangent(C)
local i,t1,t2,k,T1,T2
i = barycenter_ ({C.center,self.radius},{self.center,C.radius})
@@ -221,54 +226,52 @@ function circle: orthogonal_through (pta,ptb)
return circle : new (orthogonal_through_ (self.center,self.through,pta,ptb),pta)
end
- function circle: inversion_L (L)
- local p,q
- if L: in_out (self.center) then
- return L
- else
- p = L: projection (self.center)
- q = inversion_ (self.center,self.through,p)
- return circle: new (midpoint_(self.center,q),q)
- end
+ function circle:inversion_L(L)
+ if L:in_out(self.center) then
+ return L
+ else
+ local p = L:projection(self.center)
+ local q = inversion_(self.center, self.through, p)
+ return circle:new(midpoint_(self.center, q), q)
+ end
end
-
- function circle: inversion_C (C)
- local p,q,x,y
- if C: in_out (self.center) then
- p = C : antipode (self.center)
- q = inversion_ (self.center,self.through,p)
- x = ortho_from_ ( q , self.center , p )
- y = ortho_from_ ( q , p, self.center)
- return line : new (x,y)
- else
- x,y = intersection_lc_ (self.center,C.center,C.center,C.through)
- X = inversion_ (self.center,self.through,x)
- Y = inversion_ (self.center,self.through,y)
- return circle : new (midpoint_(X,Y),X)
- end
+
+ function circle:inversion_C(C)
+ local p, q, x, y, X, Y
+ if C:in_out(self.center) then
+ p = C:antipode(self.center)
+ q = inversion_(self.center, self.through, p)
+ x = ortho_from_(q, self.center, p)
+ y = ortho_from_(q, p, self.center)
+ return line:new(x, y)
+ else
+ x, y = intersection_lc_(self.center, C.center, C.center, C.through)
+ X = inversion_(self.center, self.through, x)
+ Y = inversion_(self.center, self.through, y)
+ return circle:new(midpoint_(X, Y), X)
+ end
end
-function circle: inversion (...)
- local obj,nb,t
- local tp = table.pack(...)
- obj = tp[1]
- nb = tp.n
- if nb == 1 then
- if obj.type == "point" then
- return inversion_ (self.center,self.through,obj)
- elseif obj.type == "line" then
- return self: inversion_L (obj)
- else
- return self: inversion_C (obj)
- end
- else
- t = {}
- for i=1,tp.n do
- table.insert( t , inversion_ (self.center,self.through , tp[i]) )
+ function circle:inversion(...)
+ local tp = table.pack(...)
+ local obj = tp[1]
+ local nb = tp.n
+ if nb == 1 then
+ if obj.type == "point" then
+ return inversion_(self.center, self.through, obj)
+ elseif obj.type == "line" then
+ return self:inversion_L(obj)
+ else
+ return self:inversion_C(obj)
end
- return table.unpack ( t )
- end
-end
+ else
+ local t = {}
+ for i = 1, nb do
+ table.insert(t, inversion_(self.center, self.through, tp[i]))
+ end
+ return table.unpack(t)
+ end
+ end
function circle: draw ()
local x,y
@@ -282,4 +285,111 @@ function circle: midcircle(C)
return midcircle_ (self,C)
end
+-- -----------------------------------------------------------
+-- Circle tangent to a circle passing through two points
+function circle : c_c_pp(a,b)
+
+ -- test If one point is inside the disk and the other is outside, there is no solution.
+ if (self:in_out_disk(a) and not self:in_out_disk(b)) or ( self:in_out_disk(b) and not self:in_out_disk(a)) then
+ tex.error("An error has occurred", {"Bad configuration. Only one point is in the disk"})
+return end
+
+-- Find the mediator of the current line
+local lab = line : new (a,b)
+local lmed = lab : mediator()
+
+if self : is_tangent (lab) then
+ local c = intersection (self,lab)
+ local d = self : antipode (c)
+
+ return circle:new (circum_circle_(a, b, d),a),
+ circle:new (circum_circle_(a, b, d),a)
+end
+
+-- pb are (AB) tgt to circle A and B equidistant of O tgt and equidistant
+if lab : is_equidistant (self.center) then
+ local t1,t2 = intersection (lmed,self)
+ return circle:new (circum_circle_(a, b, t1),t1),
+ circle:new (circum_circle_(a, b, t2),t2)
+else
+ -- Create a circumcircle passing through a, b, and a point on C
+ local Cc = circle:new(circum_circle_(a, b, self.center), a)
+ -- Find the intersection points of C and Cc
+ local c, d = intersection(self, Cc)
+ -- Create a line passing through the two intersection points
+ local lcd = line:new(c, d)
+ -- Find the intersection of the current line (self) with the line lcd
+ local i = intersection(lab, lcd)
+ -- Create tangents from the intersection point to C
+ local lt, ltp = self:tangent_from(i)
+ -- Get the tangent points
+ local t, tp = lt.pb, ltp.pb
+ -- Return two new circles tangent to C and passing through the tangent points
+ return circle:new(intersection(lmed, line:new(self.center, t)), t),
+ circle:new(intersection(lmed, line:new(self.center, tp)), tp)
+end
+end
+
+
+-- Circle tangent to two circles passing through a point
+function circle : c_cc_p (C,p)
+ local i = self: external_similitude (C)
+ local lofcenters = line : new (self.center,C.center)
+ local u1,u2 = intersection (lofcenters,self)
+ local v1,v2 = intersection (lofcenters,C)
+ local u1,v1 = self : common_tangent (C)
+ local o = circum_circle_(u1,v1,p)
+ local a,b = intersection_lc_(i,p,o,p)
+ if (point.abs(a - b) < tkz_epsilon) then
+ local li = line:new (i,p)
+ return C : c_lc_p (li,a)
+ else
+ local q
+ -- problem if p == q ?
+ if (point.abs(a - p) < tkz_epsilon) then q = b else q=a end
+ return C : c_c_pp (p,q)
+ end
+end
+
+-- Circle tangent to one circle, on line and passing through a point
+function circle : c_lc_p (l,p,inside)
+ inside = inside or false
+ if self : in_out (p) then
+ local t1 = intersection_ll_( self.north,p,l.pa,l.pb)
+ local t2 = intersection_ll_( self.south,p,l.pa,l.pb)
+ local l1 = l : ortho_from (t1)
+ local l2 = l : ortho_from (t2)
+ local o1 = intersection_ll_( self.center,p,l1.pa,l1.pb)
+ local o2 = intersection_ll_( self.center,p,l2.pa,l2.pb)
+ return circle:new(o1,t1),circle:new(o2,t2)
+ else
+ if l : in_out (p) then
+ local i = l : projection (self.center)
+ local lortho = l : ortho_from (p)
+ local u = lortho : report (self.radius,p)
+ local v = lortho : report (-self.radius,p)
+ local ux,uy = mediator_ (self.center,u)
+ local vx,vy = mediator_ (self.center,v)
+ -- pb if c tgt l
+ local o1= intersection_ll_(u,v,ux,uy)
+ local o2 = intersection_ll_(u,v,vx,vy)
+ return circle:new(o1,p),circle:new(o2,p)
+ else -- genral case
+ local u = self.north
+ local v = self.south
+ local h = intersection_ll_(u,v,l.pa,l.pb)
+ if inside then
+ local o = circum_circle_(p,u,h)
+ local q = intersection_lc_(p,v,o,p)
+ return self : c_c_pp (p,q)
+ else
+ local o = circum_circle_(p,v,h)
+ local q = intersection_lc_(u,p,o,v)
+ return self : c_c_pp (p,q)
+ end
+ end
+ end
+end
+
+
return circle \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
index 6d5fae53ec..3469a89c41 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua
@@ -1,6 +1,6 @@
-- tkz_elements_class.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- from class.lua (Simple Lua Classes from Lua-users wiki)
-- Compatible with Lua 5.1 (not 5.0).
-- http://lua-users.org/wiki/SimpleLuaClasses DavidManura
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
index cbc3a3969c..9983ae3391 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipse.lua
@@ -1,6 +1,6 @@
-- tkz_elements-ellipses.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
index 3208f7a5d3..5dfece2eb3 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_circles.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -37,45 +37,52 @@ function orthogonal_from_ (a,b,p)
return tangent_from_ (a,b,p)
end
-function orthogonal_through_ (a,b,x,y)
- local d,z
- d = 1/point.mod(x-a)
- z = a +(b-a)*d
- return circum_center_ (x,y,z)
+function orthogonal_through_(a, b, x, y)
+ local d = 1 / point.mod(x - a)
+ local z = a + (b - a) * d
+ return circum_center_(x, y, z)
end
-function inversion_ (c,p,pt)
- local ry = point.abs(c-p)
- local d = point.abs(c-pt)
- local r = (ry*ry)/d
- return c+polar_ (r,point.arg(pt-c))
+function inversion_(c, p, pt)
+ local ry = point.abs(c - p)
+ local d = point.abs(c - pt)
+ local r = (ry * ry) / d
+ return c + polar_(r, point.arg(pt - c))
end
-function circles_position_ (c1,r1,c2,r2)
- local d,max,min
- d = point.mod(c1-c2)
- max = r1+r2
- min = math.abs ( r1 - r2)
- if d > max then return "outside"
- elseif math.abs(d - max) < tkz_epsilon then return "outside tangent" -- epsilon
- elseif math.abs(d - min) < tkz_epsilon then return "inside tangent" -- epsilon
- elseif d < min then return "inside"
- else return "intersect"
- end
+function circles_position_(c1, r1, c2, r2)
+ local d = point.mod(c1 - c2)
+ local max = r1 + r2
+ local min = math.abs(r1 - r2)
+
+ if d > max then
+ return "outside"
+ elseif math.abs(d - max) < tkz_epsilon then
+ return "outside tangent"
+ elseif math.abs(d - min) < tkz_epsilon then
+ return "inside tangent"
+ elseif d < min then
+ return "inside"
+ else
+ return "intersect"
+ end
end
+
-function radical_axis_ (c1,p1,c2,p2)
- local ci,cj
- r1 = point.abs(c1-p1)
- r2 = point.abs(c2-p2)
- d = point.abs(c1-c2)
- h = (r1*r1-r2*r2+d*d)/(2*d)
- ck = radical_center_ (c1,p1,c2,p2)
- cj = rotation_ (ck,-math.pi/2,c1)
- ci = symmetry_ (ck,cj)
- return cj,ci
+function radical_axis_(c1, p1, c2, p2)
+ local r1 = point.abs(c1 - p1)
+ local r2 = point.abs(c2 - p2)
+ local d = point.abs(c1 - c2)
+ local h = (r1 * r1 - r2 * r2 + d * d) / (2 * d)
+
+ local ck = radical_center_(c1, p1, c2, p2)
+ local cj = rotation_(ck, -math.pi / 2, c1)
+ local ci = symmetry_(ck, cj)
+
+ return cj, ci
end
+
function radical_center_ (c1,p1,c2,p2)
local d,r1,r2,h
r1 = point.abs(c1-p1)
@@ -96,18 +103,16 @@ return intersection_ll_ (t1,t2,t3,t4)
end
end
-function south_pole_ (c,p)
- local r
- r = point.abs (c-p)
- return c - point (0,r)
- end
+function south_pole_(c, p)
+ return c - point(0, point.abs(c - p))
+end
+
-function north_pole_ (c,p)
- local r
- r = point.abs (c-p)
- return c + point (0,r)
+function north_pole_(c, p)
+ return c + point(0, point.abs(c - p))
end
+
function antipode_ (c,pt)
return 2 * c - pt
end
@@ -126,42 +131,46 @@ function circlepoint_ (c,t,k)
end
function midcircle_(C1,C2)
- local state,r,s,t1,t2,T1,T2,p,a,b,c,d,Cx,Cy,i,j
- state = circles_position_(C1.center,C1.radius,C2.center,C2.radius)
- i = barycenter_ ({C2.center,C1.radius},{C1.center,-C2.radius})
- j = barycenter_ ({C2.center,C1.radius},{C1.center,C2.radius})
- t1,t2 = tangent_from_ (C1.center,C1.through,i)
- T1,T2 = tangent_from_ (C2.center,C2.through,i)
+ local state, r, s, t1, t2, T1, T2, p, a, b, c, d, Cx, Cy, i, j
+ state = circles_position_(C1.center, C1.radius, C2.center, C2.radius)
+ i = barycenter_({C2.center, C1.radius}, {C1.center, -C2.radius})
+ j = barycenter_({C2.center, C1.radius}, {C1.center, C2.radius})
+ t1, t2 = tangent_from_(C1.center, C1.through, i)
+ T1, T2 = tangent_from_(C2.center, C2.through, i)
- if (state == 'outside') or (state == 'outside tangent')then
- p = math.sqrt(point.mod(i-t1)*point.mod(i-T1))
- return circle : radius (i,p)
- elseif state == 'intersect' then
- r,s = intersection (C1,C2)
- return circle : radius (i,point.mod(r-i)) , circle : radius (j,point.mod(r-j))
- elseif (state == 'inside') or (state == 'inside tangent') then
- a,b = intersection_lc_ (C1.center,C2.center,C1.center,C1.through)
- c,d = intersection_lc_ (C1.center,C2.center,C2.center,C2.through)
-
+ if (state == 'outside') or (state == 'outside tangent') then
+ p = math.sqrt(point.mod(i - t1) * point.mod(i - T1))
+ return circle:radius(i, p)
+ elseif state == 'intersect' then
+ r, s = intersection(C1, C2)
+ return circle:radius(i, point.mod(r - i)), circle:radius(j, point.mod(r - j))
+ elseif (state == 'inside') or (state == 'inside tangent') then
+ a, b = intersection_lc_(C1.center, C2.center, C1.center, C1.through)
+ c, d = intersection_lc_(C1.center, C2.center, C2.center, C2.through)
+
+ -- Ensure the smaller radius circle is used first
if C1.radius < C2.radius then
z.u, z.v, z.r, z.s = a, b, c, d
else
z.u, z.v, z.r, z.s = c, d, a, b
end
- if (in_segment_ (z.s,z.v,z.u) == true)
- then
- Cx = circle : diameter (z.r,z.v)
- Cy = circle : diameter (z.u,z.s)
- else
- Cx = circle : diameter (z.s,z.v)
- Cy = circle : diameter (z.u,z.r)
- end
- if (Cx.radius) < (Cy.radius) then
- return Cy : orthogonal_from (j)
- else
- return Cx : orthogonal_from (j)
- end
- end
+ -- Determine circle orientation and return orthogonal from j
+ if in_segment_(z.s, z.v, z.u) then
+ Cx = circle:diameter(z.r, z.v)
+ Cy = circle:diameter(z.u, z.s)
+ else
+ Cx = circle:diameter(z.s, z.v)
+ Cy = circle:diameter(z.u, z.r)
+ end
+
+ -- Return the circle with the smaller radius orthogonal from j
+ if Cx.radius < Cy.radius then
+ return Cy:orthogonal_from(j)
+ else
+ return Cx:orthogonal_from(j)
+ end
+ end
end
+
\ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
index 750bafe078..cb318bb6d0 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua
@@ -1,6 +1,6 @@
-- tkz_elements_intersections.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -72,133 +72,142 @@ function intersection_le (L,E)
end
end
-function intersection_ll_ (a,b,c,d)
- local x1,x2,x3,x4,y1,y2,y3,y4,DN,NX,NY
- x1 = a.re
- y1 = a.im
- x2 = b.re
- y2 = b.im
- x3 = c.re
- y3 = c.im
- x4 = d.re
- y4 = d.im
- DN = (x1-x2)*(y3-y4) - (y1-y2)*(x3-x4)
- if math.abs ( DN ) < tkz_epsilon then
- return false
- else
- NX = (x1*y2-y1*x2)*(x3-x4) - (x1-x2)*(x3*y4-y3*x4)
- NY = (x1*y2-y1*x2)*(y3-y4) - (y1-y2)*(x3*y4-y3*x4)
- return point (NX/DN,NY/DN)
+function intersection_ll_(a, b, c, d)
+ local x1, y1, x2, y2, x3, y3, x4, y4
+ local DN, NX, NY
+
+ x1, y1 = a.re, a.im
+ x2, y2 = b.re, b.im
+ x3, y3 = c.re, c.im
+ x4, y4 = d.re, d.im
+
+ DN = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4)
+
+ if math.abs(DN) < tkz_epsilon then
+ return false
end
+
+ NX = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4)
+ NY = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4)
+
+ return point(NX / DN, NY / DN)
end
-function intersection_lc_ (pa,pb,c,p)
- local zh, dh, arg_ab, test, phi,c1,c2,r
- r = point.mod (c-p)
- zh = projection_ (pa,pb,c)
- dh = point.abs (c - zh)
- arg_ab = point.arg (pa - pb)
- if dh < tkz_epsilon
- then
- return
- c + polar_ (r , math.pi + arg_ab), -- through center
- c + polar_ (r , arg_ab)
- elseif math.abs (r - dh) < tkz_epsilon
- then
- return zh , zh -- tangent
- elseif dh > r
- then return false , false -- no intersection
- else
- phi = math.asin (dh / r)
- -- phi = angle_normalize(phi)
- test = (pa-pb) * point.conj (c-zh)
- if test.im < 0
- then phi = math.pi + phi
- end
- c1 = angle_normalize (arg_ab + phi )
- c2 = angle_normalize (math.pi + arg_ab - phi )
- if c2 < c1 then
- return
- c + polar_ (r, c2) ,
- c + polar_ (r, c1)
- else
- return
- c + polar_ (r, c1) ,
- c + polar_ (r, c2)
- end -- if
- end -- if
+function intersection_lc_(pa, pb, c, p)
+ local zh, dh, arg_ab, phi, c1, c2, r, test
-end -- function
+ r = point.mod(c - p)
+ zh = projection_(pa, pb, c)
+ dh = point.abs(c - zh)
+ arg_ab = point.arg(pa - pb)
+
+ if dh < tkz_epsilon then
+ -- Le centre du cercle est sur la droite
+ return c + polar_(r, math.pi + arg_ab), c + polar_(r, arg_ab)
+ elseif math.abs(r - dh) < tkz_epsilon then
+ -- La droite est tangente au cercle
+ return zh, zh
+ elseif dh > r then
+ -- Aucune intersection
+ return false, false
+ else
+ -- Il y a une intersection, calcul de l'angle
+ phi = math.asin(dh / r)
+ test = (pa - pb) * point.conj(c - zh)
+ if test.im < 0 then
+ phi = math.pi + phi
+ end
+
+ c1 = angle_normalize(arg_ab + phi)
+ c2 = angle_normalize(math.pi + arg_ab - phi)
+
+ -- Retourner les deux points d'intersection
+ if c2 < c1 then
+ return c + polar_(r, c2), c + polar_(r, c1)
+ else
+ return c + polar_(r, c1), c + polar_(r, c2)
+ end
+ end
+end
-function intersection_cc_ (ca,pa,cb,pb )
- local d, cosphi, phi,ra,rb,c1,c2,epsilon
+function intersection_cc_(ca, pa, cb, pb)
+ local d, cosphi, phi, ra, rb, c1, c2, epsilon
+
+ -- Précision pour arrondir les résultats
epsilon = 12
- d = point.abs (ca - cb)
- ra = point.abs (ca - pa)
- rb = point.abs (cb - pb)
- cosphi = tkzround(((ra * ra + d * d - rb * rb)
- /( 2 * ra * d )) , epsilon)
- phi = tkzround (math.acos(cosphi),epsilon)
- if not phi then
- return false , false
- elseif phi == 0 then
- return ca + polar_ (ra, phi + point.arg (cb - ca)) ,
- ca + polar_ (ra, phi + point.arg (cb - ca))
- else
- c1 = angle_normalize ( phi + point.arg(cb - ca))
- c2 = angle_normalize (-phi + point.arg(cb - ca))
- if c1 < c2 then
- return
- ca + polar_(ra, c1),
- ca + polar_(ra, c2)
-else
- return
- ca + polar_(ra, c2),
- ca + polar_(ra, c1)
- end -- if
- end -- if
- end -- function
-
-function intersection ( X , Y )
- local i,z1,z2
- local t = {}
-
- if X.type == 'circle'
- then
- if Y.type == 'circle'
- then
- z1,z2 = intersection_cc ( X , Y )
- table.insert (t , z1 )
- table.insert (t , z2 )
- else -- Y[i] est une droite
- z1,z2 = intersection_lc ( Y , X )
- table.insert (t , z1 )
- table.insert (t , z2 )
- end -- if
- else
- if X.type == 'line' then
- if Y.type == 'circle'
- then
- z1,z2 = intersection_lc ( X , Y )
- table.insert ( t , z1 )
- table.insert ( t , z2 )
- else
- if Y.type == 'line' then
- z1 = intersection_ll ( X , Y )
- table.insert (t , z1 )
- else -- ellipse
- z1,z2 = intersection_le ( X , Y )
- table.insert ( t , z1 )
- table.insert ( t , z2 )
- end
- end -- if
- else
- if X.type == 'ellipse' then
- z1,z2 = intersection_le ( Y,X)
- table.insert ( t , z1 )
- table.insert ( t , z2 )
- end
+ -- Distance entre les centres des cercles
+ d = point.abs(ca - cb)
+ -- Rayons des cercles
+ ra = point.abs(ca - pa)
+ rb = point.abs(cb - pb)
+
+ -- Calcul du cosinus de l'angle phi entre les centres et les points sur les cercles
+ cosphi = tkzround((ra * ra + d * d - rb * rb) / (2 * ra * d), epsilon)
+
+ -- Calcul de l'angle phi
+ phi = tkzround(math.acos(cosphi), epsilon)
+
+ -- Si phi est invalide (par exemple, cosphi > 1 ou < -1), aucune intersection
+ if not phi then
+ return false, false
+ elseif phi == 0 then
+ -- Les cercles sont tangents l'un à l'autre, retourne le même point pour les deux intersections
+ return ca + polar_(ra, point.arg(cb - ca)), ca + polar_(ra, point.arg(cb - ca))
+ else
+ -- Calcul des angles des points d'intersection
+ c1 = angle_normalize(phi + point.arg(cb - ca))
+ c2 = angle_normalize(-phi + point.arg(cb - ca))
+
+ -- Retourner les points d'intersection dans l'ordre croissant des angles
+ if c1 < c2 then
+ return ca + polar_(ra, c1), ca + polar_(ra, c2)
+ else
+ return ca + polar_(ra, c2), ca + polar_(ra, c1)
+ end
+ end
+end
+
+function intersection(X, Y)
+ local t = {} -- Tableau pour stocker les points d'intersection
+
+ -- Cas où X est un cercle
+ if X.type == 'circle' then
+ if Y.type == 'circle' then
+ -- Intersection entre deux cercles
+ local z1, z2 = intersection_cc(X, Y)
+ table.insert(t, z1)
+ table.insert(t, z2)
+ else -- Y est une droite
+ local z1, z2 = intersection_lc(Y, X) -- Intersection entre un cercle et une droite
+ table.insert(t, z1)
+ table.insert(t, z2)
+ end
+
+ -- Cas où X est une droite
+ elseif X.type == 'line' then
+ if Y.type == 'circle' then
+ -- Intersection entre une droite et un cercle
+ local z1, z2 = intersection_lc(X, Y)
+ table.insert(t, z1)
+ table.insert(t, z2)
+ elseif Y.type == 'line' then
+ -- Intersection entre deux droites
+ local z1 = intersection_ll(X, Y)
+ table.insert(t, z1)
+ else -- Y est une ellipse
+ local z1, z2 = intersection_le(X, Y) -- Intersection entre une droite et une ellipse
+ table.insert(t, z1)
+ table.insert(t, z2)
end
- end -- if
- return table.unpack ( t )
-end -- function \ No newline at end of file
+
+ -- Cas où X est une ellipse
+ elseif X.type == 'ellipse' then
+ -- Intersection entre une ellipse et l'autre objet (cercle, droite ou ellipse)
+ local z1, z2 = intersection_le(Y, X)
+ table.insert(t, z1)
+ table.insert(t, z2)
+ end
+
+ -- Retourner les résultats sous forme de valeurs distinctes
+ return table.unpack(t)
+end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
index 31c735df6f..dfea7c4d3c 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_lines.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -15,16 +15,17 @@
---------------------------------------------------------------------------
-- Lines
---------------------------------------------------------------------------
-function normalize_ (a,b)
- return a+(b-a)/point.mod(b-a)
+function normalize_(a, b)
+ return a + (b - a) / point.mod(b - a)
end
-function ortho_from_ ( p , a , b )
- return p+(b-a)*point(0,1)
+
+function ortho_from_(p, a, b)
+ return p + (b - a) * point(0, 1)
end
function ll_from_ ( p , a , b )
- return p+b-a
+ return p + b - a
end
function slope_ (a,b)
@@ -32,7 +33,7 @@ function slope_ (a,b)
end
function gold_segment_ (a,b)
- return a + (b-a)*tkzinvphi
+ return a + (b - a) * tkzinvphi
end
function online_ (a,b,t)
@@ -52,26 +53,25 @@ function equilateral_tr_ (a,b)
return rotation_ (a,math.pi/3,b)
end
-function isosceles_right_tr (a,b)
- local pt
- pt = rotation_ (a,math.pi/4,b)
- return a + (pt-a) * math.sin(math.pi/4)
+function isosceles_right_tr(a, b)
+ local pt = rotation_(a, math.pi / 4, b)
+ return a + (pt - a) * math.sin(math.pi / 4)
end
-function gold_tr (a,b)
- local pt
- pt = rotation_ (a,math.pi/2,b)
- return a + (pt-a) * tkzinvphi
+
+function gold_tr(a, b)
+ local pt = rotation_(a, math.pi / 2, b)
+ return a + (pt - a) * tkzinvphi
end
+
function euclide_tr (a,b)
return rotation_ (a,math.pi/5,b)
end
function golden_tr (a,b)
- local pt
- pt = rotation_ (a,2*math.pi/5,b)
- return a + (pt-a) * tkzphi
+ local pt = rotation_ (a,2*math.pi/5,b)
+ return a + (pt-a) * tkzphi
end
function div_harmonic_int_(a,b,n)
@@ -97,66 +97,56 @@ function projection ( Dt,pt )
return projection_ ( Dt.pa,Dt.pb,pt )
end
-function projection_ ( pa,pb,pt )
- local v
- local z
- if aligned ( pa,pb,pt ) then
- return pt
- else
- v = pb - pa
- z = ((pt - pa)..v)/(point.norm(v)) -- .. dot product
- return pa + z * v
- end
+function projection_(pa, pb, pt)
+ if aligned(pa, pb, pt) then
+ return pt
+ else
+ local v = pb - pa
+ local z = ((pt - pa) .. v) / point.norm(v) -- .. dot product
+ return pa + z * v
+ end
end
+
function symmetry_axial_(pa,pb,pt)
- local p
- p = projection_ (pa,pb,pt)
+ local p = projection_ (pa,pb,pt)
return symmetry_(p,pt)
end
-function set_symmetry_axial_ (u,v,...)
- local tp = table.pack(...)
- local i
+function set_symmetry_axial_(u, v, ...)
local t = {}
- for i=1,tp.n do
- table.insert( t , symmetry_axial_ (u,v , tp[i]) )
- end
- return table.unpack ( t )
+ for _, value in ipairs({...}) do
+ table.insert(t, symmetry_axial_(u, v, value))
+ end
+ return table.unpack(t)
end
+
function square_ (a,b)
return rotation_ (b,-math.pi/2,a), rotation_ (a,math.pi/2,b)
end
-function in_segment_ (a,b,pt)
- local sc
- sc = point.mod (pt-a) + point.mod (pt-b) - point.mod(b-a)
- if sc <= tkz_epsilon
- then
- return true
+function in_segment_(a, b, pt)
+ return point.mod(pt - a) + point.mod(pt - b) - point.mod(b - a) <= tkz_epsilon
+end
+
+function report_(za, zb, d, pt)
+ local len = point.mod(zb - za)
+ local t = d / len
+ local result = barycenter_({za, 1 - t}, {zb, t})
+
+ if pt then
+ return result + pt - za
else
- return false
+ return result
end
end
-function report_ (za,zb,d,pt)
- local t,len
- len = point.mod(zb-za)
- t = d/len
- if pt == nil
- then
- return barycenter_({za,1-t},{zb,(t)})
-else
- return barycenter_({za,1-t},{zb,(t)}) +pt-za
-end
+function colinear_at_(za, zb, pt, k)
+ if k then
+ return pt + k * (zb - za)
+ else
+ return pt + (zb - za)
+ end
end
-function colinear_at_ (za,zb,pt,k)
- if k == nil
- then
- return pt+zb-za
-else
- return pt+k*(zb-za)
-end
-end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
index d3efe9b290..8b66689768 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_maths.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -38,27 +38,26 @@ function Cramer22(a1,a2,b1,b2)
return a1*b2-a2*b1
end
-function aligned ( m,a,b )
+function aligned(m, a, b)
local z
- z = (b-a)/(m-b)
- if math.abs(z.im) < tkz_epsilon
- then
- return true
- else
- return false
- end
-end
+ z = (b - a) / (m - b)
+ if math.abs(z.im) < tkz_epsilon then
+ return true
+ else
+ return false
+ end
+end
-function islinear (z1,z2,z3)
- local dp
- dp = (z2-z1) ^ (z3-z1)
- if math.abs(dp) < tkz_epsilon
- then
+function islinear(z1, z2, z3)
+ local dp
+ dp = (z2 - z1) ^ (z3 - z1)
+ if math.abs(dp) < tkz_epsilon then
return true
- else
+ else
return false
end
end
+is_linear = islinear
function isortho (z1,z2,z3)
local dp
@@ -71,6 +70,8 @@ function isortho (z1,z2,z3)
end
end
+is_ortho = isortho
+
function parabola (a,b,c)
local xa,xb,xc,ya,yb,yc
xa = a.re
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_matrices.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_matrices.lua
index 3ced42be40..47d3ce9967 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_matrices.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_matrices.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_matrices.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
index 59454e78f0..9937c0589d 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_points.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -23,30 +23,29 @@ function polar_ (radius, phi)
end
function barycenter_ (...)
-local cp = table.pack(...)
-local i
-local sum = 0
-local weight=0
-for i=1,cp.n do
- sum = sum + cp[i][1]*cp[i][2]
- weight = weight + cp[i][2]
-end
-return sum/weight
+ local cp = table.pack(...)
+ local sum = 0
+ local weight = 0
+ for i = 1, cp.n do
+ sum = sum + cp[i][1] * cp[i][2]
+ weight = weight + cp[i][2]
+ end
+ return sum / weight
end
-function rotation_ (c,a,pt)
- local z = point( math.cos(a) , math.sin(a) )
- return z*(pt-c)+c
+function rotation_ (c, a, pt)
+ local z = point(math.cos(a), math.sin(a))
+ return z * (pt - c) + c
end
-function set_rotation_ (c,angle,...)
+-- Define the set_rotation_ function
+function set_rotation_ (c, angle, ...)
local tp = table.pack(...)
- local i
local t = {}
for i=1,tp.n do
- table.insert( t , rotation_(c , angle , tp[i] ))
+ table.insert(t, rotation_(c, angle, tp[i]))
end
- return table.unpack ( t )
+ return table.unpack(t)
end
function symmetry_(c,pt)
@@ -55,8 +54,7 @@ end
function set_symmetry_ (c,...)
local tp = table.pack(...)
- local i
- local t = {}
+ local t = {}
for i=1,tp.n do
table.insert( t , symmetry_ (c , tp[i]) )
end
@@ -69,8 +67,7 @@ end
function set_homothety_ (c,coeff,...)
local tp = table.pack(...)
- local i
- local t = {}
+ local t = {}
for i=1,tp.n do
table.insert( t , homothety_ (c, coeff , tp[i]) )
end
@@ -83,7 +80,6 @@ end
function set_translation_ (u,...)
local tp = table.pack(...)
- local i
local t = {}
for i=1,tp.n do
table.insert( t , (u + tp[i]) )
@@ -101,7 +97,6 @@ end
function midpoints_ (...)
local arg = table.pack(...)
local n = arg.n
- local i
local t = {}
for i=1, n-1 do
table.insert( t , (arg[i]+arg[i+1])/2 )
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
index 0dfed425ae..01d98ad29a 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_regular.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_regular.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
index 5a81a993e1..b27353f2dc 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_triangles.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -70,20 +70,32 @@ w = point.abs(b-a)
return barycenter_ ({a,u*u},{b,v*v},{c,w*w})
end
-function nagel_point_ (a,b,c)
- local u,v,w
- u,v,w = extouch_tr_ ( a,b,c )
-return intersection_ll_ (a,u,b,v)
+function nagel_point_ (a, b, c)
+ -- Calculate the excircle tangency points (u, v, w)
+ local u, v, w = extouch_tr_ (a, b, c)
+
+ -- Find the intersection of lines through a and u, and through b and v
+ return intersection_ll_ (a, u, b, v)
end
-function feuerbach_point_ (a,b,c)
- local i,h,e,ma
- i,h = in_circle_ (a,b,c)
- e = euler_center_ (a,b,c)
- ma = (b+c)/2
-return intersection_cc_ (i,h,e,ma)
+
+function feuerbach_point_ (a, b, c)
+ local i, h, e, ma
+
+ -- Calculate the incenter and some related point (likely the orthocenter or another center)
+ i, h = in_circle_ (a, b, c)
+
+ -- Calculate the Euler center (center of the nine-point circle)
+ e = euler_center_ (a, b, c)
+
+ -- Calculate the midpoint of side BC
+ ma = (b + c) / 2
+
+ -- Find the intersection of the circles at (i, h) and (e, ma), which gives the Feuerbach point
+ return intersection_cc_ (i, h, e, ma)
end
+
function spieker_center_ (a,b,c)
return in_center_ (medial_tr_ ( a,b,c))
end
@@ -160,18 +172,28 @@ function ex_circle_ ( a,b,c )
projection_ (b,a,o)
end
-function euler_circle_ (a,b,c)
- local o,ma,mb,mc,H,ha,hb,hc
- o = euler_center_ (a,b,c)
- ma,mb,mc = medial_tr_ ( a,b,c)
- ha,hb,hc = orthic_tr_ ( a,b,c)
- local _,_,H,_ = euler_line_ (a,b,c)
- return
- o,ma,mb,mc,ha,hb,hc,
- midpoint_ ( H,a ),
- midpoint_ ( H,b ),
- midpoint_ ( H,c )
+function euler_circle_ (a, b, c)
+ local o, ma, mb, mc, H, ha, hb, hc
+ -- Compute the Euler center (center of the nine-point circle)
+ o = euler_center_ (a, b, c)
+
+ -- Calculate the medial triangle (midpoints of the sides)
+ ma, mb, mc = medial_tr_ (a, b, c)
+
+ -- Calculate the orthic triangle (feet of the altitudes)
+ ha, hb, hc = orthic_tr_ (a, b, c)
+
+ -- Get the Euler line and midpoint (H) on the Euler line
+ _, _, H, _ = euler_line_ (a, b, c)
+
+ -- Return all relevant geometric elements
+ return
+ o, ma, mb, mc, ha, hb, hc,
+ midpoint_ (H, a), -- Midpoint between H and vertex a
+ midpoint_ (H, b), -- Midpoint between H and vertex b
+ midpoint_ (H, c) -- Midpoint between H and vertex c
end
+
--------------------
-- triangles --
--------------------
@@ -194,15 +216,21 @@ function anti_tr_(a,b,c)
barycenter_ ( {a,1} , {b,1} , {c,-1} )
end
-function incentral_tr_ (a,b,c)
- local i,r,s,t
- i = in_center_ (a , b , c)
- r = intersection_ll_ ( a,i , b,c)
- s = intersection_ll_ ( b,i , a,c)
- t = intersection_ll_ ( c,i , a,b)
-return r,s,t
+function incentral_tr_ (a, b, c)
+ local i, r, s, t
+ -- Compute the incenter (center of the incircle)
+ i = in_center_ (a, b, c)
+
+ -- Calculate the points of tangency where the incircle touches the sides
+ r = intersection_ll_ (a, i, b, c) -- Intersection of lines a-i and b-c
+ s = intersection_ll_ (b, i, a, c) -- Intersection of lines b-i and a-c
+ t = intersection_ll_ (c, i, a, b) -- Intersection of lines c-i and a-b
+
+ -- Return the points of tangency that form the incentral triangle
+ return r, s, t
end
+
function excentral_tr_ (a,b,c)
local r,s,t,ka,kb,kc
ka = point.abs (b-c)
@@ -290,19 +318,22 @@ function area_ (a,b,c)
return point.mod(a - projection_(b,c,a))*point.mod (b - c)/2
end
-function check_equilateral_ (a,b,c)
- local A,B,C
- A = b - c
- B = a - c
- C = a - b
- if (point.abs(A)-point.abs(B) < tkz_epsilon) and (point.abs(B)-point.abs(C) < tkz_epsilon)
- then
- return true
- else
- return false
+function check_equilateral_ (a, b, c)
+ local A, B, C
+ -- Compute the vectors representing the sides of the triangle
+ A = b - c -- Side from b to c
+ B = a - c -- Side from a to c
+ C = a - b -- Side from a to b
+
+ -- Check if all sides have approximately equal lengths
+ if (point.abs(A) - point.abs(B) < tkz_epsilon) and (point.abs(B) - point.abs(C) < tkz_epsilon) then
+ return true -- The triangle is equilateral
+ else
+ return false -- The triangle is not equilateral
end
end
+
function parallelogram_ (a,b,c)
local x = c + a - b
return x
@@ -337,22 +368,34 @@ function in_out_ (a,b,c,pt)
end
end
-function soddy_center_ (a,b,c)
- local i,ha,hb,hc,e,f,g,x,y,z,xp,yp,zp
- i,e,f,g = in_circle_ (a,b,c)
- ha,hb,hc = orthic_tr_ (a,b,c)
- x,xp = intersection_lc_ (a,ha,a,g)
- if (point.mod(ha-x)<point.mod(ha-xp)) then else x,xp=swap(x,xp) end
- y,yp = intersection_lc_ (b,hb,b,e)
- if (point.mod(hb-y)<point.mod(hb-yp)) then else y,yp=swap(y,yp) end
- z,zp = intersection_lc_ (c,hc,c,f)
- if (point.mod(hc-z)<point.mod(hc-zp)) then else z,zp=swap(z,zp) end
- xi,t = intersection_lc_ (xp,e,a,g)
- if in_out_ (a,b,c,xi) then else xi,t = swap(xi,t) end
- yi,t = intersection_lc_ (yp,f,b,e)
- if in_out_ (a,b,c,yi) then else yi,t = swap(yi,t) end
- zi,t = intersection_lc_ (zp,g,c,f)
- if in_out_ (a,b,c,zi) then else zi,t = swap(zi,t) end
- s = circum_center_ (xi,yi,zi)
- return s,xi,yi,zi
+function soddy_center_ (a,b,c)
+ -- Step 1: Compute the incenter and excircle centers
+ local i,e,f,g = in_circle_ (a,b,c)
+ local ha,hb,hc = orthic_tr_ (a,b,c)
+
+ -- Step 2: Find the intersection points for the tangent lines
+ local x,xp = intersection_lc_ (a,ha,a,g)
+ if (point.mod(ha-x) < point.mod(ha-xp)) then else x,xp = swap(x,xp) end
+
+ local y,yp = intersection_lc_ (b,hb,b,e)
+ if (point.mod(hb-y) < point.mod(hb-yp)) then else y,yp = swap(y,yp) end
+
+ local z,zp = intersection_lc_ (c,hc,c,f)
+ if (point.mod(hc-z) < point.mod(hc-zp)) then else z,zp = swap(z,zp) end
+
+ -- Step 3: Calculate the intersections with the opposite triangle sides
+ local xi,t = intersection_lc_ (xp,e,a,g)
+ if in_out_ (a,b,c,xi) then else xi,t = swap(xi,t) end
+
+ local yi,t = intersection_lc_ (yp,f,b,e)
+ if in_out_ (a,b,c,yi) then else yi,t = swap(yi,t) end
+
+ local zi,t = intersection_lc_ (zp,g,c,f)
+ if in_out_ (a,b,c,zi) then else zi,t = swap(zi,t) end
+
+ -- Step 4: Calculate the circumcenter of the triangle formed by the tangent points
+ local s = circum_center_ (xi,yi,zi)
+
+ return s,xi,yi,zi -- Return the Soddy center and the tangent points
end
+
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
index 4d24d9d229..2b4b320e19 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_line.lua
@@ -1,6 +1,6 @@
-- tkz_elements_lines.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -16,7 +16,7 @@
-- Lines
-- -------------------------------------------------------------------------
line = {}
-function line: new(za, zb)
+function line:new(za, zb)
local type = 'line'
local mid = (za+zb)/2
local north_pa = rotation_ (za,math.pi/2,zb)
@@ -49,122 +49,119 @@ end
-------------------
-- Result -> real
-------------------
-function line: distance (pt)
+function line:distance(pt)
return point.mod(projection(self,pt)-pt)
end
-function length(a,b)
- return point.abs (a-b)
-end
-
-function line: slope ()
+function line:slope()
return slope_(self.pa,self.pb)
end
-------------------
-- Result -> boolean
-------------------
-function line: in_out (pt)
- local sc
- sc = math.abs ((pt-self.pa)^(pt-self.pb))
- if sc <= tkz_epsilon
- then
- return true
- else
- return false
- end
+function line:in_out(pt)
+ return math.abs((pt - self.pa) ^ (pt - self.pb)) <= tkz_epsilon
end
-function line: in_out_segment (pt)
- local sc
- sc = point.mod (pt-self.pa) + point.mod (pt-self.pb) - point.mod(self.pb-self.pa)
- if sc <= tkz_epsilon
- then
- return true
- else
- return false
- end
+function line:in_out_segment(pt)
+ return point.mod(pt - self.pa) + point.mod(pt - self.pb) - point.mod(self.pb - self.pa) <= tkz_epsilon
+end
+
+function line:is_parallel(L)
+ return math.abs(self.slope - L.slope) < tkz_epsilon
+end
+
+function line:is_orthogonal(L)
+ return math.abs(self.slope * L.slope + 1) < tkz_epsilon
+end
+
+function line:is_equidistant(p)
+ return math.abs( (point.mod(self.pa-p)-(point.mod(self.pb-p)))) < tkz_epsilon
end
-------------------
-- Result -> point
-------------------
-function line: barycenter (ka,kb)
+function line:barycenter(ka,kb)
return barycenter_({self.pa,ka},{self.pb,kb})
end
-function line: point (t) -- t=o A t=1 B t = AM / AB
+function line:point(t) -- t=o A t=1 B t = AM / AB
return barycenter_({self.pa,1-t},{self.pb,(t)})
end
-function line: midpoint ()
+function line:midpoint()
return (self.pa+self.pb)/2
end
-function line: harmonic_int (pt)
+function line:harmonic_int(pt)
return div_harmonic_int_(self.pa,self.pb,pt)
end
-function line: harmonic_ext (pt)
+function line:harmonic_ext(pt)
return div_harmonic_ext_(self.pa,self.pb,pt)
end
-function line: harmonic_both (k)
+function line:harmonic_both(k)
return div_harmonic_both_(self.pa,self.pb,k)
end
-function line: gold_ratio()
+function line:gold_ratio()
return self.pa + (self.pb-self.pa)*tkzinvphi
end
-function line: normalize ()
+function line:normalize()
return self.pa+(self.pb-self.pa)/point.mod(self.pb-self.pa)
end
-function line: normalize_inv ()
+function line:normalize_inv()
return normalize_ (self.pb,self.pa)
end
-function line: _east (d)
+function line:_east(d)
local d = d or 1
return self.pb+ d/self.length * (self.pb-self.pa)
end
-function line: _west (d)
+function line:_west(d)
local d = d or 1
return self.pa+ d/self.length * (self.pa-self.pb)
end
-function line: _north_pa (d)
+function line:_north_pa(d)
local d = d or 1
return d/self.length * ( self.north_pa - self.pa ) + self.pa
end
-function line: _south_pa (d)
+function line:_south_pa(d)
local d = d or 1
return d/self.length *( self.south_pa - self.pa ) + self.pa
end
-function line: _south_pb (d)
+function line:_south_pb(d)
local d = d or 1
return d/self.length *( self.south_pb - self.pb ) + self.pb
end
-function line: _north_pb (d)
+function line:_north_pb(d)
local d = d or 1
return d/self.length *( self.north_pb - self.pb ) + self.pb
end
-function line : report (d,pt)
- local t
- t = d/self.length
- if pt == nil
- then
- return barycenter_({self.pa,1-t},{self.pb,(t)})
- else
- return barycenter_({self.pa,1-t},{self.pb,(t)}) +pt-self.pa
- end
+function line:report(d, pt)
+ if not self.length or self.length == 0 then
+ error("self.length must be non-zero")
+ end
+ local t = d / self.length
+ local result = barycenter_({self.pa, 1 - t}, {self.pb, t})
+ if pt then
+ return result + pt - self.pa
+ else
+ return result
+ end
end
-function line : colinear_at (pt,k)
+
+function line:colinear_at (pt,k)
if k == nil
then
return colinear_at_ (self.pa,self.pb,pt,1)
@@ -173,28 +170,28 @@ function line : colinear_at (pt,k)
end
end
-------------- transformations -------------
-function line: translation_pt ( pt )
+function line:translation_pt( pt )
return translation_ ( self.pb-self.pa,pt )
end
-function line: translation_C ( obj )
+function line:translation_C( obj )
local pa,pb,x,y
pa = obj.center
pb = obj.through
- x,y = set_translation_ ( self.pb-self.pa,pa,pb )
+ x,y = set_translation_( self.pb-self.pa,pa,pb )
return circle : new (x,y)
end
-function line: translation_T ( obj )
+function line: translation_T( obj )
local pa,pb,pc,x,y,z
pa = obj.pa
pb = obj.pb
pc = obj.pc
- x,y,z = set_translation_ ( self.pb-self.pa,pa,pb,pc )
+ x,y,z = set_translation_( self.pb-self.pa,pa,pb,pc )
return triangle : new (x,y,z)
end
-function line: translation_L ( obj )
+function line: translation_L( obj )
local pa,pb,x,y
pa = obj.pa
pb = obj.pb
@@ -202,35 +199,42 @@ function line: translation_L ( obj )
return line : new (x,y)
end
-function line: translation (...)
- local obj,nb,t
+function line:translation(...)
+ local obj, nb, t
local tp = table.pack(...)
obj = tp[1]
nb = tp.n
- if nb == 1 then
- if obj.type == "point" then
- return translation_ ( self.pb-self.pa,obj )
- elseif obj.type == "line" then
- return self: translation_L (obj)
- elseif obj.type == "triangle" then
- return self: translation_T (obj)
- else
- return self: translation_C (obj)
- end
- else
+
+ -- If only one object is passed
+ if nb == 1 then
+ if obj.type == "point" then
+ return translation_(self.pb - self.pa, obj) -- Translate point
+ elseif obj.type == "line" then
+ return self:translation_L(obj) -- Translate line
+ elseif obj.type == "triangle" then
+ return self:translation_T(obj) -- Translate triangle
+ elseif obj.type == "circle" then
+ return self:translation_C(obj) -- Translate circle
+ else
+ error("Unsupported object type for translation")
+ end
+ else
+ -- If multiple objects are passed, translate each one
t = {}
- for i=1,tp.n do
- table.insert(t , translation_ ( self.pb-self.pa , tp[i]))
- end
- return table.unpack ( t )
- end
+ for i = 1, nb do
+ -- Translate each object using the translation vector
+ table.insert(t, translation_(self.pb - self.pa, tp[i]))
+ end
+ return table.unpack(t) -- Return the translated objects
+ end
end
+
function line: set_translation ( ...)
return set_translation_ ( self.pb-self.pa,... )
end
-function line: projection (...)
+function line:projection(...)
local obj,nb,t
local tp = table.pack(...)
obj = tp[1]
@@ -246,7 +250,7 @@ function line: projection (...)
end
end
-function line: set_projection (...)
+function line:set_projection(...)
local tp = table.pack(...)
local i
local t = {}
@@ -256,31 +260,31 @@ function line: set_projection (...)
return table.unpack ( t )
end
-function line: symmetry_axial_L ( obj )
+function line:symmetry_axial_L( obj )
local pa,pb,x,y
pa = obj.pa
pb = obj.pb
- x,y = self:set_reflection ( pa,pb )
+ x,y = self:set_reflection(pa, pb)
return line : new (x,y)
end
-function line: symmetry_axial_T ( obj )
+function line:symmetry_axial_T( obj )
local pa,pb,pc,x,y,z
pa = obj.pa
pb = obj.pb
pc = obj.pc
- x,y,z = self:set_reflection ( pa,pb,pc )
+ x,y,z = self:set_reflection (pa, pb, pc)
return triangle : new (x,y,z)
end
-function line: symmetry_axial_C ( obj )
+function line:symmetry_axial_C( obj )
local pa,pb,x,y
pa = obj.center
pb = obj.through
- x,y = self:set_reflection ( pa,pb )
+ x,y = self:set_reflection( pa,pb )
return circle : new (x,y)
end
-function line: reflection (...)
+function line:reflection(...)
local obj,nb,t
local tp = table.pack(...)
obj = tp[1]
@@ -304,203 +308,379 @@ function line: reflection (...)
end
end
-function line: set_reflection (...)
+function line:set_reflection (...)
return set_symmetry_axial_ ( self.pb,self.pa,... )
end
-------------------
-- Result -> line
-------------------
-function line: ll_from ( pt )
+function line:ll_from( pt )
return line : new (pt,pt+self.pb-self.pa)
end
-function line: ortho_from ( pt )
+function line:ortho_from( pt )
return line : new (pt+(self.pb-self.pa)*point(0,-1),pt+(self.pb-self.pa)*point(0,1))
end
-function line: mediator ()
- local m
- m = midpoint_ (self.pa,self.pb)
+function line:mediator()
+ local m = midpoint_ (self.pa,self.pb)
return line : new (rotation_ (m,-math.pi/2,self.pb),rotation_ (m,math.pi/2,self.pb))
end
-function line : perpendicular_bisector ()
- local m
- m = midpoint_ (self.pa,self.pb)
+function line:perpendicular_bisector ()
+ local m = midpoint_ (self.pa,self.pb)
return line : new (rotation_ (m,-math.pi/2,self.pb),rotation_ (m,math.pi/2,self.pb))
end
-------------------
-- Result -> circle
-------------------
-function line: circle (swap)
- if swap == nil then
- swap = false
- end
+function line:circle(swap)
+ swap = swap or false
if swap then
- return circle : new (self.pb,self.pa)
+ return circle:new(self.pb,self.pa)
else
- return circle : new (self.pa,self.pb)
+ return circle:new(self.pa,self.pb)
end
end
-function line: circle_swap ()
+function line:circle_swap()
return circle : new (self.pb,self.pa)
end
-function line : diameter ()
- local c = midpoint_ (self.pa,self.pb)
- return circle : new (c,self.pb)
+function line:diameter()
+ local c = midpoint_(self.pa,self.pb)
+ return circle:new (c,self.pb)
end
-function line : apollonius (k)
+function line:apollonius(k)
local z1,z2,c
- z1 = barycenter_ ({self.pa,1},{self.pb,k})
- z2 = barycenter_ ({self.pa,1},{self.pb,-k})
- c = midpoint_ (z1,z2)
+ z1 = barycenter_({self.pa,1},{self.pb,k})
+ z2 = barycenter_({self.pa,1},{self.pb,-k})
+ c = midpoint_ (z1,z2)
return circle : new (c,z2)
end
+function line:test(x,y)
+
+end
+
+
+-- Circle tangent to a line passing through two points
+-- In general, there are two solutions
+function line:c_l_pp(a, b) -- a and b on the same side
+ -- Initialisation
+ local lab = line:new(a, b) -- Line through a and b
+ local Cab = circle:diameter(a, b) -- Circle with a and b diameters
+ local i = intersection(lab, self) -- Intersection with current line
+
+ -- One point on the line (a)
+ if self : in_out(a) and not self:in_out(b) then
+ local lmed = lab : mediator()
+ local laperp = self:ortho_from(a)
+ local o = intersection(lmed,laperp)
+ return circle:new(o,a),
+ circle:new(o,a)
+ end
+ -- One point on the line (b)
+ if self:in_out(b) and not self:in_out(a) then
+ local lmed = lab:mediator()
+ local laperp = self:ortho_from(b)
+ local o = intersection(lmed,laperp)
+ return circle:new(o,b),
+ circle:new(o,b)
+ end
+ -- Check: if the intersection exists and lies on the segment [a, b].
+ if i and lab:in_out_segment(i) then
+ return nil, nil -- No circle is possible
+ end
+
+ -- If the current line is orthogonal to lab
+ if self:is_orthogonal(lab) then
+ local lmed = lab:mediator()
+ local m = midpoint(a, b)
+ local r = length(m, i)
+ local pt1 = lab:isosceles_s(r)
+ local pt2 = lab:isosceles_s(r, true)
+ return circle:new(pt1, a),
+ circle:new(pt2, a)
+ end
+
+ -- If the two lines are parallel
+ if lab:is_parallel(self) then
+ local mid = midpoint(a, b) -- Midpoint of segment [a, b]
+ local proj = self:projection(mid) -- Mid projection on the running line
+
+ return circle:new(circum_center_(a, b, proj), proj),
+ circle:new(circum_center_(a, b, proj), proj)
+ end
+
+ -- General case
+ local t = Cab:tangent_from(i).pb
+ local x, y = intersection(self, circle:new(i, t))
+ return circle:new(intersection(self:ortho_from(x), lab:mediator()), x),
+ circle:new(intersection(self:ortho_from(y), lab:mediator()), y)
+end
+
+
+-- Circle tangent to two straight lines passing through a given point
+function line:c_ll_p(a, p)
+
+ -- Compute the bisector of the triangle formed by self.pa, self.pb, and a
+ local lbi = bisector(self.pa, self.pb, a)
+
+ if lbi:in_out(p) then
+ -- Orthogonal projection of p onto the bisector
+ local lp = lbi:ortho_from(p)
+
+ -- Intersection of line from p to its projection with self.pa and self.pb
+ local i = intersection_ll_(p, lp.pb, self.pa, self.pb)
+
+ -- Intersection points of the line with the circle defined by (i, p)
+ local t1, t2 = intersection_lc_(self.pa, self.pb, i, p)
+
+ -- Create the main line and find orthogonal projections from t1 and t2
+ local lab = line:new(self.pa, self.pb)
+ local x = lab:ortho_from(t1).pb
+ local y = lab:ortho_from(t2).pb
+
+ -- Return two circles based on the orthogonal projections and points t1, t2
+ return circle:new(intersection_ll_(x, t1, self.pa, p), t1),
+ circle:new(intersection_ll_(y, t2, self.pa, p), t2)
+ else
+ -- Reflection of p across the bisector
+ local q = lbi : reflection (p)
+
+ -- Compute circles from the Wallis construction
+ local c1, c2 = self:c_l_pp(p, q)
+
+ -- Return two circles with centers and points on their circumference
+ return c1,c2
+ end
+end
+
+
+
----------------------
-- Result -> triangle
----------------------
-function line: equilateral (swap)
- if swap == nil then
- swap = false
- end
- if swap then
- return triangle : new (self.pa,self.pb,rotation_ (self.pa,-math.pi/3,self.pb))
+function line:equilateral(swap)
+ swap = swap or false
+ if swap then
+ return triangle:new(self.pa, self.pb, rotation_(self.pa, -math.pi / 3, self.pb))
else
- return triangle : new (self.pa,self.pb,rotation_ (self.pa,math.pi/3,self.pb))
-end
+ return triangle:new(self.pa, self.pb, rotation_(self.pa, math.pi / 3, self.pb))
+ end
end
-function line: isosceles (phi,swap)
- local pta,ptb
- if swap == nil then
- swap = false
- end
+function line:isosceles(phi,swap)
+ local pta,ptb
+ swap = swap or false
if swap then
- pta = rotation_ (self.pa,-phi,self.pb)
- ptb = rotation_ (self.pb,phi,self.pa)
- return triangle : new (self.pa,self.pb, intersection_ll_ (self.pa,pta,self.pb,ptb ))
+ pta = rotation_(self.pa,-phi,self.pb)
+ ptb = rotation_(self.pb,phi,self.pa)
+ return triangle : new (self.pa,self.pb, intersection_ll_(self.pa,pta,self.pb,ptb ))
else
- pta = rotation_ (self.pa,phi,self.pb)
- ptb = rotation_ (self.pb,-phi,self.pa)
+ pta = rotation_(self.pa,phi,self.pb)
+ ptb = rotation_(self.pb,-phi,self.pa)
return triangle : new (self.pa,self.pb, intersection_ll_ (self.pa,pta,self.pb,ptb ))
end
end
+line.isosceles_a = line.isosceles
+
+function line:isosceles_s(a,swap)
+ local c1,c2,pta,ptb,pt1,pt2
+ c1 = circle : radius (self.pa,a)
+ c2 = circle : radius (self.pb,a)
+ pta,ptb = intersection_cc (c1,c2)
+ if get_angle(self.pa,self.pb,pta) < get_angle(self.pa,self.pb,ptb) then
+ pt1=pta pt2=ptb
+ else pt1=ptb pt2=pta end
+ swap = swap or false
+ if swap then
+ return triangle : new (self.pa,self.pb,pt2 )
+ else
+ return triangle : new (self.pa,self.pb,pt1)
+end
+end
-function line: two_angles (alpha,beta)
+function line:two_angles(alpha,beta,swap)
local pta,ptb,pt
- pta = rotation_ (self.pa,alpha,self.pb)
- ptb = rotation_ (self.pb,-beta,self.pa)
- pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
- return triangle : new (self.pa,self.pb,pt)
+ swap = swap or false
+ if swap then
+ pta = rotation_(self.pa,-alpha,self.pb)
+ ptb = rotation_(self.pb,beta,self.pa)
+ else
+ pta = rotation_(self.pa,alpha,self.pb)
+ ptb = rotation_(self.pb,-beta,self.pa)
+ end
+ pt = intersection_ll_(self.pa,pta,self.pb,ptb)
+ return triangle:new(self.pa,self.pb,pt)
end
-function line: school ()
+function line:school(swap)
local pta,ptb,pt
- pta = rotation_ (self.pa,math.pi/6,self.pb)
- ptb = rotation_ (self.pb,-math.pi/3,self.pa)
- pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
- return triangle : new (self.pa,self.pb,pt)
+ swap = swap or false
+ if swap then
+ pta = rotation_(self.pa,-math.pi/6,self.pb)
+ ptb = rotation_(self.pb,math.pi/3,self.pa)
+ else
+ pta = rotation_(self.pa,math.pi/6,self.pb)
+ ptb = rotation_(self.pb,-math.pi/3,self.pa)
+ end
+ pt = intersection_ll_(self.pa,pta,self.pb,ptb)
+ return triangle:new(self.pa,self.pb,pt)
end
-function line: half ()
+function line:half(swap)
local x,pt
x = midpoint_(self.pa,self.pb)
- pt = rotation_ (self.pb,-math.pi/2,x)
- return triangle : new (self.pa,self.pb,pt)
+ swap = swap or false
+ if swap then
+ pt = rotation_(self.pb,math.pi/2,x)
+ else
+ pt = rotation_(self.pb,-math.pi/2,x)
+ end
+ return triangle:new(self.pa,self.pb,pt)
end
-function line: sss (a,b)
+function line:sss(a,b,swap)
local pta,ptb,i,j
+ swap = swap or false
pta = self.pa + point ( a, 0 )
ptb = self.pb + point ( -b , 0)
i,j = intersection_cc_ (self.pa,pta,self.pb,ptb)
- return triangle : new (self.pa,self.pb,i),triangle : new (self.pa,self.pb,j)
+ if swap then
+ return triangle : new (self.pa,self.pb,j)
+ else
+ return triangle : new (self.pa,self.pb,i)
+ end
end
-function line: ssa (a,phi)
- local x,y,pt
- x = rotation_ (self.pb,-phi,self.pa)
- y = self.pa + polar_ ( a , self.slope)
- i,j = intersection_lc_ (self.pb,x,self.pa,y)
- return triangle : new (self.pa,self.pb,i),triangle : new (self.pa,self.pb,j)
+function line:ssa(a, phi,swap)
+ local x, y, i, j
+ swap = swap or false
+ x = rotation_(self.pb, -phi, self.pa)
+ y = self.pa + polar_(a, self.slope)
+ i, j = intersection_lc_(self.pb, x, self.pa, y)
+ if swap then
+ return triangle:new(self.pa, self.pb, j)
+ else
+ return triangle:new(self.pa, self.pb, i)
+ end
end
-function line: sas (a,phi)
- local x,pt
- x = self.pa + polar_ ( a , self.slope)
- pt = rotation_ (self.pa,phi,x)
- return triangle : new (self.pa,self.pb,pt)
+function line:sas(a, phi,swap)
+ local x, pt
+ swap = swap or false
+ x = self.pa + polar_(a, self.slope)
+ if swap then
+ pt = rotation_(self.pa, -phi, x)
+ else
+ pt = rotation_(self.pa, phi, x)
+ end
+ return triangle:new(self.pa, self.pb, pt)
end
-function line: asa (alpha,beta)
+function line:asa(alpha,beta,swap)
local pta,ptb,pt
+ swap = swap or false
+ if swap then
+ pta = rotation_ (self.pa,-alpha,self.pb)
+ ptb = rotation_ (self.pb,beta,self.pa)
+ else
pta = rotation_ (self.pa,alpha,self.pb)
ptb = rotation_ (self.pb,-beta,self.pa)
- pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
+ end
+ pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
return triangle : new (self.pa,self.pb,pt)
end
---- sacred triangles ----
-function line: gold (swap)
+function line:gold(swap)
local pt
- if swap == nil then
- swap = false
- end
-if swap then
- pt = rotation_ (self.pa,-math.pi/2,self.pb)
- return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
-else
- pt = rotation_ (self.pa,math.pi/2,self.pb)
- return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
-end
+ swap = swap or false
+ if swap then
+ pt = rotation_ (self.pa,-math.pi/2,self.pb)
+ return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
+ else
+ pt = rotation_ (self.pa,math.pi/2,self.pb)
+ return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi)
+ end
end
-function line: sublime ()
+function line:sublime(swap)
local pta,ptb,pt
- pta = rotation_ (self.pa,2*math.pi/5,self.pb)
- ptb = rotation_ (self.pb,-2*math.pi/5,self.pa)
- pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
- return triangle : new (self.pa,self.pb,pt)
+ swap = swap or false
+ if swap then
+ pta = rotation_(self.pa,-2*math.pi/5,self.pb)
+ ptb = rotation_(self.pb,2*math.pi/5,self.pa)
+ pt = intersection_ll_(self.pa,pta,self.pb,ptb)
+ return triangle:new(self.pa,self.pb,pt)
+ else
+ pta = rotation_(self.pa,2*math.pi/5,self.pb)
+ ptb = rotation_(self.pb,-2*math.pi/5,self.pa)
+ pt = intersection_ll_(self.pa,pta,self.pb,ptb)
+ return triangle:new(self.pa,self.pb,pt)
+end
end
line.euclid = line.sublime
-function line: euclide (swap)
- if swap == nil then
- return triangle : new (self.pa,self.pb, rotation_ (self.pa,math.pi/5,self.pb))
- else
- return triangle : new (self.pa,self.pb, rotation_ (self.pa,-math.pi/5,self.pb))
- end
+function line:euclide (swap)
+ swap = swap or false
+ if swap then
+ return triangle : new (self.pa,self.pb, rotation_(self.pa,-math.pi/5,self.pb))
+ else
+ return triangle : new (self.pa,self.pb, rotation_(self.pa,math.pi/5,self.pb))
+ end
end
-function line: divine ()
- local pta,ptb,pt,h
- pta = rotation_ (self.pa,math.pi/5,self.pb)
- ptb = rotation_ (self.pb,-math.pi/5,self.pa)
- pt = intersection_ll_ (self.pa,pta,self.pb,ptb)
- return triangle : new (self.pa,self.pb,pt)
-end
+ function line:divine(swap)
+ local pta, ptb, pt
+ swap = swap or false
+ if swap then
+ pta = rotation_(self.pa, -math.pi / 5, self.pb)
+ ptb = rotation_(self.pb, math.pi / 5, self.pa)
+ pt = intersection_ll_(self.pa, pta, self.pb, ptb)
+ return triangle:new(self.pa, self.pb, pt)
+ else
+ pta = rotation_(self.pa, math.pi / 5, self.pb)
+ ptb = rotation_(self.pb, -math.pi / 5, self.pa)
+ pt = intersection_ll_(self.pa, pta, self.pb, ptb)
+ return triangle:new(self.pa, self.pb, pt)
+ end
+ end
-function line: cheops ()
- local m,n,pt
- m = midpoint_ (self.pa,self.pb)
- n = rotation_ (m,- math.pi/2,self.pa)
- pt = m + (n-m)* tkzsqrtphi
- return triangle : new (self.pa,self.pb,pt)
+function line:cheops(swap)
+ local m, n, pt
+ m = midpoint_(self.pa, self.pb)
+ swap = swap or false
+ if swap then
+ n = rotation_(m, math.pi / 2, self.pa)
+ pt = m + (n - m) * tkzsqrtphi
+else
+ n = rotation_(m, -math.pi / 2, self.pa)
+ pt = m + (n - m) * tkzsqrtphi
+ end
+ return triangle:new(self.pa, self.pb, pt)
end
-function line: egyptian ()
- local n,pt
- n = rotation_ (self.pb,- math.pi/2,self.pa)
- pt = self.pb + (n-self.pb)/point.mod(n-self.pb)*self.length* 0.75
- return triangle : new (self.pa,self.pb,pt)
+
+function line:egyptian(swap)
+ local n, pt
+ swap = swap or false
+ if swap then
+ n = rotation_(self.pb, math.pi / 2, self.pa)
+ pt = self.pb + (n - self.pb) / point.mod(n - self.pb) * self.length * 0.75
+ else
+ n = rotation_(self.pb, -math.pi / 2, self.pa)
+ pt = self.pb + (n - self.pb) / point.mod(n - self.pb) * self.length * 0.75
+ end
+ return triangle:new(self.pa, self.pb, pt)
end
+
line.pythagoras = line.egyptian
line.isis = line.egyptian
line.golden = line.sublime
@@ -509,12 +689,14 @@ line.golden_gnomon = line.divine
------------------------------
-- Result -> square
------------------------------
-function line: square (swap)
- if swap == nil
+function line:square (swap)
+ swap = swap or false
+ if swap
then
- return square : side (self.pa,self.pb)
- else
return square : side (self.pa,self.pb,indirect)
+ else
+ return square : side (self.pa,self.pb)
+
end
end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
index e4f5c7623e..e5843dae1a 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua
@@ -1,6 +1,6 @@
-- tkz_elements-main.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_matrices.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_matrices.lua
index f0bd69b95e..07048af557 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_matrices.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_matrices.lua
@@ -1,6 +1,6 @@
-- tkz_elements_matrices.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -44,26 +44,37 @@ function matrix.__sub(m1,m2)
return add_matrix(m1,k_mul_matrix(-1, m2))
end
-function matrix.__pow( m, num )
- if num =='T' then
- return transposeMatrix(m)
- else
- if num == 0 then
- return matrix:new( #m,"I" )
- end
- if num < 0 then
- local i; m,i = inv_matrix ( m )
- if not m then return m, i end
- num = -num
- end
- local mt = m
- for i = 2,num do
- mt = mul_matrix(mt,m)
- end
- return mt
-end
+function matrix.__pow(m, num)
+ -- Handle transpose (when num is 'T')
+ if num == 'T' then
+ return transposeMatrix(m)
+ end
+
+ -- Handle exponentiation by 0 (returns the identity matrix)
+ if num == 0 then
+ return matrix:new(#m, "I") -- Identity matrix
+ end
+
+ -- Handle negative exponents (invert the matrix)
+ if num < 0 then
+ local inv_matrix, err = inv_matrix(m)
+ if not inv_matrix then
+ return nil, err -- Return nil and the error if matrix is non-invertible
+ end
+ num = -num -- Make exponent positive for easier handling
+ m = inv_matrix -- Now use the inverted matrix
+ end
+
+ -- Now handle the positive exponentiation
+ local result = m
+ for i = 2, num do
+ result = mul_matrix(result, m) -- Repeated multiplication
+ end
+
+ return result
end
+
function matrix.__tostring( A )
local mt = (A.type=='matrix' and A.set or A)
local k = {}
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
index 7fcac90d86..5f01756b5a 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_misc.lua
@@ -1,6 +1,6 @@
-- tkz_elements_functions_maths.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -14,19 +14,31 @@
-- ----------------------------------------------------------------
--
-- ----------------------------------------------------------------
-function get_points (obj)
-if obj.type == 'line' then return obj.pa,obj.pb
- elseif
- obj.type == 'triangle' then return obj.pa,obj.pb,obj.pc
- elseif
- obj.type == 'circle' then return obj.center,obj.through
- elseif
- obj.type == 'ellipse' then return obj.pc,obj.pa,obj.pb
- elseif
- obj.type == 'square' or obj.type == 'rectangle' or obj.type == 'quadrilateral' or obj.type == 'parallelogram'
- then return obj.pa,obj.pb,obj.pc,obj.pd
-end
-end
+function get_points(obj)
+ -- Map of object types to their respective point keys
+ local point_map = {
+ line = {"pa", "pb"}, -- Line has two points
+ triangle = {"pa", "pb", "pc"}, -- Triangle has three points
+ circle = {"center", "through"}, -- Circle has center and a point through its circumference
+ ellipse = {"pc", "pa", "pb"}, -- Ellipse has three key points
+ square = {"pa", "pb", "pc", "pd"}, -- Square has four vertices
+ rectangle = {"pa", "pb", "pc", "pd"}, -- Rectangle has four vertices
+ quadrilateral = {"pa", "pb", "pc", "pd"}, -- Quadrilateral has four vertices
+ parallelogram = {"pa", "pb", "pc", "pd"} -- Parallelogram has four vertices
+ }
+
+ -- Check if the object's type is recognized
+ if point_map[obj.type] then
+ local points = {}
+ -- Iterate over the keys for the given type and extract the corresponding values
+ for _, key in ipairs(point_map[obj.type]) do
+ table.insert(points, obj[key])
+ end
+ -- Return all points as multiple return values
+ return table.unpack(points)
+ end
+ end
+
function set_lua_to_tex (t)
for k,v in pairs(t) do
@@ -35,29 +47,49 @@ function set_lua_to_tex (t)
end
function bisector (a,b,c)
- local i
- i = in_center_ (a,b,c)
+ local i = in_center_ (a,b,c)
return line : new (a,intersection_ll_ (a,i,b,c))
end
-function altitude (a,b,c)
- local o,p
- o = ortho_center_ (a,b,c)
- p = projection_ (b,c,a)
- return line : new (a,p)
+function altitude(a, b, c)
+ local o, p
+ -- Get the orthocenter (which is the point of concurrency of the altitudes)
+ o = ortho_center_(a, b, c)
+
+ -- Get the perpendicular projection of point 'a' onto the line defined by 'b' and 'c'
+ p = projection_(b, c, a)
+
+ -- Return the altitude, which is the line from point 'a' to the point 'p'
+ return line:new(a, p)
end
-function bisector_ext(a,b,c) -- n =1 swap n=2 2 swap
- local i,p
- i = in_center_ (a,b,c)
- p = rotation_ (a,math.pi/2,i)
- return line : new (a,p)
+
+function bisector_ext(a, b, c) -- n=1 swap n=2 swap 2
+ local i, p
+ -- Get the incenter of the triangle
+ i = in_center_(a, b, c)
+
+ -- Rotate the incenter by 90 degrees around point 'a' to compute the external bisector
+ p = rotation_(a, math.pi / 2, i)
+
+ -- Return the external bisector as the line passing through points 'a' and 'p'
+ return line:new(a, p)
end
+
function equilateral (a,b)
return equilateral_tr_ (a,b)
end
function midpoint (a,b)
return (a+b)/2
+end
+
+function midpoints (...)
+ return midpoints_(...)
+end
+
+
+function length(a,b)
+ return point.abs (a-b)
end \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
index a6dc3360f9..8cd02bf73e 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_parallelogram.lua
@@ -1,6 +1,6 @@
-- tkz_elements_parallelogram.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
index 3ec0262051..be28002328 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua
@@ -1,6 +1,6 @@
-- tkz_elements_point.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -252,28 +252,28 @@ function point: west(d)
-- return symmetry_ (self ,pt)
-- end
-function point: symmetry (...)
- local obj,nb,t
- local tp = table.pack(...)
- obj = tp[1]
- nb = tp.n
- if nb == 1 then
- if obj.type == "point" then
- return symmetry_ (self,obj)
- elseif obj.type == "line" then
- return line: new (set_symmetry_ (self,obj.pa,obj.pb))
- elseif obj.type == "circle" then
- return circle: new (set_symmetry_ (self,obj.center,obj.through))
- else
- return triangle: new (set_symmetry (self,obj.pa,obj.pb,obj.pc))
- end
- else
- local t = {}
- for i=1,tp.n do
- table.insert( t , symmetry_ (self , tp[i]) )
- end
- return table.unpack ( t )
- end
+function point:symmetry(...)
+ local tp = table.pack(...) -- Pack arguments into a table
+ local nb = tp.n -- Number of arguments
+ local obj = tp[1] -- The first object in the arguments
+
+ if nb == 1 then -- If there's only one argument
+ if obj.type == "point" then
+ return symmetry_(self, obj) -- Apply symmetry on the point
+ elseif obj.type == "line" then
+ return line:new(set_symmetry_(self, obj.pa, obj.pb)) -- Create a new line
+ elseif obj.type == "circle" then
+ return circle:new(set_symmetry_(self, obj.center, obj.through)) -- Create a new circle
+ else
+ return triangle:new(set_symmetry(self, obj.pa, obj.pb, obj.pc)) -- Create a new triangle
+ end
+ else -- If there are multiple arguments
+ local results = {} -- Initialize a table to store results
+ for i = 1, nb do
+ table.insert(results, symmetry_(self, tp[i])) -- Apply symmetry on each object
+ end
+ return table.unpack(results) -- Return the results as separate values
+ end
end
function point: set_symmetry (...)
@@ -288,56 +288,56 @@ function point:set_rotation (angle,...)
return set_rotation_ ( self,angle,... )
end
-function point : rotation (angle,...)
- local obj,nb,t
- local tp = table.pack(...)
- obj = tp[1]
- nb = tp.n
- if nb == 1 then
- if obj.type == "point" then
- return rotation_ (self,angle,obj )
- elseif obj.type == "line" then
- return line : new (set_rotation_ (self, angle,obj.pa,obj.pb ))
- elseif obj.type == "triangle" then
- return triangle: new (set_rotation_ (self, angle,obj.pa,obj.pb,obj.pc))
- elseif obj.type == "circle" then
-return circle : new (set_rotation_ (self,angle,obj.center,obj.through))
- else
-return square: new (set_rotation_(self,angle,obj.pa,obj.pb,obj.pc,obj.pd))
- end
- else
- t = {}
- for i=1,tp.n do
- table.insert( t , rotation_ ( self,angle,tp[i]))
- end
- return table.unpack ( t )
- end
+function point:rotation(angle, ...)
+ local tp = table.pack(...) -- Pack arguments into a table
+ local nb = tp.n -- Number of arguments
+ local obj = tp[1] -- The first object in the arguments
+
+ if nb == 1 then -- If there's only one argument
+ if obj.type == "point" then
+ return rotation_(self, angle, obj) -- Rotate the point
+ elseif obj.type == "line" then
+ return line:new(set_rotation_(self, angle, obj.pa, obj.pb)) -- Rotate the line
+ elseif obj.type == "triangle" then
+ return triangle:new(set_rotation_(self, angle, obj.pa, obj.pb, obj.pc)) -- Rotate the triangle
+ elseif obj.type == "circle" then
+ return circle:new(set_rotation_(self, angle, obj.center, obj.through)) -- Rotate the circle
+ else -- For other shapes like square
+ return square:new(set_rotation_(self, angle, obj.pa, obj.pb, obj.pc, obj.pd)) -- Rotate the square
+ end
+ else -- If there are multiple arguments
+ local results = {} -- Initialize a table to store results
+ for i = 1, nb do
+ table.insert(results, rotation_(self, angle, tp[i])) -- Rotate each object
+ end
+ return table.unpack(results) -- Return the results as separate values
+ end
end
-function point : homothety (coeff,...)
-local obj,nb,t
-local tp = table.pack(...)
-obj = tp[1]
-nb = tp.n
- if nb == 1 then
- if obj.type == "point" then
- return homothety_ (self,coeff,obj )
- elseif obj.type == "line" then
- return line : new (set_homothety_ (self, coeff,obj.pa,obj.pb ))
- elseif obj.type == "triangle" then
- return triangle: new (set_homothety_(self,coeff,obj.pa,obj.pb,obj.pc))
- elseif obj.type == "circle" then
- return circle: new (set_homothety_(self,coeff,obj.center,obj.through))
- else
-return square: new (set_homothety_(self,coeff,obj.pa,obj.pb))
- end
- else
- t = {}
- for i=1,tp.n do
- table.insert( t , homothety_ ( self,coeff,tp[i]))
- end
- return table.unpack ( t )
- end
+function point:homothety(coeff, ...)
+ local tp = table.pack(...) -- Pack arguments into a table
+ local nb = tp.n -- Number of arguments
+ local obj = tp[1] -- The first object in the arguments
+ local t = {} -- Initialize a table to store results
+
+ if nb == 1 then -- If there's only one argument
+ if obj.type == "point" then
+ return homothety_(self, coeff, obj) -- Apply homothety to the point
+ elseif obj.type == "line" then
+ return line:new(set_homothety_(self, coeff, obj.pa, obj.pb)) -- Apply homothety to the line
+ elseif obj.type == "triangle" then
+ return triangle:new(set_homothety_(self, coeff, obj.pa, obj.pb, obj.pc)) -- Apply homothety to the triangle
+ elseif obj.type == "circle" then
+ return circle:new(set_homothety_(self, coeff, obj.center, obj.through)) -- Apply homothety to the circle
+ else -- For other shapes like square
+ return square:new(set_homothety_(self, coeff, obj.pa, obj.pb, obj.pc, obj.pd)) -- Apply homothety to the square
+ end
+ else -- If there are multiple arguments
+ for i = 1, nb do
+ table.insert(t, homothety_(self, coeff, tp[i])) -- Apply homothety to each object
+ end
+ return table.unpack(t) -- Return the results as separate values
+ end
end
function point: normalize()
@@ -345,16 +345,19 @@ function point: normalize()
return point(self.re/d,self.im/d)
end
-function point: orthogonal(d)
+function point:orthogonal(d)
local m
- if d==nil then
- return point(-self.im,self.re)
-else
- m = point.mod(self)
- return point(-self.im*d/m,self.re*d/m)
-end
+ if d == nil then
+ -- If no scaling factor d is provided, return the point rotated 90 degrees counterclockwise
+ return point(-self.im, self.re)
+ else
+ -- If a scaling factor d is provided, scale the orthogonal point
+ m = point.mod(self) -- Get the modulus (magnitude) of the current point
+ return point(-self.im * d / m, self.re * d / m) -- Return the scaled orthogonal point
+ end
end
+
function point : at (z)
return point(self.re+z.re,self.im+z.im)
end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
index fc3e95b28f..0cc6ca30a6 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_quadrilateral.lua
@@ -1,6 +1,6 @@
-- tkz_elements_quadrilateral.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
index a531722020..5247d48e1b 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_rectangle.lua
@@ -1,6 +1,6 @@
-- tkz_elements-rectangle.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -24,34 +24,34 @@ function rectangle: new (za, zb,zc,zd)
end
if math.abs(point.abs (zc-za)-point.abs (zd-zb)) < tkz_epsilon then else error ("it's not a rectangle")
end
- local type = 'rectangle'
- local center = midpoint_ (za,zc)
- local exradius = point.abs (center-za)
- local ab = line : new (za,zb)
- local bc = line : new (zb,zc)
- local cd = line : new (zc,zd)
- local da = line : new (zd,za)
- local ac = line : new (za,zc)
- local bd = line : new (zb,zd)
- local length = point.mod (zb-za)
- local width = point.mod (zd-za)
- local diagonal = point.abs (zc-za)
- local o = { pa = za,
- pb = zb,
- pc = zc,
- pd = zd,
- ab = ab,
- ac = ac,
- bc = bc,
- da = da,
- cd = cd,
- bd = bd,
- diagonal = diagonal,
- exradius = exradius,
- center = center,
- length = length,
- width = width,
- type = type }
+ local type = 'rectangle'
+ local center = midpoint_ (za,zc)
+ local circumradius = point.abs (center-za)
+ local ab = line : new (za,zb)
+ local bc = line : new (zb,zc)
+ local cd = line : new (zc,zd)
+ local da = line : new (zd,za)
+ local ac = line : new (za,zc)
+ local bd = line : new (zb,zd)
+ local length = point.mod (zb-za)
+ local width = point.mod (zd-za)
+ local diagonal = point.abs (zc-za)
+ local o = { pa = za,
+ pb = zb,
+ pc = zc,
+ pd = zd,
+ ab = ab,
+ ac = ac,
+ bc = bc,
+ da = da,
+ cd = cd,
+ bd = bd,
+ diagonal = diagonal,
+ circumradius = circumradius,
+ center = center,
+ length = length,
+ width = width,
+ type = type }
setmetatable(o, self)
self.__index = self
return o
@@ -69,7 +69,7 @@ function rectangle : gold (za,zb,swap)
local zc,zd
local a = point.arg (zb-za)
local d = point.abs(zb-za)/tkzphi
- if swap == nil then swap = false end
+ swap = swap or false
if swap then
zc = zb : south (d/scale)
zc = rotation_ (zb,a,zc)
@@ -87,7 +87,7 @@ end
function rectangle : diagonal (za,zc,swap)
local zb,zd
- if swap == nil then swap = false end
+ swap = swap or false
if swap then
zd = point (zc.re,za.im)
zb = point (za.re,zc.im)
@@ -102,7 +102,7 @@ end
function rectangle : side (za,zb,d,swap)
local a,zc,zd
a = point.arg (zb-za)
- if swap == nil then swap = false end
+ swap = swap or false
if swap then
zc = zb : south (d/scale)
zc = rotation_ (zb,a,zc)
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
index bf49fca814..65c197d315 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_regular.lua
@@ -1,6 +1,6 @@
-- tkz_elements_regular.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -11,7 +11,7 @@
-- version 2005/12/01 or later.
-- This work has the LPPL maintenance status “maintained”.
-- The Current Maintainer of this work is Alain Matthes.
-
+-- za = center zb a vertex
regular_polygon = {}
function regular_polygon: new (za, zb ,nb)
local type = 'regular_polygon'
@@ -19,24 +19,28 @@ function regular_polygon: new (za, zb ,nb)
local center = za
local through = zb
local angle = 2 * math.pi/nb
- local exradius = point.abs (zb-za)
+ local circumradius = point.abs (zb-za)
local circle = circle : new (za,zb)
- local inradius = exradius * math.cos(math.pi/nb)
- local side = exradius * math.sin(math.pi/nb)
+ local inradius = circumradius * math.cos(math.pi/nb)
+ local side = circumradius * math.sin(math.pi/nb)
local next = table[2]
local first = table[1]
local proj = projection_ (first,next,za)
+ local perimeter = nb * side
+ local area = (perimeter * inradius)/2
local o = { type = type,
center = center,
through = through,
- exradius = exradius,
+ circumradius= circumradius,
inradius = inradius,
table = table,
circle = circle,
nb = nb,
angle = angle,
side = side,
- proj = proj }
+ proj = proj,
+ perimeter = perimeter,
+ area = area}
setmetatable(o, self)
self.__index = self
return o
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
index 68bfa8dec0..d968feacde 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_square.lua
@@ -1,6 +1,6 @@
-- tkz_elements-square.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -27,38 +27,42 @@ function square: new (za, zb,zc,zd)
if math.abs(point.abs (zb-za) - point.abs (zd-za)) < tkz_epsilon then else error ("it's not a square (side)")
end
- local type = 'square'
- local side = point.abs ( zb - za )
- local pc = rotation_ (zb,-math.pi/2,za)
- local pd = rotation_ (za,math.pi/2,zb)
- local center = midpoint_ (za,zc)
- local exradius = point.abs (center-za)
- local inradius = exradius * math.cos(math.pi/4)
- local diagonal = math.sqrt(2) * side
- local proj = projection_ (za,zb,center)
- local ab = line : new (za,zb)
- local bc = line : new (zb,zc)
- local cd = line : new (zc,zd)
- local da = line : new (zd,za)
- local bd = line : new (zb,zd)
- local ac = line : new (za,zc)
- local o = { pa = za,
- pb = zb,
- pc = zc,
- pd = zd,
- side = side,
- center = center,
- exradius = exradius,
- inradius = inradius,
- diagonal = diagonal,
- proj = proj,
- ab = ab,
- ac = ac,
- bc = bc,
- da = da,
- cd = cd,
- bd = bd,
- type = type }
+ local type = 'square'
+ local side = point.abs ( zb - za )
+ local pc = rotation_ (zb,-math.pi/2,za)
+ local pd = rotation_ (za,math.pi/2,zb)
+ local center = midpoint_ (za,zc)
+ local circumradius = point.abs (center-za)
+ local inradius = circumradius * math.cos(math.pi/4)
+ local diagonal = math.sqrt(2) * side
+ local proj = projection_ (za,zb,center)
+ local ab = line : new (za,zb)
+ local bc = line : new (zb,zc)
+ local cd = line : new (zc,zd)
+ local da = line : new (zd,za)
+ local bd = line : new (zb,zd)
+ local ac = line : new (za,zc)
+ local area = side * side
+ local perimeter = 4 * side
+ local o = { pa = za,
+ pb = zb,
+ pc = zc,
+ pd = zd,
+ side = side,
+ center = center,
+ circumradius = circumradius,
+ inradius = inradius,
+ diagonal = diagonal,
+ proj = proj,
+ ab = ab,
+ ac = ac,
+ bc = bc,
+ da = da,
+ cd = cd,
+ bd = bd,
+ type = type,
+ area = area,
+ perimeter = perimeter }
setmetatable(o, self)
self.__index = self
return o
@@ -71,16 +75,20 @@ function square : rotation (zi,za)
return square : new (za,zb,zc,zd)
end
-function square : side (za,zb,swap)
- if swap == nil
- then
- local zc = rotation_ (zb,-math.pi/2,za)
- local zd = rotation_ (za,math.pi/2,zb)
- return square : new (za,zb,zc,zd)
+function square:side(za, zb, swap)
+ swap = swap or false
+ if swap then
+ -- Rotate zb clockwise around za to get zc
+ local zc = rotation_(zb, math.pi / 2, za)
+ -- Rotate za counterclockwise around zb to get zd
+ local zd = rotation_(za, -math.pi / 2, zb)
+ return square:new(za, zb, zc, zd)
else
- local zc = rotation_ (zb,math.pi/2,za)
- local zd = rotation_ (za,-math.pi/2,zb)
- return square : new (za,zb,zc,zd)
+ -- Rotate zb counterclockwise around za to get zc
+ local zc = rotation_(zb, -math.pi / 2, za)
+ -- Rotate za clockwise around zb to get zd
+ local zd = rotation_(za, math.pi / 2, zb)
+ return square:new(za, zb, zc, zd)
end
end
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
index 6318a7d8d1..5267740033 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangle.lua
@@ -1,6 +1,6 @@
-- tkz_elements_triangles.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3
@@ -30,6 +30,10 @@ function triangle: new (za, zb ,zc)
local ab = line : new (za,zb)
local ca = line : new (zc,za)
local bc = line : new (zb,zc)
+ local semiperimeter = (a+b+c)/2
+ local area = math.sqrt((semiperimeter)*(semiperimeter-a)*(semiperimeter-b)*(semiperimeter-c))
+ local inradius = area / semiperimeter
+ local circumradius = (a*b*c)/(4*inradius*semiperimeter)
local o = { pa = za,
pb = zb,
pc = zc,
@@ -48,7 +52,11 @@ function triangle: new (za, zb ,zc)
bc = bc,
alpha = alpha,
beta = beta,
- gamma = gamma}
+ gamma = gamma,
+ semiperimeter = semiperimeter,
+ area = area,
+ inradius = inradius,
+ circumradius = circumradius}
setmetatable(o, self)
self.__index = self
return o
@@ -110,24 +118,25 @@ function triangle: euler_points ()
return midpoint_ ( H,self.pa ), midpoint_ ( H,self.pb ), midpoint_ ( H,self.pc )
end
-function triangle: nine_points ()
- local H,ma,mb,mc,H,ha,hb,hc
- ma,mb,mc = medial_tr_ ( self.pa , self.pb , self.pc)
- ha,hb,hc = orthic_tr_ ( self.pa , self.pb , self.pc)
- H = ortho_center_ ( self.pa , self.pb , self.pc )
- return
- ma,mb,mc,
- ha,hb,hc,
- midpoint_ ( H,self.pa ),
- midpoint_ ( H,self.pb ),
- midpoint_ ( H,self.pc )
+function triangle:nine_points()
+ local ma, mb, mc, ha, hb, hc, H
+ -- Calculate the medial triangle
+ ma, mb, mc = medial_tr_(self.pa, self.pb, self.pc)
+ -- Calculate the orthic triangle
+ ha, hb, hc = orthic_tr_(self.pa, self.pb, self.pc)
+ -- Calculate the orthocenter
+ H = ortho_center_(self.pa, self.pb, self.pc)
+
+ -- Return the points of the nine-point circle
+ return ma, mb, mc, ha, hb, hc,
+ midpoint_(H, self.pa), midpoint_(H, self.pb), midpoint_(H, self.pc)
end
+
function triangle : point (t)
- local t1,t2,p
- p = (self.a + self.b + self.c)
- t1 = self.a / p
- t2 = (self.a + self.b) / p
+ local p = (self.a + self.b + self.c)
+ local t1 = self.a / p
+ local t2 = (self.a + self.b) / p
if t<= t1 then
return self.ab : point (t/t1)
elseif t <= t2 then
@@ -163,11 +172,10 @@ function triangle: euler_line ()
end
function triangle: symmedian_line (n)
- local a,b,c,l
- a = self.pa
- b = self.pb
- c = self.pc
- l = self : lemoine_point ()
+ local a = self.pa
+ local b = self.pb
+ local c = self.pc
+ local l = self : lemoine_point ()
if n==1 then
return line : new (b,intersection_ll_ (b,l,a,c))
elseif n==2 then
@@ -184,23 +192,22 @@ function triangle: altitude (n)
c = self.pc
o = ortho_center_ (a,b,c)
if n==1 then
- p = projection_ (a,c,b)
+ p = projection_ (a,c,b)
return line : new (b,p)
elseif n==2 then
p = projection_ (a,b,c)
return line : new (c,p)
else
- p = projection_ (b,c,a)
+ p = projection_ (b,c,a)
return line : new (a,p)
end
end
function triangle: bisector (n)
- local a,b,c,i
- a = self.pa
- b = self.pb
- c = self.pc
- i = in_center_ (a,b,c)
+ local a = self.pa
+ local b = self.pb
+ local c = self.pc
+ local i = in_center_ (a,b,c)
if n==1 then
return line : new (b,intersection_ll_ (b,i,a,c))
elseif n==2 then
@@ -211,10 +218,9 @@ function triangle: bisector (n)
end
function triangle: bisector_ext(n) -- n =1 swap n=2 2 swap
-local a,b,c
- a = self.pa
- b = self.pb
- c = self.pc
+ local a = self.pa
+ local b = self.pb
+ local c = self.pc
if n==1 then -- ac
return line : new (b,bisector_ext_ (b,c,a))
elseif n==2 then -- ab
@@ -254,21 +260,21 @@ end
-----------------------
--- Result -> circles --
-----------------------
-function triangle: euler_circle ()
+function triangle:euler_circle()
return circle : new (euler_center_ ( self.pa , self.pb , self.pc),midpoint_( self.pb , self.pc))
end
-function triangle: circum_circle()
+function triangle:circum_circle()
return circle : new (circum_circle_ ( self.pa , self.pb , self.pc), self.pa )
end
-function triangle: in_circle ()
+function triangle:in_circle()
local o
o = in_center_ ( self.pa , self.pb , self.pc)
return circle : new (o, projection_ (self.pb , self.pc,o) )
end
-function triangle: ex_circle (n) -- n =1 swap n=2 2 swap
+function triangle:ex_circle (n) -- n =1 swap n=2 2 swap
local a,b,c,o
a = self.pa
b = self.pb
@@ -505,5 +511,42 @@ function triangle: check_acutangle()
end
end
+-- Circle tangent to two straight lines passing through a given point
+function triangle:c_ll_p(p)
+
+ -- Compute the bisector of the triangle
+ local lbi = bisector(self.pa, self.pb,self.pc)
+
+ if lbi:in_out(p) then
+ -- Orthogonal projection of p onto the bisector
+ local lp = lbi:ortho_from(p)
+
+ -- Intersection of line from p to its projection with self.pa and self.pb
+ local i = intersection_ll_(p, lp.pb, self.pa, self.pb)
+
+ -- Intersection points of the line with the circle defined by (i, p)
+ local t1, t2 = intersection_lc_(self.pa, self.pb, i, p)
+
+ -- Create the main line and find orthogonal projections from t1 and t2
+ local lab = line:new(self.pa, self.pb)
+ local x = lab:ortho_from(t1).pb
+ local y = lab:ortho_from(t2).pb
+
+ -- Return two circles based on the orthogonal projections and points t1, t2
+ return circle:new(intersection_ll_(x, t1, self.pa, p), t1),
+ circle:new(intersection_ll_(y, t2, self.pa, p), t2)
+ else
+ local lab = line:new(self.pa, self.pb)
+ -- Reflection of p across the bisector
+ local q = lbi : reflection (p)
+
+ -- Compute circles from the Wallis construction
+ local c1, c2 = lab:c_l_pp(p, q)
+
+ -- Return two circles with centers and points on their circumference
+ return c1,c2
+ end
+end
+
return triangle \ No newline at end of file
diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
index fcd63c783a..7e9f0ff94f 100644
--- a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
+++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vector.lua
@@ -1,6 +1,6 @@
-- tkz_elements_vectors.lua
--- date 2024/07/16
--- version 3.00
+-- date 2025/01/06
+-- version 3.10
-- Copyright 2024 Alain Matthes
-- This work may be distributed and/or modified under the
-- conditions of the LaTeX Project Public License, either version 1.3