diff options
author | Norbert Preining <norbert@preining.info> | 2023-10-27 03:03:08 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-10-27 03:03:08 +0000 |
commit | e7c703c953f148411c70d5ca86dc1c1023d73806 (patch) | |
tree | 103695d0d26aa0b1d5b1942fd433cf5f9a90d47f /macros/latex | |
parent | 721b0492f150d59f61b504ab803c7ef1a9a67a0b (diff) |
CTAN sync 202310270303
Diffstat (limited to 'macros/latex')
132 files changed, 11453 insertions, 1266 deletions
diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/README.md b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/README.md index 5382e8cdb4..b625254241 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/README.md +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/README.md @@ -1,5 +1,5 @@ <!-- -arguelles v2.2.0 +arguelles v2.3.0 author: Michele Piazzai contact: michele.piazzai@uc3m.es license: MIT @@ -9,19 +9,13 @@ license: MIT Argüelles is a beamer theme that helps you create beautiful presentations. It aims for simplicity and readability by following best practices of graphic design. The layout is elegant but subtle, so as to keep the audience's attention on your content. This is brought to life by Alegreya, one of the 53 Fonts of the Decade selected by the Association Typographique Internationale (2011). -The theme requires the packages [Alegreya/AlegreyaSans](https://ctan.org/pkg/alegreya), [eulervm](https://ctan.org/pkg/eulervm), [mathalpha](https://www.ctan.org/pkg/mathalpha), [microtype](https://ctan.org/pkg/microtype), [fontawesome5](https://ctan.org/pkg/fontawesome5), [opencolor](https://www.ctan.org/pkg/opencolor), [enumitem](https://www.ctan.org/pkg/enumitem), [parskip](https://www.ctan.org/pkg/parskip), and [tikz/pgf](https://ctan.org/pkg/pgf) to be installed on your computer. These are included in common LaTeX distributions, such as [MiKTeX](https://ctan.org/pkg/miktex) and [TeXLive](https://ctan.org/pkg/texlive). +The theme requires the packages [alegreya](https://ctan.org/pkg/alegreya), [eulervm](https://ctan.org/pkg/eulervm), [mathalpha](https://www.ctan.org/pkg/mathalpha), [microtype](https://ctan.org/pkg/microtype), [fontawesome5](https://ctan.org/pkg/fontawesome5), [opencolor](https://www.ctan.org/pkg/opencolor), [enumitem](https://www.ctan.org/pkg/enumitem), [parskip](https://www.ctan.org/pkg/parskip), and [pgf](https://ctan.org/pkg/pgf) to be installed on your computer. These are included in common LaTeX distributions, such as MiKTeX and TeXLive. ## Demo -The files `demo.tex` and `demo.pdf` demonstrate the main features of the theme. +The files `demo-arguelles.tex` and `demo-arguelles.pdf` demonstrate the main features of the theme. -### Serif - -![](https://github.com/piazzai/arguelles/blob/master/demo/demo-arguelles-serif.gif) - -### Sans-serif - -![](https://github.com/piazzai/arguelles/blob/master/demo/demo-arguelles-sans.gif) +![](https://github.com/piazzai/arguelles/blob/master/demo/demo-arguelles.gif) ## Installation @@ -29,13 +23,13 @@ Argüelles is hosted on CTAN and distributed as part of MikTex and TeXLive. It c ## Usage -By default, the theme uses serif fonts for body text. Loading it with the `sans` option makes sans-serif fonts default, keeping serif only for math type. Because sans-serif font is more space-efficient, this could be useful for slides that contain more text and bullet points. See the two animations below for comparison. +By default, the theme uses serif fonts for body text. Loading it with the `sans` option makes sans-serif fonts default, keeping serif only for math type. Because sans-serif font is more space-efficient, this could be useful for slides that contain more text and bullet points. The `frameno` option adds frame numbering in the bottom right corner of each frame. By default, frame numbers are hidden on title and plain frames. They can also be suppressed on individual frames by `\begin{frame}[noframenumbering]`. The `splitnav` option makes the navigation bar in the headline display only the current section and its frames. This could be preferable if your presentation has only a few sections, which do not adequately fill the headline, or if it has a lot of sections and the headline looks too crowded. -The `mp` option loads additional dependencies that could be useful for designing scientific presentations. These currently include [ulem](https://ctan.org/pkg/ulem), [booktabs](https://ctan.org/pkg/booktabs), [dcolumn](https://ctan.org/pkg/dcolumn), [makecell](https://ctan.org/pkg/makecell), [colortbl](https://www.ctan.org/pkg/colortbl), [cancel](https://www.ctan.org/pkg/cancel), [pgfplots](https://www.ctan.org/pkg/pgfplots), and [csvsimple](https://www.ctan.org/pkg/csvsimple). In addition, the option loads the [calc](https://tikz.dev/library-calc) library for TikZ, and the [statistics](https://tikz.dev/pgfplots/libs-statistics) and [fillbetween](https://tikz.dev/pgfplots/libs-fillbetween) libraries for PGFplots. +The `mp` option loads additional dependencies that could be useful for scientific presentations. These currently include [ulem](https://ctan.org/pkg/ulem), [booktabs](https://ctan.org/pkg/booktabs), [dcolumn](https://ctan.org/pkg/dcolumn), [makecell](https://ctan.org/pkg/makecell), [colortbl](https://www.ctan.org/pkg/colortbl), [cancel](https://www.ctan.org/pkg/cancel), [pgfplots](https://www.ctan.org/pkg/pgfplots), and [csvsimple](https://www.ctan.org/pkg/csvsimple). In addition, the option loads the [calc](https://tikz.dev/library-calc) library for TikZ, and the [groupplots](https://tikz.dev/pgfplots/libs-groupplots), [fillbetween](https://tikz.dev/pgfplots/libs-fillbetween), and [statistics](https://tikz.dev/pgfplots/libs-statistics) libraries for PGFplots. ## Customization diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamercolorthemeArguelles.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamercolorthemeArguelles.sty index 3f9b398074..a741c8d8a3 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamercolorthemeArguelles.sty +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamercolorthemeArguelles.sty @@ -1,10 +1,10 @@ -% arguelles v2.2.0 +% arguelles v2.3.0 % author: Michele Piazzai % contact: michele.piazzai@uc3m.es % license: MIT \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamercolorthemeArguelles}[2023/03/22 Argüelles] +\ProvidesPackage{beamercolorthemeArguelles}[2023/10/26 Argüelles] \mode<presentation> diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerfontthemeArguelles.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerfontthemeArguelles.sty index c1b7e74267..aa2455b591 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerfontthemeArguelles.sty +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerfontthemeArguelles.sty @@ -1,10 +1,10 @@ -% arguelles v2.2.0 +% arguelles v2.3.0 % author: Michele Piazzai % contact: michele.piazzai@uc3m.es % license: MIT \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerfontthemeArguelles}[2023/03/22 Argüelles] +\ProvidesPackage{beamerfontthemeArguelles}[2023/10/26 Argüelles] \mode<presentation> @@ -19,6 +19,8 @@ \setbeamerfont{author}{series=\bfseries,size=\large} \setbeamerfont{institute}{size=\small} \setbeamerfont{email}{size=\small} +\setbeamerfont{homepage}{size=\small} +\setbeamerfont{github}{size=\small} % frame elements \setbeamerfont{headline section}{series=\AlegreyaSans\scshape} diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerinnerthemeArguelles.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerinnerthemeArguelles.sty index fb5ffd180c..36b0b8c4f1 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerinnerthemeArguelles.sty +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerinnerthemeArguelles.sty @@ -1,10 +1,10 @@ -% arguelles v2.2.0 +% arguelles v2.3.0 % author: Michele Piazzai % contact: michele.piazzai@uc3m.es % license: MIT \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerinnerthemeArguelles}[2023/03/22 Argüelles] +\ProvidesPackage{beamerinnerthemeArguelles}[2023/10/26 Argüelles] \mode<presentation> @@ -17,6 +17,14 @@ \newcommand{\email}[1]{ \def\insertemail{\href{mailto:#1}{\raisebox{-.1em}{\faIcon{envelope}}\hspace{.3em}#1}} } +\def\inserthomepage{} +\newcommand{\homepage}[1]{ + \def\inserthomepage{\href{https://#1}{\raisebox{-.1em}{\hspace{.025em}\faIcon{globe}}\hspace{.325em}#1}} +} +\def\insertgithub{} +\newcommand{\github}[1]{ + \def\insertgithub{\href{https://github.com/#1}{\raisebox{-.1em}{\hspace{.025em}\faIcon{github}}\hspace{.325em}github.com/#1}} +} % title page \defbeamertemplate*{title page}{Arguelles}{ @@ -27,7 +35,9 @@ {\usebeamerfont{date}\insertdate}\par\bigskip {\usebeamerfont{author}\insertauthor}\par\smallskip {\usebeamerfont{institute}\insertinstitute}\par - {\usebeamerfont{email}\insertemail} + {\usebeamerfont{email}\insertemail}\par + {\usebeamerfont{homepage}\inserthomepage}\par + {\usebeamerfont{github}\insertgithub} \end{beamercolorbox} \addtocounter{framenumber}{-1} } @@ -73,6 +83,16 @@ \fi } +% background image +\define@key{beamerframe}{bg}{ + \setbeamertemplate{background}{ + \begin{tikzpicture} + \useasboundingbox (0,0) rectangle (\paperwidth,\paperheight); + \path[fill overzoom image=#1] (0,.01\paperheight) rectangle (\paperwidth,.99\paperheight); + \end{tikzpicture} + } +} + % standout frame \providebool{Arguelles@standout} \define@key{beamerframe}{standout}[true]{ diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerouterthemeArguelles.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerouterthemeArguelles.sty index c1c7350506..051c8cb6a2 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerouterthemeArguelles.sty +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerouterthemeArguelles.sty @@ -1,10 +1,10 @@ -% arguelles v2.2.0 +% arguelles v2.3.0 % author: Michele Piazzai % contact: michele.piazzai@uc3m.es % license: MIT \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerouterthemeArguelles}[2023/03/22 Argüelles] +\ProvidesPackage{beamerouterthemeArguelles}[2023/10/26 Argüelles] \mode<presentation> diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerthemeArguelles.sty b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerthemeArguelles.sty index 817e780bea..24e5cf85bc 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerthemeArguelles.sty +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/beamerthemeArguelles.sty @@ -1,10 +1,10 @@ -% arguelles v2.2.0 +% arguelles v2.3.0 % author: Michele Piazzai % contact: michele.piazzai@uc3m.es % license: MIT \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{beamerthemeArguelles}[2023/03/22 Argüelles] +\ProvidesPackage{beamerthemeArguelles}[2023/10/26 Argüelles] \mode<presentation> @@ -49,6 +49,10 @@ \RequirePackage{enumitem} \RequirePackage{parskip} \RequirePackage{tikz} +\RequirePackage[skins]{tcolorbox} + +% tikz options +\usetikzlibrary{calc} % components \useinnertheme{Arguelles} @@ -84,13 +88,9 @@ \RequirePackage{cancel} \RequirePackage{pgfplots} \RequirePackage{csvsimple} - -% tikz options -\usetikzlibrary{calc} - % pgfplots options \pgfplotsset{compat=1.18} -\usepgfplotslibrary{statistics,fillbetween} +\usepgfplotslibrary{fillbetween,groupplots,statistics} \fi \AtBeginEnvironment{proof}{\let\@addpunct\@gobble} diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.pdf b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.pdf Binary files differindex 85ee585794..3475fb8878 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.pdf +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.pdf diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.png b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.png Binary files differnew file mode 100644 index 0000000000..6246f9b2cb --- /dev/null +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.png diff --git a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.tex b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.tex index 7ed3abb8ae..2718de1572 100644 --- a/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.tex +++ b/macros/latex/contrib/beamer-contrib/themes/beamertheme-arguelles/demo/demo-arguelles.tex @@ -1,4 +1,4 @@ -% arguelles v2.2.0 +% arguelles v2.3.0 % author: Michele Piazzai % contact: michele.piazzai@uc3m.es % license: MIT @@ -13,7 +13,9 @@ \date{} \author{Place Holder} \institute{University of \TeX} -\email{username@domain.com} +\email{name@domain.com} +\homepage{www.mywebsite.com} +\github{username} \begin{document} @@ -62,6 +64,13 @@ \end{theorem} \end{frame} +\begin{frame}[bg=demo-arguelles.png] + \frametitle{A frame with background image} + You can still add title and subtitle. \par + You can also use a background in the title slide by setting: \\ + \texttt{\textbackslash frame[plain,bg=demo-background.jpg]\{\textbackslash titlepage\}} +\end{frame} + \begin{frame}[plain] \frametitle{A plain frame has no headline} \begin{table} diff --git a/macros/latex/contrib/cje/README.txt b/macros/latex/contrib/cje/README.txt index 296ed38d09..6a29606aa8 100644 --- a/macros/latex/contrib/cje/README.txt +++ b/macros/latex/contrib/cje/README.txt @@ -1,5 +1,5 @@ README.txt for the Canadian Journal of Economics “cje” package -2018/02/22 v1.06 +2023/10/25 v1.07 INFORMATION =========== @@ -11,7 +11,7 @@ INFORMATION COPYRIGHT ========= -(c) 2017 Canadian Economics Association +(c) 2023 Canadian Economics Association LICENSE ======= @@ -30,8 +30,8 @@ cje.cls (CJE class file) cjebibstyle.bst (CJE bibliography style file) cjenatbib.sty (CJE style file for citations) cjeupmath.sty (CJE style file for non-italic Greek characters) -ageingbib.bib (bib file called in by cjeGuide2018.tex) -canadian-flag.pdf (figure file called in by cjeGuide.tex) +ageingbib.bib (bib file called in by cjeguide.tex) +canadian-flag.pdf (figure file called in by cjeguide.tex) ========= diff --git a/macros/latex/contrib/cje/ageingbib.bib b/macros/latex/contrib/cje/ageingbib.bib index 2dd76d46aa..ad1eec309d 100644 --- a/macros/latex/contrib/cje/ageingbib.bib +++ b/macros/latex/contrib/cje/ageingbib.bib @@ -129,6 +129,18 @@ Url = {http://doi.acm.org/10.1145/2187980.2188129} timestamp = {2008.07.24} } +@incollection{Danzon, + author = "P.M. Danzon and A. J. Epstein", + title = "Effects of regulation on +drug launch and pricing in interdependent markets", + booktitle = "The Economics of Medical Technology", + year = "2012", + publisher = "Emerald Group Publishing Limited", + address = "Bingley, UK", + editor= {K. Bolin and R. Kaestner}, + pages= {35--71} +} + @ARTICLE{Baldacci06, author = {E. Baldacci and B. Clements and S. Gupta and Q. Cui}, title = {Social Spending, Human Capital, and Growth in Developing Countries}, diff --git a/macros/latex/contrib/cje/cje.cls b/macros/latex/contrib/cje/cje.cls index a79a558164..f16170bd1b 100644 --- a/macros/latex/contrib/cje/cje.cls +++ b/macros/latex/contrib/cje/cje.cls @@ -1,5 +1,5 @@ %% This is file cje.cls -%% 2018/02/22 v1.06 +%% 2023/10/25 v1.07 %% %% It was developed from `article.cls,' %% generated with the docstrip utility. @@ -11,7 +11,7 @@ %% %% ========= %% -%% COPYRIGHT (c) 2017 Canadian Economics Association +%% COPYRIGHT (c) 2023 Canadian Economics Association %% %% LICENSE %% ======= @@ -52,7 +52,7 @@ \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesClass{cje} - [2018/02/22 v1.06 CJE document class] + [2023/10/25 v1.07 CJE document class] \newcommand{\@xiiiptvpt}{13.5}%large For author \DeclareMathSizes{\@xiiiptvpt}{\@xiiiptvpt}{\@xpt}{\@viipt} diff --git a/macros/latex/contrib/cje/cjebibstyle.bst b/macros/latex/contrib/cje/cjebibstyle.bst index f31442addf..7bc625cbd0 100644 --- a/macros/latex/contrib/cje/cjebibstyle.bst +++ b/macros/latex/contrib/cje/cjebibstyle.bst @@ -1,6 +1,6 @@ %% %% This is file cjebibstyle.bst. -%% 2018/22/02 v1.06 +%% 2023/10/25 v1.07 %% %% It was generated with the docstrip utility. %% @@ -11,7 +11,7 @@ %% %% ========= %% -%% COPYRIGHT (c) 2017 Canadian Economics Association +%% COPYRIGHT (c) 2023 Canadian Economics Association %% %% LICENSE %% ======= diff --git a/macros/latex/contrib/cje/cjeguide.pdf b/macros/latex/contrib/cje/cjeguide.pdf Binary files differdeleted file mode 100644 index ea0f489ba2..0000000000 --- a/macros/latex/contrib/cje/cjeguide.pdf +++ /dev/null diff --git a/macros/latex/contrib/cje/cjeguide.tex b/macros/latex/contrib/cje/cjeguide.tex index c2be40fa03..d0f443ae5f 100644 --- a/macros/latex/contrib/cje/cjeguide.tex +++ b/macros/latex/contrib/cje/cjeguide.tex @@ -1,8 +1,8 @@ %% This is file cjeguide.tex -%% 2018/02/22 v1.06 +%% 2023/10/26 v1.07 %% ========= %% -%% COPYRIGHT (c) 2017 Canadian Economics Association +%% COPYRIGHT (c) 2023 Canadian Economics Association %% %% LICENSE %% ======= @@ -62,7 +62,7 @@ \usepackage{hyperref} \def\citeapos#1{\citeauthor{#1}'s (\citeyear{#1})} \hypersetup{% - pdftitle = {Author guide to Canadian Journal of Economics \LaTeXe\ class file (v. 1.06, 2018)}, + pdftitle = {Author guide to Canadian Journal of Economics \LaTeXe\ class file (v. 1.07, 2023)}, pdfauthor = {Author One, Author Two, Author Three, Author Four and Author Five}, citecolor=blue, @@ -76,7 +76,7 @@ \label{firstpage} % shortened version of title [in square brackets] for running head -\title[Guide to \texttt{cje} \LaTeXe\ class]{Guide to Canadian Journal of Economics \LaTeXe\ class file (v. 1.06, 2018)} +\title[Guide to \texttt{cje} \LaTeXe\ class]{Guide to Canadian Journal of Economics \LaTeXe\ class file (v. 1.07, 2023)} % summary of authors for running head \authors{A. One, A. Two, A. Three, A. Four and A. Five} @@ -104,7 +104,7 @@ \maketitle \section{Using the \texttt{cje} class file} -Download the latest version from \href{https://economics.ca/cje/en/latex.php}{economics.ca/cje/en/latex.php} or \href{https://www.ctan.org/tex-archive/macros/latex/contrib/cje?lang=en}{ctan.org}. This guide has examples of most environments you're likely to need. +Download the latest version from \url{www.ctan.org/pkg/cje}. This guide has examples of most environments you're likely to need. \subsection{\texttt{cje.cls} package files} The distribution package contains the following files.\\[0.5\baselineskip] @@ -199,7 +199,7 @@ Two other class file options are also available: the review option, which can be \usepackage{hyperref} \def\citeapos#1{\citeauthor{#1}'s (\citeyear{#1})} \hypersetup{% - pdftitle = {Author guide to Canadian Journal of Economics \LaTeXe\ class file (v. 1.06, 2018)}, + pdftitle = {Author guide to Canadian Journal of Economics \LaTeXe\ class file (v. 1.07, 2023)}, pdfauthor = {Author One, Author Two, Author Three, Author Four and Author Five}, citecolor=blue, @@ -214,7 +214,7 @@ Two other class file options are also available: the review option, which can be % shortened version of title [in square brackets] for running head \title[Guide to \texttt{cje} \LaTeXe\ class]{Guide to Canadian Journal of -Economics \LaTeXe\ class file (v. 1.06, 2018)} +Economics \LaTeXe\ class file (v. 1.07, 2023)} % summary of authors for running head \authors{A. One, A. Two, A. Three, A. Four and A. Five} @@ -230,7 +230,7 @@ Economics \LaTeXe\ class file (v. 1.06, 2018)} \abstract{The \LaTeXe\ class file for the \emph{Canadian Journal of Economics}... If you have any questions or would like to signal any corrections to the class - file or this guide, please contact Kim Nesbitt, CJE copyeditor, at + file or this guide, please contact Kim Nesbitt, CJE Copy Editor, at \texttt{CJE-copyeditor@outlook.com}.} \resume{If you do not provide a French abstract, the English abstract will be translated @@ -244,7 +244,7 @@ Economics \LaTeXe\ class file (v. 1.06, 2018)} Woollatt for her work on creating this package and documentation. Thank you to Karl Berry, James S. Hefferon, CTAN and the friendly and helpful members of the \TeX\ Users Group (TUG) for their technical assistance, guidance and advice.\\ -Corresponding author: Kim Nesbitt, CJE-copyeditor@outlook.com} +Corresponding author: Kim Nesbitt, \url{CJE-copyeditor@outlook.com}} \maketitle @@ -820,6 +820,7 @@ For example, if you've cited only these 10 sources from your bib database that c \cite{Mas-Colell}, \cite{Atkinson}, \cite{Van-Zon}, +\cite{Danzon}, \cite{vanderPolGairns2000}, \cite{Lucas90}, \cite{Mendoza1991}, @@ -829,7 +830,7 @@ For example, if you've cited only these 10 sources from your bib database that c only these 10 references will appear as the reference list. See the last page of this guide for the reference list output. \subsubsection{\texttt{natbib} commands for in-text citations} -The standard \texttt{natbib} style file has been modified to impose the CJE reference style. This modified style file is called \texttt{cjenatbib.sty} (included in the \texttt{cje} distribution) and works exactly the same as \texttt{natbib.sty}. Here are some of the \verb"\cite" commands available (please refer to the \texttt{natbib} documentation \href{https://www.ctan.org/pkg/natbib?lang=en}{ctan.org/pkg/natbib?lang=en} if you would like more information):\\*[0.5\baselineskip] +The standard \texttt{natbib} style file has been modified to impose the CJE reference style. This modified style file is called \texttt{cjenatbib.sty} (included in the \texttt{cje} distribution) and works exactly the same as \texttt{natbib.sty}. Here are some of the \verb"\cite" commands available (please refer to the \texttt{natbib} documentation at \url{www.ctan.org/pkg/natbib?lang=en} if you would like more information):\\*[0.5\baselineskip] \begin{tabular}{@{}ll} \cite{Lucas90} & \indexsize\verb"\cite{Lucas90}"\\ @@ -879,6 +880,12 @@ Aisa, R., and F. Pueyo (2004) \enquote{Endogenous longevity, health and Atkinson, A., and J. Stiglitz (1980) \emph{Lectures on Public Economics}, New York: McGraw-Hill +\bibitem[{Danzon and Epstein(2012)}]{Danzon} +Danzon, P.M., and A. J. Epstein (2012) \enquote{Effects of regulation on +drug launch and pricing in interdependent markets.} In K. Bolin +and R. Kaestner, eds., \emph{The Economics of Medical Technology}, vol. 23, +pp. 35--71. Bingley, UK: Emerald Group Publishing Limited + \bibitem[{Glomm and Ravikumar(1992)}]{Glomm92} Glomm, G., and B. Ravikumar (1992) \enquote{Public versus private investment in human capital endogenous growth and income inequality,} @@ -984,7 +991,7 @@ Aisa, R., and F. Pueyo (2004) \enquote{Endogenous longevity, health and 9, 1--10 \bibitem[{Atkinson and Stiglitz(1980)}]{Atkinson} -Atkinson, A., and J. Stiglitz (1980) \emph{Lectures on Public Economics}, New +Atkinson, A., and J. Stiglitz (1980) \emph{Lectures on Public Economics}. New York: McGraw-Hill \bibitem[{Glomm and Ravikumar(1992)}]{Glomm92} @@ -998,8 +1005,7 @@ Glomm, G., and B. Ravikumar (1992) \enquote{Public versus private investment in \bibitem[{Li et al.(2012)Li, Shrivastava, and K{\"o}nig}]{LiSK12} Li, P., A. Shrivastava, and A. C. K{\"o}nig (2012) \enquote{{GPU}-based minwise - hashing,} in \emph{Proceedings of the 21st World Wide Web Conference (WWW - 2012) (Companion Volume)}, pp. 565--66 + hashing.} In \emph{Proceedings of the 21st World Wide Web Conference}, pp. 565--66 \bibitem[{Lucas(1990)}]{Lucas90} Lucas, R. (1990) \enquote{Supply-side economics: An analytical review,} @@ -1007,14 +1013,14 @@ Lucas, R. (1990) \enquote{Supply-side economics: An analytical review,} \bibitem[{Mas-Colell et al.(1995)Mas-Colell, Whinston, and Green}]{Mas-Colell} Mas-Colell, A., M. D. Whinston, and J. R. Green (1995) \emph{Microeconomic - Theory}, Oxford: Oxford University Press + Theory}. Oxford, UK: Oxford University Press \bibitem[{Mendoza(1991)}]{Mendoza1991} Mendoza, E. G. (1991) \enquote{Real business cycles in a small open economy,} \emph{American Economic Review} 81, 717--818 \bibitem[{van der Pol and Cairns(2000)}]{vanderPolGairns2000} -van der Pol, M. M., and J. A. Cairns (2000) \enquote{Zero and negative time +van der Pol, M.M., and J. A. Cairns (2000) \enquote{Zero and negative time preference for health,} \emph{Health Economics} 9, 171--75 \bibitem[{Van-Zon and Muysken(2001)}]{Van-Zon} diff --git a/macros/latex/contrib/cje/cjenatbib.sty b/macros/latex/contrib/cje/cjenatbib.sty index 73817ef6e7..62510b407b 100644 --- a/macros/latex/contrib/cje/cjenatbib.sty +++ b/macros/latex/contrib/cje/cjenatbib.sty @@ -1,5 +1,5 @@ %% This is file cjenatbib.sty. -%% 2018/02/22 v1.06 +%% 2023/10/25 v1.07 %% Lines changed from natbib.sty 2003/06/06 v7.1 are marked with %%ajw %% %% This is file `natbib.sty', @@ -9,7 +9,7 @@ %% %% natbib.dtx (with options: `package,all') %% ============================================= -%% COPYRIGHT (c) 2017 Canadian Economics Association +%% COPYRIGHT (c) 2023 Canadian Economics Association %% %% LICENSE %% ======= @@ -32,7 +32,7 @@ %% E-mail: daly@linmpi.mpg.de \NeedsTeXFormat{LaTeX2e}[1995/06/01] \ProvidesPackage{cje}%%ajw - [2018/02/22 v1.06 CJE version of natbib.sty]%%ajw + [2023/10/25 v1.07 CJE version of natbib.sty]%%ajw % This package reimplements the LaTeX \cite command to be used for various % citation styles, both author-year and numerical. It accepts BibTeX % output intended for many other packages, and therefore acts as a diff --git a/macros/latex/contrib/cje/cjetemplate.tex b/macros/latex/contrib/cje/cjetemplate.tex index 3c5b332635..1917c2bc43 100644 --- a/macros/latex/contrib/cje/cjetemplate.tex +++ b/macros/latex/contrib/cje/cjetemplate.tex @@ -1,8 +1,8 @@ %% This is file cjetemplate.tex -%% 2018/02/22 v1.06 +%% 2023/10/26 v1.07 %% ========= %% -%% COPYRIGHT (c) 2017 Canadian Economics Association +%% COPYRIGHT (c) 2023 Canadian Economics Association %% %% LICENSE %% ======= @@ -140,13 +140,15 @@ \finalhline \end{tabular} \end{minipage}% Use this line only if you used \begin{minipage} +\end{table} \begin{figure} \includegraphics[width=0.6\textwidth]{} \caption{ \figurenote NOTE: } \label{}%Label with figure number - + \end{table} + \begin{proof} \end{proof} @@ -154,15 +156,17 @@ \end{proof} %Manual creation reference list -\begin{thebibliography}{} +\begin{thebibliography} \newcommand{\enquote}[1]{``#1''} \bibitem[{}]{} Aisa, R., and F. Pueyo (2004) ``Endogenous longevity, health and economic growth: A slow growth for a longer life?,'' \textit{Economics Bulletin} 9(5), 1--10 - +\end{thebibliography}{} % Using BibTeX and .bib file + +%Creation of reference list using .bib file \bibliography{} \bibliographystyle{cjebibstyle} % to impose CJE bibliography style on output diff --git a/macros/latex/contrib/cje/cjeupmath.sty b/macros/latex/contrib/cje/cjeupmath.sty index 775cabe5d8..64bdcf5d93 100644 --- a/macros/latex/contrib/cje/cjeupmath.sty +++ b/macros/latex/contrib/cje/cjeupmath.sty @@ -1,6 +1,6 @@ %% %% This is file `cjeupmath.sty', written for the CEA by Ali Woollatt -%% 2018/02/22 v1.06 +%% 2023/10/25 v1.07 %% %% This package provides 'upright' math (lower-case Greek, A-Z, a-z, %% punctuation, < >, \ell, \partial) from the AMS Euler fonts EURM/B. @@ -8,7 +8,7 @@ %% Requires the amsbsy.sty and amsgen.sty packages. %% %% -%% COPYRIGHT (c) 2017 Canadian Economics Association +%% COPYRIGHT (c) 2023 Canadian Economics Association %% %% LICENSE %% ======= @@ -18,7 +18,7 @@ %% latex-project.org/lppl.txt. Version 1.3, or later, is part of all distributions of LaTeX version 2005/12/01 or later. -\ProvidesPackage{cjeupmath}[2018/02/22 v1.06 CJE LaTeX2e package] +\ProvidesPackage{cjeupmath}[2023/10/25 v1.07 CJE LaTeX2e package] \RequirePackage{amsbsy}[1995/01/20] % also includes amsgen.sty diff --git a/macros/latex/contrib/hypdoc/README.md b/macros/latex/contrib/hypdoc/README.md index 32ac39c26a..6a106ee4f9 100644 --- a/macros/latex/contrib/hypdoc/README.md +++ b/macros/latex/contrib/hypdoc/README.md @@ -1,6 +1,6 @@ # hypdoc -Version: 2023-01-23 v1.18 +Version: 2023-10-26 v1.19 This package adds hyper features to the package doc that is used in the documentation diff --git a/macros/latex/contrib/hypdoc/hypdoc.dtx b/macros/latex/contrib/hypdoc/hypdoc.dtx index 836fa1b368..1a1b5876e7 100644 --- a/macros/latex/contrib/hypdoc/hypdoc.dtx +++ b/macros/latex/contrib/hypdoc/hypdoc.dtx @@ -1,7 +1,7 @@ % \iffalse meta-comment % % File: hypdoc.dtx -% Version: 2023-01-23 v1.18 +% Version: 2023-10-26 v1.19 % Info: Hyper extensions for doc.sty % % Copyright (C) @@ -79,7 +79,7 @@ \input docstrip.tex \Msg{************************************************************************} \Msg{* Installation} -\Msg{* Package: hypdoc 2023-01-23 v1.18 Hyper extensions for doc.sty (HO)} +\Msg{* Package: hypdoc 2023-10-26 v1.19 Hyper extensions for doc.sty (HO)} \Msg{************************************************************************} \keepsilent @@ -91,7 +91,7 @@ This is a generated file. Project: hypdoc -Version: 2023-01-23 v1.18 +Version: 2023-10-26 v1.19 Copyright (C) 2002, 2006, 2007, 2009-2011 Heiko Oberdiek @@ -152,7 +152,7 @@ and the derived files %<*driver> \NeedsTeXFormat{LaTeX2e} \ProvidesFile{hypdoc.drv}% - [2023-01-23 v1.18 Hyper extensions for doc.sty (HO)]% + [2023-10-26 v1.19 Hyper extensions for doc.sty (HO)]% \PassOptionsToPackage{numbered}{hypdoc} \documentclass{ltxdoc} \usepackage{holtxdoc}[2011/11/22] @@ -167,7 +167,7 @@ and the derived files % \GetFileInfo{hypdoc.drv} % % \title{The \xpackage{hypdoc} package} -% \date{2023-01-23 v1.18} +% \date{2023-10-26 v1.19} % \author{Heiko Oberdiek\thanks % {Please report any issues at \url{https://github.com/ho-tex/hypdoc/issues}}} % @@ -345,7 +345,7 @@ and the derived files %<*package> \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{hypdoc}% - [2023-01-23 v1.18 Hyper extensions for doc.sty (HO)]% + [2023-10-26 v1.19 Hyper extensions for doc.sty (HO)]% % \end{macrocode} % The package identification is done at the top of the |.dtx| file % in order to use only one identification string. @@ -377,11 +377,20 @@ and the derived files % \end{macrocode} % \begin{macrocode} \@ifpackageloaded{hyperref} - {\PackageWarning{hypdoc}{hyperref has been loaded before. Check the options!}} + { + \ifHy@hyperindex + \PackageWarning{hypdoc}{% + hyperref has been loaded before with option 'hyperindex' enabled.\MessageBreak + The index will not work properly.} + \fi + \ifHy@pdfusetitle\else + \PackageInfo{hypdoc}{% + hyperref has been loaded before with option 'pdfusetitle' disabled.} + \fi + } {\RequirePackage[% hyperindex=false,% - pdfusetitle,% - pdfpagelabels% + pdfusetitle,% ]{hyperref}[2002/05/09]% } \hypersetup{% @@ -811,6 +820,7 @@ and the derived files \def\HD@maketarget{% \stepcounter{HD@hypercount}% \def\HD@next{% + \leavevmode \llap{\hypertarget{HD.\the\c@HD@hypercount}{}\,}% }% \ifHD@savedest @@ -1345,6 +1355,10 @@ and the derived files % \begin{Version}{2023-01-23 v1.18} % \item made an internal command long for compability with natbib, issue \#6 % \end{Version} +% \begin{Version}{2023-10-26 v1.19} +% \item Switch to hmode in \cs{HD@maketarget}, issue \#7 +% \item Check options of previously loaded hyperref more explicitly, issue \#4 and \#5. +% \end{Version} % \end{History} % % \PrintIndex diff --git a/macros/latex/contrib/hypdoc/hypdoc.pdf b/macros/latex/contrib/hypdoc/hypdoc.pdf Binary files differindex cd657eb271..79b50d72ca 100644 --- a/macros/latex/contrib/hypdoc/hypdoc.pdf +++ b/macros/latex/contrib/hypdoc/hypdoc.pdf diff --git a/macros/latex/contrib/physics2/README.md b/macros/latex/contrib/physics2/README.md index f8efc73124..6cdfe86e8a 100644 --- a/macros/latex/contrib/physics2/README.md +++ b/macros/latex/contrib/physics2/README.md @@ -24,4 +24,5 @@ either version 1.3c of this license or (at your option) any later version. This work has the LPPL maintenance status `maintained`. The Current Maintainer of this work is -[Zhang Tingxuan](https://www.ctan.org/author/zhang-tx).
\ No newline at end of file +[Zhang Tingxuan](https://www.ctan.org/author/zhang-tx). + diff --git a/macros/latex/contrib/physics2/doc/physics2-legacy.pdf b/macros/latex/contrib/physics2/doc/physics2-legacy.pdf Binary files differdeleted file mode 100644 index cee629a676..0000000000 --- a/macros/latex/contrib/physics2/doc/physics2-legacy.pdf +++ /dev/null diff --git a/macros/latex/contrib/physics2/doc/physics2.pdf b/macros/latex/contrib/physics2/doc/physics2.pdf Binary files differdeleted file mode 100644 index 5a56e39b67..0000000000 --- a/macros/latex/contrib/physics2/doc/physics2.pdf +++ /dev/null diff --git a/macros/latex/contrib/physics2/doc/phy2docdef.tex b/macros/latex/contrib/physics2/phy2docdef.tex index 53fb2f9dea..2590823097 100644 --- a/macros/latex/contrib/physics2/doc/phy2docdef.tex +++ b/macros/latex/contrib/physics2/phy2docdef.tex @@ -22,8 +22,8 @@ \hypersetup{colorlinks,urlcolor=magenta,linkcolor=black,filecolor=blue, pdfstartview=FitH,pdfview=FitH,pdfcreator=XeTeX output} \def\s@pkg#1{\texorpdfstring{\textcolor{pkgcolor}{\textsf{#1}}}{“#1”}} -\def\@pkg#1{\texorpdfstring{\hyperref{https://www.ctan.org/pkg/#1}% - {}{}{\textcolor{pkgcolor}{\textsf{#1}}}}{“#1”}} +\def\@pkg#1{\texorpdfstring{\href{https://www.ctan.org/pkg/#1}% + {\textcolor{pkgcolor}{\textsf{#1}}}}{“#1”}} \DeclareRobustCommand\pkg{\@ifstar\@pkg\s@pkg} \def\modu#1{\texorpdfstring{\textcolor{moducolor}{\textsf{#1}}}{“#1”}} \def\opt#1{\texorpdfstring{\texttt{#1}}{“#1”}} @@ -64,7 +64,7 @@ \newenvironment{example} {\stepcounter{example}\example@start}{\example@end} \author{Zhang Tingxuan} -\date{2023/04/02\quad Version 0.2.1\thanks{% +\date{2023/10/24\quad Version 1.0.0\thanks{% \url{https://www.github.com/AlphaZTX/physics2}}} \makeatother -\endinput
\ No newline at end of file +\endinput diff --git a/macros/latex/contrib/physics2/physics2-code.dtx b/macros/latex/contrib/physics2/physics2-code.dtx new file mode 100644 index 0000000000..f83913530f --- /dev/null +++ b/macros/latex/contrib/physics2/physics2-code.dtx @@ -0,0 +1,1345 @@ +% \iffalse meta-comment +% +% Copyright (C) 2023 by Zhang Tingxuan <alphaztx@163.com> +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3c of this license or (at your option) any later +% version. The latest version of this license is in: +% +% http://www.latex-project.org/lppl.txt +% +% and version 1.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Zhang Tingxuan. +% +% This work consists of the files physics2-code.dtx, +% and the derived files physics2.ins, +% physics2.sty, +% phy-<module>.sty, +% physics2-code.pdf, +% and README.md. +% +%<*internal> +\iffalse +%</internal> +% +%<*readme> +# The `physics2` package + +This package defines commands for typesetting math formulae faster and +more simply. `physics2` is a modularized package, each module provides its +own function while `physics2.sty` itself only provides very few functions. +Therefore you can load modules separately after loading `physics2`. + +Modules of `physics2` provide the following supports: + +- Automatic braces; +- Dirac bra-ket notation; +- Easy way to typeset diagonal matrices and matrices with similar entries; +- Double cross and double dot (binary) operators for tensors; + +**Welcome to pull requests +[here](https://github.com/AlphaZTX/physics2/pulls).** + +## License + +This work may be distributed and/or modified under the conditions of the +[LaTeX Project Public License](http://www.latex-project.org/lppl.txt), +either version 1.3c of this license or (at your option) any later version. + +This work has the LPPL maintenance status `maintained`. + +The Current Maintainer of this work is +[Zhang Tingxuan](https://www.ctan.org/author/zhang-tx). + +%</readme> +% +%<*internal> +\fi +\begingroup + \def\NameOfLaTeXe{LaTeX2e} +\expandafter\endgroup\ifx\NameOfLaTeXe\fmtname\else +\csname fi\endcsname +%</internal> +% +%<*install> +\input docstrip.tex +\keepsilent + +\preamble + + Copyright (C) 2023 by Zhang Tingxuan <alphaztx@163.com> + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3c of this license or (at your option) any later + version. The latest version of this license is in: + + http://www.latex-project.org/lppl.txt + + and version 1.3 or later is part of all distributions of + LaTeX version 2005/12/01 or later. + + This work has the LPPL maintenance status `maintained'. + + The Current Maintainer of this work is Zhang Tingxuan. + + This work consists of the files physics2-code.dtx, + and the derived files physics2.ins, + physics2.sty, + phy-<module>.sty, + physics2-code.pdf, + and README.md. + +\endpreamble + +\generate{ + \usedir{tex/latex/physics2} + \file{physics2.sty} {\from{physics2-code.dtx}{package}} + \file{phy-ab.sty} {\from{physics2-code.dtx}{ab}} + \file{phy-ab.braket.sty} {\from{physics2-code.dtx}{ab.braket}} + \file{phy-braket.sty} {\from{physics2-code.dtx}{braket}} + \file{phy-diagmat.sty} {\from{physics2-code.dtx}{diagmat}} + \file{phy-doubleprod.sty} {\from{physics2-code.dtx}{doubleprod}} + \file{phy-xmat.sty} {\from{physics2-code.dtx}{xmat}} + \file{phy-ab.legacy.sty} {\from{physics2-code.dtx}{ab.legacy}} + \file{phy-bm-um.legacy.sty} {\from{physics2-code.dtx}{bm-um.legacy}} + \file{phy-nabla.legacy.sty} {\from{physics2-code.dtx}{nabla.legacy}} + \file{phy-op.legacy.sty} {\from{physics2-code.dtx}{op.legacy}} + \file{phy-qtext.legacy.sty} {\from{physics2-code.dtx}{qtext.legacy}} +%</install> +%<*internal> + \usedir{source/latex/physics2} + \file{physics2.ins} {\from{physics2-code.dtx}{install}} +%</internal> +%<*install> + \usedir{doc/latex/physics2} + \nopreamble\nopostamble + \file{README.md} {\from{physics2-code.dtx}{readme}} +} + +\obeyspaces +\Msg{**********************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the *} +\Msg{* following files into a directory searched by TeX: *} +\Msg{* *} +\Msg{* physics2.sty, *} +\Msg{* (for all modules) phy-<module>.sty. *} +\Msg{* *} +\Msg{* The recommended directory is *} +\Msg{* TEXMFDIST/tex/latex/physics2 *} +\Msg{* *} +\Msg{* To produce the documentation, run the file *} +\Msg{* physics2-code.dtx through XeLaTeX or LuaLaTeX. *} +\Msg{* XeLaTeX is recommended. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{**********************************************************} + +\endbatchfile +%</install> +% +%<*internal> +\fi +%</internal> +% +%<*driver> +\ProvidesFile{fixdif.dtx}[2023/03/20 (c) Copyright 2022-2023 by Zhang Tingxuan] +\documentclass{l3doc} +\usepackage{doc} +\hypersetup{hidelinks} +\usepackage{color} +\definecolor{pkgcolor}{RGB}{0,120,80} +\definecolor{moducolor}{RGB}{0,0,150} +\definecolor{gray}{rgb}{.5,.5,.5} +\DeclareRobustCommand\pkg[1]{\texorpdfstring{\textcolor{pkgcolor}{\textsf{#1}}}{“#1”}} +\DeclareRobustCommand\modu[1]{\texorpdfstring{\textcolor{moducolor}{\textsf{#1}}}{“#1”}} +\DeclareRobustCommand\note{\textbf{Note:} } +\usepackage{amsmath} +\usepackage{fontspec} +\setmonofont{Latin Modern Mono Light} +\usepackage{fancyvrb} +\fvset{gobble=2,xleftmargin=2em} +\usepackage{physics2} +\usephysicsmodule{ab} +\makeatletter +\@addtoreset{CodelineNo}{section} +\newbox\@tempboxb +\DeclareDocumentCommand\macrodef{O{4em}O{.6}mo+m}{\leavevmode +\ensuremath{% + \setbox\@tempboxa\hbox to #1 {\hss\cs{#3}}% + \setbox\@tempboxb\vbox{\hsize=#2\textwidth + \textwidth=\hsize + \leftskip=\z@ + \parindent=\z@ + \textbf{begindef}\IfValueT{#4}{ \textcolor{gray}{(#4)}}\par + \begingroup\leftskip2em\parindent-1em#5\par\endgroup + \textbf{enddef}% + }% + \dp\@tempboxb=\dimexpr\ht\@tempboxb-\ht\@tempboxa\relax + \ht\@tempboxb=\ht\@tempboxa + \box\@tempboxa\leftarrow\box\@tempboxb +}} +\protected\long\def\macroifelse#1#2#3{\par + \textbf{if} #1 \textbf{then}\par + \begingroup\advance\leftskip1em#2\par\endgroup + \textbf{else}\par + \begingroup\advance\leftskip1em#3\par\endgroup + \textbf{endif}\par +} +\protected\long\def\macroif#1#2{\par + \textbf{if} #1 \textbf{then}\par + \begingroup\advance\leftskip1em#2\par\endgroup + \textbf{endif}\par +} +\protected\def\macrocr{\par} +\newdimen\ttwd +\protected\def\updatettwd{% + \setbox\@tempboxa\hbox{\normalsize\ttfamily a} + \ttwd=\wd\@tempboxa +} +\updatettwd +\makeatother +\title{Code documentation to the \pkg{physics2} package} +\author{Zhang Tingxuan} +\date{2023/10/24 v1.0.0} +\begin{document} + \DocInput{physics2-code.dtx} +\end{document} +%</driver> +% \fi +% +% \maketitle +% +% \tableofcontents\newpage +% +%^^A******************************************************************************** [physics2.sty] +% \part{The bare \pkg{physics2}} +% \section{The \pkg{physics2} package} +% \begin{macrocode} +%<*package> +\NeedsTeXFormat{LaTeX2e}[2020/10/01] +\ProvidesPackage{physics2} + [2023/10/24 v1.0.0 Tools for typesetting math for physics.] +% \end{macrocode} +% \subsection{Common variables} +% \begin{variable}{\phy@temp..} +% \begin{syntax} +% \cs{phy@temp}\meta{register type}\meta{a|b|c} +% \end{syntax} +% Some \LaTeXe\ variables starting with ``|\phy@temp|''. +% These variables can be shared by any module of \pkg{physics2}. +% \end{variable} +% \begin{macrocode} +\newcount \phy@tempcnta +\newdimen \phy@tempdima +\newdimen \phy@tempdimb +\newskip \phy@tempskipa +\newmuskip \phy@tempmuskipa +\newbox \phy@tempboxa +\newif \ifphy@tempswa +\newtoks \phy@toksa +% \end{macrocode} +% \subsection{Package requirements and module-loading methods} +% \pkg{physics2} requires \pkg{keyval} (part of the graphics bundle) to +% process options of modules. +% \begin{macrocode} +\RequirePackage{keyval} +\def\phy@true{true} +\def\phy@false{false} +% \end{macrocode} +% \begin{function}{\phy@define@key, \phy@setkeys, \phy@processkeyopt} +% \begin{syntax} +% \cs{phy@define@key} \marg{module} \marg{key} \oarg{default value} \marg{code} +% \cs{phy@setkeys} \marg{module} \marg{key-val list} +% \cs{phy@processkeyopt} \marg{module} +% \end{syntax} +% The position of \cs{phy@processkeyopt} in a \pkg{physics2} module is just the same +% as the position of \cs{ProcessOptions} in a regular \LaTeX\ package. +% \end{function} +% \begin{macrocode} +\long\def\phy@define@key#1{\define@key{phy-#1}} +\long\def\phy@setkeys#1{\setkeys{phy-#1}} +\def\phy@processkeyopt#1{\let\reserved@a\@empty% + \edef\reserved@a{\@ptionlist{\@currname.\@currext}}% + \edef\reserved@a{\noexpand\phy@setkeys{#1}{\reserved@a}}% + \reserved@a% the next line thanks to `geometry' + \AtEndOfPackage{\let\@unprocessedoptions\relax}} +% \end{macrocode} +% We use almost the same way to load \pkg{physics2} modules as \LaTeXe\ kernel +% does. We use a lot of kernel commands in \LaTeXe. +% +% \begin{function}{\usephysicsmodule, \phy@requiremodule} +% \begin{syntax} +% \cs{usephysicsmodule} \oarg{key-val options} \marg{module} \oarg{key-val options} +% \cs{phy@requiremodule} \oarg{key-val options} \marg{module} \oarg{key-val options} +% \end{syntax} +% \cs{usephysicsmodule} is a user command, and \cs{phy@requiremodule} is a developer +% command. +% \end{function} +% \begin{macrocode} +\def\usephysicsmodule{\phy@FWoptions\@pkgextension} +\let\phy@requiremodule\usephysicsmodule +\@onlypreamble\usephysicsmodule +\def\phy@FWoptions#1{\@ifnextchar[%] + {\phy@FW@ptions#1}{\phy@FW@ptions#1[]}} +\@onlypreamble\phy@FWoptions +\def\phy@FW@ptions#1[#2]#3{\@ifnextchar[%] + {\phy@FW@pti@ns#1[{#2}]#3}{\phy@FW@pti@ns#1[{#2}]#3[]}} +\@onlypreamble\phy@FW@ptions +\def\phy@FW@pti@ns#1[#2]#3[#4]{% + \def\reserved@b##1,{% + \ifx\@nnil##1\relax\else + \ifx\@nnil##1\@nnil\else + \noexpand\@onefilewithoptions{phy-##1}[{\unexpanded{#2}}][{#4}]% + \noexpand\@pkgextension + \fi + \expandafter\reserved@b + \fi}% + \edef\reserved@a{\zap@space#3 \@empty}% + \edef\reserved@a{\expandafter\reserved@b\reserved@a,\@nnil,}% + \reserved@a} +\@onlypreamble\phy@FW@pti@ns +% \end{macrocode} +% \subsection{The (used to be) \modu{common} module} +% The code below used to be the automatically-loaded \modu{common} module, +% but now we load it together with \pkg{physics2}'s code. This change may +% bring better performance in Windows system. +% +% Check if \pkg{unicode-math} loaded and (re)define the vert symbols. +% The \cs{relax}'s at the ends of \cs{vert} and \cs{Vert}'s definitions must not be +% removed. They are for \cs{ifx} to compare. \pkg{unicode-math} sets these symbols +% \cs{fam}1, \cs{symoperators} is equal to 1 in \LaTeXe\ kernel. Moreover, we make +% \cs{mid} as a delimiter but it may not work. +% \begin{macrocode} +\AtBeginDocument{\ifcsname symrm\endcsname + \protected\def\|{\Udelimiter 0 \symoperators "2016 }% + \protected\def\vert{\Udelimiter 0 \symoperators "007C\relax}% + \protected\def\Vert{\Udelimiter 0 \symoperators "2016\relax}% + \protected\def\mid{\Udelimiter 3 \symoperators "007C }% +\fi} +\protected\def\Vert{\delimiter"026B30D\relax} +\protected\def\mid{\delimiter"326A30C } +% \end{macrocode} +% \begin{function}{\delopen, \delclose} +% \begin{syntax} +% \cs{delopen} \meta{left delimiter} +% \cs{delclose} \meta{right delimiter} +% \end{syntax} +% Actually in \TeX, \cs{left} and \cs{right} will enclose the subformula as ``inner'', +% but \cs{delopen} and \cs{delclose} will make the subformula an empty open node and +% a non-empty close node. +% \end{function} +% \begin{macrocode} +\DeclareRobustCommand\delopen{\mathopen{}\mathclose\bgroup\left} +\DeclareRobustCommand\delclose{\aftergroup\egroup\right} +% Extension to 2e kernel's or amsmath's biggggg commands. +% \end{macrocode} +% \cs{bBigg@} is a command from \pkg{amsmath}. The code below should +% update with \pkg{amsmath} together. +% \begin{macrocode} +\ifdefined\bBigg@ + \DeclareRobustCommand\biggg{\bBigg@{3}} + \DeclareRobustCommand\Biggg{\bBigg@{3.5}} +\else + \DeclareRobustCommand\biggg[1]{\leavevmode@ifvmode + {\hbox{$\left#1\vbox to20.5\p@{}\right.\n@space$}}} + \DeclareRobustCommand\Biggg[1]{\leavevmode@ifvmode + {\hbox{$\left#1\vbox to23.5\p@{}\right.\n@space$}}} + \AtBeginDocument{\ifdefined\bBigg@ + \DeclareRobustCommand\biggg{\bBigg@{3}}% + \DeclareRobustCommand\Biggg{\bBigg@{3.5}}% + \fi} +\fi +\DeclareRobustCommand\bigggl{\mathopen\biggg} +\DeclareRobustCommand\bigggm{\mathrel\biggg} +\DeclareRobustCommand\bigggr{\mathclose\biggg} +\DeclareRobustCommand\Bigggl{\mathopen\Biggg} +\DeclareRobustCommand\Bigggm{\mathrel\Biggg} +\DeclareRobustCommand\Bigggr{\mathclose\Biggg} +% \end{macrocode} +% \begin{function}{\phy@mathvphantom} +% \begin{syntax} +% \cs{phy@mathvphantom} \marg{math mode material} +% \end{syntax} +% This command is just like \cs{vphantom} in \LaTeXe\ kernel but only works +% in math mode. +% \end{function} +% \begin{macrocode} +\def\phy@mathvphantom#1{\setbox\phy@tempboxa=\hbox{}% + \mathchoice + {\setbox\@tempboxa\hbox{$\displaystyle#1$}% + \ht\phy@tempboxa=\ht\@tempboxa + \dp\phy@tempboxa=\dp\@tempboxa + \box\phy@tempboxa} + {\setbox\@tempboxa\hbox{$\textstyle#1$}% + \ht\phy@tempboxa=\ht\@tempboxa + \dp\phy@tempboxa=\dp\@tempboxa + \box\phy@tempboxa} + {\setbox\@tempboxa\hbox{$\scriptstyle#1$}% + \ht\phy@tempboxa=\ht\@tempboxa + \dp\phy@tempboxa=\dp\@tempboxa + \box\phy@tempboxa} + {\setbox\@tempboxa\hbox{$\scriptscriptstyle#1$}% + \ht\phy@tempboxa=\ht\@tempboxa + \dp\phy@tempboxa=\dp\@tempboxa + \box\phy@tempboxa}% +} +% \end{macrocode} +% \subsection{The (used to be) \modu{explsetup} module} +% Some common variables and functions for experimental \LaTeX3 syntax. +% \begin{macrocode} +%<@@=phy> +\ExplSyntaxOn +\int_new:N \l_@@_tmpa_int +\int_new:N \l_@@_tmpb_int +\tl_new:N \l_@@_tmpa_tl +\tl_new:N \l_@@_tmpb_tl +% \end{macrocode} +% The function that can gobble one token. +% \begin{macrocode} +\cs_new:Npn \_@@_gobble_i:n #1 { } +\ExplSyntaxOff +%<@@=> +%</package> +% \end{macrocode} +% +%^^A******************************************************************************** [l2e modules] +% \part{Modules written in \LaTeXe\ syntax} +% \section{The \modu{ab} module} +% \begingroup\color{gray}% +% \noindent$\langle*\hbox{\sffamily gibberish}\rangle$\par +% This module is important but the code is hard to read. One of the motivations +% I manage \pkg{physics2} with \pkg{DocStrip} is that, when I tried to write a +% new module based on \modu{ab} after 5 months when I maintained \pkg{physics2} +% the last time, I found that I could not understand the code I wrote at all! +% Therefore, it's significant to comment out the alien code in \modu{ab}.\par +% \noindent$\langle/\hbox{\sffamily gibberish}\rangle$\par +% \endgroup +% \begin{macrocode} +%<*ab> +\ProvidesFile{phy-ab.sty} + [2023/10/24 `ab' (autobraces) module of physics2] +% \end{macrocode} +% If you don't know when to use \cs{phy@define@key}, \cs{phy@setkeys} and +% \cs{phy@processkeyopt} in a module, see ahead. In \modu{ab}, the |tightbraces| +% option can control if the automatically-sized braces are tight or not. Do you +% remember \cs{delopen} and \cs{delclose}? +% \begin{macrocode} +\phy@define@key{ab}{tightbraces}[true]{\def\@phy@abtight{#1}} +\phy@setkeys{ab}{tightbraces=true} +\phy@processkeyopt{ab} +% \end{macrocode} +% \begin{function}{\phy@abopen, \phy@abclose} +% \begin{syntax} +% \cs{phy@abopen} \meta{left delimiter} +% \cs{phy@abclose} \meta{right delimiter} +% \end{syntax} +% They are defined either \{\cs{delopen}, \cs{delclose}\} or +% \{\cs{left}, \cs{right}\}. If a module requires \modu{ab}, +% these two commands are likely to be used. +% \end{function} +% \begin{macrocode} +\ifx\@phy@abtight\phy@true + \let\phy@abopen\delopen + \let\phy@abclose\delclose +\else + \let\phy@abopen\left + \let\phy@abclose\right +\fi +% \end{macrocode} +% \subsection{The implementation of \cs{ab}} +% This is the alienest part of \modu{ab}. It's better to draw something rather +% than write boring comments. First let's take a look at \cs{ab}'s syntax. +% After \cs{ab} should be a pair of delimiters; take \texttt{()} as an example. +% Between \cs{ab} and ``\texttt{(}'' can be a biggg command or star, or even nothing. +% \cs{ab} is defined as follows: +% \[ \macrodef{ab}{\cs{phy@d@lx} \texttt{\{mb\}} \texttt{\{ab\}}} \] +% where \texttt{ab} is the branch name of |\ab()|, and \texttt{mb} is the branch +% name of |\ab\big()| and |\ab*()|. Then let's see the syntax of \cs{phy@d@lx}. +% \[ \hbox{\ttfamily\cs{phy@d@lx} \marg{biggg or star branch name} \marg{automatic branch name} \{\#3\}} \] +% Here exists an \texttt{\#3}. \texttt{\#3} is one token immediately following \cs{ab}, +% which can be \{\,a biggg command or a star\,\} or a ``\texttt{(}'', under our assumption. + +% \cs{phy@d@lx} is defined as follows: +% \[ +% \macrodef {phy@d@lx} [\#1: biggg or star branch name, \meta{mb}; \#2: automatic branch name, \meta{ab}; \#3, the token after \cs{ab}] +% {% +% \macroifelse {\#3 == biggg or \#3 == star ($\Leftrightarrow$ csname \{phy@del\cs{string}\#3\} is defined)} +% {let \meta{next cs} = csname \{phy@d@lx\meta{mb}\}} +% {let \meta{next cs} = csname \{phy@d@lx\meta{ab}\}} +% \meta{next cs} \#3 +% } +% \] +% The condition should be true when \#3 is |\big| or |*|, and it should be false when +% \#3 is ``|(|''. Accordingly, in math mode, +% \begin{align*} +% \hbox{\ttfamily\cs{ab} \cs{big} (}&\quad\to\quad\hbox{\ttfamily\cs{phy@d@lxmb} \cs{big} (}\\ +% \hbox{\ttfamily\cs{ab} \phantom{\cs{big}} (}&\quad\to\quad\hbox{\ttfamily\cs{phy@d@lxab} \phantom{\cs{big}} (} +% \end{align*} +% Then we meet two new commands --- \cs{phy@d@lxmb} and \cs{phy@d@lxab}. Syntax is as follows. +% \begin{align*} +% &\hbox{\ttfamily\cs{phy@d@lxmb} \meta{biggg or *} +% \meta{left delimiter} \meta{subformula} \meta{right delimiter}}\\ +% &\hbox{\ttfamily\cs{phy@d@lxab} \phantom{\meta{biggg or *}} +% \meta{left delimiter} \meta{subformula} \meta{right delimiter}} +% \end{align*} +% Notice that \texttt{ab} and \texttt{mb} in the above commands are names of \cs{ab}'s +% two branches --- they are like namespaces. \cs{phy@d@lxmb} and \cs{phy@d@lxab} are +% defined by the following two lines: +% \begin{Verbatim} +% \phy@d@l@genxm{mb} +% \phy@d@l@genxa{ab} +% \end{Verbatim} +% \cs{phy@d@l@genxm} and \cs{phy@d@l@genxa} are defined as follows: +% \begin{align*} +% & \macrodef {phy@d@l@genxm} [\#1: biggg or star branch name, \meta{mb}] +% {% +% \macrodef [12\ttwd] {phy@d@lx\meta{mb}} [\#\#1: biggg or star; \#\#2: left delimiter] +% {% +% \cs{begingroup} +% \macroifelse {\#\#1 == star} +% {\meta{temp} $\gets$ \cs{relax}} +% {\meta{temp} $\gets$ \#\#1} +% csname \{phy@\meta{mb}@\cs{string}\#\#2\} \meta{temp} \#\#2 \macrocr +% \% requires an \cs{endgroup} after the right delimiter +% } +% } \\[1ex] +% & \macrodef {phy@d@l@genxa} [\#1: automatic branch name, \meta{ab}] +% {% +% \macrodef [12\ttwd] {phy@d@lx\meta{ab}} [\#\#1: left delimiter] +% {% +% csname \{phy@\meta{ab}@\cs{string}\#\#1\} \#\#1 +% } +% } +% \end{align*} +% So we can get +% \begin{align*} +% \hbox{\ttfamily\cs{ab} \cs{big} (}&\quad\to\quad\hbox{\cs{begingroup} csname \{phy@mb@(\} \cs{big}\hskip2\ttwd\ \texttt(}\\ +% \hbox{\ttfamily\cs{ab} *\phantom{big} (}&\quad\to\quad\hbox{\cs{begingroup} csname \{phy@mb@(\} \cs{relax} \texttt(}\\ +% \hbox{\ttfamily\cs{ab} \phantom{\cs{big}} (}&\quad\to\quad\hbox{\hskip11\ttwd\ csname \{phy@ab@(\} \texttt(} +% \end{align*} +% The csnames above (\cs{phy@mb@(} and \cs{phy@ab@(}) are generated with \cs{phy@AB@gen}. +% \[ \hbox{\cs{phy@AB@gen} \marg{branch name} \meta{left delimiter} \marg{arg spec} \marg{definition}} \] +% If \meta{branch name} is \texttt{mb}, \marg{arg spec} should be |mr()|, where |m| is for biggg or star; +% If \meta{branch name} is \texttt{ab}, \marg{arg spec} should be |r()|. +% +% \note The ``|(|'' in the example above must not be replaced by a subformula braced by a pair of |{}|. +% +% \begin{function}{\phy@AB@gen} +% \begin{syntax} +% \cs{phy@AB@gen} \marg{branch name} \meta{left delimiter} \marg{arg spec} \marg{definition} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\def\phy@AB@gen#1#2{\expandafter\DeclareDocumentCommand\csname phy@#1@\string#2\endcsname} +\phy@AB@gen{ab}({r()}{\phy@abopen(#1\phy@abclose)} +\phy@AB@gen{ab}[{r[]}{\phy@abopen[#1\phy@abclose]} +\phy@AB@gen{ab}\{{r\{\}}{\phy@abopen\{#1\phy@abclose\}} +\phy@AB@gen{ab}|{r||}{\phy@abopen|#1\phy@abclose|} +\phy@AB@gen{ab}\|{r\|\|}{\phy@abopen\|#1\phy@abclose\|} +\phy@AB@gen{ab}<{r<>}{\phy@abopen<#1\phy@abclose>} +\phy@AB@gen{ab}\lbrace{r\lbrace\rbrace}{\phy@abopen\lbrace#1\phy@abclose\rbrace} +\phy@AB@gen{ab}\vert{r\vert\vert}{\phy@abopen\vert#1\phy@abclose\vert} +\phy@AB@gen{ab}\Vert{r\Vert\Vert}{\phy@abopen\Vert#1\phy@abclose\Vert} +\phy@AB@gen{ab}\langle{r\langle\rangle}{\phy@abopen\langle#1\phy@abclose\rangle} +% \end{macrocode} +% \cs{endgroup}'s in the end of the following definitions are corresponding to +% \cs{begingroup}'s in the definition of \cs{phy@d@l@genxm}. +% \begin{macrocode} +\phy@AB@gen{mb}({mr()}{\mathopen#1(#2\mathclose#1)\endgroup} +\phy@AB@gen{mb}[{mr[]}{\mathopen#1[#2\mathclose#1]\endgroup} +\phy@AB@gen{mb}\{{mr\{\}}{\mathopen#1\lbrace#2\mathclose#1\rbrace\endgroup} +\phy@AB@gen{mb}|{mr||}{\mathopen#1\vert#2\mathclose#1\vert\endgroup} +\phy@AB@gen{mb}\|{mr\|\|}{\mathopen#1\Vert#2\mathclose#1\Vert\endgroup} +\phy@AB@gen{mb}<{mr<>}{\mathopen#1\langle#2\mathclose#1\rangle\endgroup} +\phy@AB@gen{mb}\lbrace{mr\lbrace\rbrace}{\mathopen#1\lbrace#2\mathclose#1\rbrace\endgroup} +\phy@AB@gen{mb}\vert{mr\vert\vert}{\mathopen#1\vert#2\mathclose#1\vert\endgroup} +\phy@AB@gen{mb}\Vert{mr\Vert\Vert}{\mathopen#1\Vert#2\mathclose#1\Vert\endgroup} +\phy@AB@gen{mb}\langle{mr\langle\rangle}{\mathopen#1\langle#2\mathclose#1\rangle\endgroup} +% \end{macrocode} +% \begin{function}{\phy@del\string.} +% The syntax seems not important. These following lines seems only for \cs{ifcsname} +% to judge if the commands are defined. +% \end{function} +% \begin{macrocode} +\def\phy@del#1#2#3{\phy@abopen#1#3\phy@abclose#2} +\expandafter\def\csname phy@del\string*\endcsname#1#2#3{\mathopen#1#3\mathclose#2} +\expandafter\def\csname phy@del\string\big\endcsname#1#2#3{\bigl#1#3\bigr#2} +\expandafter\def\csname phy@del\string\Big\endcsname#1#2#3{\Bigl#1#3\Bigr#2} +\expandafter\def\csname phy@del\string\bigg\endcsname#1#2#3{\biggl#1#3\biggr#2} +\expandafter\def\csname phy@del\string\Bigg\endcsname#1#2#3{\Biggl#1#3\Biggr#2} +\expandafter\def\csname phy@del\string\biggg\endcsname#1#2#3{\bigggl#1#3\bigggr#2} +\expandafter\def\csname phy@del\string\Biggg\endcsname#1#2#3{\Bigggl#1#3\Bigggr#2} +% \end{macrocode} +% \begin{function}{\phy@d@lx} +% \begin{syntax} +% \cs{phy@d@lx} \marg{biggg or star branch name} \marg{automatic branch name} \{\#3\} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\def\phy@d@lx#1#2#3{% + \ifcsname phy@del\string#3\endcsname + \def\reserved@a{#1}% #3 is star or \biggg + \else + \def\reserved@a{#2}% #3 is delimiter + \fi + \csname phy@d@lx\reserved@a\endcsname#3} +% \end{macrocode} +% \begin{function}{\phy@d@l@genxm, \phy@d@l@genxa} +% \begin{syntax} +% \cs{phy@d@l@genxm} \marg{biggg or star branch name} +% \cs{phy@d@l@genxa} \marg{automatic branch name} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\def\phy@d@l@genxm#1{% + \expandafter\def\csname phy@d@lx#1\endcsname##1##2{% + \begingroup % \endgroup is at the end of #4 of \phy@AB@gen + \ifx##1*\let\phy@tempa=\relax\else\let\phy@tempa=##1\fi + \csname phy@#1@\string##2\endcsname\phy@tempa##2}} +\def\phy@d@l@genxa#1{% + \expandafter\def\csname phy@d@lx#1\endcsname##1{% + \csname phy@#1@\string##1\endcsname##1}} +% \end{macrocode} +% \begin{function}{\phy@d@lxmb, \phy@d@lxab} +% \begin{syntax} +% \cs{phy@d@lxmb} \meta{biggg or *} \meta{left delimiter} \meta{subformula} \meta{right delimiter} +% \cs{phy@d@lxab} \phantom{\meta{biggg or *}} \meta{left delimiter} \meta{subformula} \meta{right delimiter} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\phy@d@l@genxm{mb} +\phy@d@l@genxa{ab} +% \end{macrocode} +% \begin{function}{\ab} +% The users' command \cs{ab}. +% \end{function} +% \begin{macrocode} +\DeclareRobustCommand\ab{\phy@d@lx{mb}{ab}} +% \end{macrocode} +% \subsection{\cs{pab}-like commands} +% This is so simple. No need to comment a lot. +% +% \begin{function}{\phy@d@l@geny} +% \begin{syntax} +% \cs{phy@d@l@geny} \meta{command} \meta{left delimiter} \meta{right delimiter} +% \end{syntax} +% This command used to define commands like \cs{pab}. +% \end{function} +% \begin{macrocode} +\def\phy@d@l@geny#1#2#3{% + \DeclareDocumentCommand#1{som}{% ##1: star; ##2: bigg (csname); ##3: subformula. + \IfBooleanTF{##1}% + {#2##3#3}% + {\IfValueTF{##2}% + {\csname##2l\endcsname#2##3\csname##2r\endcsname#3}% + {\phy@abopen#2##3\phy@abclose#3}% + }% + }% +} +\phy@d@l@geny\pab() +\phy@d@l@geny\bab[] +\phy@d@l@geny\Bab\lbrace\rbrace +\phy@d@l@geny\vab\vert\vert +\phy@d@l@geny\aab\langle\rangle +\phy@d@l@geny\Vab\Vert\Vert +%</ab> +% \end{macrocode} +% \section{The \modu{ab.braket} module} +% \begin{macrocode} +%<*ab.braket> +\ProvidesFile{phy-ab.braket.sty} + [2023/10/24 `ab.braket' module of physics2] +% \end{macrocode} +% This module requires \cs{phy@abopen} and \cs{phy@abclose} from \modu{ab}. +% This module may have conflict with \modu{braket}. +% \begin{macrocode} +\phy@requiremodule{ab} +\ifdefined\phy@bra@@ + \PackageWarning{physics2}{You cannot load `ab.braket' and `braket' + modules together.\MessageBreak Only `ab.braket' module works now.} +\fi +% \end{macrocode} +% \begin{function}{\bra} +% \begin{syntax} +% \cs{bra} \char`\<\ \meta{subformula} \char`\| +% \end{syntax} +% \end{function} +% \begin{macrocode} +\phy@AB@gen{br.m}<{mr<|}{\mathopen#1\langle#2\mathclose#1\vert\endgroup} +\phy@AB@gen{br.a}<{r<|}{\phy@abopen\langle#1\phy@abclose\vert} +\phy@d@l@genxm{br.m} +\phy@d@l@genxa{br.a} +\DeclareRobustCommand\bra{\phy@d@lx{br.m}{br.a}} +% \end{macrocode} +% \begin{function}{\ket} +% \begin{syntax} +% \cs{ket} \char`\|\ \meta{subformula} \char`\> +% \end{syntax} +% \end{function} +% \begin{macrocode} +\phy@AB@gen{kt.m}|{mr|>}{\mathopen#1\vert#2\mathclose#1\rangle\endgroup} +\phy@AB@gen{kt.a}|{r|>}{\phy@abopen\vert#1\phy@abclose\rangle} +\phy@d@l@genxm{kt.m} +\phy@d@l@genxa{kt.a} +\DeclareRobustCommand\ket{\phy@d@lx{kt.m}{kt.a}} +% \end{macrocode} +% \begin{function}{\braket} +% \begin{syntax} +% \cs{braket} \char`\<\ \meta{subformula 1} \char`\|\ \meta{subformula 2} {\color{gray}\textrm{[}\char`\|\ \meta{subformula 3} \textrm{\dots]}} \char`\> +% \end{syntax} +% \end{function} +% \begin{macrocode} +\begingroup +\catcode`\|=\active +\gdef\phy@@mb@bk#1#2{\begingroup + \mathcode`\|="8000\def|{\egroup#1\vert\bgroup}% + \def\<{\mathrel{<}}\def\>{\mathrel{>}}% + \mathopen#1\langle\bgroup#2\egroup\mathclose#1\rangle\endgroup} +\gdef\phy@@ab@bk#1{\begingroup + \mathcode`\|="8000\def|{\egroup\phy@abb@bkv\bgroup}% + \def\<{\mathrel{<}}\def\>{\mathrel{>}}% + \phy@abopen\langle\bgroup#1\egroup\phy@abclose\rangle\endgroup} +\endgroup +\def\phy@abb@bkv{\middle\vert} +\phy@AB@gen{bk.m}<{mr<>}{\phy@@mb@bk#1{#2}\endgroup} +\phy@AB@gen{bk.a}<{r<>}{\phy@@ab@bk{#1}} +\phy@d@l@genxm{bk.m} +\phy@d@l@genxa{bk.a} +\DeclareRobustCommand\braket{\phy@d@lx{bk.m}{bk.a}} +% \end{macrocode} +% \begin{function}{\ketbra} +% \begin{syntax} +% \cs{braket} \char`\|\ \meta{subformula 1} \char`\>\ \meta{subformula 2} \char`\<\ \meta{subformula 3} \char`\| +% \end{syntax} +% \end{function} +% \begin{macrocode} +\begingroup +\catcode`\<=\active +\catcode`\>=\active +\gdef\phy@@mb@kb#1#2{\begingroup + \mathcode`\<="8000 \mathcode`\>="8000% + \def<{#1\langle}\def>{#1\rangle}% + \def\<{\phy@abb@l}\def\>{\phy@abb@r}% + \mathopen#1\vert#2\mathclose#1\vert\endgroup} +\endgroup +\gdef\phy@@ab@kb#1>#2<#3\phy@@end{\begingroup + \def\<{\phy@abb@l}\def\>{\phy@abb@r}% + \phy@abopen\vert\mathopen{\phy@mathvphantom{#3}}#1\phy@abclose\rangle#2% + \phy@abopen\langle#3\mathclose{\phy@mathvphantom{#1}}\phy@abclose\vert +\endgroup} +\AtBeginDocument{\ifcsname symbf\endcsname + \def\phy@abb@l{\Umathchar 3 \symoperators "003C }% + \def\phy@abb@r{\Umathchar 3 \symoperators "003E }% +\fi} +\def\phy@abb@l{\mathchar"313C } +\def\phy@abb@r{\mathchar"313E } +\phy@AB@gen{kb.m}|{mr||}{\phy@@mb@kb#1{#2}\endgroup} +\phy@AB@gen{kb.a}|{r||}{\phy@@ab@kb#1\phy@@end} +\phy@d@l@genxm{kb.m} +\phy@d@l@genxa{kb.a} +\DeclareRobustCommand\ketbra{\phy@d@lx{kb.m}{kb.a}} +%</ab.braket> +% \end{macrocode} +% \section{The \modu{braket} module} +% \begin{macrocode} +%<*braket> +\ProvidesFile{phy-braket.sty} + [2023/10/24 `braket' module of physics2] +% \end{macrocode} +% This module requires \cs{phy@abopen} and \cs{phy@abclose} from \modu{ab}. +% This module may have conflict with \modu{ab.braket}. +% \begin{macrocode} +\phy@requiremodule{ab} +\ifdefined\phy@abb@bkv + \PackageWarning{physics2}{You cannot load `ab.braket' and `braket' + modules together.\MessageBreak Only `braket' module works now.} +\fi +% \end{macrocode} +% \begin{function}{\bra} +% \begin{syntax} +% \cs{bra} * \oarg{biggg} \marg{subformula} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\DeclareDocumentCommand\bra{ s o m }{% + \IfBooleanTF{#1} + {\mathopen\langle#3\mathclose\vert} + {\IfValueTF{#2} + {\csname#2l\endcsname\langle#3\csname#2r\endcsname\vert} + {\phy@abopen\langle#3\phy@abclose\vert}% + }% +} +% \end{macrocode} +% \begin{function}{\ket} +% \begin{syntax} +% \cs{ket} * \oarg{biggg} \marg{subformula} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\DeclareDocumentCommand\ket{ s o m }{% + \IfBooleanTF{#1} + {\mathopen\vert#3\mathclose\rangle} + {\IfValueTF{#2} + {\csname#2l\endcsname\vert#3\csname#2r\endcsname\rangle} + {\phy@abopen\vert#3\phy@abclose\rangle}% + }% +} +% \end{macrocode} +% \begin{function}{\braket} +% \begin{syntax} +% \cs{ket} * [\meta{biggg}, $n \in \{1,2,3\}$] \marg{subformula 1} \dots \marg{subformula $n$} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\DeclareDocumentCommand\braket{ s O{} }{% + \IfBooleanTF{#1}% + {% + \gdef\@phy@bk@argnum{ii}% + \phy@bk@doopt{#2}% + \gdef\@phy@bk@l{mathopen}% + \gdef\@phy@bk@m{mathord}% + \gdef\@phy@bk@r{mathclose}% + }% + {% + \gdef\@phy@bk@argnum{ii}% + \gdef\@phy@bk@l{phy@abopen}% + \gdef\@phy@bk@m{middle}% + \gdef\@phy@bk@r{phy@abclose}% + \phy@bk@doopt{#2}% + }% + \csname phy@bk@in@\@phy@bk@argnum\endcsname% +} +% \end{macrocode} +% \begin{function}{\phy@bk@in@i, \phy@bk@in@ii, \phy@bk@in@iii} +% \begin{syntax} +% \cs{phy@bk@in@\meta{n.roman}} \marg{subformula 1} \dots \marg{subformula $n$} +% \end{syntax} +% \meta{n.roman} is $n$ in roman lowercase, where $n \in \{1,2,3\}$. +% \end{function} +% \begin{macrocode} +\def\phy@bk@in@i#1{% + \csname\@phy@bk@l\endcsname\langle{#1}% + \csname\@phy@bk@r\endcsname\rangle} +\def\phy@bk@in@ii#1#2{% + \csname\@phy@bk@l\endcsname\langle{#1}% + \csname\@phy@bk@m\endcsname\vert{#2}% + \csname\@phy@bk@r\endcsname\rangle} +\def\phy@bk@in@iii#1#2#3{% + \csname\@phy@bk@l\endcsname\langle{#1}% + \csname\@phy@bk@m\endcsname\vert{#2}% + \csname\@phy@bk@m\endcsname\vert{#3}% + \csname\@phy@bk@r\endcsname\rangle} +% \end{macrocode} +% \begin{function}{\phy@bk@doopt, \phy@bk@do@pt} +% \begin{syntax} +% \cs{phy@bk@doopt} \marg{clist} +% \end{syntax} +% Parse the optional argument of \cs{braket}. This will add 3 entries to hash. +% \end{function} +% \begin{macrocode} +\def\@phy@bk@do@pt#1,{\ifx#1\relax\@empty\else + \edef\reserved@a{\zap@space#1 \@empty}% + \ifx\reserved@a\@empty\else + \ifcsname phy@del\expandafter\string\csname\reserved@a\endcsname\endcsname + \xdef\@phy@bk@l{\reserved@a l}% + \xdef\@phy@bk@m{\reserved@a}% but not m (m stands for \mathrel) + \xdef\@phy@bk@r{\reserved@a r}% + \else + \ifnum\reserved@a>3% + \PackageError{physics2}{\string\braket\space can only take 3 + mandatory arguments at most}{Check if you had written a number + more than 3 in the [optional] argument.}% + \fi + \xdef\@phy@bk@argnum{\romannumeral\reserved@a}% + \fi + \fi + \expandafter\@phy@bk@do@pt\fi} +\def\phy@bk@doopt#1{\@phy@bk@do@pt#1,\relax,} +% \end{macrocode} +% \begin{function}{\ketbra} +% \begin{syntax} +% \cs{ketbra} * [\meta{biggg}] \marg{subformula 1} \oarg{between 1 and 2} \marg{subformula 2} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\DeclareDocumentCommand\ketbra{ s o m O{} m }{% + \IfBooleanTF{#1}% + {\mathopen\vert#3\mathclose\rangle#4\mathopen\langle#5\mathclose\vert}% + {\IfValueTF{#2}% + {\csname#2l\endcsname\vert#3\csname#2r\endcsname\rangle#4% + \csname#2l\endcsname\langle#5\csname#2r\endcsname\vert}% + {\begingroup + \phy@abopen\vert\mathopen{\phy@mathvphantom{#5}}#3\phy@abclose\rangle#4% + \phy@abopen\langle#5\mathclose{\phy@mathvphantom{#3}}\phy@abclose\vert + \endgroup}% + }% +} +%</braket> +% \end{macrocode} +% \section{The \modu{doubleprod} module} +% \begin{macrocode} +%<*doubleprod> +\ProvidesFile{phy-doubleprod.sty} + [2023/10/24 `doubleprod' (vertically stacked binary operators) module of physics2] +% \end{macrocode} +% Boolean options. +% \begin{macrocode} +\phy@define@key{doubleprod}{crosssymbol}{\def\@phy@dbl@c{#1}} +\phy@define@key{doubleprod}{dotsymbol}{\def\@phy@dbl@d{#1}} +\phy@define@key{doubleprod}{crossscale}{\def\@phy@dbl@sc{#1}} +\phy@define@key{doubleprod}{dotscale}{\def\@phy@dbl@sd{#1}} +\phy@define@key{doubleprod}{crossopenup}{\def\@phy@dbl@oc{#1}} +\phy@define@key{doubleprod}{dotopenup}{\def\@phy@dbl@od{#1}} +\phy@setkeys{doubleprod}{crosssymbol=\times,dotsymbol=\ldotp, + crossscale=0.8,dotscale=1,crossopenup=.02,dotopenup=.2} +\phy@processkeyopt{doubleprod} +\def\phy@dbl@gen#1#2#3#4{% + \DeclareRobustCommand#1{\mathbin{\vcenter{\baselineskip\z@skip% + \lineskip#4\phy@dblcurrf@size% + \setbox\@tempboxa=\hbox{\fontsize{#2\phy@dblcurrf@size}\z@$#3$}% + \copy\@tempboxa\box\@tempboxa}}}} +\def\phy@dblcurrf@size{\dimexpr\f@size pt\relax} +\phy@dbl@gen\doublecross\@phy@dbl@sc\@phy@dbl@c\@phy@dbl@oc +\phy@dbl@gen\doubledot\@phy@dbl@sd\@phy@dbl@d\@phy@dbl@od +%</doubleprod> +% \end{macrocode} +%^^A******************************************************************************** [l3 modules] +% \part{Modules written in \LaTeX3 syntax} +% We use |phy| as the namespace for \pkg{physics2} modules. +% \begin{macrocode} +%<@@=phy> +% \end{macrocode} +% \section{The \modu{diagmat} module} +% \begin{macrocode} +%<*diagmat> +\ProvidesExplFile{phy-diagmat.sty}{2023/10/24}{} + {`diagmat' module of physics2} +\RequirePackage { amsmath } +\phy@define@key { diagmat } { empty } [ 0 ] { \tl_gset:Nn \l_@@_mat_empty_tl { #1 } } +% \end{macrocode} +% This module requires some new variables. +% \begin{macrocode} +\clist_new:N \l_@@_mat_diag_clist +\clist_new:N \l_@@_mat_tmpa_clist +\clist_new:N \l_@@_mat_tmpb_clist +\clist_new:N \l_@@_mat_diagpos_clist +\int_new:N \l_@@_mat_dim_int +\tl_new:N \l_@@_mat_line_tl +\tl_new:N \l_@@_diagmat_tl +\tl_new:N \l_@@_mat_empty_tl +\tl_gset:Nn \l_@@_mat_empty_tl { 0 } +\phy@processkeyopt { diagmat } +\keys_define:nn { phy/diagmat } + { + empty .tl_set:N = \l_@@_mat_empty_tl , + } +% \end{macrocode} +% \begin{function}{\diagmat} +% \begin{syntax} +% \cs{\meta{delimiter type}diagmat} \oarg{key-val list} \marg{diagonal} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\DeclareDocumentCommand \diagmat { O{} m } + { \_@@_diagmat_type:nnn { } { #1 } { #2 } } +\DeclareDocumentCommand \pdiagmat { O{} m } + { \_@@_diagmat_type:nnn { p } { #1 } { #2 } } +\DeclareDocumentCommand \bdiagmat { O{} m } + { \_@@_diagmat_type:nnn { b } { #1 } { #2 } } +\DeclareDocumentCommand \Bdiagmat { O{} m } + { \_@@_diagmat_type:nnn { B } { #1 } { #2 } } +\DeclareDocumentCommand \vdiagmat { O{} m } + { \_@@_diagmat_type:nnn { v } { #1 } { #2 } } +\DeclareDocumentCommand \Vdiagmat { O{} m } + { \_@@_diagmat_type:nnn { V } { #1 } { #2 } } +% \end{macrocode} +% \begin{function}{\_@@_diagmat_type:nnn} +% \begin{syntax} +% \cs{_@@_diagmat_type:nnn} \marg{delimiter type} \marg{key-val list} \marg{diagonal} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\cs_new:Npn \_@@_diagmat_type:nnn #1#2#3 + { + \group_begin: + \clist_set:Nn \l_@@_mat_diag_clist { #3 } + \int_set:Nn \l_@@_mat_dim_int { \clist_count:N \l_@@_mat_diag_clist } + \int_compare:nNnT { \l_@@_mat_dim_int } > { \value { MaxMatrixCols } } + { \setcounter { MaxMatrixCols } { \l_@@_mat_dim_int } } + \keys_set:nn { phy/diagmat } { #2 } + \tl_gclear:N \l_@@_diagmat_tl + \int_step_inline:nnn { 0 } { \l_@@_mat_dim_int - 1 } + { + \int_step_inline:nnn { 0 } { \l_@@_mat_dim_int - 1 } + { + \int_compare:nNnTF { ##1 } = { ####1 } + { + \clist_gpop:NN \l_@@_mat_diag_clist \l_@@_tmpa_tl + \tl_if_empty:NTF \l_@@_tmpa_tl + { \tl_gput_right:Nn \l_@@_mat_line_tl { \l_@@_mat_empty_tl } } + { \tl_gput_right:Nx \l_@@_mat_line_tl { \l_@@_tmpa_tl } } + } + { \tl_gput_right:Nn \l_@@_mat_line_tl { \l_@@_mat_empty_tl } } +% \end{macrocode} +% Add |&| (or |\\|) between matrix entries. +% \begin{macrocode} + \int_compare:nNnTF { ####1 } = { \l_@@_mat_dim_int - 1 } + { + \tl_gput_right:Nn \l_@@_mat_line_tl { \\ } + } + { + \tl_gput_right:Nn \l_@@_mat_line_tl { & } + } + } + \tl_gput_right:Nx \l_@@_diagmat_tl { \l_@@_mat_line_tl } + \tl_gclear:N \l_@@_mat_line_tl + } + \begin { #1 matrix } + \tl_use:N \l_@@_diagmat_tl + \end { #1 matrix } + \group_end: + } +%</diagmat> +% \end{macrocode} +% \section{The \modu{xmat} module} +% \begin{macrocode} +%<*xmat> +\ProvidesExplFile{phy-xmat.sty}{2023/10/24}{} + {`xmat' module of physics2} +\RequirePackage { amsmath } +\phy@define@key { xmat } { showtop } + { \int_gset:Nn \l_@@_xmat_showtop_int { #1 } } +\phy@define@key { xmat } { showleft } + { \int_gset:Nn \l_@@_xmat_showleft_int { #1 } } +% \end{macrocode} +% This module requires some new variables. +% \begin{macrocode} +\bool_new:N \l_@@_xmat_extra_vdots_bool +\bool_new:N \l_@@_xmat_extra_cdots_bool +\int_new:N \l_@@_xmat_showtop_int +\int_new:N \l_@@_xmat_showleft_int +\tl_new:N \l_@@_xmat_tl +\int_gset:Nn \l_@@_xmat_showtop_int { \value { MaxMatrixCols } - 2 } +\int_gset:Nn \l_@@_xmat_showleft_int { \value { MaxMatrixCols } - 2 } +\cs_new:Npn \_@@_xmat_entry_format:nnn #1#2#3 + { + #1 \c_math_subscript_token { #2 #3 } + } +\phy@processkeyopt { xmat } +\DeclareDocumentCommand \xmat { O{} m m m } + { \_@@_xmat_type:nnnnn { } { #1 } { #2 } { #3 } { #4 } } +\DeclareDocumentCommand \pxmat { O{} m m m } + { \_@@_xmat_type:nnnnn { p } { #1 } { #2 } { #3 } { #4 } } +\DeclareDocumentCommand \bxmat { O{} m m m } + { \_@@_xmat_type:nnnnn { b } { #1 } { #2 } { #3 } { #4 } } +\DeclareDocumentCommand \Bxmat { O{} m m m } + { \_@@_xmat_type:nnnnn { B } { #1 } { #2 } { #3 } { #4 } } +\DeclareDocumentCommand \vxmat { O{} m m m } + { \_@@_xmat_type:nnnnn { v } { #1 } { #2 } { #3 } { #4 } } +\DeclareDocumentCommand \Vxmat { O{} m m m } + { \_@@_xmat_type:nnnnn { V } { #1 } { #2 } { #3 } { #4 } } +\keys_define:nn { phy/xmat } + { + format .cs_set:Np = \_@@_xmat_entry_format:nnn #1#2#3 , + showtop .int_set:N = \l_@@_xmat_showtop_int , + showleft.int_set:N = \l_@@_xmat_showleft_int , + } +% \end{macrocode} +% \begin{function}[pTF]{\_@@_if_digits_only:n} +% \begin{syntax} +% \cs{_@@_if_digits_only:nTF} \marg{token list} \marg{true code} \marg{flase code} +% \end{syntax} +% Use \LaTeX3 regular expression to tell if \meta{token list} +% (the numbers of rows or columns) contain digits only. +% \end{function} +% \begin{macrocode} +\prg_new_conditional:Npnn \_@@_if_digits_only:n #1 { TF } + { + \regex_match:nnTF { \A [[:digit:]]* \Z } { #1 } + { \prg_return_true: } { \prg_return_false: } + } +% \end{macrocode} +% \begin{function}{\_@@_xmat_type:nnnnn} +% \begin{syntax} +% \cs{_@@_xmat_type:nnnnn} \marg{delimiter type} \marg{key-val list} \marg{common entry} \marg{row number} \marg{column number} +% \end{syntax} +% \end{function} +% \begin{macrocode} +\cs_new:Npn \_@@_xmat_type:nnnnn #1#2#3#4#5 + { + \group_begin: + \tl_gclear:N \l_@@_xmat_tl + \keys_set:nn { phy/xmat } { #2 } % + \_@@_if_digits_only:nTF { #4 } + { + \int_compare:nNnTF { #4 } < { \l_@@_xmat_showtop_int + 1 } + { + \int_set:Nn \l_@@_xmat_showtop_int { #4 } + \bool_set_false:N \l_@@_xmat_extra_vdots_bool + } + { + \bool_set_true:N \l_@@_xmat_extra_vdots_bool + } + } + { + \bool_set_true:N \l_@@_xmat_extra_vdots_bool + } + \_@@_if_digits_only:nTF { #5 } + { + \int_compare:nNnTF { #5 } < { \l_@@_xmat_showleft_int + 1 } + { + \int_set:Nn \l_@@_xmat_showleft_int { #5 } + \bool_set_false:N \l_@@_xmat_extra_cdots_bool + } + { + \bool_set_true:N \l_@@_xmat_extra_cdots_bool + } + } + { + \bool_set_true:N \l_@@_xmat_extra_cdots_bool + } + \int_step_inline:nn { \l_@@_xmat_showtop_int } + { + \tl_put_right:Nn \l_@@_xmat_tl + { \_@@_xmat_entry_format:nnn { #3 } { ##1 } { 1 } } + \int_step_inline:nnn { 2 } { \l_@@_xmat_showleft_int } + { + \tl_put_right:Nn \l_@@_xmat_tl + { & \_@@_xmat_entry_format:nnn { #3 } { ##1 } { ####1 } } + } + \bool_if:NT \l_@@_xmat_extra_cdots_bool + { + \tl_put_right:Nn \l_@@_xmat_tl + { & \cdots & \_@@_xmat_entry_format:nnn { #3 } { ##1 } { #5 } } + } + \tl_put_right:Nn \l_@@_xmat_tl { \\ } + } + \bool_if:NT \l_@@_xmat_extra_vdots_bool + { + \tl_put_right:Nn \l_@@_xmat_tl { \vdots } + \prg_replicate:nn { \l_@@_xmat_showleft_int - 1 } + { + \tl_put_right:Nn \l_@@_xmat_tl { & \vdots } + } + % Add \ddots if vdots_bool and cdots_bool be true simultaneously. + \bool_if:NT \l_@@_xmat_extra_cdots_bool + { + \tl_put_right:Nn \l_@@_xmat_tl { & \ddots & \vdots } + } % else relax + \tl_put_right:Nn \l_@@_xmat_tl { \\ } + % The last row. + \tl_put_right:Nn \l_@@_xmat_tl + { \_@@_xmat_entry_format:nnn { #3 } { #4 } { 1 } } + \int_step_inline:nnn { 2 } { \l_@@_xmat_showleft_int } + { + \tl_put_right:Nn \l_@@_xmat_tl + { & \_@@_xmat_entry_format:nnn { #3 } { #4 } { ##1 } } + } + \bool_if:NT \l_@@_xmat_extra_cdots_bool + { + \tl_put_right:Nn \l_@@_xmat_tl + { & \cdots & \_@@_xmat_entry_format:nnn { #3 } { #4 } { #5 } } + } + } % else relax + \begin { #1 matrix } + \tl_use:N \l_@@_xmat_tl + \end { #1 matrix } + \group_end: + } +%</xmat> +% \end{macrocode} +% This part ends here. +% \begin{macrocode} +%<@@=> +% \end{macrocode} +%^^A******************************************************************************** [l2e legacy] +% \part{Legacy modules written in \LaTeXe\ syntax} +% \section{The \modu{ab.legacy} module} +% \begin{macrocode} +%<*ab.legacy> +\ProvidesFile{phy-ab.legacy.sty} + [2023/10/24 `ab.legacy' module of physics2] +% \end{macrocode} +% Requires \modu{ab}'s |tight| option. +% \begin{macrocode} +\phy@requiremodule{ab} +\phy@define@key{ab.legacy}{order}[\mathcal{O}]{\def\phy@ab@ordersym{#1}} +\phy@setkeys{ab.legacy}{order} +\phy@processkeyopt{ab.legacy} +\phy@d@l@geny\abs\vert\vert +\phy@d@l@geny\norm\Vert\Vert +\DeclareDocumentCommand\order{som}{% + \phy@ab@ordersym + \IfBooleanTF{#1} + {(#3)} + {\IfValueTF{#2} + {\csname#2l\endcsname(#3\csname#2r\endcsname)} + {\phy@abopen(#3\phy@abclose)}% + }% +} +\phy@d@l@geny\eval.\vert +\phy@d@l@geny\peval(\vert +\phy@d@l@geny\beval[\vert +%</ab.legacy> +% \end{macrocode} +% \section{The \modu{nabla.legacy} module} +% \begin{macrocode} +%<*nabla.legacy> +\ProvidesFile{phy-nabla.legacy.sty} + [2023/10/24 `nabla.legacy' module of physics2] +\phy@requiremodule{ab} +% \end{macrocode} +% Requires \pkg{fixdif} version 2.$x$. +% \begin{macrocode} +\RequirePackage{fixdif}[2023/01/31] +\letdif\phy@nl@nabla{nabla} +\AtBeginDocument{\ifcsname div\endcsname\let\divsymbol\div\fi + \DeclareRobustCommand\grad{\phy@nl@nabla\ab}% + \DeclareRobustCommand\div{\phy@nl@nabla\cdot\ab}% + \DeclareRobustCommand\curl{\phy@nl@nabla\times\ab}% + \DeclareRobustCommand\laplacian{\phy@nl@nabla^2\ab}% +} +%</nabla.legacy> +% \end{macrocode} +% \section{The \modu{op.legacy} module} +% \begin{macrocode} +%<*op.legacy> +\ProvidesFile{phy-op.legacy.sty} + [2023/10/24 `op.legacy' module of physics2] +\phy@define@key{op.lega}{ReIm}[true]{\def\phy@reserveda{#1}} +\phy@define@key{op.lega}{PV}{\def\@phy@oplega@PV{#1}} +\phy@define@key{op.lega}{pv}{\def\@phy@oplega@pv{#1}} +\phy@setkeys{op.lega}{PV=\mathcal{P},pv={p.v.},ReIm=true} +\phy@processkeyopt{ab} +\DeclareRobustCommand\asin{\mathop{\operator@font asin}\nolimits} +\DeclareRobustCommand\acos{\mathop{\operator@font acos}\nolimits} +\DeclareRobustCommand\atan{\mathop{\operator@font atan}\nolimits} +\DeclareRobustCommand\acsc{\mathop{\operator@font acsc}\nolimits} +\DeclareRobustCommand\asec{\mathop{\operator@font asec}\nolimits} +\DeclareRobustCommand\acot{\mathop{\operator@font acot}\nolimits} +\DeclareRobustCommand\Tr{\mathop{\operator@font Tr}\nolimits} +\DeclareRobustCommand\tr{\mathop{\operator@font tr}\nolimits} +\DeclareRobustCommand\rank{\mathop{\operator@font rank}\nolimits} +\DeclareRobustCommand\erf{\mathop{\operator@font erf}\nolimits} +\DeclareRobustCommand\Res{\mathop{\operator@font Res}\nolimits} +\DeclareRobustCommand\res{\mathop{\operator@font res}\nolimits} +\DeclareRobustCommand\PV{\mathord{\@phy@oplega@PV}} +\DeclareRobustCommand\pv{\mathop{\operator@font\@phy@oplega@pv{}}\nolimits} +% \end{macrocode} +% Restore \cs{Re} and \cs{Im} in \cs{Resymbol} and \cs{Imsymbol}. The \cs{AtBeginDocument} +% hook is used for the compatibility of \pkg{unicode-math}. +% \begin{macrocode} +\ifx\phy@reserveda\phy@true +\AtBeginDocument{% + \let\Resymbol\Re% + \let\Imsymbol\Im% + \DeclareRobustCommand\Re{\mathop{\operator@font Re}\nolimits}% + \DeclareRobustCommand\Im{\mathop{\operator@font Im}\nolimits}% +} +\fi +%</op.legacy> +% \end{macrocode} +% \section{The \modu{qtext.legacy} module} +% This module is written for the compatibility with the bad commands provided by +% \pkg{physics} only. The commands in this module should NEVER be used! +% \begin{macrocode} +%<*qtext.legacy> +\ProvidesFile{phy-qtext.legacy.sty} + [2023/10/24 `qtext.legacy' module of physics2.sty] +\RequirePackage{amstext} +\def\phy@qtext@#1#2{#1\text{#2}\quad} +\DeclareRobustCommand\qqtext{\@ifstar{\phy@qtext@{}}{\phy@qtext@\quad}} +\DeclareRobustCommand\qq{\qqtext} +\DeclareRobustCommand\qcomma{,\quad} +\DeclareRobustCommand\qc{\qcomma} +\DeclareRobustCommand\qcc{\@ifstar{\phy@qtext@{}{c.c}}{\phy@qtext@\quad{c.c}}} +\def\phy@qtext@lega@gen@#1{% + \expandafter\DeclareRobustCommand\csname q#1\endcsname% + {\@ifstar{\phy@qtext@{}{#1}}{\phy@qtext@\quad{#1}}}} +\phy@qtext@lega@gen@{if} +\phy@qtext@lega@gen@{then} +\phy@qtext@lega@gen@{else} +\phy@qtext@lega@gen@{otherwise} +\phy@qtext@lega@gen@{unless} +\phy@qtext@lega@gen@{give} +\phy@qtext@lega@gen@{using} +\phy@qtext@lega@gen@{unless} +\phy@qtext@lega@gen@{assume} +\phy@qtext@lega@gen@{since} +\phy@qtext@lega@gen@{let} +\phy@qtext@lega@gen@{for} +\phy@qtext@lega@gen@{all} +\phy@qtext@lega@gen@{even} +\phy@qtext@lega@gen@{odd} +\phy@qtext@lega@gen@{integer} +\phy@qtext@lega@gen@{and} +\phy@qtext@lega@gen@{or} +\phy@qtext@lega@gen@{as} +\phy@qtext@lega@gen@{in} +%</qtext.legacy> +% \end{macrocode} +%^^A******************************************************************************** [l3 legacy] +% \part{Legacy modules written in \LaTeX3 syntax} +% \begin{macrocode} +%<@@=phy> +% \end{macrocode} +% \section{The \modu{bm-um.legacy} module} +% \begin{macrocode} +%<*bm-um.legacy> +\ProvidesExplFile{phy-bm-um.legacy.sty}{2023/10/24}{} + {`bm-um.legacy' module of physics2} +\AtBeginDocument + { + \cs_if_exist:cF { symbf } + { + \PackageError { physics2 } + { + The ~ `bm-um.legacy' ~ module ~ requires ~ + `unicode-math' ~ package + } + { + Have ~ you ~ used ~ `unicode-math' ~ + in ~ the ~ preamble? + } + } + } +\DeclareDocumentCommand \bm { m } + { + \mode_if_math:TF + { + \tl_if_head_eq_catcode:nNTF { #1 } A + { + \symbfit { #1 } + } + { + \symbf { #1 } + } + } + { + \PackageError { physics2 } + { + The ~ \string\bm\space command ~ should ~ be ~ + used ~ in ~ math ~ mode ~ only. \MessageBreak + This ~ is ~ an ~ error ~ from ~ `bm-um.legacy' ~ module + } + { + Check ~ if ~ any ~ `\string\bm' ~ is ~ out ~ + of ~ math ~ mode. + } + } + } +%</bm-um.legacy> +% \end{macrocode} +% This part ends here. +% \begin{macrocode} +%<@@=> +% \end{macrocode} +\endinput diff --git a/macros/latex/contrib/physics2/physics2-code.pdf b/macros/latex/contrib/physics2/physics2-code.pdf Binary files differnew file mode 100644 index 0000000000..ea4d90cd31 --- /dev/null +++ b/macros/latex/contrib/physics2/physics2-code.pdf diff --git a/macros/latex/contrib/physics2/physics2-legacy.pdf b/macros/latex/contrib/physics2/physics2-legacy.pdf Binary files differnew file mode 100644 index 0000000000..5406b3d748 --- /dev/null +++ b/macros/latex/contrib/physics2/physics2-legacy.pdf diff --git a/macros/latex/contrib/physics2/doc/physics2-legacy.tex b/macros/latex/contrib/physics2/physics2-legacy.tex index d1b64a4374..fe3dcb1ce2 100644 --- a/macros/latex/contrib/physics2/doc/physics2-legacy.tex +++ b/macros/latex/contrib/physics2/physics2-legacy.tex @@ -10,7 +10,12 @@ \usepackage{unicode-math} \setmainfont{Libertinus Serif} \setsansfont{Libertinus Sans} -\setmonofont{Noto Sans Mono}[Scale=MatchLowercase] +\setmonofont{NotoSansMono}[ + Scale=MatchLowercase, + Extension=.ttf, + UprightFont=*-Light, + BoldFont=*-Medium +] \setmathfont{Libertinus Math} \usepackage{physics2} \usephysicsmodule{ab} @@ -35,7 +40,7 @@ manual for: \item Users who failed to use \pkg*{unicode-math} with \pkg{physics}. \end{itemize} It seems no reason for any other user to read \emph{this} document instead of -the \hyperref{./physics2.pdf}{}{}{package documentation} of \pkg{physics2}, +the \href{./physics2.pdf}{package documentation} of \pkg{physics2}, because this document cannot describe the package in detail. In this document, the modules of \pkg{physics2} will be introduced in @@ -85,9 +90,9 @@ command we mentioned in the first paragraph. Moreover, the code of \texttt{physics.sty} ``abuses'' the \texttt{g}-type arguments of \pkg*{xparse} package. Therefore the syntax of \pkg{physics} package -looks kind of weird. See \hyperref{https://tex.stackexchange.com/questions/% +looks kind of weird. See \href{https://tex.stackexchange.com/questions/% 470819/macros-dv-and-pdv-eat-the-subsequent-parenthesis-argument/470842#470842}% -{}{}{here} for more. +{here} for more. \subsection{Loading \pkg{physics2}} The \pkg{physics2} package includes different modules, among which every module @@ -97,9 +102,8 @@ Write the following line in the preamble to load \pkg{physics2}: \begin{Verbatim} \usepackage{physics2} \end{Verbatim} -But this is not enough. \pkg{physics2} contains different modules, among which, -only the \modu{common} module would be loaded automatically by the package. -If you want to load other modules of \pkg{physics2}, write this after loading +But this is not enough. \pkg{physics2} contains different modules. +If you want to load any module of \pkg{physics2}, write this line after loading \pkg{physics2} package: \begin{displayed} \cs{usephysicsmodule}\marg{module list} @@ -241,7 +245,7 @@ The \cs{boldsymbol} command requires the \pkg*{amsmath} or \pkg*{bm} package. If you prefer to use \pkg{bm}, you can also use the \cs{bm} command. What's more, if you tried the commands above, you might find that, the result of \cs{va} above is different from that of \pkg{physics}. -This is beacuse, if you choose to present a vector in bold, it's alomost +This is because, if you choose to present a vector in bold, there's almost no need to put a \cs{vec} ($\vec{\mskip9mu}$) sign above it. However, the method above may not work well with \pkg*{unicode-math} @@ -274,7 +278,7 @@ after these commands can be delimited with \verb|()|, \verb|[]| and \verb|\{\}|. The \modu{nabla.legacy} requires the \pkg*{fixdif} package at least version 2.0 (file date: 2023/01/31 or after 2023/01/31). -By the way, if you are used to write \cs{bm} for a vector but interested in +By the way, if you are used to writing \cs{bm} for a vector but interested in \pkg{unicode-math}, the \modu{bm-um.legacy} module would be a passable alternative to \pkg{bm} package. Notice that the \cs{bm} command from the \modu{bm-um.legacy} module can only take \emph{one} letter (or \emph{one} digit) @@ -294,7 +298,7 @@ log-like functions. The \pkg{physics} package provides a bundle of commands for log-like functions that have not been defined in the \LaTeXe\ kernel. Those log-like functions -can be used with the \modu{op.legacy} module; this module do not support +can be used with the \modu{op.legacy} module; this module does not support the syntax of \pkg{physics} either. For example: \begin{example} % \usephysicsmodule{op.legacy} @@ -303,7 +307,7 @@ the syntax of \pkg{physics} either. For example: The \cs{Re} and \cs{Im} commands are redefined as operators ``$\Re$'' and ``$\Im$'', while $\Resymbol$ and $\Imsymbol$ are reserved as \cs{Resymbol} and \cs{Imsymbol}. $\Resymbol$ and $\Imsymbol$ are ordinary symbols but $\Re$ and -$\Im$ are opetators. +$\Im$ are operators. \subsection{Quick quad text}\label{subsec:qtext} The \modu{qtext.legacy} module provides the \cs{q}\meta{foo} commands @@ -317,9 +321,9 @@ for \cs{quad}-wrapped texts. These commands have the same syntax as \[ F \qif G \qthen H \] \end{example} All the commands described in \S2.4 of -\hyperref{http://mirrors.ctan.org/macros/latex/contrib/physics/physics.pdf}{}{}% +\href{http://mirrors.ctan.org/macros/latex/contrib/physics/physics.pdf}% {\textsf{physics} documentation} are supported when using \modu{qtext.legacy} -module, but I don't recommend to use this module unless you are maintaining a +module, but I don't recommend using this module unless you are maintaining a document written with \pkg{physics}'s \cs{q}\meta{foo} commands. \subsection{Derivatives} @@ -334,10 +338,10 @@ together. For example, Math ($\d x$) v.s.\ Text (\d x) \end{example} Here are the documentations of -\hyperref{http://mirrors.ctan.org/macros/latex/contrib/fixdif/fixdif.pdf}% -{}{}{\textsf{fixdif}} and -\hyperref{http://mirrors.ctan.org/macros/latex/contrib/derivative/derivative% -.pdf}{}{}{\textsf{derivative}}. +\href{http://mirrors.ctan.org/macros/latex/contrib/fixdif/fixdif.pdf}% +{\textsf{fixdif}} and +\href{http://mirrors.ctan.org/macros/latex/contrib/derivative/derivative% +.pdf}{\textsf{derivative}}. \pkg{fixdif}'s commands behave better in superscripts and subscripts. @@ -401,7 +405,7 @@ extensible vertical bar. For example, \end{example} The argument of \cs{ketbra} should be delimited with \opt{|} and \opt{|}. In the argument, \opt{>} and \opt{<} will be regarded as extensible $\rangle$ -and $\langle$. that is, +and $\langle$. That is, \begin{center} \cs{ketbra} \opt{|} \meta{subformula$_1$} \opt{>} \meta{optional} \opt{<} \meta{subformula$_2$} \opt{|} @@ -456,7 +460,7 @@ The \cs{braket} command, in default, can take two arguments. \braket[big] {\0} {\psi} \] \end{example} If you want \cs{braket} to take one or three arguments, you can write the -number of arguments in the sqare bracket. If you need to specify the size +number of arguments in the square bracket. If you need to specify the size of bra-ket simultaneously, you need to separate the number and the size with a comma: \begin{example} diff --git a/macros/latex/contrib/physics2/physics2.ins b/macros/latex/contrib/physics2/physics2.ins new file mode 100644 index 0000000000..38faddfe10 --- /dev/null +++ b/macros/latex/contrib/physics2/physics2.ins @@ -0,0 +1,104 @@ +%% +%% This is file `physics2.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% physics2-code.dtx (with options: `install') +%% +%% Copyright (C) 2023 by Zhang Tingxuan <alphaztx@163.com> +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either +%% version 1.3c of this license or (at your option) any later +%% version. The latest version of this license is in: +%% +%% http://www.latex-project.org/lppl.txt +%% +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Zhang Tingxuan. +%% +%% This work consists of the files physics2-code.dtx, +%% and the derived files physics2.ins, +%% physics2.sty, +%% phy-<module>.sty, +%% physics2-code.pdf, +%% and README.md. +%% +\input docstrip.tex +\keepsilent + +\preamble + + Copyright (C) 2023 by Zhang Tingxuan <alphaztx@163.com> + + This work may be distributed and/or modified under the + conditions of the LaTeX Project Public License, either + version 1.3c of this license or (at your option) any later + version. The latest version of this license is in: + + http://www.latex-project.org/lppl.txt + + and version 1.3 or later is part of all distributions of + LaTeX version 2005/12/01 or later. + + This work has the LPPL maintenance status `maintained'. + + The Current Maintainer of this work is Zhang Tingxuan. + + This work consists of the files physics2-code.dtx, + and the derived files physics2.ins, + physics2.sty, + phy-<module>.sty, + physics2-code.pdf, + and README.md. + +\endpreamble + +\generate{ + \usedir{tex/latex/physics2} + \file{physics2.sty} {\from{physics2-code.dtx}{package}} + \file{phy-ab.sty} {\from{physics2-code.dtx}{ab}} + \file{phy-ab.braket.sty} {\from{physics2-code.dtx}{ab.braket}} + \file{phy-braket.sty} {\from{physics2-code.dtx}{braket}} + \file{phy-diagmat.sty} {\from{physics2-code.dtx}{diagmat}} + \file{phy-doubleprod.sty} {\from{physics2-code.dtx}{doubleprod}} + \file{phy-xmat.sty} {\from{physics2-code.dtx}{xmat}} + \file{phy-ab.legacy.sty} {\from{physics2-code.dtx}{ab.legacy}} + \file{phy-bm-um.legacy.sty} {\from{physics2-code.dtx}{bm-um.legacy}} + \file{phy-nabla.legacy.sty} {\from{physics2-code.dtx}{nabla.legacy}} + \file{phy-op.legacy.sty} {\from{physics2-code.dtx}{op.legacy}} + \file{phy-qtext.legacy.sty} {\from{physics2-code.dtx}{qtext.legacy}} + \usedir{doc/latex/physics2} + \nopreamble\nopostamble + \file{README.md} {\from{physics2-code.dtx}{readme}} +} + +\obeyspaces +\Msg{**********************************************************} +\Msg{* *} +\Msg{* To finish the installation you have to move the *} +\Msg{* following files into a directory searched by TeX: *} +\Msg{* *} +\Msg{* physics2.sty, *} +\Msg{* (for all modules) phy-<module>.sty. *} +\Msg{* *} +\Msg{* The recommended directory is *} +\Msg{* TEXMFDIST/tex/latex/physics2 *} +\Msg{* *} +\Msg{* To produce the documentation, run the file *} +\Msg{* physics2-code.dtx through XeLaTeX or LuaLaTeX. *} +\Msg{* XeLaTeX is recommended. *} +\Msg{* *} +\Msg{* Happy TeXing! *} +\Msg{* *} +\Msg{**********************************************************} + +\endbatchfile +\endinput +%% +%% End of file `physics2.ins'. diff --git a/macros/latex/contrib/physics2/physics2.pdf b/macros/latex/contrib/physics2/physics2.pdf Binary files differnew file mode 100644 index 0000000000..d8a1f3a376 --- /dev/null +++ b/macros/latex/contrib/physics2/physics2.pdf diff --git a/macros/latex/contrib/physics2/doc/physics2.tex b/macros/latex/contrib/physics2/physics2.tex index f567d5219c..c643ab72f9 100644 --- a/macros/latex/contrib/physics2/doc/physics2.tex +++ b/macros/latex/contrib/physics2/physics2.tex @@ -10,7 +10,12 @@ \usepackage{unicode-math} \setmainfont{Libertinus Serif} \setsansfont{Libertinus Sans} -\setmonofont{Noto Sans Mono}[Scale=MatchLowercase] +\setmonofont{NotoSansMono}[ + Scale=MatchLowercase, + Extension=.ttf, + UprightFont=*-Light, + BoldFont=*-Medium +] \setmathfont{Libertinus Math} \usepackage{physics2} \usephysicsmodule{ab,ab.braket} @@ -31,7 +36,7 @@ modularized package, each module provides its own function. This document describes the \pkg{physics2} package in more detail. But if you are a user of the legacy \pkg{physics} package, you can click -\hyperref{./physics2-legacy.pdf}{}{}{here} to see the documention for +\href{./physics2-legacy.pdf}{here} to see the documentation for \pkg{physics} users before you start. If you never used \pkg{physics} package before, just read \emph{this} documentation. \end{abstract} @@ -55,17 +60,17 @@ be explained in the following sections that which module requires which package. The \pkg{physics2} package requires \LaTeXe\ kernel released after 2020/10. Please make sure that your \LaTeX\ distribution is not too old. -\subsection{Loading the \pkg{physics2} package} +\subsection{Loading \pkg{physics2} and its modules} Just like loading any package, write \begin{Verbatim} \usepackage{physics2} \end{Verbatim} -in the preamble to load the \pkg{physics2} package. In this version, +in the preamble to load the \pkg{physics2} package. In the current version, \pkg{physics2} doesn't provide a package option. -However, \pkg{physics2} itself only provides very few functions. Actually, it -just provides a method to load modules. You need to load different modules of -\pkg{physics2} to have different kinds of functions applied to your document. +\pkg{physics2} itself doesn't provide many features. +You need to load different modules of \pkg{physics2} to have different +features applied to your document. \subsection{Loading a module of \pkg{physics2}} You can load a module of \pkg{physics2} only \emph{after} you write @@ -75,7 +80,7 @@ like this: \cs{usephysicsmodule}\marg{module} \end{center} The usage of \cs{usephysicsmodule} is similar to \cs{usepackage}, so you can -load more than one modules in one line. For example, +load several modules in one line. For example, \begin{Verbatim} \usephysicsmodule{ab,ab.braket} \end{Verbatim} @@ -91,19 +96,12 @@ These two lines load the \modu{ab} module with option \opt{tightbraces\:=\:true} and load \modu{ab.braket} and \modu{doubleprod} modules. -\pardanger -The \modu{common} module will be loaded automatically when you load the -\pkg{physics2} package and \emph{only} the \modu{common} module will be -loaded automatically. Any other module should be loaded manually by writing -\cs{usephysicsmodule}\marg{module} after you loaded \pkg{physics2} in the -preamble. - The following sections introduce all the user-level modules of \pkg{physics2}. View back to the table of contents to see the names of user-level modules. \section{Modules of \pkg{physics2}} -\subsection{The automatically loaded \modu{common} module} -The \modu{common} module provides the following commands: +\subsection{Features of the bare \pkg{physics2} package} +The following commands are available once you load \pkg{physics2} in preamble. \cs{delopen} and \cs{delclose}, followed by a math delimiter. They can be regarded as abbreviations of ``open delimiter'' and ``close delimiter''. If @@ -127,6 +125,14 @@ an example, \cs{bigggl}, \cs{bigggm}, \cs{bigggr}, \cs{Bigggl}, \cs{Bigggm} and \cs{Bigggr} are also supported. +\textbf{Note:} +If you had heard version $0.x.y$ of \pkg{physics2}, you might know the +\modu{common} module. Now the \modu{common} module is included in +\pkg{physics2}.sty --- the source file of \modu{common} module is deleted +but all the features of \modu{common} are reserved. Those commands above +used to be provided by \modu{common} module, but now they are provided by +\pkg{physics2}. + \subsection{The \modu{ab} module --- automatic braces} This module provides the command \cs{ab}. The \cs{ab} command, as a shorthand of ``automatic braces'', would specify the size of the following pair of @@ -237,7 +243,7 @@ extensible vertical bar. For example, \end{example} The argument of \cs{ketbra} should be delimited with \opt{|} and \opt{|}. In the argument, \opt{>} and \opt{<} will be regarded as extensible $\rangle$ -and $\langle$. that is, +and $\langle$. That is, \begin{center} \cs{ketbra} \opt{|} \meta{subformula$_1$} \opt{>} \meta{optional} \opt{<} \meta{subformula$_2$} \opt{|} @@ -298,7 +304,7 @@ The \cs{braket} command, in default, can take two arguments. \braket[big] {\0} {\psi} \] \end{example} If you want \cs{braket} to take one or three arguments, you can write the -number of arguments in the sqare bracket. If you need to specify the size +number of arguments in the square bracket. If you need to specify the size of bra-ket simultaneously, you need to separate the number and the size with a comma: \begin{example} @@ -454,7 +460,7 @@ to use a new entry format. For example, \] \end{example} In the value of \opt{format} key, \verb|#1| stands for the common entry, -or the first mandotary \meta{entry} argument of \cs{xmat}; \verb|#2| +or the first mandatory \meta{entry} argument of \cs{xmat}; \verb|#2| stands for the row index and \verb|#3| stands for the column index. This module requires \pkg{amsmath}. @@ -467,14 +473,14 @@ Only \opt{showtop} and \opt{showleft} can be used as module options. \section{The ``legacy'' modules} The legacy modules have similar names like \meta{module}\opt{.legacy}. Most of them are designed to provide solutions to maintain documents written with the -legacy \pkg{physics} package. It's not suggest to use them in a new document. +legacy \pkg{physics} package. It's not suggested to use them in a new document. \subsection{The \modu{ab.legacy} module} This module provides the following commands: \begin{Verbatim}[fontsize=\small] \abs \norm \eval (\peval \beval) \order \end{Verbatim} -They shares the same syntax as \meta{cmd}\opt{*}\oarg{biggg}\marg{subformula}. +They share the same syntax as \meta{cmd}\opt{*}\oarg{biggg}\marg{subformula}. Star and \meta{biggg} are optional. Star stands for ``use the default size''. For example, \begin{example} @@ -564,6 +570,6 @@ redefine \cs{Re} and \cs{Im}. If you want to reserve the definition of \subsection{The \modu{qtext.legacy} module} This module was written just to offer a method to maintain documents written with the legacy \pkg{physics} package. See \S\ref*{lega-subsec:qtext} of -\hyperref{./physics2-legacy.pdf}{}{}{physics2-legacy} for more information. +\href{./physics2-legacy.pdf}{physics2-legacy} for more information. \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/physics2/tex/phy-ab.braket.sty b/macros/latex/contrib/physics2/tex/phy-ab.braket.sty deleted file mode 100644 index e8e7bb30b7..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-ab.braket.sty +++ /dev/null @@ -1,84 +0,0 @@ -%% -%% This is file `phy-ab.braket.sty', -%% the `ab.braket' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesFile{phy-ab.braket.sty} - [2023/04/02 `ab.braket' module of `physics2.sty'] -% This module requires \phy@abopen and \phy@abclose from `ab'. -\phy@requiremodule{ab} -\ifdefined\phy@bra@@ - \PackageWarning{physics2}{You cannot load `ab.braket' and `braket' - modules together.\MessageBreak Only `ab.braket' module works now.} -\fi -% \bra<foo| -\phy@AB@gen{br.m}<{mr<|}{\mathopen#1\langle#2\mathclose#1\vert\endgroup} -\phy@AB@gen{br.a}<{r<|}{\phy@abopen\langle#1\phy@abclose\vert} -\phy@d@l@genxm{br.m} -\phy@d@l@genxa{br.a} -\DeclareRobustCommand\bra{\phy@d@lx{br.m}{br.a}} -% \ket|foo> -\phy@AB@gen{kt.m}|{mr|>}{\mathopen#1\vert#2\mathclose#1\rangle\endgroup} -\phy@AB@gen{kt.a}|{r|>}{\phy@abopen\vert#1\phy@abclose\rangle} -\phy@d@l@genxm{kt.m} -\phy@d@l@genxa{kt.a} -\DeclareRobustCommand\ket{\phy@d@lx{kt.m}{kt.a}} -% \braket<foo|bar> -\begingroup -\catcode`\|=\active -\gdef\phy@@mb@bk#1#2{\begingroup - \mathcode`\|="8000\def|{\egroup#1\vert\bgroup}% - \def\<{\mathrel{<}}\def\>{\mathrel{>}}% - \mathopen#1\langle\bgroup#2\egroup\mathclose#1\rangle\endgroup} -\gdef\phy@@ab@bk#1{\begingroup - \mathcode`\|="8000\def|{\egroup\phy@abb@bkv\bgroup}% - \def\<{\mathrel{<}}\def\>{\mathrel{>}}% - \phy@abopen\langle\bgroup#1\egroup\phy@abclose\rangle\endgroup} -\endgroup -\def\phy@abb@bkv{\middle\vert} -\phy@AB@gen{bk.m}<{mr<>}{\phy@@mb@bk#1{#2}\endgroup} -\phy@AB@gen{bk.a}<{r<>}{\phy@@ab@bk{#1}} -\phy@d@l@genxm{bk.m} -\phy@d@l@genxa{bk.a} -\DeclareRobustCommand\braket{\phy@d@lx{bk.m}{bk.a}} -% \ketbra|foo>bar<baz| -\begingroup -\catcode`\<=\active -\catcode`\>=\active -\gdef\phy@@mb@kb#1#2{\begingroup - \mathcode`\<="8000 \mathcode`\>="8000% - \def<{#1\langle}\def>{#1\rangle}% - \def\<{\phy@abb@l}\def\>{\phy@abb@r}% - \mathopen#1\vert#2\mathclose#1\vert\endgroup} -\endgroup -\gdef\phy@@ab@kb#1>#2<#3\phy@@end{\begingroup - \def\<{\phy@abb@l}\def\>{\phy@abb@r}% - \phy@abopen\vert\mathopen{\phy@mathvphantom{#3}}#1\phy@abclose\rangle#2% - \phy@abopen\langle#3\mathclose{\phy@mathvphantom{#1}}\phy@abclose\vert -\endgroup} -\AtBeginDocument{\ifcsname symbf\endcsname - \def\phy@abb@l{\Umathchar 3 \symoperators "003C }% - \def\phy@abb@r{\Umathchar 3 \symoperators "003E }% -\fi} -\def\phy@abb@l{\mathchar"313C } -\def\phy@abb@r{\mathchar"313E } -\phy@AB@gen{kb.m}|{mr||}{\phy@@mb@kb#1{#2}\endgroup} -\phy@AB@gen{kb.a}|{r||}{\phy@@ab@kb#1\phy@@end} -\phy@d@l@genxm{kb.m} -\phy@d@l@genxa{kb.a} -\DeclareRobustCommand\ketbra{\phy@d@lx{kb.m}{kb.a}} -\endinput -%% End of file `phy-ab.braket.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-ab.legacy.sty b/macros/latex/contrib/physics2/tex/phy-ab.legacy.sty deleted file mode 100644 index bbfa1f2b4a..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-ab.legacy.sty +++ /dev/null @@ -1,43 +0,0 @@ -%% -%% This is file `phy-ab.legacy.sty', -%% the `ab.legacy' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesFile{phy-ab.legacy.sty} - [2023/03/29 `ab.legacy' module of `physics2.sty'] -\phy@requiremodule{ab} -% The `tight' bool option, true or false. -\phy@define@key{ab.legacy}{order}[\mathcal{O}]{\def\phy@ab@ordersym{#1}} -% The default values to keys in this module. -\phy@setkeys{ab.legacy}{order} -\phy@processkeyopt{ab.legacy} -% The braced operators. -\phy@d@l@geny\abs\vert\vert -\phy@d@l@geny\norm\Vert\Vert -\DeclareDocumentCommand\order{som}{% - \phy@ab@ordersym - \IfBooleanTF{#1}% - {(#3)}% - {\IfValueTF{#2}% - {\csname#2l\endcsname(#3\csname#2r\endcsname)}% - {\phy@abopen(#3\phy@abclose)}% - }% -} -\phy@d@l@geny\eval.\vert -\phy@d@l@geny\peval(\vert -\phy@d@l@geny\beval[\vert -\endinput -%% End of file `phy-ab.legacy.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-ab.sty b/macros/latex/contrib/physics2/tex/phy-ab.sty deleted file mode 100644 index 9845903a82..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-ab.sty +++ /dev/null @@ -1,111 +0,0 @@ -%% -%% This is file `phy-ab.sty', -%% the `ab' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesFile{phy-ab.sty} - [2023/04/02 `ab' (autobraces) module of `physics2.sty'] -% \phy@requiremodule{common} -% The `tightbraces' bool option, true or false. -\phy@define@key{ab}{tightbraces}[true]{\def\@phy@abtight{#1}} -% Execute the default values to keys in this module. -\phy@setkeys{ab}{tightbraces=true} -\phy@processkeyopt{ab} -% \phy@abopen and \phy@abclose, -% internal definition for all commands in this module. -\ifx\@phy@abtight\phy@true - \let\phy@abopen\delopen - \let\phy@abclose\delclose -\else - \let\phy@abopen\left - \let\phy@abclose\right -\fi -% The internal version of \ab. #1: `ab' or `mb'; #2: open symbol; (#3: arg-spec; #4: definition) -\def\phy@AB@gen#1#2{\expandafter\DeclareDocumentCommand\csname phy@#1@\string#2\endcsname} -% #1 (r<token1><token2>): inner content. -\phy@AB@gen{ab}({r()}{\phy@abopen(#1\phy@abclose)} -\phy@AB@gen{ab}[{r[]}{\phy@abopen[#1\phy@abclose]} -\phy@AB@gen{ab}\{{r\{\}}{\phy@abopen\{#1\phy@abclose\}} -\phy@AB@gen{ab}|{r||}{\phy@abopen|#1\phy@abclose|} -\phy@AB@gen{ab}\|{r\|\|}{\phy@abopen\|#1\phy@abclose\|} -\phy@AB@gen{ab}<{r<>}{\phy@abopen<#1\phy@abclose>} -\phy@AB@gen{ab}\lbrace{r\lbrace\rbrace}{\phy@abopen\lbrace#1\phy@abclose\rbrace} -\phy@AB@gen{ab}\vert{r\vert\vert}{\phy@abopen\vert#1\phy@abclose\vert} -\phy@AB@gen{ab}\Vert{r\Vert\Vert}{\phy@abopen\Vert#1\phy@abclose\Vert} -\phy@AB@gen{ab}\langle{r\langle\rangle}{\phy@abopen\langle#1\phy@abclose\rangle} -% #1 (m): \biggg; #2 (r<token1><token2>): inner content. -% \endgroup's in the end of definition are corresponding to \begingroup in \phy@d@l@genxm. -\phy@AB@gen{mb}({mr()}{\mathopen#1(#2\mathclose#1)\endgroup} -\phy@AB@gen{mb}[{mr[]}{\mathopen#1[#2\mathclose#1]\endgroup} -\phy@AB@gen{mb}\{{mr\{\}}{\mathopen#1\lbrace#2\mathclose#1\rbrace\endgroup} -\phy@AB@gen{mb}|{mr||}{\mathopen#1\vert#2\mathclose#1\vert\endgroup} -\phy@AB@gen{mb}\|{mr\|\|}{\mathopen#1\Vert#2\mathclose#1\Vert\endgroup} -\phy@AB@gen{mb}<{mr<>}{\mathopen#1\langle#2\mathclose#1\rangle\endgroup} -\phy@AB@gen{mb}\lbrace{mr\lbrace\rbrace}{\mathopen#1\lbrace#2\mathclose#1\rbrace\endgroup} -\phy@AB@gen{mb}\vert{mr\vert\vert}{\mathopen#1\vert#2\mathclose#1\vert\endgroup} -\phy@AB@gen{mb}\Vert{mr\Vert\Vert}{\mathopen#1\Vert#2\mathclose#1\Vert\endgroup} -\phy@AB@gen{mb}\langle{mr\langle\rangle}{\mathopen#1\langle#2\mathclose#1\rangle\endgroup} -% \phy@del, the automatic braces. #1: opensymbol; #2: close symbol; #3 -\def\phy@del#1#2#3{\phy@abopen#1#3\phy@abclose#2} -\expandafter\def\csname phy@del\string*\endcsname#1#2#3{\mathopen#1#3\mathclose#2} -\expandafter\def\csname phy@del\string\big\endcsname#1#2#3{\bigl#1#3\bigr#2} -\expandafter\def\csname phy@del\string\Big\endcsname#1#2#3{\Bigl#1#3\Bigr#2} -\expandafter\def\csname phy@del\string\bigg\endcsname#1#2#3{\biggl#1#3\biggr#2} -\expandafter\def\csname phy@del\string\Bigg\endcsname#1#2#3{\Biggl#1#3\Biggr#2} -\expandafter\def\csname phy@del\string\biggg\endcsname#1#2#3{\bigggl#1#3\bigggr#2} -\expandafter\def\csname phy@del\string\Biggg\endcsname#1#2#3{\Bigggl#1#3\Bigggr#2} -% \phy@d@lx (phy_del_x): the internal defination of \ab. -% #1: `mb', according to \phy@AB@gen; #2: `ab'; #3: star or big or left delimiter. -\def\phy@d@lx#1#2#3{% - \ifcsname phy@del\string#3\endcsname% - \def\reserved@a{#1}% #3 is star or \biggg, then get the next argument. - \else% - \def\reserved@a{#2}% #3 is delimiter, the braces are automatic. - \fi% - \csname phy@d@lx\reserved@a\endcsname#3} -% The first two arguments of \phy@d@lx need to be generated by the following two commands. -\def\phy@d@l@genxm#1{% generate arguments like `mb' - \expandafter\def\csname phy@d@lx#1\endcsname##1##2{% - \begingroup% \endgroup in \phy@AB@gen{mb}<open><arg><definition> - \ifx##1*\let\phy@tempa=\relax\else\let\phy@tempa=##1\fi - \csname phy@#1@\string##2\endcsname\phy@tempa##2}} -\def\phy@d@l@genxa#1{% generate arguments like `ab' - \expandafter\def\csname phy@d@lx#1\endcsname##1{% - \csname phy@#1@\string##1\endcsname##1}} -% Generate the `mb' and `ab' arguments. -\phy@d@l@genxm{mb} -\phy@d@l@genxa{ab} -% \ab(<subformula>), after \ab can be a star or \biggg. -\DeclareRobustCommand\ab{\phy@d@lx{mb}{ab}} -% \phy@d@l@geny: define commands like \pab. #1: cs; #2: open symbol; #3: close symbol. -\def\phy@d@l@geny#1#2#3{% - \DeclareDocumentCommand#1{som}{% ##1: star; ##2: bigg (csname); ##3: subformula. - \IfBooleanTF{##1}% - {#2##3#3}% - {\IfValueTF{##2}% - {\csname##2l\endcsname#2##3\csname##2r\endcsname#3}% - {\phy@abopen#2##3\phy@abclose#3}% - }% - }% -} -\phy@d@l@geny\pab() -\phy@d@l@geny\bab[] -\phy@d@l@geny\Bab\lbrace\rbrace -\phy@d@l@geny\vab\vert\vert -\phy@d@l@geny\aab\langle\rangle -\phy@d@l@geny\Vab\Vert\Vert -\endinput -%% End of file `phy-ab.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-bm-um.legacy.sty b/macros/latex/contrib/physics2/tex/phy-bm-um.legacy.sty deleted file mode 100644 index 36ffe206a6..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-bm-um.legacy.sty +++ /dev/null @@ -1,62 +0,0 @@ -%% -%% This is file `phy-bm-um.legacy.sty', -%% the `bm-um.legacy' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesExplFile{phy-bm-um.legacy.sty}{2023/01/25}{} - {`bm-um.legacy' module of `physics2.sty'} -\AtBeginDocument - { - \cs_if_exist:cF { symbf } - { - \PackageError { physics2 } - { - The ~ `bm-um.legacy' ~ module ~ requires ~ - `unicode-math' ~ package - } - { - Have ~ you ~ used ~ `unicode-math' ~ - in ~ the ~ preamble? - } - } - } -\DeclareDocumentCommand \bm { m } - { - \mode_if_math:TF - { - \tl_if_head_eq_catcode:nNTF { #1 } A - { - \symbfit { #1 } - } - { - \symbf { #1 } - } - } - { - \PackageError { physics2 } - { - The ~ \string\bm\space command ~ should ~ be ~ - used ~ in ~ math ~ mode ~ only. \MessageBreak - This ~ is ~ an ~ error ~ from ~ `bm-um.legacy' ~ module - } - { - Check ~ if ~ any ~ `\string\bm' ~ is ~ out ~ - of ~ math ~ mode. - } - } - } -\endinput -%% End of file `phy-bm-um.legacy.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-braket.sty b/macros/latex/contrib/physics2/tex/phy-braket.sty deleted file mode 100644 index bd3a9f3249..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-braket.sty +++ /dev/null @@ -1,110 +0,0 @@ -%% -%% This is file `phy-braket.sty', -%% the `braket' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesFile{phy-braket.sty} - [2023/03/29 `braket' module of `physics2.sty'] -% Here we need to get the definition of \phy@abopen and \phy@abclose. -\phy@requiremodule{ab} -\ifdefined\phy@abb@bkv - \PackageWarning{physics2}{You cannot load `ab.braket' and `braket' - modules together.\MessageBreak Only `braket' module works now.} -\fi -% \bra -\DeclareDocumentCommand\bra{ s o m }{% - \IfBooleanTF{#1}% - {\mathopen\langle#3\mathclose\vert}% - {\IfValueTF{#2}% - {\csname#2l\endcsname\langle#3\csname#2r\endcsname\vert}% - {\phy@abopen\langle#3\phy@abclose\vert}% - }% -} -% \ket -\DeclareDocumentCommand\ket{ s o m }{% - \IfBooleanTF{#1}% - {\mathopen\vert#3\mathclose\rangle}% - {\IfValueTF{#2}% - {\csname#2l\endcsname\vert#3\csname#2r\endcsname\rangle}% - {\phy@abopen\vert#3\phy@abclose\rangle}% - }% -} -% \braket -\DeclareDocumentCommand\braket{ s O{} }{% - \IfBooleanTF{#1}% - {% - \gdef\@phy@bk@argnum{ii}% - \phy@bk@doopt{#2}% - \gdef\@phy@bk@l{mathopen}% - \gdef\@phy@bk@m{mathord}% - \gdef\@phy@bk@r{mathclose}% - }% - {% - \gdef\@phy@bk@argnum{ii}% - \gdef\@phy@bk@l{phy@abopen}% - \gdef\@phy@bk@m{middle}% - \gdef\@phy@bk@r{phy@abclose}% - \phy@bk@doopt{#2}% - }% - \csname phy@bk@in@\@phy@bk@argnum\endcsname% -} -% The internal version of \braket -\def\phy@bk@in@i#1{% - \csname\@phy@bk@l\endcsname\langle{#1}% - \csname\@phy@bk@r\endcsname\rangle} -\def\phy@bk@in@ii#1#2{% - \csname\@phy@bk@l\endcsname\langle{#1}% - \csname\@phy@bk@m\endcsname\vert{#2}% - \csname\@phy@bk@r\endcsname\rangle} -\def\phy@bk@in@iii#1#2#3{% - \csname\@phy@bk@l\endcsname\langle{#1}% - \csname\@phy@bk@m\endcsname\vert{#2}% - \csname\@phy@bk@m\endcsname\vert{#3}% - \csname\@phy@bk@r\endcsname\rangle} -% Parse the optional argument of \braket. This will add 3 entries to hash table. -\def\@phy@bk@do@pt#1,{\ifx#1\relax\@empty\else - \edef\reserved@a{\zap@space#1 \@empty}% - \ifx\reserved@a\@empty\else - \ifcsname phy@del\expandafter\string\csname\reserved@a\endcsname\endcsname - \xdef\@phy@bk@l{\reserved@a l}% - \xdef\@phy@bk@m{\reserved@a}% but not m (m stands for \mathrel) - \xdef\@phy@bk@r{\reserved@a r}% - \else - \ifnum\reserved@a>3% - \PackageError{physics2}{\string\braket\space can only take 3 - mandatory arguments at most}{Check if you had written a number - more than 3 in the [optional] argument.}% - \fi - \xdef\@phy@bk@argnum{\romannumeral\reserved@a}% - \fi - \fi -\expandafter\@phy@bk@do@pt\fi} -\def\phy@bk@doopt#1{\@phy@bk@do@pt#1,\relax,} -% \ketbra -\DeclareDocumentCommand\ketbra{ s o m O{} m }{% - \IfBooleanTF{#1}% - {\mathopen\vert#3\mathclose\rangle#4\mathopen\langle#5\mathclose\vert}% - {\IfValueTF{#2}% - {\csname#2l\endcsname\vert#3\csname#2r\endcsname\rangle#4% - \csname#2l\endcsname\langle#5\csname#2r\endcsname\vert}% - {\begingroup - \phy@abopen\vert\mathopen{\phy@mathvphantom{#5}}#3\phy@abclose\rangle#4% - \phy@abopen\langle#5\mathclose{\phy@mathvphantom{#3}}\phy@abclose\vert - \endgroup}% - }% -} -\endinput -%% End of file `phy-braket.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-common.sty b/macros/latex/contrib/physics2/tex/phy-common.sty deleted file mode 100644 index e587c02bec..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-common.sty +++ /dev/null @@ -1,68 +0,0 @@ -%% -%% This is file `phy-common.sty', -%% the `common' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesFile{phy-common.sty} - [2023/03/29 `common' module of `physics2.sty'] -% Check if unicode-math loaded and (re)define the vert symbols. -% The \relax's here are for \ifx to compare. -% unicode-math sets these symbols in \fam1, \symoperators is set 1 in 2e kernel. -\AtBeginDocument{\ifcsname symrm\endcsname - \protected\def\|{\Udelimiter 0 \symoperators "2016 }% - \protected\def\vert{\Udelimiter 0 \symoperators "007C\relax}% - \protected\def\Vert{\Udelimiter 0 \symoperators "2016\relax}% - \protected\def\mid{\Udelimiter 3 \symoperators "007C }% -\fi} -\protected\def\Vert{\delimiter"026B30D\relax} -\protected\def\mid{\delimiter"326A30C } -% \delopen and \delclose, make inner subformulae delimited by -% \left and \right behave as an open plus a close atom. -\DeclareRobustCommand\delopen{\mathopen{}\mathclose\bgroup\left} -\DeclareRobustCommand\delclose{\aftergroup\egroup\right} -% Extension to the 2e kernel biggggg commands. -\DeclareRobustCommand\biggg[1]{\leavevmode@ifvmode - {\hbox{$\left#1\vbox to20.5\p@{}\right.\n@space$}}} -\DeclareRobustCommand\Biggg[1]{\leavevmode@ifvmode - {\hbox{$\left#1\vbox to23.5\p@{}\right.\n@space$}}} -\DeclareRobustCommand\bigggl{\mathopen\biggg} -\DeclareRobustCommand\bigggm{\mathrel\biggg} -\DeclareRobustCommand\bigggr{\mathclose\biggg} -\DeclareRobustCommand\Bigggl{\mathopen\Biggg} -\DeclareRobustCommand\Bigggm{\mathrel\Biggg} -\DeclareRobustCommand\Bigggr{\mathclose\Biggg} -% \phy@mathvphantom, does the same job as \vphantom in math mode actually. -\def\phy@mathvphantom#1{\setbox\phy@tempboxa=\hbox{}% - \mathchoice% - {\setbox\@tempboxa\hbox{$\displaystyle#1$}% - \ht\phy@tempboxa=\ht\@tempboxa% - \dp\phy@tempboxa=\dp\@tempboxa% - \box\phy@tempboxa}% - {\setbox\@tempboxa\hbox{$\textstyle#1$}% - \ht\phy@tempboxa=\ht\@tempboxa% - \dp\phy@tempboxa=\dp\@tempboxa% - \box\phy@tempboxa}% - {\setbox\@tempboxa\hbox{$\scriptstyle#1$}% - \ht\phy@tempboxa=\ht\@tempboxa% - \dp\phy@tempboxa=\dp\@tempboxa% - \box\phy@tempboxa}% - {\setbox\@tempboxa\hbox{$\scriptscriptstyle#1$}% - \ht\phy@tempboxa=\ht\@tempboxa% - \dp\phy@tempboxa=\dp\@tempboxa% - \box\phy@tempboxa}% -} -\endinput -%% End of file `phy-common.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-diagmat.sty b/macros/latex/contrib/physics2/tex/phy-diagmat.sty deleted file mode 100644 index e90c99d928..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-diagmat.sty +++ /dev/null @@ -1,92 +0,0 @@ -%% -%% This is file `phy-diagmat.sty', -%% the `diagmat' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesExplFile{phy-diagmat.sty}{2023/01/25}{} - {`diagmat' module of `physics2.sty'} -\phy@requiremodule { explsetup } -\RequirePackage { amsmath } -\phy@define@key { diagmat } { empty } [ 0 ] { \tl_gset:Nn \l__phy_mat_empty_tl { #1 } } -% New variables -\clist_new:N \l__phy_mat_diag_clist -\clist_new:N \l__phy_mat_tmpa_clist -\clist_new:N \l__phy_mat_tmpb_clist -\clist_new:N \l__phy_mat_diagpos_clist -\int_new:N \l__phy_mat_dim_int -\tl_new:N \l__phy_mat_line_tl -\tl_new:N \l__phy_diagmat_tl -\tl_new:N \l__phy_mat_empty_tl -\tl_gset:Nn \l__phy_mat_empty_tl { 0 } -\phy@processkeyopt { diagmat } -\keys_define:nn { phy/diagmat } - { - empty .tl_set:N = \l__phy_mat_empty_tl , - } -% Document Commands -\DeclareDocumentCommand \diagmat { O{} m } - { \__phy_diagmat_type:nnn { } { #1 } { #2 } } -\DeclareDocumentCommand \pdiagmat { O{} m } - { \__phy_diagmat_type:nnn { p } { #1 } { #2 } } -\DeclareDocumentCommand \bdiagmat { O{} m } - { \__phy_diagmat_type:nnn { b } { #1 } { #2 } } -\DeclareDocumentCommand \Bdiagmat { O{} m } - { \__phy_diagmat_type:nnn { B } { #1 } { #2 } } -\DeclareDocumentCommand \vdiagmat { O{} m } - { \__phy_diagmat_type:nnn { v } { #1 } { #2 } } -\DeclareDocumentCommand \Vdiagmat { O{} m } - { \__phy_diagmat_type:nnn { V } { #1 } { #2 } } -% Internal function -\cs_new:Npn \__phy_diagmat_type:nnn #1#2#3 - { - \group_begin: - \clist_set:Nn \l__phy_mat_diag_clist { #3 } - \int_set:Nn \l__phy_mat_dim_int { \clist_count:N \l__phy_mat_diag_clist } - \int_compare:nNnT { \l__phy_mat_dim_int } > { \value { MaxMatrixCols } } - { \setcounter { MaxMatrixCols } { \l__phy_mat_dim_int } } - \keys_set:nn { phy/diagmat } { #2 } - \tl_gclear:N \l__phy_diagmat_tl - \int_step_inline:nnn { 0 } { \l__phy_mat_dim_int - 1 } - { - \int_step_inline:nnn { 0 } { \l__phy_mat_dim_int - 1 } - { - \int_compare:nNnTF { ##1 } = { ####1 } - { - \clist_gpop:NN \l__phy_mat_diag_clist \l__phy_tmpa_tl - \tl_if_empty:NTF \l__phy_tmpa_tl - { \tl_gput_right:Nn \l__phy_mat_line_tl { \l__phy_mat_empty_tl } } - { \tl_gput_right:Nx \l__phy_mat_line_tl { \l__phy_tmpa_tl } } - } - { \tl_gput_right:Nn \l__phy_mat_line_tl { \l__phy_mat_empty_tl } } - % The `&' and `\\' between entries. - \int_compare:nNnTF { ####1 } = { \l__phy_mat_dim_int - 1 } - { - \tl_gput_right:Nn \l__phy_mat_line_tl { \\ } - } - { - \tl_gput_right:Nn \l__phy_mat_line_tl { & } - } - } - \tl_gput_right:Nx \l__phy_diagmat_tl { \l__phy_mat_line_tl } - \tl_gclear:N \l__phy_mat_line_tl - } - \begin { #1 matrix } - \tl_use:N \l__phy_diagmat_tl - \end { #1 matrix } - \group_end: - } -\endinput -%% End of file `phy-diagmat.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-doubleprod.sty b/macros/latex/contrib/physics2/tex/phy-doubleprod.sty deleted file mode 100644 index 1888b6e70a..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-doubleprod.sty +++ /dev/null @@ -1,40 +0,0 @@ -%% -%% This is file `phy-doubleprod.sty', -%% the `doubleprod' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesFile{phy-doubleprod.sty} - [2023/01/25 `doubleprod' (double binary) module of `physics2.sty'] -% The options, true or false. -\phy@define@key{doubleprod}{crosssymbol}{\def\@phy@dbl@c{#1}} -\phy@define@key{doubleprod}{dotsymbol}{\def\@phy@dbl@d{#1}} -\phy@define@key{doubleprod}{crossscale}{\def\@phy@dbl@sc{#1}} -\phy@define@key{doubleprod}{dotscale}{\def\@phy@dbl@sd{#1}} -\phy@define@key{doubleprod}{crossopenup}{\def\@phy@dbl@oc{#1}} -\phy@define@key{doubleprod}{dotopenup}{\def\@phy@dbl@od{#1}} -\phy@setkeys{doubleprod}{crosssymbol=\times,dotsymbol=\ldotp, - crossscale=0.8,dotscale=1,crossopenup=.02,dotopenup=.2} -\phy@processkeyopt{doubleprod} -\def\phy@dbl@gen#1#2#3#4{% - \DeclareRobustCommand#1{\mathbin{\vcenter{\baselineskip\z@skip% - \lineskip#4\phy@dblcurrf@size% - \setbox\@tempboxa=\hbox{\fontsize{#2\phy@dblcurrf@size}\z@$#3$}% - \copy\@tempboxa\box\@tempboxa}}}} -\def\phy@dblcurrf@size{\dimexpr\f@size pt\relax} -\phy@dbl@gen\doublecross\@phy@dbl@sc\@phy@dbl@c\@phy@dbl@oc -\phy@dbl@gen\doubledot\@phy@dbl@sd\@phy@dbl@d\@phy@dbl@od -\endinput -%% End of file `phy-doubleprod.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-explsetup.sty b/macros/latex/contrib/physics2/tex/phy-explsetup.sty deleted file mode 100644 index a861201f9a..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-explsetup.sty +++ /dev/null @@ -1,29 +0,0 @@ -%% -%% This is file `phy-explsetup.sty', -%% the `explsetup' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesExplFile{phy-explsetup.sty}{2023/01/25}{} - {`explsetup' module of `physics2.sty'} -% temporary variables -\int_new:N \l__phy_tmpa_int -\int_new:N \l__phy_tmpb_int -\tl_new:N \l__phy_tmpa_tl -\tl_new:N \l__phy_tmpb_tl -% gobble one token -\cs_new:Npn \__phy_gobble_i:n #1 { } -\endinput -%% End of file `phy-explsetup.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-nabla.legacy.sty b/macros/latex/contrib/physics2/tex/phy-nabla.legacy.sty deleted file mode 100644 index 04d75d88fd..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-nabla.legacy.sty +++ /dev/null @@ -1,32 +0,0 @@ -%% -%% This is file `phy-nabla.legacy.sty', -%% the `nabla.legacy' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesFile{phy-nabla.legacy.sty} - [2023/01/25 `nabla.legacy' (autobraces) module of `physics2.sty'] -\phy@requiremodule{ab} -% This package required `fixdif' package version 2.x. -\RequirePackage{fixdif}[2023/01/31] -\letdif\phy@nl@nabla{nabla} -\AtBeginDocument{\ifcsname div\endcsname\let\divsymbol\div\fi - \DeclareRobustCommand\grad{\phy@nl@nabla\ab}% - \DeclareRobustCommand\div{\phy@nl@nabla\cdot\ab}% - \DeclareRobustCommand\curl{\phy@nl@nabla\times\ab}% - \DeclareRobustCommand\laplacian{\phy@nl@nabla^2\ab}% -} -\endinput -%% End of file `phy-nabla.legacy.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-op.legacy.sty b/macros/latex/contrib/physics2/tex/phy-op.legacy.sty deleted file mode 100644 index ec7bd359d4..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-op.legacy.sty +++ /dev/null @@ -1,51 +0,0 @@ -%% -%% This is file `phy-op.legacy.sty', -%% the `op.legacy' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesFile{phy-op.legacy.sty} - [2023/01/25 `op.legacy' module of `physics2.sty'] -\phy@define@key{op.lega}{ReIm}[true]{\def\phy@reserveda{#1}} -% The keys for \PV and \pv -\phy@define@key{op.lega}{PV}{\def\@phy@oplega@PV{#1}} -\phy@define@key{op.lega}{pv}{\def\@phy@oplega@pv{#1}} -\phy@setkeys{op.lega}{PV=\mathcal{P},pv={p.v.},ReIm=true} -\phy@processkeyopt{ab} -\DeclareRobustCommand\asin{\mathop{\operator@font asin}\nolimits} -\DeclareRobustCommand\acos{\mathop{\operator@font acos}\nolimits} -\DeclareRobustCommand\atan{\mathop{\operator@font atan}\nolimits} -\DeclareRobustCommand\acsc{\mathop{\operator@font acsc}\nolimits} -\DeclareRobustCommand\asec{\mathop{\operator@font asec}\nolimits} -\DeclareRobustCommand\acot{\mathop{\operator@font acot}\nolimits} -\DeclareRobustCommand\Tr{\mathop{\operator@font Tr}\nolimits} -\DeclareRobustCommand\tr{\mathop{\operator@font tr}\nolimits} -\DeclareRobustCommand\rank{\mathop{\operator@font rank}\nolimits} -\DeclareRobustCommand\erf{\mathop{\operator@font erf}\nolimits} -\DeclareRobustCommand\Res{\mathop{\operator@font Res}\nolimits} -\DeclareRobustCommand\res{\mathop{\operator@font res}\nolimits} -\DeclareRobustCommand\PV{\mathord{\@phy@oplega@PV}} -\DeclareRobustCommand\pv{\mathop{\operator@font\@phy@oplega@pv{}}\nolimits} -% \Re and \Im, restore the former comands as \Resymbol and \Imsymbol -\ifx\phy@reserveda\phy@true -\AtBeginDocument{% - \let\Resymbol\Re% - \let\Imsymbol\Im% - \DeclareRobustCommand\Re{\mathop{\operator@font Re}\nolimits}% - \DeclareRobustCommand\Im{\mathop{\operator@font Im}\nolimits}% -} -\fi -\endinput -%% End of file `phy-op.legacy.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-qtext.legacy.sty b/macros/latex/contrib/physics2/tex/phy-qtext.legacy.sty deleted file mode 100644 index 6ac0d250b0..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-qtext.legacy.sty +++ /dev/null @@ -1,52 +0,0 @@ -%% -%% This is file `phy-qtext.legacy.sty', -%% the `qtext.legacy' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesFile{phy-qtext.legacy.sty} - [2023/01/25 `qtext.legacy' module of `physics2.sty'] -\RequirePackage{amstext} -\def\phy@qtext@#1#2{#1\text{#2}\quad} -\DeclareRobustCommand\qqtext{\@ifstar{\phy@qtext@{}}{\phy@qtext@\quad}} -\DeclareRobustCommand\qq{\qqtext} -\DeclareRobustCommand\qcomma{,\quad} -\DeclareRobustCommand\qc{\qcomma} -\DeclareRobustCommand\qcc{\@ifstar{\phy@qtext@{}{c.c}}{\phy@qtext@\quad{c.c}}} -\def\phy@qtext@lega@gen@#1{% - \expandafter\DeclareRobustCommand\csname q#1\endcsname% - {\@ifstar{\phy@qtext@{}{#1}}{\phy@qtext@\quad{#1}}}} -\phy@qtext@lega@gen@{if} -\phy@qtext@lega@gen@{then} -\phy@qtext@lega@gen@{else} -\phy@qtext@lega@gen@{otherwise} -\phy@qtext@lega@gen@{unless} -\phy@qtext@lega@gen@{give} -\phy@qtext@lega@gen@{using} -\phy@qtext@lega@gen@{unless} -\phy@qtext@lega@gen@{assume} -\phy@qtext@lega@gen@{since} -\phy@qtext@lega@gen@{let} -\phy@qtext@lega@gen@{for} -\phy@qtext@lega@gen@{all} -\phy@qtext@lega@gen@{even} -\phy@qtext@lega@gen@{odd} -\phy@qtext@lega@gen@{integer} -\phy@qtext@lega@gen@{and} -\phy@qtext@lega@gen@{or} -\phy@qtext@lega@gen@{as} -\phy@qtext@lega@gen@{in} -\endinput -%% End of file `phy-qtext.legacy.sty'. diff --git a/macros/latex/contrib/physics2/tex/phy-xmat.sty b/macros/latex/contrib/physics2/tex/phy-xmat.sty deleted file mode 100644 index 9e7058b062..0000000000 --- a/macros/latex/contrib/physics2/tex/phy-xmat.sty +++ /dev/null @@ -1,148 +0,0 @@ -%% -%% This is file `phy-xmat.sty', -%% the `xmat' module of `physics2' package. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\ProvidesExplFile{phy-xmat.sty}{2023/01/25}{} - {`xmat' module of `physics2.sty'} -\phy@requiremodule { explsetup } -\RequirePackage { amsmath } -\phy@define@key { xmat } { showtop } - { \int_gset:Nn \l__phy_xmat_showtop_int { #1 } } -\phy@define@key { xmat } { showleft } - { \int_gset:Nn \l__phy_xmat_showleft_int { #1 } } -% New variables -\bool_new:N \l__phy_xmat_extra_vdots_bool -\bool_new:N \l__phy_xmat_extra_cdots_bool -\int_new:N \l__phy_xmat_showtop_int -\int_new:N \l__phy_xmat_showleft_int -\tl_new:N \l__phy_xmat_tl -\int_gset:Nn \l__phy_xmat_showtop_int { \value { MaxMatrixCols } - 2 } -\int_gset:Nn \l__phy_xmat_showleft_int { \value { MaxMatrixCols } - 2 } -\cs_new:Npn \__phy_xmat_entry_format:nnn #1#2#3 - { - #1 \c_math_subscript_token { #2 #3 } - } -\phy@processkeyopt { xmat } -\DeclareDocumentCommand \xmat { O{} m m m } - { \__phy_xmat_type:nnnnn { } { #1 } { #2 } { #3 } { #4 } } -\DeclareDocumentCommand \pxmat { O{} m m m } - { \__phy_xmat_type:nnnnn { p } { #1 } { #2 } { #3 } { #4 } } -\DeclareDocumentCommand \bxmat { O{} m m m } - { \__phy_xmat_type:nnnnn { b } { #1 } { #2 } { #3 } { #4 } } -\DeclareDocumentCommand \Bxmat { O{} m m m } - { \__phy_xmat_type:nnnnn { B } { #1 } { #2 } { #3 } { #4 } } -\DeclareDocumentCommand \vxmat { O{} m m m } - { \__phy_xmat_type:nnnnn { v } { #1 } { #2 } { #3 } { #4 } } -\DeclareDocumentCommand \Vxmat { O{} m m m } - { \__phy_xmat_type:nnnnn { V } { #1 } { #2 } { #3 } { #4 } } - -\keys_define:nn { phy/xmat } - { - format .cs_set:Np = \__phy_xmat_entry_format:nnn #1#2#3 , - showtop .int_set:N = \l__phy_xmat_showtop_int , - showleft.int_set:N = \l__phy_xmat_showleft_int , - } -% Use regex to judge if the total row/column number contains digits **only**. -\prg_new_conditional:Npnn \__phy_if_digits_only:n #1 { TF } - { - \regex_match:nnTF { \A [[:digit:]]* \Z } { #1 } - { \prg_return_true: } { \prg_return_false: } - } -% #1: p,b,B; #2: options; #2: common entry; #3: total rows; #4: total cols. -\cs_new:Npn \__phy_xmat_type:nnnnn #1#2#3#4#5 - { - \group_begin: - \tl_gclear:N \l__phy_xmat_tl - \keys_set:nn { phy/xmat } { #2 } % - \__phy_if_digits_only:nTF { #4 } - { - \int_compare:nNnTF { #4 } < { \l__phy_xmat_showtop_int + 1 } - { - \int_set:Nn \l__phy_xmat_showtop_int { #4 } - \bool_set_false:N \l__phy_xmat_extra_vdots_bool - } - { - \bool_set_true:N \l__phy_xmat_extra_vdots_bool - } - } - { - \bool_set_true:N \l__phy_xmat_extra_vdots_bool - } - \__phy_if_digits_only:nTF { #5 } - { - \int_compare:nNnTF { #5 } < { \l__phy_xmat_showleft_int + 1 } - { - \int_set:Nn \l__phy_xmat_showleft_int { #5 } - \bool_set_false:N \l__phy_xmat_extra_cdots_bool - } - { - \bool_set_true:N \l__phy_xmat_extra_cdots_bool - } - } - { - \bool_set_true:N \l__phy_xmat_extra_cdots_bool - } - \int_step_inline:nn { \l__phy_xmat_showtop_int } - { - \tl_put_right:Nn \l__phy_xmat_tl - { \__phy_xmat_entry_format:nnn { #3 } { ##1 } { 1 } } - \int_step_inline:nnn { 2 } { \l__phy_xmat_showleft_int } - { - \tl_put_right:Nn \l__phy_xmat_tl - { & \__phy_xmat_entry_format:nnn { #3 } { ##1 } { ####1 } } - } - \bool_if:NT \l__phy_xmat_extra_cdots_bool - { - \tl_put_right:Nn \l__phy_xmat_tl - { & \cdots & \__phy_xmat_entry_format:nnn { #3 } { ##1 } { #5 } } - } - \tl_put_right:Nn \l__phy_xmat_tl { \\ } - } - \bool_if:NT \l__phy_xmat_extra_vdots_bool - { - \tl_put_right:Nn \l__phy_xmat_tl { \vdots } - \prg_replicate:nn { \l__phy_xmat_showleft_int - 1 } - { - \tl_put_right:Nn \l__phy_xmat_tl { & \vdots } - } - % Add \ddots if vdots_bool and cdots_bool be true simultaneously. - \bool_if:NT \l__phy_xmat_extra_cdots_bool - { - \tl_put_right:Nn \l__phy_xmat_tl { & \ddots & \vdots } - } % else relax - \tl_put_right:Nn \l__phy_xmat_tl { \\ } - % The last row. - \tl_put_right:Nn \l__phy_xmat_tl - { \__phy_xmat_entry_format:nnn { #3 } { #4 } { 1 } } - \int_step_inline:nnn { 2 } { \l__phy_xmat_showleft_int } - { - \tl_put_right:Nn \l__phy_xmat_tl - { & \__phy_xmat_entry_format:nnn { #3 } { #4 } { ##1 } } - } - \bool_if:NT \l__phy_xmat_extra_cdots_bool - { - \tl_put_right:Nn \l__phy_xmat_tl - { & \cdots & \__phy_xmat_entry_format:nnn { #3 } { #4 } { #5 } } - } - } % else relax - \begin { #1 matrix } - \tl_use:N \l__phy_xmat_tl - \end { #1 matrix } - \group_end: - } -\endinput -%% End of file `phy-xmat.sty'. diff --git a/macros/latex/contrib/physics2/tex/physics2.sty b/macros/latex/contrib/physics2/tex/physics2.sty deleted file mode 100644 index 3d732b8d29..0000000000 --- a/macros/latex/contrib/physics2/tex/physics2.sty +++ /dev/null @@ -1,70 +0,0 @@ -%% -%% This is file `physics2.sty'. -%% -%% ****************************************************** -%% * This work may be distributed and/or modified under * -%% * the conditions of the LaTeX Project Public License * -%% * * -%% * http://www.latex-project.org/lppl.txt * -%% * * -%% * either version 1.3c of this license or any later * -%% * version. * -%% ****************************************************** -%% -%% This work has the LPPL maintenance status `maintained'. -%% -%% The Current Maintainer of this work is Zhang Tingxuan. -%% -\NeedsTeXFormat{LaTeX2e}[2020/10/01] -\ProvidesPackage{physics2} - [2023/04/02 v0.2.1 Tools for typesetting math for physics.] -% Some common variables. -\newcount\phy@tempcnta -\newdimen\phy@tempdima -\newdimen\phy@tempdimb -\newskip\phy@tempskipa -\newmuskip\phy@tempmuskipa -\newbox\phy@tempboxa -\newif\ifphy@tempswa -\newtoks\phy@toksa -% The package uses `keyval' to support key-value settings. -\RequirePackage{keyval} -\def\phy@true{true} -\def\phy@false{false} -% \phy@define@key{<module>}{<key>}[<default value>]{<code>} -\long\def\phy@define@key#1{\define@key{phy-#1}} -% \phy@setkeys{<module>}{<key-val list>} -\long\def\phy@setkeys#1{\setkeys{phy-#1}} -% \phy@processkeyopt{<module>} -\def\phy@processkeyopt#1{\let\reserved@a\@empty% - \edef\reserved@a{\@ptionlist{\@currname.\@currext}}% - \edef\reserved@a{\noexpand\phy@setkeys{#1}{\reserved@a}}% - \reserved@a% the next line thanks to `geometry' - \AtEndOfPackage{\let\@unprocessedoptions\relax}} -% Load the physics modules as 2e kernel does. -\def\usephysicsmodule{\phy@FWoptions\@pkgextension} -\let\phy@requiremodule\usephysicsmodule -\@onlypreamble\usephysicsmodule -\def\phy@FWoptions#1{\@ifnextchar[%] - {\phy@FW@ptions#1}{\phy@FW@ptions#1[]}} -\@onlypreamble\phy@FWoptions -\def\phy@FW@ptions#1[#2]#3{\@ifnextchar[%] - {\phy@FW@pti@ns#1[{#2}]#3}{\phy@FW@pti@ns#1[{#2}]#3[]}} -\@onlypreamble\phy@FW@ptions -\def\phy@FW@pti@ns#1[#2]#3[#4]{% - \def\reserved@b##1,{% - \ifx\@nnil##1\relax\else - \ifx\@nnil##1\@nnil\else - \noexpand\@onefilewithoptions{phy-##1}[{\unexpanded{#2}}][{#4}]% - \noexpand\@pkgextension - \fi - \expandafter\reserved@b - \fi}% - \edef\reserved@a{\zap@space#3 \@empty}% - \edef\reserved@a{\expandafter\reserved@b\reserved@a,\@nnil,}% - \reserved@a} -\@onlypreamble\phy@FW@pti@ns -% The `common' module of physics2, every module needs this. -\phy@requiremodule{common} -\endinput -%% End of file `physics2.sty'. diff --git a/macros/latex/contrib/tkz/tkz-elements/README.md b/macros/latex/contrib/tkz/tkz-elements/README.md new file mode 100644 index 0000000000..49f16ad785 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/README.md @@ -0,0 +1,73 @@ +# tkz-elements — for euclidean geometry + +Release 1.00b 2023/10/25 + +## Description + +`tkz-elements` is the first 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. + +## Licence + +This package may be modified and distributed under the terms and +conditions of the [LaTeX Project Public License](https://www.latex-project.org/lppl/), version 1.3 or greater. + + +## Requirements + +The package compiles with utf8 and lualatex. You need actually to load: + +- [tikz](https://ctan.org/pkg/tikz) +- [tkz-euclide](https://ctan.org/pkg/tkz-euclide) + +## Installation + +The package `tkz-elements` is (will be) present in TeXLive and MiKTeX, use the package +manager to install. + +You can experiment with the `tkz-elements` package by placing all of the +distribution files in the directory containing your current tex file. + +The different files must be moved into the different directories in your +installation `TDS` tree or in your `TEXMFHOME`: + + +## How to use it + +To use the package `tkz-elements`, place the following lines in the preamble of +your LaTeX document: + +``` +\usepackage{tkz-elements} +\begin{document} +\begin{tkzelements} + your code +\end{tkzelements} +\begin{tikzpicture} + your code +\end{tikzpicture} +``` + +If you use the `xcolor` package, load that package before `tkz-euclide` to avoid +package conflicts. + +## Documentation + +Documentation for `tkz-euclide` is available on `CTAN`. + +## Examples + +All examples given in documentation will be stored on my site : [http://altermundus.fr](http://altermundus.fr) as standalone +files, ready for compilation. + +Other examples, in French, are on my site. + + +## History + +- First version 1.00b + +## Author + +Alain Matthes, 5 rue de Valence, Paris 75005, al (dot) ma (at) mac (dot) com 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 new file mode 100644 index 0000000000..a86fe1230b --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-circle.tex @@ -0,0 +1,259 @@ +\newpage +\section{Class circle} % (fold) +\label{sec:class_circle} + +\subsection{Attributs of a circle} % (fold) +\label{sub:attributs_of_a_circle} +This class is also defined by two points, on the one hand the center and on the other hand a point through which the circle passes. + +\bgroup +\catcode`_=12 + +\small +\begin{center} +%\caption{Attributes about point circle.} +\begin{tabular}{ll} +\toprule +\textbf{Attributes} & \textbf{Application}\\ +\Iattr{circle}{center} & |z.A = C.AB.center|\\ +\Iattr{circle}{through} & |z.B = C.AB.through|\\ +\Iattr{circle}{type} & |C.AB.type| \tkzar |C.OA.type = circle|\\ +\Iattr{circle}{radius} & |C.AB.radius| \tkzar |r = C.OA.radius | $r$ real number\\ +\Iattr{circle}{north} & |C.AB.north| \tkzar |z.N = C.OA.north|\\ +\Iattr{circle}{south} & |C.AB.south| \tkzar |z.S = C.OA.south| \\ +\Iattr{circle}{east} & |C.AB.east| \tkzar |z.E = C.OA.east| \\ +\Iattr{circle}{west} & |C.AB.west| \tkzar |z.W = C.OA.west| \\ +\bottomrule % +\end{tabular} +\end{center} +\egroup + +\subsubsection{Example: circle attributes} % (fold) +\label{ssub:example_circle_attributes} + +Three attributes are used (south, west, radius). Currently, \Igfct{package}{set\_lua\_to\_tex} (see \ref{ssub:transfer_from_lua_to_tex}) creates global macros. The |\r| macro must not already be defined. + +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .5 + z.a = point: new (1, 1) + z.b = point: new (5, 4) + C.ab = circle : new (z.a,z.b) + z.s = C.ab.south + z.w = C.ab.west + r = C.ab.radius + set_lua_to_tex{"r"} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(a,b,s,w) + \tkzLabelPoints(a,b,s,w) + \tkzDrawCircle(a,b) + \tkzDrawSegment(a,b) + \tkzLabelSegment[sloped](a,b){ab = \r} +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} + scale = .5 + z.a = point: new (1, 1) + z.b = point: new (5, 4) + C.ab = circle : new (z.a,z.b) + z.s = C.ab.south + z.w = C.ab.west + r = C.ab.radius + set_lua_to_tex{"r"} +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPoints(a,b,s,w) +\tkzLabelPoints(a,b,s,w) +\tkzDrawCircle(a,b) +\tkzDrawSegment(a,b) +\tkzLabelSegment[sloped](a,b){ab = \r} +\end{tikzpicture} +\hspace*{\fill} +\end{minipage} + +% \caption{Class Circle} +% subsubsection example_circle_attributes (end) + +% subsection attributs_of_a_circle (end) + +\subsection{Methods of the class circle} % (fold) +\label{sub:methods_of_the_class_circle} +\bgroup +\catcode`_=12 +\small +\begin{center} +\begin{tabular}{ll} +\toprule +\textbf{Methods} & \textbf{Comments} \\ +\midrule \\ +\Imeth{circle}{new(O,A)} & |C.OA = circle : new (z.O,z.A)| \tkzar circle center $O$ through $A$\\ +\midrule + \textbf{Points} &\\ +\midrule +\Imeth{circle}{antipode (pt)} & |z.C = C.OA: antipode (z.B)| \tkzar $[BC]$ is a dimater \\ +\Imeth{circle}{inversion (pt)} & |z.Bp = C.AC:inversion (z.B)|\\ +\Imeth{circle}{set\_inversion (list of pts)} & |z.Bp,z.Ep,z.Cp = C.AC: set_inversion ( z.B, z.E, z.C )|\\ +\Imeth{circle}{midarc (z1,z2)} & |z.D = C.AB: midarc (z.B,z.C)| $D$ is the midarc of $\widearc{AB}$\\ +\Imeth{circle}{point (phi)} & |z.E = C.AB: point (-math.pi/3)|\\ +\Imeth{circle}{random\_pt(lower, upper)} & \\ +\Imeth{circle}{internal\_similitude (C)} & |z.I = C.1 : internal_similitude (C.2)| \\ +\Imeth{circle}{external\_similitude (C)} & |z.J = C.1 : external_similitude (C.2)| \\ +\midrule + \textbf{Lines} &\\ +\midrule +\Imeth{circle}{radical\_axis (C)} & \\ +\Imeth{circle}{tangent\_at (pt)} & |z.P = C.OA: tangent_at (z.M)| $((PM) \perp (OM))$\\ +\Imeth{circle}{tangent\_from (pt)}& |z.M,z.N = C.OA: tangent_from (z.P)| \\ +\midrule + \textbf{Circles} &\\ +\midrule +\Imeth{circle}{orthogonal\_from (pt)} & |C= C.OA: orthogonal_from (z.P)| \\ +\Imeth{circle}{orthogonal\_through (pta,ptb)} & |C = C.OA: orthogonal_through (z.z1,z.z2)|\\ +\midrule + \textbf{Miscellaneous} &\\ +\midrule +\Imeth{circle}{power (pt)} &| p = C.OA: power (z.M)| \tkzar power with respect to a circle \\ +\Imeth{circle}{in\_out (pt)} & |C.OA : in_out (z.M)| \tkzar boolean \\ +\Imeth{circle}{draw ()} & for further use\\ +\bottomrule % +\end{tabular} +\end{center} +\egroup +% subsubsection methods_circle (end) + +\subsubsection{Altshiller} % (fold) +\label{ssub:altshiller} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.P = point : new (0,0) + z.Q = point : new (5,0) + z.I = point : new (3,2) + C.QI = circle : new (z.Q,z.I) + C.PE = C.QI : orthogonal_from (z.P) + z.E = C.PE.through + C.QE = circle : new (z.Q,z.E) + _,z.F = intersection (C.PE,C.QE) + z.A = C.PE: point (math.pi/180*80) + L.AE = line : new (z.A,z.E) + _,z.C = intersection (L.AE,C.QE) + L.AF = line : new (z.A,z.F) + L.CQ = line : new (z.C,z.Q) + z.D = intersection (L.AF,L.CQ) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(P,E Q,E) + \tkzDrawLines[add=0 and 1](P,Q) + \tkzDrawLines[add=0 and 2](A,E) + \tkzDrawSegments(P,E E,F F,C A,F C,D) + \tkzDrawPoints(P,Q,E,F,A,C,D) + \tkzLabelPoints(P,Q,E,F,A,C,D) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.P = point : new (0,0) +z.Q = point : new (5,0) +z.I = point : new (3,2) +C.QI = circle : new (z.Q,z.I) +C.PE = C.QI : orthogonal_from (z.P) +z.E = C.PE.through +C.QE = circle : new (z.Q,z.E) +_,z.F = intersection (C.PE,C.QE) +z.A = C.PE: point (math.pi/180*80) +L.AE = line : new (z.A,z.E) +_,z.C = intersection (L.AE,C.QE) +L.AF = line : new (z.A,z.F) +L.CQ = line : new (z.C,z.Q) +z.D = intersection (L.AF,L.CQ) +\end{tkzelements} + + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(P,E Q,E) +\tkzDrawLines[add=0 and 1](P,Q) +\tkzDrawLines[add=0 and 2](A,E) +\tkzDrawSegments(P,E E,F F,C A,F C,D) +\tkzDrawPoints(P,Q,E,F,A,C,D) +\tkzLabelPoints(P,Q,E,F,A,C,D) +\end{tikzpicture} +\hspace*{\fill} +%subsubsection altshiller (end) + +\subsubsection{Lemoine} % (fold) +\label{ssub:lemoine} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = 1.6 + z.A = point: new (1,0) + z.B = point: new (5,2) + z.C = point: new (1.2,2) + T = triangle: new(z.A,z.B,z.C) + z.O = T.circumcenter + C.OA = circle: new (z.O,z.A) + L.tA = C.OA: tangent_at (z.A) + L.tB = C.OA: tangent_at (z.B) + L.tC = C.OA: tangent_at (z.C) + z.P = intersection (L.tA,T.bc) + z.Q = intersection (L.tB,T.ac) + z.R = intersection (L.tC,T.ab) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon[teal](A,B,C) + \tkzDrawCircle(O,A) + \tkzDrawPoints(A,B,C,P,Q,R) + \tkzLabelPoints(A,B,C,P,Q,R) + \tkzDrawLine[blue](Q,R) + \tkzDrawLines[red](A,P B,Q R,C) + \tkzDrawSegments(A,R C,P C,Q) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = 1.25 +z.A = point: new (1,0) +z.B = point: new (5,2) +z.C = point: new (1.2,2) +T = triangle: new(z.A,z.B,z.C) +z.O = T.circumcenter +C.OA = circle: new (z.O,z.A) +L.tA = C.OA: tangent_at (z.A) +L.tB = C.OA: tangent_at (z.B) +L.tC = C.OA: tangent_at (z.C) +z.P = intersection (L.tA,T.bc) +z.Q = intersection (L.tB,T.ac) +z.R = intersection (L.tC,T.ab) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture}[rotate=90] +\tkzGetNodes +\tkzDrawPolygon[teal](A,B,C) +\tkzDrawCircle(O,A) +\tkzDrawPoints(A,B,C,P,Q,R) +\tkzLabelPoints(A,B,C,P,Q,R) +\tkzDrawLine[blue](Q,R) +\tkzDrawLines[red](A,P B,Q R,C) +\tkzDrawSegments(A,R C,P C,Q) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Lemoine line} +% subsubsection lemoine (end) +% subsection methods_of_the_class_circle (end) + + +% section class_circle (end) +\endinput diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex new file mode 100644 index 0000000000..4480417f08 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-ellipse.tex @@ -0,0 +1,377 @@ +\newpage +\section{Classe ellipse} % (fold) +\label{sec:classe_ellipse} + +\subsection{Attributs of an ellipse} % (fold) +\label{sub:attributs_of_an_ellipse} +The first attributes are the three points that define the ellipse : \Iattr{ellipse}{center} , \Iattr{ellipse}{vertex} and \Iattr{ellipse}{covertex}. The first method to define an ellipse is to give its center, then the point named \tkzname{vertex} which defines the major axis and finally the point named \tkzname{covertex} which defines the minor axis. + + +\bgroup +\catcode`_=12 +\small +\begin{center} +%\caption{Attributes about ellipse class.} +\begin{tabular}{ll} +\toprule +\textbf{Attributes} & \textbf{Application}\\ +\Iattr{ellipse}{center} & center of the ellipse\\ +\Iattr{ellipse}{vertex} & point of the major axis and of the ellipse\\ +\Iattr{ellipse}{covertex} & point of the minor axis and of the ellipse\\ +\Iattr{ellipse}{type}& The type is 'ellipse'\\ +\Iattr{ellipse}{Rx}& Radius from center to vertex\\ +\Iattr{ellipse}{Ry}& Radius from center to covertex\\ +\Iattr{ellipse}{slope}& Slope of the line passes through the foci\\ +\Iattr{ellipse}{Fa}& First focus\\ +\Iattr{ellipse}{Fb}& Second focus\\ +\Imeth{ellipse}{south} & See next example \ref{ssub:attributs_of_an_ellipse} \\ +\Imeth{ellipse}{north} & See next example \ref{ssub:attributs_of_an_ellipse} \\ +\Imeth{ellipse}{west} & See next example \ref{ssub:attributs_of_an_ellipse} \\ +\Imeth{ellipse}{east} & See next example \ref{ssub:attributs_of_an_ellipse} \\ +\bottomrule % +\end{tabular} +\end{center} +\egroup + + +\subsubsection{Attributs of an ellipse} % (fold) +\label{ssub:attributs_of_an_ellipse} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.C = point: new (3 , 2) + z.A = point: new (5 , 1) + L.CA = line : new (z.C,z.A) + z.b = L.CA.north_pa + L = line : new (z.C,z.b) + z.B = L : point (0.5) + E = ellipse: new (z.C,z.A,z.B) + a = E.Rx + b = E.Ry + z.F1 = E.Fa + z.F2 = E.Fb + slope = math.deg(E.slope) + z.E = E.east + z.N = E.north + z.W = E.west + z.S = E.south + z.Co = E.covertex + z.Ve = E.vertex + set_lua_to_tex {'a','b','slope'} +\end{tkzelements} +\begin{tikzpicture} + \pgfkeys{/pgf/number format/.cd,fixed,precision=2} + \tkzGetNodes + \tkzDrawCircles[teal](C,A) + \tkzDrawEllipse[red](C,\a,\b,\slope) + \tkzDrawPoints(C,A,B,b,W,S,F1,F2) + \tkzLabelPoints(C,A,B) + \tkzDrawLine[add = .5 and .5](A,W) + \tkzLabelSegment[pos=1.5,above,sloped](A,W){slope = \pgfmathprintnumber{\slope}} + \tkzLabelPoint[below](S){South} + \tkzLabelPoint[below left](F1){Focus 1} + \tkzLabelPoint[below left](F2){Focus 2} + \tkzLabelPoint[above right](Ve){Vertex ; East} + \tkzLabelPoint[above right](Co){Covertex ; North} +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.C = point: new (3 , 2) +z.A = point: new (5 , 1) +L.CA = line : new (z.C,z.A) +z.b = L.CA.north_pa +L = line : new (z.C,z.b) +z.B = L : point (0.5) +E = ellipse: new (z.C,z.A,z.B) +a = E.Rx +b = E.Ry +z.F1 = E.Fa +z.F2 = E.Fb +slope = math.deg(E.slope) +z.E = E.east +z.N = E.north +z.W = E.west +z.S = E.south +z.Co = E.covertex +z.Ve = E.vertex +set_lua_to_tex {'a','b','slope'} +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\pgfkeys{/pgf/number format/.cd,fixed,precision=2} +\tkzGetNodes +\tkzDrawCircles[teal](C,A) +\tkzDrawEllipse[red](C,\a,\b,\slope) +\tkzDrawPoints(C,A,B,b,W,S,F1,F2) +\tkzLabelPoints(C,A,B) +\tkzDrawLine[add = .5 and .5](A,W) +\tkzLabelSegment[pos=1.5,above,sloped](A,W){slope = \pgfmathprintnumber{\slope}} +\tkzLabelPoint[below](S){South} +\tkzLabelPoint[below left](F1){Focus 1} +\tkzLabelPoint[below left](F2){Focus 2} +\tkzLabelPoint[above right](Ve){Vertex ; East} +\tkzLabelPoint[above right](Co){Covertex ; North} +\end{tikzpicture} +\hspace*{\fill} +% \caption{Class Ellipse} +% subsection attributs_of_an_ellipse (end) + + +\subsection{Methods of the class ellipse} % (fold) +\label{sub:methods_of_the_class_ellipse} +Before reviewing the methods and functions related to ellipses, let's take a look at how you can draw ellipses with \pkg{tkz-elements}. The \tkzcname{tkzDrawEllipse} macro requires 4 arguments: the center of the ellipse, the long radius (on the focus axis), the short radius and the angle formed by the focus axis. +The last three arguments must be transferred from \tkzNameEnv{tkzelements} to \tkzNameEnv{tikzpicture}. +To do this, you'll need to use a \pkg{tkz-elements }function: \Igfct{package}{set\_lua\_to\_tex}. See \ref{sec:math_functions} or the next examples. + +\vskip 1em +\lefthand\ You need to proceed with care, because unfortunately at the moment, the macros you create are global and you can overwrite existing macros. One solution is either to choose a macro name that won't cause any problems, or to save the initial macro. + +\bgroup +\catcode`_=12 +\small +\begin{center} +%\caption{elements\_ellipses.lua} +\begin{tabular}{ll} +\toprule +\textbf{Methods} & \textbf{Example} \\ +\midrule +\Imeth{ellipse}{new (pc, pa ,pb) } & E = ellipse: new ( center, vertex, covertex ) \\ +\midrule +\Imeth{ellipse}{foci (f1,f2,v)} & E = ellipse: foci ( focus 1, focus 2, vertex ) \\ +\Imeth{ellipse}{radii (c,a,b,sl) } & E = ellipse: radii ( center, radius a, radius b, slope ) \\ +\Imeth{ellipse}{in\_out (pt) } & pt in/out of the ellipse \\ +\Imeth{ellipse}{tangent\_at (pt) } & see example \ref{ssub:method_point} \\ +\Imeth{ellipse}{tangent\_from (pt) } & see example \ref{ssub:method_point} \\ +\Imeth{ellipse}{point (phi) } & vertex = point (0) covertex = point (math.pi/4) ex see \ref{ssub:method_point} \\ +\bottomrule +\end{tabular} +\end{center} +\egroup + +\subsubsection{Method \Imeth{ellipse}{new}} % (fold) +\label{ssub:method_imeth_ellipse_new} +The main method for creating a new ellipse is \Imeth{ellipse}{new}. The arguments are three: \Iattr{ellipse}{center}, \Iattr{ellipse}{vertex} and \Iattr{ellipse}{covertex} +For attributes see \ref{sec:classe_ellipse} + +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.C = point: new (3 , 2) + z.A = point: new (5 , 1) + z.B = z.C : homothety(0.5, + z.C : rotation (math.pi/2,z.A)) + E = ellipse: new (z.C,z.A,z.B) + a = E.Rx + b = E.Ry + slope = math.deg(E.Sl) + set_lua_to_tex {'a','b','slope'} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles[teal](C,A) + \tkzDrawEllipse[red](C,\a,\b,\slope) + \tkzDrawPoints(C,A,B) + \tkzLabelPoints(C,A,B) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} +z.C = point: new (3 , 2) +z.A = point: new (5 , 1) +z.B = z.C : homothety(0.5, + z.C : rotation (math.pi/2,z.A)) +E = ellipse: new (z.C,z.A,z.B) +a = E.Rx +b = E.Ry +slope = math.deg(E.slope) +set_lua_to_tex {'a','b','slope'} +\end{tkzelements} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles[teal](C,A) +\tkzDrawEllipse[red](C,\a,\b,\slope) +\tkzDrawPoints(C,A,B) +\tkzLabelPoints(C,A,B) +\end{tikzpicture} +\end{minipage} + +The function \Igfct{package}{set\_lua\_to\_tex (list)} is used to define the macros that will be used to draw the ellipse with \TIKZ\ or \pkg{tkz-euclide}. +% subsubsection method_imeth_ellipse_new (end) + + +\subsubsection{Method \Imeth{ellipse}{foci}} % (fold) +\label{ssub:function_tkzname_ellipse__foci} +The first two points are the foci of the ellipse. The third one is the vertex. We can deduce all the other characteristics. + +\emph{The function launches the |new| method, all the characteristics of the ellipse are defined.} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (5 , 1) + L.AB = line : new (z.A,z.B) + z.C = point: new (.8 , 3) + T.ABC = triangle: new (z.A,z.B,z.C) + z.N = T.ABC.eulercenter + z.H = T.ABC.orthocenter + z.O = T.ABC.circumcenter + _,_,z.Mc = get_points (T.ABC: medial ()) + L.euler = line: new (z.H,z.O) + C.circum = circle: new (z.O,z.A) + C.euler = circle: new (z.N,z.Mc) + z.i,z.j = intersection (L.euler,C.circum) + z.I,z.J = intersection (L.euler,C.euler) + E = ellipse: foci (z.H,z.O,z.I) + L.AH = line: new (z.A,z.H) + z.X = intersection (L.AH,C.circum) + L.XO = line: new (z.X,z.O) + z.R,z.S = intersection (L.XO,E) + a,b = E.Rx,E.Ry + ang = math.deg(E.slope) + set_lua_to_tex{'a','b','ang'} +\end{tkzelements} +\end{tkzexample} +\begin{minipage}{0.6\textwidth} + \begin{tkzexample}[latex=0cm,small,code only] +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \tkzDrawCircles[cyan](O,A N,I) + \tkzDrawSegments(X,R A,X) + \tkzDrawEllipse[red](N,\a,\b,\ang) + \tkzDrawLines[add=.2 and .5](I,H) + \tkzDrawPoints(A,B,C,N,O,X,H,R,S,I) + \tkzLabelPoints[above](C,X) + \tkzLabelPoints[above right](N,O) + \tkzLabelPoints[above left](R) + \tkzLabelPoints[left](A) + \tkzLabelPoints[right](B,I,S,H) + \end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.4\textwidth} +\begin{tkzelements} + scale =1 + z.A = point: new (0 , 0) + z.B = point: new (5 , 1) + L.AB = line : new (z.A,z.B) + z.C = point: new (.8 , 3) + T.ABC = triangle: new (z.A,z.B,z.C) + z.N = T.ABC.eulercenter + z.H = T.ABC.orthocenter + z.O = T.ABC.circumcenter + _,_,z.Mc = get_points (T.ABC: medial ()) + L.euler = line: new (z.H,z.O) + C.circum = circle: new (z.O,z.A) + C.euler = circle: new (z.N,z.Mc) + z.i,z.j = intersection (L.euler,C.circum) + z.I,z.J = intersection (L.euler,C.euler) + E = ellipse: foci (z.H,z.O,z.I) + L.AH = line: new (z.A,z.H) + z.X = intersection (L.AH,C.circum) + L.XO = line: new (z.X,z.O) + z.R,z.S = intersection (L.XO,E) + a,b = E.Rx,E.Ry + ang = math.deg(E.slope) + set_lua_to_tex{'a','b','ang'} +\end{tkzelements} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon(A,B,C) +\tkzDrawCircles[cyan](O,A N,I) +\tkzDrawSegments(X,R A,X) +\tkzDrawEllipse[red](N,\a,\b,\ang) +\tkzDrawLines[add=.2 and .5](I,H) +\tkzDrawPoints(A,B,C,N,O,X,H,R,S,I) +\tkzLabelPoints[above](C,X) +\tkzLabelPoints[above right](N,O) +\tkzLabelPoints[above left](R) +\tkzLabelPoints[left](A) +\tkzLabelPoints[right](B,I,S,H) +\end{tikzpicture} +\end{minipage} +% subsubsection function_tkzname_ellipse__foci (end) + +\subsubsection{Method \Imeth{ellipse}{point} and \Imeth{ellipse}{radii}} % (fold) +\label{ssub:method_point} + The method \Imeth{ellipse}{point} defines a point $M$ of the ellipse whose coordinates are $(a\times cos(phi), b\times sin(phi))$. |phi| angle between (center,vertex) and (center,M) + + \emph{The environment \tkzNameEnv{tkzelements} uses as \tkzname{lua} the radian as unit for angles. } + + +\begin{minipage}{0.6\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.C = point: new (2 , 3) + z.A = point: new (6 , 5) + a = value(4) + b = value(3) + ang = math.deg(-math.pi/4) + E = ellipse: radii (z.C,a,b,-math.pi/4) + z.V = E : point (0) + z.K = E : point (1) + z.CoV = E : point (math.pi/2) + z.X = E : point (math.pi) + L = E :tangent_at (z.V) + z.x,z.y = get_points(L) + L.ta,L.tb = E :tangent_from (z.A) + z.M = L.ta.pb + z.N = L.tb.pb + L.K = E :tangent_at (z.K) + z.ka,z.kb = get_points(L.K) + set_lua_to_tex {'a','b','ang'} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawSegments(C,V C,CoV) + \tkzDrawLines(x,y A,M A,N ka,kb) + \tkzLabelSegment(C,V){$a$} + \tkzLabelSegment[right](C,CoV){$b$} + \tkzDrawEllipse[teal](C,\a,\b,\ang) + \tkzDrawPoints(C,V,CoV,X,x,y,M,N,A,K) + \tkzLabelPoints(C,V,A,M,N,K) + \tkzLabelPoints[above left](CoV) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.4\textwidth} +\begin{tkzelements} +scale = .5 +z.C = point: new (2 , 3) +z.A = point: new (6 , 5) +a = value(4) +b = value(3) +ang = math.deg(-math.pi/4) +E = ellipse: radii (z.C,a,b,-math.pi/4) +z.V = E : point (0) +z.K = E : point (1) +z.CoV = E : point (math.pi/2) +z.X = E : point (math.pi) +L = E :tangent_at (z.V) +z.x,z.y = get_points(L) +L.ta,L.tb = E :tangent_from (z.A) +z.M = L.ta.pb +z.N = L.tb.pb +L.K = E :tangent_at (z.K) +z.ka,z.kb = get_points(L.K) +set_lua_to_tex {'a','b','ang'} +\end{tkzelements} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawSegments(C,V C,CoV) +\tkzDrawLines(x,y A,M A,N ka,kb) +\tkzLabelSegment(C,V){$a$} +\tkzLabelSegment[right](C,CoV){$b$} +\tkzDrawEllipse[teal](C,\a,\b,\ang) +\tkzDrawPoints(C,V,CoV,X,x,y,M,N,A,K) +\tkzLabelPoints(C,V,A,M,N,K) +\tkzLabelPoints[above left](CoV) +\end{tikzpicture} +\end{minipage} +% subsubsection method_point (end) +% subsection methods_of_the_class_ellipse (end) + +% section classe_ellipse (end) +\endinput
\ No newline at end of file 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 new file mode 100644 index 0000000000..de11a45a51 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-line.tex @@ -0,0 +1,420 @@ +\newpage +\section{Class line} % (fold) +\label{sec:class_line} + +\subsection{Attributs of a line} % (fold) +\label{sub:attributs_of_a_line} + +Writing |L.AB = line: new (z.A,z.B) | creates an object of the class \tkzname{line} (the notation is arbitrary for the moment). Geometrically it is as much the line passing through the points $A$ and $B$ as the segment $[AB]$. Thus we can use the midpoint of |L.AB| which is of course the midpoint of the segment $[AB]$. This medium is obtained with |L.AB.mid|. Note that |L.AB.pa = z.A| and |L.AB.pb = z.B|. Finally, if a line $L$ is the result of a method, you can obtain the points with |z.A,z.B = get_points (L)| or with the previous remark. + +The attributes are : + +\bgroup +\catcode`_=12 + +\small +\begin{center} +%\caption{Attributes about line class.} +\begin{tabular}{ll} +\toprule +\textbf{Attributes} & \textbf{Application}\\ +\Iattr{line}{pa} & First point of the segment \\ +\Iattr{line}{pb} & Second point of the segment\\ +\Iattr{line}{type} & Type is 'line'\\ +\Iattr{line}{mid} & Middle of the segment |z.M = L.AB.mid|\\ +\Iattr{line}{slope} & Slope of the line obtained with |an = L.AB.slope|\\ +\Iattr{line}{length} & Length of the segment |l = L.AB.length| \\ +\Iattr{line}{north\_pa} & See next example \\ +\Iattr{line}{north\_pb} & \\ +\Iattr{line}{south\_pa} & \\ +\Iattr{line}{south\_pb} & \\ +\Iattr{line}{east} & \\ +\Iattr{line}{west} & \\ +\bottomrule +\end{tabular} +\end{center} +\egroup + +\subsubsection{Example: attributes of class line} % (fold) +\label{ssub:example_class_line} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .5 + z.a = point: new (1, 1) + z.b = point: new (5, 4) + L.ab = line : new (z.a,z.b) + 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 + len = L.ab.length + set_lua_to_tex{"sl","len"} +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(a,b,m,e,r,s,w) + \tkzLabelPoints(a,b,e,r,s,w) + \tkzLabelPoints[above](m) + \tkzDrawLine(a,b) + \tkzLabelSegment[sloped](a,b){ab = \len} + \tkzLabelSegment[above=12pt,sloped](a,b){slope of (ab) = \sl} +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .5 +z.a = point: new (1, 1) +z.b = point: new (5, 4) +L.ab = line : new (z.a,z.b) +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 +len = L.ab.length +set_lua_to_tex{"sl","len"} +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPoints(a,b,m,e,r,s,w) +\tkzLabelPoints(a,b,e,r,s,w) +\tkzLabelPoints[above](m) +\tkzDrawLine(a,b) +\tkzLabelSegment[sloped](a,b){ab = \len} +\tkzLabelSegment[above=12pt,sloped](a,b){slope of (ab) = \sl} +\end{tikzpicture} +\hspace*{\fill} +% \caption{Class Line} +% subsubsection example_class_line (end) + +\subsubsection{Method \Imeth{line}{new} and line attributes} +\label{ssub:example_line_attributes} + +Notation |L| or |L.AB| or |L.euler|. The notation is actually free. +|L.AB| can also represent the segment. With | L.AB = line : new (z.A,z.B)|, a line is defined. + + +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point : new (1,1) + z.B = point : new (3,2) + L.AB = line : new (z.A,z.B) + z.C = L.AB.north_pa + z.D = L.AB.south_pa +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(A,B C,D) + \tkzDrawPoints(A,...,D) + \tkzLabelPoints(A,...,D) + \tkzMarkRightAngle(B,A,C) + \tkzMarkSegments(A,C A,B A,D) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} + scale = 1 + z.A = point : new (1,1) + z.B = point : new (3,2) + L.AB = line : new (z.A,z.B) + z.C = L.AB.north_pa + z.D = L.AB.south_pa +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(A,B C,D) + \tkzDrawPoints(A,...,D) + \tkzLabelPoints(A,...,D) + \tkzMarkRightAngle(B,A,C) + \tkzMarkSegments(A,C A,B A,D) +\end{tikzpicture} +\end{minipage} +% subsubsection example_line_attributes (end) +% subsection attributs_of_a_line (end) + +\clearpage\newpage +\subsection{Methods of the class line} % (fold) +\label{sub:methods_from_class_line} +Here's the list of methods for the \tkzNameObj{line} object. The results are either reals, points, lines, circles or triangles. +\subsubsection{Table of the methods from class line} % (fold) +\label{ssub:table_of_the_methods_from_class_line} +\bgroup +\catcode`_=12 +\small +\begin{center} +%\caption{Methods from class line} +\begin{tabular}{ll} +\toprule +\textbf{Methods} & \textbf{Comments} \\ +\midrule +\Imeth{line}{new(A, B)} & |L.AB = line : new(z.A,z.B)| line through the points $A$ and $B$\\ +\midrule + \textbf{Points} &\\ +\midrule +\Imeth{line}{gold\_ratio ()} & |z.C = L.AB : gold_ratio()| \tkzar gold ratio \\ +\Imeth{line}{barycenter (ka,kb)} & |z.C = L.AB : barycenter (1,2)| $C$ --> barycenter of |{(A,1)(B,2)}|\\ +\Imeth{line}{point (t)} & |z.C = L.AB : point (2)| \tkzar $\overrightarrow{AC} = 2\overrightarrow{AB}$\\ +\Imeth{line}{midpoint ()} & |z.M = L.AB : midpoint ()| \tkzar better is |z.M = L.AB.mid| \\ +\Imeth{line}{harmonic\_int } & |z.D = L.AB : harmonic_int (z.C)| \tkzar $D\in [AB]$ $C\notin [AB]$\\ +\Imeth{line}{harmonic\_ext (pt)} & |z.D = L.AB : harmonic_ext (z.C)| \tkzar $D\notin [AB]$ $C\in [AB]$\\ +\Imeth{line}{harmonic\_both (k)} & |z.C,z.D = L.AB : harmonic_both (tkzphi)| \tkzar ${ {CA/CB}={DA/DB}=t\varphi.}$\\ +\Imeth{line}{projection ( pt )} & |z.H = L.AB : projection (z.C)| \tkzar $CH \perp (AB)$ and $H\in (AB)$\\ +\Imeth{line}{set\_projection (...)} & projection of a list of points \\ +\Imeth{line}{symmetry\_axial ( pt )} & |z.Cp = L.AB : symmetry_axial (z.C)|\\ +\Imeth{line}{set\_symmetry\_axial (...) }&symmetry_axial of a list of points \\ +\Imeth{line}{square ()} & |z.C,z.D = L.AB : square () | \tkzar creates 2 points to make a square.\\ +\midrule + \textbf{Lines} &\\ +\midrule +\Imeth{line}{ll\_from ( pt )} & |L.CD = L.AB : ll_from (z.C)| \tkzar $(CD) \parallel (AB)$ \\ +\Imeth{line}{ortho\_from ( pt )} & |L.CD = L.AB : ortho_from (z.C)| \tkzar $(CD) \perp (AB)$\\ +\Imeth{line}{mediator ()}&|L.uv = L.AB : mediator ()| \tkzar $(u,v)$ mediator of $(A,B)$\\ +\midrule + \textbf{Triangles} &\\ +\midrule +\Imeth{line}{equilateral ()} & |z.C = L.AB : equilateral_tr ()| $(\overrightarrow{AB},\overrightarrow{AC})>0$ \\ +\Imeth{line}{isosceles (phi)} & |z.C = L.AB : isosceles (math.pi/6)| \\ +\Imeth{line}{gold ()} & |z.C = L.AB : gold ()| \tkzar right in $B$ and $AC = \varphi \times AB $ \\ +\Imeth{line}{euclide ()} & |z.C = L.AB : euclide ()| \tkzar $AB=AC$ and $(\overrightarrow{AB},\overrightarrow{AC}) = math.pi/5$ \\ +\Imeth{line}{golden ()} & |z.C = L.AB : golden ()| $(\overrightarrow{AB},\overrightarrow{AC}) = 2\times math.pi/5$ \\ +\midrule + \textbf{Circles} &\\ +\midrule +\Imeth{line}{circle ()} & |C.AB = L.AB : circle ()| circle center pa through pb \\ +\Imeth{line}{circle\_swap ()} & |C.BA = L.AB : circle\_swap ()| circle center pb through pa \\ +\midrule + \textbf{Miscellaneous} &\\ +\midrule +\Imeth{line}{distance (pt)} & |d = L.Ab : distance (z.C)| d=CH with H projection of $C$ onto (AB)\\ +\Imeth{line}{in\_out (pt)} & |b = L.AB : in_out (z.C)| $b$ is a boolean b=true if $C\in (AB)$ \\ +\Imeth{line}{slope ()} & |a = L.AB : slope()| \tkzar better is L.AB.slope \\ +\bottomrule +\end{tabular} +\end{center} +\egroup +% subsubsection table_of_the_methods_from_class_line (end) + +Here are a few examples. + +\subsubsection{Example: new line from a defined line} % (fold) +\label{ssub:new_line_from_a_defined_line} +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = 1.25 + z.A = point : new (1,1) + z.B = point : new (3,2) + L.AB = line : new (z.A,z.B) + z.C = L.AB.north_pa + z.D = L.AB.south_pa + L.CD = line : new (z.C,z.D) + _,z.E = get_points ( L.CD: ll_from (z.B)) + -- z.E = L2.pb +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(A,B C,D B,E) + \tkzDrawPoints(A,...,E) + \tkzLabelPoints(A,...,E) + \tkzMarkRightAngle(B,A,C) + \tkzMarkSegments(A,C A,B A,D) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} +scale = 1.25 +z.A = point : new (1,1) +z.B = point : new (3,2) +L.AB = line : new (z.A,z.B) +z.C = L.AB.north_pa +z.D = L.AB.south_pa +L.CD = line : new (z.C,z.D) +_,z.E = get_points ( L.CD: ll_from (z.B)) +-- or z.E = L2.pb with |L2 = L.CD: ll_from (z.B)| +\end{tkzelements} +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawLines(A,B C,D B,E) +\tkzDrawPoints(A,...,E) +\tkzLabelPoints(A,...,E) +\tkzMarkRightAngle(B,A,C) +\tkzMarkSegments(A,C A,B A,D) +\end{tikzpicture} +\hspace*{\fill} +\end{minipage} + % \caption{New line from defined line} +% subsubsection new_line_from_a_defined_line (end) + + +\subsubsection{Example: projection of several points} % (fold) +\label{ssub:example_projection_of_several_points} +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .8 + z.a = point: new (0, 0) + z.b = point: new (4, 1) + z.c = point: new (2, 5) + z.d = point: new (5, 2) + L.ab = line: new (z.a,z.b) + z.cp,z.dp = L.ab: set_projection(z.c,z.d) +\end{tkzelements} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(a,b c,c' d,d') + \tkzDrawPoints(a,...,d,c',d') + \tkzLabelPoints(a,...,d,c',d') + \end{tikzpicture} + \end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} +scale = .8 +z.a = point: new (0, 0) +z.b = point: new (4, 1) +z.c = point: new (2, 5) +z.d = point: new (5, 2) +L.ab = line: new (z.a,z.b) +z.cp,z.dp = L.ab : set_projection(z.c,z.d) +\end{tkzelements} +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawLines(a,b c,c' d,d') +\tkzDrawPoints(a,...,d,c',d') +\tkzLabelPoints(a,...,d,c',d') +\end{tikzpicture} +\hspace*{\fill} +\end{minipage} + +% \caption{Projection of several points} +% subsubsection example_projection_of_several_points (end) + +\subsubsection{Example: combination of methods} % (fold) +\label{ssub:example_combination_of_methods} + +\begin{minipage}{0.6\textwidth} +\begin{tkzexample}[small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.C = point: new (1 , 5) + T.ABC = triangle: new (z.A,z.B,z.C) + L.AB = T.ABC.ab + z.O = T.ABC.circumcenter + C.OA = circle: new (z.O,z.A) + z.H = L.AB: projection (z.O) + L.ab = C.OA: tangent_at (z.A) + z.a,z.b = L.ab.pa,L.ab.pb + -- or z.a,z.b = get_points (L.ab) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \tkzDrawCircle(O,A) + \tkzDrawSegments[purple](O,A O,B O,H) + \tkzDrawArc[red](O,A)(B) + \tkzDrawArc[blue](O,B)(A) + \tkzDrawLine[add = 2 and 1](A,a) + \tkzFillAngles[teal!30,opacity=.4](A,C,B b,A,B A,O,H) + \tkzMarkAngles[mark=|](A,C,B b,A,B A,O,H H,O,B) + \tkzDrawPoints(A,B,C,H,O) + \tkzLabelPoints(A,B,C,H,O) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.4\textwidth} +\begin{tkzelements} +scale = .5 +z.A = point: new (0 , 0) +z.B = point: new (6 , 0) +z.C = point: new (1 , 5) +T.ABC = triangle: new (z.A,z.B,z.C) +L.AB = T.ABC.ab +z.O = T.ABC.circumcenter +C.OA = circle: new (z.O,z.A) +z.H = L.AB : projection (z.O) +L.ab = C.OA : tangent_at (z.A) +z.a,z.b = L.ab.pa,L.ab.pb + -- or z.a,z.b = get_points (L.ab) +\end{tkzelements} +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon(A,B,C) +\tkzDrawCircle(O,A) +\tkzDrawSegments[purple](O,A O,B O,H) +\tkzDrawArc[red](O,A)(B) +\tkzDrawArc[blue](O,B)(A) +\tkzDrawLine[add = 2 and 1](A,a) +\tkzFillAngles[teal!30,opacity=.4,,size=.5](A,C,B b,A,B A,O,H) +\tkzMarkAngles[mark=|,size=.5](A,C,B b,A,B A,O,H H,O,B) +\tkzDrawPoints(A,B,C,H,O) +\tkzLabelPoints(A,B,C,H,O) +\end{tikzpicture} +\hspace*{\fill} +\end{minipage} + +% subsubsection example_combination_of_methods (end) + +\subsubsection{Example: distance and projection} % (fold) +\label{ssub:example_distance_and_projection} + +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point : new (0 , 0) + z.B = point : new (5 , -2) + z.C = point : new (3 , 3) + L.AB = line : new (z.A,z.B) + d = L.AB : distance (z.C) + z.H = L.AB : projection (z.C) + set_lua_to_tex{'d'} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(A,B C,H) + \tkzDrawPoints(A,B,C,H) + \tkzLabelPoints(A,B,C,H) + \tkzLabelSegment[above left, + draw](C,H){$CH = \d$} +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} + z.A = point : new (0 , 0) + z.B = point : new (5 , -2) + z.C = point : new (3 , 3) + L.AB = line : new (z.A,z.B) + d = L.AB : distance (z.C) + z.H = L.AB : projection (z.C) + set_lua_to_tex{'d'} +\end{tkzelements} +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawLines(A,B C,H) +\tkzDrawPoints(A,B,C,H) +\tkzLabelPoints(A,B,C,H) +\tkzLabelSegment[above left,draw](C,H){$CH = \d$} +\end{tikzpicture} +\hspace*{\fill} +\end{minipage} + +% \caption{Method distance with line object} +% subsubsection example_distance_and_projection (end) +% subsection methods_from_class_line (end) + +% section class_line (end) +\endinput 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 new file mode 100644 index 0000000000..9bb092ce56 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-misc.tex @@ -0,0 +1,361 @@ +\clearpage\newpage + \section{Math constants and functions} % (fold) + \label{sec:math_functions} + +\bgroup +\catcode`_=12 +\small +\begin{center} +%\caption{functions\_maths.lua } +\begin{tabular}{ll} +\toprule +\textbf{contants or functions} & \textbf{Comments}\\ +\midrule +\Igfct{math}{tkzphi} & constant $\varphi = (1+math.sqrt(5))/2 $\\ +\Igfct{math}{tkzinvphi} & constant $1/\varphi = 1/tkzphi$\\ +\Igfct{math}{tkzsqrtphi} & constant $\sqrt{\varphi}= math.sqrt(tkzphi)$ \\ +%round(num, idp) & \\ +%tkzround( num, idp ) & \\ +% Cramer33(a1,a2,a3,b1,b2,b3,c1,c2,c3) & \\ +% Cramer22(a1,a2,b1,b2) & \\ +\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{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| to the value \\ +\Igfct{math}{angle\_normalize (a) } & to get a value between 0 and $2\pi$ \\ +\bottomrule +\end{tabular} +\end{center} +\egroup + +\subsubsection{Harmonic division with tkzphi } % (fold) +\label{ssub:harmonic_division_with_tkzphi} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale =.5 + z.a = point: new(0,0) + z.b = point: new(8,0) + L.ab = line: new (z.a,z.b) + z.m,z.n = L.ab: harmonic_both (tkzphi) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLine[add= .2 and .2](a,n) + \tkzDrawPoints(a,b,n,m) + \tkzLabelPoints(a,b,n,m) +\end{tikzpicture} +\end{tkzexample} + + +\begin{tkzelements} + scale =.5 + z.a = point: new(0,0) + z.b = point: new(8,0) + L.ab = line: new (z.a,z.b) + z.m,z.n = L.ab: harmonic_both (tkzphi) +\end{tkzelements} +\hspace*{\fill} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLine[add= .2 and .2](a,n) + \tkzDrawPoints(a,b,n,m) + \tkzLabelPoints(a,b,n,m) +\end{tikzpicture} + \hspace*{\fill} +% subsubsection harmonic_division_with_tkzphi (end) + +\subsubsection{Function islinear} % (fold) +\label{ssub:function_islinear} +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.a = point: new (1, 1) + z.b = point: new (2, 2) + z.c = point: new (4, 4) + if islinear (z.a,z.b,z.c) then + z.d = point: new (0, 0) + else + z.d = point: new (-1, -1) + end +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(a,...,d) + \tkzLabelPoints(a,...,d) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} + z.a = point: new (1, 1) + z.b = point: new (2, 2) + z.c = point: new (4, 4) + if islinear (z.a,z.b,z.c) then + z.d = point: new (0, 0) + else + z.d = point: new (-1, -1) + end +\end{tkzelements} + \hspace*{\fill} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(a,...,d) + \tkzLabelPoints(a,...,d) +\end{tikzpicture} +\hspace*{\fill} +\end{minipage} + +% subsubsection function_islinear (end) + + + + +\subsubsection{Function \tkzfname{value} }% (fold) +\label{ssub:function_value} + +value to apply scaling if necessary + +If |scale = 1.2| with a = value(5) the actual value of |a| will be $5\times 1.2 = 6$. + + +% subsubsection function_value (end) + +\subsubsection{Transfer from lua to \TEX} % (fold) +\label{ssub:transfer_from_lua_to_tex} + + \Igfct{package}{set\_lua\_to\_tex (list)} + +see examples \ref{ssub:get_angle}, \ref{ssub:dot_or_scalar_product} +% subsubsection transfer_from_lua_to_tex (end) + +\subsubsection{Normalized angles : Slope of lines (ab), (ac) and (ad)} % (fold) +\label{sub:normalized_angles} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.a = point: new(0, 0) + z.b = point: new(-3, -3) + z.c = point: new(0, 3) + z.d = point: new(2, -2) + angle = point.arg (z.b-z.a) + tex.print('slope of (ab) : '..tostring(angle)..'\\\\') + tex.print('slope normalized of (ab) : '..tostring(angle\_normalize(angle))..'\\\\') + angle = point.arg (z.c-z.a) + tex.print('slope of (ac) : '..tostring(angle)..'\\\\') + 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))..'\\\\') +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines[red](a,b a,c a,d) + \tkzDrawPoints(a,b,c,d) + \tkzLabelPoints(a,b,c,d) +\end{tikzpicture} +\end{tkzexample} +\begin{tkzelements} + scale = .75 +z.a = point: new(0, 0) +z.b = point: new(-3, -3) +z.c = point: new(0, 3) +z.d = point: new(2, -2) +angle = point.arg (z.b-z.a) +tex.print('slope of (ab) : '..tostring(angle)..'\\\\') +tex.print('slope normalized of (ab) : '..tostring(angle_normalize(angle))..'\\\\') +angle = point.arg (z.c-z.a) +tex.print('slope of (ac) : '..tostring(angle)..'\\\\') +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 (ad) : '..tostring(angle_normalize(angle))..'\\\\') +\end{tkzelements} + + \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} + % \caption{Normalized angles} + + +% subsubsection normalized_angles (end) + +\subsubsection{Get angle} % (fold) +\label{ssub:get_angle} + +The function |get_angle (a,b,c)| gives the angle normalized of $(\overrightarrow{ab},\overrightarrow{ac})$. + +\begin{minipage}{0.6\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.a = point: new(0, 0) + z.b = point: new(-2, -2) + z.c = point: new(0, 3) + angcb = tkzround ( get_angle (z.a,z.c,z.b),3) + angbc = tkzround ( get_angle (z.a,z.b,z.c),3) + set_lua_to_tex{"angcb","angbc"} +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines[red](a,b a,c) + \tkzDrawPoints(a,b,c) + \tkzLabelPoints(a,b,c) + \tkzMarkAngle[->](c,a,b) + \tkzLabelAngle(c,a,b){\angcb} + \tkzMarkAngle[->](b,a,c) + \tkzLabelAngle(b,a,c){\angbc} +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.4\textwidth} +\begin{tkzelements} + scale = 1.2 + z.a = point: new(0, 0) + z.b = point: new(-2, -2) + z.c = point: new(0, 3) + angcb = tkzround ( get_angle (z.a,z.c,z.b),3) + angbc = tkzround ( get_angle (z.a,z.b,z.c),3) + set_lua_to_tex{"angcb","angbc"} +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawLines[red](a,b a,c) +\tkzDrawPoints(a,b,c) +\tkzLabelPoints(a,b,c) +\tkzMarkAngle[->](c,a,b) +\tkzLabelAngle(c,a,b){\angcb} +\tkzMarkAngle[->](b,a,c) +\tkzLabelAngle(b,a,c){\angbc} +\end{tikzpicture} +\hspace*{\fill} +\end{minipage} + +% \caption{Get angle} +% subsubsection get_angle (end) + +\subsubsection{Dot or scalar product} % (fold) +\label{ssub:dot_or_scalar_product} + +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new(0,0) + z.B = point: new(5,0) + z.C = point: new(0,3) + T.ABC = triangle: new (z.A,z.B,z.C) + z.A_1, + z.B_1, + z.C_1 = get_points (T.ABC: anti ()) + x = dot_product (z.A,z.B,z.C) + set_lua_to_tex{"x"} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \tkzDrawPoints(A,B,C,A_1,B_1,C_1) + \tkzLabelPoints(A,B,C,A_1,B_1,C_1) + \tkzDrawPolygon[blue](A_1,B_1,C_1) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} + scale = .6 + z.A = point: new(0,0) + z.B = point: new(5,0) + z.C = point: new(0,3) + T.ABC = triangle: new (z.A,z.B,z.C) + z.A_1, + z.B_1, + z.C_1 = get_points (T.ABC: anti ()) + x = dot_product (z.A,z.B,z.C) + set_lua_to_tex{"x"} +\end{tkzelements} +\hspace*{\fill} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \tkzDrawPoints(A,B,C,A_1,B_1,C_1) + \tkzLabelPoints(A,B,C,A_1,B_1,C_1) + \tkzDrawPolygon[blue](A_1,B_1,C_1) + \end{tikzpicture} +\hspace*{\fill} +\end{minipage} + +%\caption{Dot or scalar product} + + +The scalar product of the vectors $\overrightarrow{AC}$ and $\overrightarrow{AB}$ is equal to $\x$, so these vectors are orthogonal. +% subsubsection dot_or_scalar_product (end) + +\subsubsection{Alignment or orthogonality} % (fold) +\label{ssub:alignment_or_orthogonality} + +With the functions |islinear| and |isortho|. |islinear(z.a,z.b,z.c)| gives |true| idf the points $a$, $b$ and $c$ are aligned. + +|isortho(z.a,z.b,z.c)| gives |true| if the line $(ab)$ is orthogonal to the line $(ac)$. +% subsection alignment_or_orthogonality (end) + +\subsubsection{Other functions} % (fold) +\label{ssub:other_functions} + +Not documented because still in beta version: |parabola|, |Cramer22|, |Cramer33|. + +% subsubsection other_functions (end) + +% section math_functions (end) +% % section classes_and_objects (end) +\endinput + + + + +% \bgroup +% \catcode`_=12 +% \begin{table}[H] +% \small +% \begin{center} +% \caption{functions\_polygons.lua } +% \begin{tabular}{lll} +% \toprule +% \textbf{Functions} & \textbf{Comments}\\ +% \midrule +% function square (a,b) \\ +% function parallelogram (a,b,c) \\ +% \bottomrule +% \end{tabular} +% \end{center} +% \end{table} +% \egroup + + +% \bgroup +% \catcode`_=12 +% \begin{table}[H] +% \small +% \begin{center} +% \caption{elements\_vectors.lua } +% \begin{tabular}{lll} +% \toprule +% \textbf{Methods} & \textbf{Comments}\\ +% \midrule +% vector = {} class vector \\ +% \Imeth{vector}{function vector: new (z1,z2)} & st, ed \\ +% \Imeth{vector}{function vector: normalize ()} &\\ +% \bottomrule +% \end{tabular} +% \end{center} +% \end{table} +% \egroup + + + + +\endinput
\ No newline at end of file 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 new file mode 100644 index 0000000000..311debb4a6 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex @@ -0,0 +1,217 @@ +\newpage + +\section{Class point} % (fold) +\label{sec:class_point} + +The first one is the base of the package, it is the class \tkzname{point}. This class is hybrid in the sense that it is as much about points of a plane as complex numbers. The principle is the following: the plane is provided with an orthonormal basis which allows us to determine the placement of a point using its abscissa and ordinate coordinates; in the same way any complex number can simply be considered 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 affix $z.A$. This affix will be with Lua stored in the table $z$ in the form of a couple of real numbers $(x_A,y_A)$. The first element being the real part of the complex, and the second the imaginary part. There will be an identification between the and its corresponding affix. More precisely, for Lua the name of the point is the key that allows the table to designate the pair of reals associated to the affix. + +Writing |z.A = point: new (2,3) | creates an object of class point where |z.A = 2+3i|. + + +The creation of a point is done using the following method, but there are other possibilities. If a scaling factor has been given, the method takes it into account. + +\subsection{Attributs of a point} % (fold) +\label{sub:attributs_of_a_point} +% Method \Imeth{point}{new} +|z.A = point: new (1,2)|. The point $A$ has coordinates $x=1$ and $y=2$. If you use the notation |z.A| then $A$ will be the reference of a node in \TIKZ\ or in \pkg{tkz-euclide}. + +This is the creation of a fixed point with coordinates 1 and 2 and which is named $A$. The notation |z.A| indicates that the coordinates will be stored in a table noted |z| (reference to the notation of the affixes of the complex numbers) that A is the name of the point and the key allowing access to the values. + +\bgroup +\catcode`_=12 + +\small +\begin{center} +%\caption{Attributes about point class.} +\begin{tabular}{ll} +\toprule +\textbf{Attributes} & \textbf{Application}\\ +\Iattr{point}{re} & |z.a.re| \tkzar z.a = point:new (2,3) x = z.a.re -> x=2\\ +\Iattr{point}{im} & |z.a.im| \tkzar z.a = point:new (2,3) y= z.a.im -> y=3\\ +\Iattr{point}{type} & |z.a.type| \tkzar |z.a.type = point|\\ +\Iattr{point}{argument} & |z.a.argument| \tkzar |z.a.argument = 0.78539816339745| if z.a = 1+i\\ +\Iattr{point}{module} & |z.a.module| \tkzar |z.a.module = 1.4142135623731| if z.a = 1+i\\ +\bottomrule +\end{tabular} +\end{center} +\egroup + +\subsubsection{Example:point attributes} % (fold) +\label{ssub:example_point_attributes} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.O = point: new (0 , 0) + z.a = point: new (2, 3) + x = z.a.re + y = z.a.im + ty = z.a.type + arg = z.a.argument + m = z.a.modulus + set_lua_to_tex{"x","y","ty","arg","m"} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzInit[ymax=4,xmax=7] + \tkzGrid + \tkzDrawPoints(a,O) + \tkzLabelPoints[above](O,a) + \tkzLabelPoint[below](a){ + \begin{minipage} {5cm} + x=\x\\ y=\y\\ type =\ty\\ argument = \arg \\ module = \m + \end{minipage}} +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} + z.O = point: new (0 , 0) + z.a = point: new (2, 3) + x = z.a.re + y = z.a.im + ty = z.a.type + arg = z.a.argument + m = z.a.modulus + set_lua_to_tex{"x","y","ty","arg","m"} +\end{tkzelements} + + \hspace*{\fill} + \begin{tikzpicture} + \tkzGetNodes + \tkzInit[ymax=5,xmax=7] + \tkzGrid + \tkzDrawPoints(a,O) + \tkzLabelPoints[above](O,a) + \tkzLabelPoint[below right](a){ + \begin{minipage} {5cm} + x=\x\\ y=\y\\ type =\ty\\ argument = \arg \\ module = \m + \end{minipage}} + \end{tikzpicture} + \hspace*{\fill} + % \caption{Class Point} +% subsubsection example_point_attributes (end) +% subsection attributs_of_a_point (end) + +\subsection{Methods of the class point} % (fold) +\label{sub:methods_of_the_class_point} + +The methods described in the following table are standard. You'll find them in most of the examples at the end of this documentation. The result of the different methods presented in the following table is a \tkzNameObj{point}. A word about methods beginning with |set_|. The purpose is to be able to apply a method to a list of points. + +\bgroup +\catcode`_=12 + +\small +\begin{center} +%\caption{Methods from elements\_points.lua } +\begin{tabular}{ll} +\toprule +\textbf{Methods} & \textbf{Application} \\ +\midrule +\midrule + \textbf{Points} &\\ +\midrule + new (a,b) & |z.a = point : new(1,2)| \tkzar affix z.a=1+2i \\ + polar (radius, phi) & |z.a = point : polar(1,math.pi/3)| \tkzar affix $cos(\pi/3)+sin(\pi/3)i$ \\ + polar_deg (radius, phi) & phi in deg \tkzar polar coordinates phi deg \\ + north(d) & see \ref{sub:power_v2} |d| distance to the point 1 if empty \\ + south(d) & \\ + east(d) & \\ + west(d) & \\ + symmetry(z) & |z.c = z.a:symmetry(z.b)| \tkzar c symmetry of b with respect to a\\ + set\_symmetry (...) & |z.bp,z.cp = z.a : symmetry(z.b,z.c)| \tkzar list of points\\ + rotation(angle , pt) & |z.c = z.a : rotation (math.pi/2,z.b)| \tkzar affix; rotation center a\\ + set\_rotation (angle,...)& \\ + homothety(k,pt) & |z.c = z.a : homothety (2,z.b)| \\ + set\_homothety (k,...) & \\ + normalize() & |z.b = z.a: normalize () | \tkzar |z.b| = 1 and z.a = k$\times$ z.b \\ +\bottomrule % +\end{tabular} +\end{center} + + \egroup + + +\subsubsection{Example: method \Imeth{point}{polar} } % (fold) +\label{ssub:example_polar_method} +\begin{minipage}{0.6\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .5 + z.O = point: new (0, 0) + z.A = point: new (3, 0) + z.F = point: polar (3, math.pi/6) +\end{tkzelements} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircle(O,A) + \tkzDrawSegments[new](O,A) + \tkzDrawSegments[purple](O,F) + \tkzDrawPoints(A,O,F) + \tkzLabelPoints(A,O,F) + \end{tikzpicture} + \end{tkzexample} +\end{minipage} +\begin{minipage}{0.4\textwidth} +\begin{tkzelements} + scale = .5 + z.O = point: new (0, 0) + z.A = point: new (3, 0) + z.F = point: polar (3, math.pi/6) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircle(O,A) +\tkzDrawSegments[new](O,A) +\tkzDrawSegments[purple](O,F) +\tkzDrawPoints(A,O,F) +\tkzLabelPoints(A,O,F) +\end{tikzpicture} +\hspace*{\fill} +\end{minipage} +% \caption{Method polar} + +% subsubsection example_polar_method (end) + +\subsubsection{Example: rotation of points method \Imeth{point}{set\_rotation}} % (fold) +\label{ssub:example_rotation_of_points} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.a = point: new(0, -1) + z.b = point: new(4, 0) + z.o = point: new(6, -2) + z.ap,z.bp = z.o : set_rotation (math.pi/2,z.a,z.b) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(o,a o,a' o,b o,b') + \tkzDrawPoints(a,a',b,b',o) + \tkzLabelPoints(a,a',b,b',o) + \tkzDrawArc(o,a)(a') + \tkzDrawArc(o,b)(b') + \end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} + scale = .5 + z.a = point: new(0, -1) + z.b = point: new(4, 0) + z.o = point: new(6, -2) + z.ap,z.bp = z.o : set_rotation (math.pi/2,z.a,z.b) +\end{tkzelements} + + +\hspace*{\fill} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(o,a o,a' o,b o,b') + \tkzDrawPoints(a,a',b,b',o) + \tkzLabelPoints(a,a',b,b',o) + \tkzDrawArc(o,a)(a') + \tkzDrawArc(o,b)(b') + \end{tikzpicture} +\hspace*{\fill} +%\caption{Rotation of points} +% subsubsection example_rotation_of_points (end) +% subsection methods_of_the_class_point (end) +% section class_point (end) +\endinput
\ 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 new file mode 100644 index 0000000000..2b3056ff92 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-triangle.tex @@ -0,0 +1,220 @@ +\newpage +\section{Classe triangle} % (fold) +\label{sec:classe_triangle} + +\subsection{Attributs of a triangle} % (fold) +\label{sub:attributs_of_a_triangle} +The triangle object is created using the \Imeth{triangle}{new} method, for example with | T.abc = triangle : new (z.a,z.b,z.c)| (See examples: \ref{sub:alternate}; \ref{sub:apollonius_circle}; \ref{sub:excircle} ). Multiple attributes are then created. + +\bgroup +\catcode`_=12 +\small +\begin{center} +%\caption{Attributes about triangle class.} +\begin{tabular}{ll} +\toprule +\textbf{Attributes} & \textbf{Application}\\ +\Iattr{triangle}{pa} &\\ +\Iattr{triangle}{pb} &\\ +\Iattr{triangle}{pc} &\\ +\Iattr{triangle}{circumcenter} & \\ +\Iattr{triangle}{centroid} &\\ +\Iattr{triangle}{incenter} &\\ +\Iattr{triangle}{orthocenter} &\\ +\Iattr{triangle}{eulercenter} & \\ +\Iattr{triangle}{a}& It's the length of the side opposite the first vertex \\ +\Iattr{triangle}{b}& It's the length of the side opposite the second verte\\ +\Iattr{triangle}{c}& It's the length of the side opposite the third vertex \\ +\Iattr{triangle}{alpha}& Vertex angle of the first vertex\\ +\Iattr{triangle}{beta}& Vertex angle of the second vertex\\ +\Iattr{triangle}{gamma}& Vertex angle of the third vertex\\ +\Iattr{triangle}{ab}& Line defined by the first two points of the triangle\\ +\Iattr{triangle}{ac}& Line defined by the first point and the last point\\ +\Iattr{triangle}{bc}& Line defined by the last two points of the triangle\\ +\bottomrule % +\end{tabular} +\end{center} +\egroup + +\subsubsection{Example: triangle attributes} % (fold) +\label{ssub:example_triangle_attributes} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.a = point: new (0 , 0) + z.b = point: new (4 , 0) + z.c = point: new (0 , 3) + T.abc = triangle : new (z.a,z.b,z.c) + z.O = T.abc.circumcenter + z.I = T.abc.incenter + z.H = T.abc.orthocenter + z.G = T.abc.centroid + a = T.abc.a + b = T.abc.b + c = T.abc.c + alpha = T.abc.alpha + beta = T.abc.beta + gamma = T.abc.gamma + set_lua_to_tex{"a","b","c","alpha","beta","gamma"} +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(a,b,c) + \tkzDrawPoints(a,b,c,O,G,I,H) + \tkzLabelPoints(a,b,c,O,G,I) + \tkzLabelPoints[above right](H) + \tkzDrawCircles(O,a) + \tkzLabelSegment[sloped](a,b){\c} + \tkzLabelSegment[sloped,above](b,c){\a} +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} + scale = 1.2 + z.a = point: new (0 , 0) + z.b = point: new (4 , 0) + z.c = point: new (0 , 3) + T.abc = triangle : new (z.a,z.b,z.c) + z.O = T.abc.circumcenter + z.I = T.abc.incenter + z.H = T.abc.orthocenter + z.G = T.abc.centroid + a = T.abc.a + b = T.abc.b + c = T.abc.c + alpha = T.abc.alpha + beta = T.abc.beta + gamma = T.abc.gamma + set_lua_to_tex{"a","b","c","alpha","beta","gamma"} +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon(a,b,c) +\tkzDrawPoints(a,b,c,O,G,I,H) +\tkzLabelPoints(a,b,c,O,G,I) +\tkzLabelPoints[above right](H) +\tkzDrawCircles(O,a) +\tkzLabelSegment[sloped](a,b){\c} +\tkzLabelSegment[sloped,above](b,c){\a} +\end{tikzpicture} +\hspace*{\fill} +% \caption{Class Triangle} +% subsubsection example_triangle_attributes (end) + +% subsection attributs_of_a_triangle (end) + +\subsection{Methods of the class triangle} % (fold) +\label{sub:methods_of_the_class_triangle} + +\bgroup +\catcode`_=12 +\small +\begin{minipage}{\textwidth} +\begin{center} +%\caption{Methods of the class triangle} +\begin{tabular}{ll} +\toprule +\textbf{Methods} & \textbf{Comments} \\ +\midrule +triangle = {} class triangle \\ +\Imeth{triangle}{new} (a, b ,c) & |T.ABC = triangle : new (z.A,z.B,z.C)| \\ + ... & |T| or |T.name| with what you want for name, is possible.\\ +\midrule + \textbf{Points} &\\ +\midrule +\Imeth{triangle}{lemoine\_point ()} & |T.ABC : lemoine_point ()| intersection os the symmedians\\ +\Imeth{triangle}{symmedian\_point ()} & Lemoine point or the Grebe point \\ +\Imeth{triangle}{bevan\_point ()} & Circumcenter of the excentral triangle\\ +\Imeth{triangle}{mittenpunkt\_point ()} & Symmedian point of the excentral triangle\\ +\Imeth{triangle}{gergonne\_point ()} & Intersection of the three cevians that lead to the contact points \\ +\Imeth{triangle}{nagel\_point () } & Intersection of the three cevians that lead to the extouch points\\ +\Imeth{triangle}{feuerbach\_point () } & The point at which the incircle and euler circle are tangent. \\ +\Imeth{triangle}{spieker\_center ()} & Incenter of the medial triangle \\ +\Imeth{triangle}{barycenter (ka,kb,kc)} & |T.ABC: barycenter (2,1,1)| barycenter of |({A,2},{B,1},{C,1}) |\\ +\Imeth{triangle}{base (u,v) } & |z.D = T.ABC: base(1,1)| \tkzar ABDC is a parallelogram \\ +\Imeth{triangle}{projection (p) } & Projection of a point on the sides \\ +\Imeth{triangle}{euler\_points () } & Euler points of euler circle \\ +\Imeth{triangle}{nine\_points () } & Points of the euler circle \\ +\Imeth{triangle}{parallelogram ()} & |z.D = T.ABC : parallelogram ()| \tkzar ABCD is a parallelogram\\ +\midrule + \textbf{Lines} &\\ +\midrule +\Imeth{triangle}{altitude (n) } & |L.AHa = T.ABC : altitude () | n empty or 0 line from $A$ +\footnote{|z.Ha = L.AHa.pb| recovers the common point of the opposite side and altitude. The method |orthic| is usefull.}\\ +\Imeth{triangle}{bisector (n) } & |L.Bb = T.ABC : bisector (1) | n = 1 line from $B$ \footnote{|_,z.b = get_points(L.Bb)| recovers the common point of the opposite side and bisector. }\\ +\Imeth{triangle}{bisector\_ext(n) } & n=2 line from the third vertex.\\ +\Imeth{triangle}{symmedian\_line (n)} & Cevian with respect to Lemoine point. \\ +\Imeth{triangle}{euler\_line () } & the line through $N$ ,$G$, $H$ and $O$ if the triangle is not equilateral +\footnote{N center of nine points circle, G centroid, H orthocenter , O circum center } \\ +\Imeth{triangle}{antiparallel(pt,n)} & n=0 antiparallel through pt to $(BC)$, n=1 to $(AC)$ etc.\\ +\bottomrule +\end{tabular} +\end{center} +\end{minipage} +\egroup + +\clearpage\newpage +\bgroup +\catcode`_=12 +\small +\begin{minipage}{\textwidth} +\begin{center} +%\caption{Methods of the class triangle (follow-up) } +\begin{tabular}{ll} +\toprule +\textbf{Methods} & \textbf{Comments} \\ +\midrule + \textbf{Circles} &\\ +\midrule +\Imeth{triangle}{euler\_circle ()} & C.|NP = T.ABC : euler_circle ()| \tkzar $N$ euler point + \footnote{ The midpoint of each side of the triangle, the foot of each altitude, the midpoint of the line segment from each vertex of the triangle to the orthocenter.} \\ +\Imeth{triangle}{circum\_circle ()} & |C.OA = T.ABC : circum ()| Triangle's circumscribed circle \\ +\Imeth{triangle}{in\_circle ()} & Inscribed circle of the triangle\\ +\Imeth{triangle}{ex\_circle (n)} & Circle tangent to three lines defined by the sides of the triangle \\ +\Imeth{triangle}{first\_lemoine\_circle ()} & The center is the midpoint between Lemoine point and the circumcenter.\footnote{ +Through the Lemoine point draw lines parallel to the triangle's sides. The points where the parallel lines intersect the sides of ABC + then lie on a circle known as the first Lemoine circle. } \\ +\Imeth{triangle}{second\_lemoine\_circle ()} & see example \ref{sub:antiparallel_through_lemoine_point}\\ +\Imeth{triangle}{spieker\_circle ()} & The incircle of the medial triangle\\ +\Imeth{triangle}{ex\_circle(n) } & |z.o,z.p,z.q,z.r = T.ABC: ex_circle ()|\\ +... & n=0 ex_circle opposed to $A$ p,q,r projections of o on the sides \\ +\midrule + \textbf{Triangles} &\\ +\midrule +\Imeth{triangle}{orthic ()} & |T = T.ABC : orthic ()| triangle joining the feet of the altitudes \\ +\Imeth{triangle}{medial ()} & |T = T.ABC : medial ()| triangle with vertices at the midpoints\\ +\Imeth{triangle}{incentral ()} & Cevian triangle of the triangle with respect to its incenter \\ +\Imeth{triangle}{excentral () } & Triangle with vertices corresponding to the excenters \\ +\Imeth{triangle}{extouch ()} & Triangle formed by the points of tangency with the excircles \\ +\Imeth{triangle}{intouch () } & Contact triangle formed by the points of tangency of the incircle \\ +\Imeth{triangle}{tangential ()} & Triangle formed by the lines tangent to the circumcircle at the vertices\\ +\Imeth{triangle}{feuerbach ()} & Triangle formed by the points of tangency of the euler circle with the excircles\\ +\Imeth{triangle}{anti () }& Anticomplementary Triangle The given triangle is its medial triangle. \\ +\Imeth{triangle}{cevian (pt)} & Triangle formed with the endpoints of the three cevians with respect to |pt|.\\ +\Imeth{triangle}{symmedian ()} & Triangle formed with the intersection points of the symmedians. \\ +\Imeth{triangle}{euler ()} & Triangle formed with the euler points \\ +\midrule +\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} +\end{minipage} +\egroup +% subsubsection methods_of_the_class_triangle (end) + + + +% subsection methods_of_the_class_triangle (end) + + + +% section classe_triangle (end) +\endinput diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex new file mode 100644 index 0000000000..53bdb06558 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes.tex @@ -0,0 +1,98 @@ +\newpage +\section{Classes and objects} % (fold) +\label{sec:classes_and_objects} + +\subsection{Objects} % (fold) +\label{sub:objects} +The object types currently defined and used are \tkzNameObj{point}, \tkzNameObj{line}, \tkzNameObj{circle}, \tkzNameObj{triangle} and \tkzNameObj{ellipse}. + +They can be created directly using the method \Imeth{obj}{new} and, with the exception of the \Iclass{class}{point} class, by giving points. Objects can also be obtained by applying methods to other objects. For example, |T.ABC : circum_circle ()| creates an object \tkzNameObj{circle}. Some object attributes are also objects, such as |T.ABC.bc| which creates the object \tkzNameObj{line}, a straight line passing through the last two points defining the triangle. + +Attributes are accessed using the classic method, so |T.pc| gives the third of the triangle and |C.center| gives the center of the circle, but I've added a |get_points| function that returns the points of an object. This applies to straight lines (pa and pc), triangles (pa, pb and pc) and circles (center and through). + +Example: |z.O,z.T = get_points (C)| recovers the center and a point of the circle. +% subsection objects (end) + +\subsection{tkz\_elements\_point.lua: complex numbers library} % (fold) +\label{sub:complex_numbers} + +Unless you want to create your own functions, you won't need to know and use complex numbers. However, in some cases it may be useful to implement some of their properties. + +|za = point (1,2 )| and \ |zb = point (1,-1)| define two affixes which are |za = 1+2i| and + + |zb = 1-i|. The notation may come as a surprise, as I used the term "point". The aim here was not to create a complete library on complex numbers, but to be able to use their main properties in relation to points. I didn't want to have two different levels, and since a unique connection can be established between the points of the plane and the complexes, I decided not to mention the complex numbers! But they are there. + +The above entries must not be confused with the following ones : + +|z.a = point : new (1,2) | and |z.b = point : new (1,-1) |. + +Here we define two "point" objects that are in the form of an affix in the |z| table. +|z.a = za| only if |scale = 1| and |z.a| creates a point named |a|. This point is an object and you can use its attributes, as well as methods referring to points. + +That said, |z.a| is indeed an affix, and it's possible to use the methods and metamethods associated with complex numbers. + +\bgroup +\catcode`_=12 +\small +\begin{minipage}{\textwidth} +\begin{center} +%\caption{Metamethods and methods about point class.} +\begin{tabular}{ll} + \toprule + \textbf{Metamethods} & \textbf{Application} \\ + \midrule +__add(z1,z2) & |z.a + z.b| \tkzar affix \\ +__sub(z1,z2) & |z.a - z.b| \tkzar affix\\ +__unm(z) & |- z.a| \tkzar affix\\ +__mul(z1,z2) & |z.a * z.b| \tkzar affix\\ +__concat(z1,z2)& |z.a .. z.b| \tkzar dot product = real number \footnote{If $O$ is the origin of the complex plan, then we get the dot product of the vectors $\overrightarrow{Oa}$ and $\overrightarrow{Ob}$} \\ +__pow(z1,z2) & |z.a ^ z.b| \tkzar determinant = real number\\ +__div(z1,z2) & |z.a / z.b| \tkzar affix \\ +__tostring(z) & tex.print(tostring(z)) \tkzar displays the affix \\ +__tonumber(z) & tonumber(z) \tkzar affix or nil\\ +__eq(z1,z2) & eq (z.a,z.b) \tkzar boolean\\ +\bottomrule +\end{tabular} +\end{center} +\end{minipage} +\egroup + +\bgroup +\catcode`_=12 +\small +\begin{center} +%\caption{Metamethods and methods about point class.} +\begin{tabular}{ll} + \toprule +\textbf{Methods} & \textbf{Application}\\ +\midrule +\Imeth{point}{conj(z)}& |z.a : conj()| \tkzar affix (conjugate) \\ +\Imeth{point}{mod(z)}& |z.a : mod()| \tkzar real number = modulus |z.a|\\ +\Imeth{point}{abs (z)}& |z.a : abs()| \tkzar real number = modulus \\ +\Imeth{point}{norm (z)} & |z.a : norm()| \tkzar norm (real number ) \\ +\Imeth{point}{arg (z)}& |z.a : arg()| \tkzar real number = argument of z.a (in rad)\\ +\Imeth{point}{get(z)}& |z.a : get()| \tkzar re and im (two real numbers ) \\ +\Imeth{point}{sqrt(z)}& |z.a : sqrt()| \tkzar affix \\ +\bottomrule +\end{tabular} +\end{center} +\egroup + +The class is provided with two specific metamethods. + +\begin{itemize} + \item Since concatenation makes little sense here, the operation associated with |..| is the scalar or dot product. If |z1 = a+ib| and |z2 = c+id| then + + |z1..z2 = (a+ib) .. (c+id) = (a+ib) (c-id) = ac+bd + i(bc-ad) | + + There's also a mathematical function, |dot_product|, which takes three arguments. See example \ref{ssub:dot_or_scalar_product} + + + \item With the same idea, the operation associated with |^| is the determinant i.e. + + |z1 ^ z2 = (a+ib) ^ (c+id) = ad - bc From (a-ib) (c+id) = ac+bd + i(ad - bc)| we take the imaginary part. + +\end{itemize} +% subsection complex_numbers (end) +% section classes_and_objects (end) +\endinput
\ No newline at end of file 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 new file mode 100644 index 0000000000..916e6bd1fb --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-convention.tex @@ -0,0 +1,88 @@ +\newpage + +\section{Writing Convention} % (fold) +\label{sec:writing_convention} + +Writing conventions for real numbers are the same as for \pkg{Lua}. +The package introduces complex numbers (see \ref{sub:complex_numbers}) in order to associate them with points. |z1 = point (1,2)| designates the affix |z1=1+2i|, |z1| is a complex number, but here it's not a object point (related to objects in object-oriented programming). + +|z.A = point : new (1,2)| creates an object point $A$ with coordinates 1 and 2, which are stored as an affix in the table |z|. The key is $A$ and the value |1+2i| (or (1,2) if you prefer.) + +\subsection{Assigning a Name to a Point} % (fold) +\label{sub:assigning_a_name_to_a_point} +The basic object is the point which belongs to the class point. A point can be created in two ways: either directly |z.A = point : new (1,2)|, or as the result of a function or a method. + +Currently the only obligation is to store the points in the table |z| \footnote{To place the point M in the table, simply write |z.M| = \ldots or |z["M"]|= \ldots} if you want to use them in \TIKZ\ or \pkg{tkz-euclide}. If it is a point which will not be used, then you can designate it as you wish by respecting the conventions of Lua. + +More generally, with |z.A = point: new (a,b)|, we define a complex number |z.A = a+bi|, where $a$ and $b$ are the coordinates of point $A$. The name $A$ of a point is the key associated with a complex number noted |z.A| whose affix is |a+ib|, with $a$ and $b$ unique coordinates of $A$. + + +There are two cases. Either you want to keep the point to use it with the package that will allow you to draw, or the point is intermediate and you can abandon it. + +\vspace{12pt} +In the second case, simply don't store the point in the |z| table. For example, |A = point : new (1,2)| defines a point $A$ that will not be transferred. Another way of avoiding a transfer is to assign |nil| to the point: |z.A = nil| before exiting the environment \tkzNameEnv{elements}. + + In the first case, you must store the point in the table |z|. The points which occur in the environment \tkzNameEnv{elements} must respect a convention which is |z.name| such that |name| will be the name of the corresponding \tkzname{node}. \footnote{ However, that a point can be deleted with |z.name = nil|.} + +What are the conventions for designating |name|? You have to respect the Lua conventions in particular cases. +\begin{enumerate} + + \item The use of prime is 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 One possibility, however, in order to have a more explicit code is to suppose that you want to designate a point by "euler". It would be possible for example to 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} + +\lefthand\ The syntax |z.name| is important, it allows to store the data of the point in a table named |z|, which will be used for the transition to the program that will perform the plots and place the labels. + +Point names: You can use the lower case and unaccented upper case. + +The names of the points follow the rules of convention for writing identifiers in lua. +The name starts with a letter "A to Z" or "a to z" or an underscore "|_|" followed by zero or more letters, underscores, and digits (0 to 9). + +You should avoid identifiers starting with an underscore followed by one or more uppercase letters. + +In general, the points used in geometry are lower or upper case letters. The use of underscore is also frequent. So it is possible to write |z.T_a|. + +\lefthand\ Another use in geometry that can be used with \TIKZ{} is the apostrophe. Unfortunately, the apostrophe is necessary to use strings. There are several ways to get around this difficulty. +The simplest one, which keeps the syntax consistent, is that if you want to use |A'| as a point name, you can use |Ap|. When switching to \TIKZ{} |Ap| will be replaced by |A'|. All names of more than one character ending in |p| will have the letter |p| replaced by an apostrophe |'|. +% subsection assigning_a_name_to_a_point (end) + +\subsection{Assigning a Name to Other Objects} % (fold) +\label{sub:assigning_a_name_to_other_objects} + +You have the choice to give a name to objects other than points. That said, it is preferable to respect certain rules in order to make the code easier to read. +I have chosen for my examples the following conventions: first of all I store the objects in tables: |L.name| for lines and segments, |C.name| for circles, |T.name| for triangles, |E.name| for ellipses. + +For lines, I use the names of the two points. So if a line passes through points $A$ and $B$, I name the line |L.AB|. It is possible if only one line is named to simply name it |L| but this should be avoided so as not to create bad practices. + +For circles, I name |C.AB| the circle of center $A$ passing through $B$, but siomething like |C.euler| or |C.external| is fine. + +For triangles, I name |T.ABC| the triangle whose vertices are $A$, $B$ and $C$. + +For ellipses, I name |E.ABC| the ellipse with center $A$ through vertex $B$ and covertex $C$. +% subsection assigning_a_name_to_other_objects(end) + +\subsection{Writing conventions for attributes, methods.} % (fold) +\label{sub:writing_conventions_for_attributs_methods_and_functions} + +You must use the conventions of Lua, so + +\begin{itemize} + \item To obtain an attribute, for all objects, the convention is identical: |object.attribute|. For example, for the point $A$ we access its abscissa with |z.A.re| and its ordinate with |z.A.im|; as for its type we obtain it with |z.A.type|. To get the south pole of the circle |C.OA| you need to write: |C.OA.south|. + + \item To use a method such as obtaining the incircle of a triangle ABC, just write + + |z.i,z.i_a,z.i_b,z.i_c = T.ABC : in_circle ()| (you get the center and its projections on the sides), but to get only the incenter you write |T.ABC.incenter|. + + \item Some methods need a parameter. For example, to know the distance between a point $C$ to the line $(A,B)$ we will write + + |d = L.AB : distance (z.C)|. + + \item Use the underscore to store a result you don't want to use. If you only need the second point of an intersection between a line and a circle, you would write + + |_,z.J = intersection (L.AB , C.OC)|. + +\end{itemize} +% section writing_convention (end) +\endinput
\ No newline at end of file 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 new file mode 100644 index 0000000000..bcf0ccacce --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-examples.tex @@ -0,0 +1,4308 @@ +\newpage + +\section{Examples} % (fold) +\label{sec:examples} + +\subsection{D'Alembert 1} % (fold) +\label{sub:d_alembert_1} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point : new (0,0) + z.a = point : new (4,0) + z.B = point : new (7,-1) + z.b = point : new (5.5,-1) + z.C = point : new (5,-4) + z.c = point : new (4.25,-4) + C.Aa = circle : new (z.A,z.a) + C.Bb = circle : new (z.B,z.b) + C.Cc = circle : new (z.C,z.c) + z.I = C.Aa : external_similitude (C.Bb) + z.J = C.Aa : external_similitude (C.Cc) + z.K = C.Cc : external_similitude (C.Bb) + z.Ip = C.Aa : internal_similitude (C.Bb) + z.Jp = C.Aa : internal_similitude (C.Cc) + z.Kp = C.Cc : internal_similitude (C.Bb) +\end{tkzelements} +\begin{tikzpicture}[rotate=-60] + \tkzGetNodes + \tkzDrawCircles(A,a B,b C,c) + \tkzDrawPoints(A,B,C,I,J,K,I',J',K') + \tkzDrawSegments[new](I,K A,I A,J B,I B,K C,J C,K) + \tkzDrawSegments[purple](I,J' I',J I',K) + \tkzLabelPoints(I,J,K,I',J',K') +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .5 +z.A = point : new (0,0) +z.a = point : new (4,0) +z.B = point : new (7,-1) +z.b = point : new (5.5,-1) +z.C = point : new (5,-4) +z.c = point : new (4.25,-4) +C.Aa = circle : new (z.A,z.a) +C.Bb = circle : new (z.B,z.b) +C.Cc = circle : new (z.C,z.c) +z.I = C.Aa : external_similitude (C.Bb) +z.J = C.Aa : external_similitude (C.Cc) +z.K = C.Cc : external_similitude (C.Bb) +z.Ip = C.Aa : internal_similitude (C.Bb) +z.Jp = C.Aa : internal_similitude (C.Cc) +z.Kp = C.Cc : internal_similitude (C.Bb) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture}[rotate=30] + \tkzGetNodes + \tkzDrawCircles(A,a B,b C,c) + \tkzDrawPoints(A,B,C,I,J,K,I',J',K') + \tkzDrawSegments[new](I,K A,I A,J B,I B,K C,J C,K) + \tkzDrawSegments[purple](I,J' I',J I',K) + \tkzLabelPoints(I,J,K,I',J',K') +\end{tikzpicture} +\hspace*{\fill} +\vspace*{\fill} +%\caption{D'Alembert I} + +% subsection d_alembert_1 (end) + +\subsection{D'Alembert 2} % (fold) +\label{sub:d_alembert_2} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .75 + z.A = point : new (0,0) + z.a = point : new (5,0) + z.B = point : new (7,-1) + z.b = point : new (3,-1) + z.C = point : new (5,-4) + z.c = point : new (2,-4) + C.Aa = circle : new (z.A,z.a) + C.Bb = circle : new (z.B,z.b) + C.Cc = circle : new (z.C,z.c) + z.i,z.j = get_points (C.Aa : radical_axis (C.Bb)) + z.k,z.l = get_points (C.Aa : radical_axis (C.Cc)) + z.m,z.n = get_points (C.Bb : radical_axis (C.Cc)) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(A,a B,b C,c) + \tkzDrawLines[new](i,j k,l m,n) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} + scale = .75 + z.A = point : new (0,0) + z.a = point : new (5,0) + z.B = point : new (7,-1) + z.b = point : new (3,-1) + z.C = point : new (5,-4) + z.c = point : new (2,-4) + C.Aa = circle : new (z.A,z.a) + C.Bb = circle : new (z.B,z.b) + C.Cc = circle : new (z.C,z.c) + z.i,z.j = get_points (C.Aa : radical_axis (C.Bb)) + z.k,z.l = get_points (C.Aa : radical_axis (C.Cc)) + z.m,z.n = get_points (C.Bb : radical_axis (C.Cc)) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(A,a B,b C,c) +\tkzDrawLines[new](i,j k,l m,n) +\end{tikzpicture} +\hspace*{\fill} +%\caption{D'alembert II} + +% subsection d_alembert_2 (end) + +\subsection{Alternate} % (fold) +\label{sub:alternate} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.C = point: new (1 , 5) + T = triangle: new (z.A,z.B,z.C) + z.I = T.incenter + L.AI = line: new (z.A,z.I) + z.D = intersection (L.AI,T.bc) + L.LLC = T.ab: ll_from (z.C) + z.E = intersection (L.AI,L.LLC) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \tkzDrawLine[purple](C,E) + \tkzDrawSegment[purple](A,E) + \tkzFillAngles[purple!30,opacity=.4](B,A,C C,E,D) + \tkzMarkAngles[mark=|](B,A,D D,A,C C,E,D) + \tkzDrawPoints(A,...,E) + \tkzLabelPoints(A,B) + \tkzLabelPoints[above](C,D,E) + \tkzMarkSegments(A,C C,E) +\end{tikzpicture} +\end{tkzexample} + + +\begin{tkzelements} +z.A = point: new (0 , 0) +z.B = point: new (6 , 0) +z.C = point: new (1 , 5) +T = triangle: new (z.A,z.B,z.C) +z.I = T.incenter +L.AI = line: new (z.A,z.I) +z.D = intersection (L.AI,T.bc) +L.LLC = T.ab: ll_from (z.C) +z.E = intersection (L.AI,L.LLC) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon(A,B,C) +\tkzDrawLine[purple](C,E) +\tkzDrawSegment[purple](A,E) +\tkzFillAngles[purple!30,opacity=.4](B,A,C C,E,D) +\tkzMarkAngles[mark=|](B,A,D D,A,C C,E,D) +\tkzDrawPoints(A,...,E) +\tkzLabelPoints(A,B) +\tkzLabelPoints[above](C,D,E) +\tkzMarkSegments(A,C C,E) +\end{tikzpicture} +\hspace*{\fill} + +% subsection alternate (end) + +\subsection{Apollonius circle} % (fold) +\label{sub:apollonius_circle} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} +scale=.75 + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.M = point: new (5 , 3) + T.MAB = triangle : new (z.M,z.A,z.B) + L.bis = T.MAB : bisector () + z.C = L.bis.pb + L.bisext = T.MAB : bisector_ext () + z.D = intersection (T.MAB.bc, L.bisext) + L.CD = line: new (z.C,z.D) + z.O = L.CD.mid + L.AM = T.MAB.ab + z.E = z.M : symmetry (z.A) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawSegment[add=0 and 1](A,M) + \tkzDrawSegments[purple](M,C M,D) + \tkzDrawCircle[purple](O,C) + \tkzDrawSegments(A,B B,M D,B) + \tkzDrawPoints(A,B,M,C,D) + \tkzLabelPoints[below right](A,B,C,D) + \tkzLabelPoints[above](M) + \tkzFillAngles[opacity=.4,cyan!20](A,M,B) + \tkzFillAngles[opacity=.4,purple!20](B,M,E) + \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D) + \tkzMarkAngles[mark=|](A,M,C C,M,B) + \tkzMarkAngles[mark=||](B,M,D D,M,E) +\end{tikzpicture} +\end{tkzexample} + + +\begin{tkzelements} +scale=.75 + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.M = point: new (5 , 3) + T.MAB = triangle : new (z.M,z.A,z.B) + L.bis = T.MAB : bisector () + z.C = L.bis.pb + L.bisext = T.MAB : bisector_ext () + z.D = intersection (T.MAB.bc, L.bisext) + L.CD = line: new (z.C,z.D) + z.O = L.CD.mid + L.AM = T.MAB.ab + z.E = z.M : symmetry (z.A) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawSegment[add=0 and 1](A,M) + \tkzDrawSegments[purple](M,C M,D) + \tkzDrawCircle[purple](O,C) + \tkzDrawSegments(A,B B,M D,B) + \tkzDrawPoints(A,B,M,C,D) + \tkzLabelPoints[below right](A,B,C,D) + \tkzLabelPoints[above](M) + \tkzFillAngles[opacity=.4,cyan!20](A,M,B) + \tkzFillAngles[opacity=.4,purple!20](B,M,E) + \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D) + \tkzMarkAngles[mark=|](A,M,C C,M,B) + \tkzMarkAngles[mark=||](B,M,D D,M,E) +\end{tikzpicture} +\hspace*{\fill} + +%subsection apollonius_circle (end) + +\subsection{Apollonius and circle circumscribed } % (fold) +\label{sub:apollonius_and_circle_circumscribed} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale =.75 + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + L.AB = line: new (z.A,z.B) + z.M = point: new (5 , 4) + T.AMB = triangle: new (z.A,z.M,z.B) + z.I = T.AMB.incenter + L.MI = line: new (z.M,z.I) + z.C = intersection (L.AB , L.MI) + z.J = L.MI: ortho_from (z.M) + L.MJ = line: new (z.M,z.J) + z.D = intersection (L.AB , L.MJ) + L.CD = line: new (z.C,z.D) + z.O = L.CD.mid + z.G = T.AMB.circumcenter + C.GA = circle: new (z.G,z.A) + C.OC = circle: new (z.O,z.C) + _,z.N = intersection (C.GA , C.OC) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,M) + \tkzDrawCircles[purple](O,C G,A) + \tkzDrawSegments[purple](M,D) + \tkzDrawSegments(D,B O,G M,C) + \tkzDrawSegments[red,dashed](M,N M,O M,G) + \tkzDrawPoints(A,B,M,C,D,N,O,G) + \tkzLabelPoints[below right](A,B,C,D,N,O,G) + \tkzLabelPoints[above](M) + \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D) +\end{tikzpicture} +\end{tkzexample} + + +\begin{tkzelements} + scale =.75 + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.M = point: new (5 , 4) + T.AMB = triangle: new (z.A,z.M,z.B) + L.AB = T.AMB.ac + z.I = T.AMB.incenter + L.MI = line: new (z.M,z.I) + z.C = intersection (L.AB , L.MI) + L.MJ = L.MI: ortho_from (z.M) + z.D = intersection (L.AB , L.MJ) + L.CD = line: new (z.C,z.D) + z.O = L.CD.mid + z.G = T.AMB.circumcenter + C.GA = circle: new (z.G,z.A) + C.OC = circle: new (z.O,z.C) + _,z.N = intersection (C.GA , C.OC) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon(A,B,M) +\tkzDrawCircles[purple](O,C G,A) +\tkzDrawSegments[purple](M,D) +\tkzDrawSegments(D,B O,G M,C) +\tkzDrawSegments[red,dashed](M,N M,O M,G) +\tkzDrawPoints(A,B,M,C,D,N,O,G) +\tkzLabelPoints[below right](A,B,C,D,N,O,G) +\tkzLabelPoints[above](M) +\tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D) +\end{tikzpicture} +\hspace*{\fill} + + +%subsection apollonius_and_circle_circumscribed (end) +% +\subsection{Apollonius circles in a triangle} % (fold) +\label{sub:apollonius_circles} + + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.C = point: new (4.5 , 1) + T.ABC = triangle: new (z.A,z.B,z.C) + z.I = T.ABC.incenter + z.O = T.ABC.circumcenter + L.CI = line: new (z.C,z.I) + z.Cp = intersection (T.ABC.ab , L.CI) + z.x = L.CI.north_pa + L.Cx = line: new (z.C,z.x) + z.R = intersection (L.Cx,T.ABC.ab) + L.CpR = line: new (z.Cp,z.R) + z.O1 = L.CpR.mid + L.AI = line: new (z.A,z.I) + z.Ap = intersection (T.ABC.bc , L.AI) + z.y = L.AI.north_pa + L.Ay = line: new (z.A,z.y) + z.S = intersection (L.Ay,T.ABC.bc) + L.ApS = line: new (z.Ap,z.S) + z.O2 = L.ApS.mid + L.BI = line: new (z.B,z.I) + z.Bp = intersection (T.ABC.ac , L.BI) + z.z = L.BI.north_pa + L.Bz = line: new (z.B,z.z) + z.T = intersection (L.Bz,T.ABC.ac) + L.Bpt = line: new (z.Bp,z.T) + z.O3 = L.Bpt.mid +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles[blue!50!black](O1,C' O2,A' O3,B') + \tkzDrawSegments[new](B,S C,T A,R) + \tkzDrawPolygon(A,B,C) + \tkzDrawPoints(A,B,C,A',B',C',O,I,R,S,T,O1,O2,O3) + \tkzLabelPoints(A,B,C,A',B',C',O,I) + \tkzLabelPoints(O1,O2,O3) + \tkzDrawCircle[purple](O,A) + \tkzDrawLine(O1,O2) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.A = point: new (0 , 0) +z.B = point: new (6 , 0) +z.C = point: new (4.5 , 1) +T.ABC = triangle: new (z.A,z.B,z.C) +z.I = T.ABC.incenter +z.O = T.ABC.circumcenter +L.CI = line: new (z.C,z.I) +z.Cp = intersection (T.ABC.ab , L.CI) +z.x = L.CI.north_pa +L.Cx = line: new (z.C,z.x) +z.R = intersection (L.Cx,T.ABC.ab) +L.CpR = line: new (z.Cp,z.R) +z.O1 = L.CpR.mid +L.AI = line: new (z.A,z.I) +z.Ap = intersection (T.ABC.bc , L.AI) +z.y = L.AI.north_pa +L.Ay = line: new (z.A,z.y) +z.S = intersection (L.Ay,T.ABC.bc) +L.ApS = line: new (z.Ap,z.S) +z.O2 = L.ApS.mid +L.BI = line: new (z.B,z.I) +z.Bp = intersection (T.ABC.ac , L.BI) +z.z = L.BI.north_pa +L.Bz = line: new (z.B,z.z) +z.T = intersection (L.Bz,T.ABC.ac) +L.Bpt = line: new (z.Bp,z.T) +z.O3 = L.Bpt.mid +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles[blue!50!black](O1,C' O2,A' O3,B') +\tkzDrawSegments[new](B,S C,T A,R) +\tkzDrawPolygon(A,B,C) +\tkzDrawPoints(A,B,C,A',B',C',O,I,R,S,T,O1,O2,O3) +\tkzLabelPoints(A,B,C,A',B',C',O,I) +\tkzLabelPoints(O1,O2,O3) +\tkzDrawCircle[purple](O,A) +\tkzDrawLine(O1,O2) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Apollonius circles in a triangle} + + +% subsection apollonius_circles (end) + +\subsection{Archimedes} % (fold) +\label{sub:archimedes} + +\begin{tkzexample}[small,code only] +\begin{tkzelements} + z.O_1 = point: new (0, 0) + z.O_2 = point: new (0, 1) + z.A = point: new (0, 3) + z.F = point: polar (3, math.pi/6) + L = line: new (z.F,z.O_1) + C = circle: new (z.O_1,z.A) + z.E = intersection (L,C) + T = triangle: new (z.F,z.E,z.O_2) + z.x = T: parallelogram () + L = line: new (z.x,z.O_2) + C = circle: new (z.O_2,z.A) + z.C,z.D = intersection (L ,C) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(O_1,A O_2,A) + \tkzDrawSegments[new](O_1,A E,F C,D) + \tkzDrawSegments[purple](A,E A,F) + \tkzDrawPoints(A,O_1,O_2,E,F,C,D) + \tkzLabelPoints(A,O_1,O_2,E,F,C,D) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} + z.O_1 = point: new (0, 0) + z.O_2 = point: new (0, 1) + z.A = point: new (0, 3) + z.F = point: polar (3, math.pi/6) + L = line: new (z.F,z.O_1) + C = circle: new (z.O_1,z.A) + z.E = intersection (L,C) + T = triangle: new (z.F,z.E,z.O_2) + z.x = T: parallelogram () + L = line: new (z.x,z.O_2) + C = circle: new (z.O_2,z.A) + z.C,z.D = intersection (L ,C) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(O_1,A O_2,A) +\tkzDrawSegments[new](O_1,A E,F C,D) +\tkzDrawSegments[purple](A,E A,F) +\tkzDrawPoints(A,O_1,O_2,E,F,C,D) +\tkzLabelPoints(A,O_1,O_2,E,F,C,D) +\end{tikzpicture} +\hspace*{\fill} + %\caption{Archimedes} + + +\subsection{Bankoff circle} % (fold) +\label{sub:bankoff_circle} +\begin{tkzexample}[small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (10 , 0) + L.AB = line : new (z.A,z.B) + z.C = L.AB: gold_ratio () + L.AC = line : new (z.A,z.C) + L.CB = line : new (z.C,z.B) + z.O_0 = L.AB.mid + z.O_1 = L.AC.mid + z.O_2 = L.CB.mid + C.O0B = circle : new (z.O_0,z.B) + C.O1C = circle : new (z.O_1,z.C) + C.O2C = circle : new (z.O_2,z.B) + z.Pp = C.O0B : midarc (z.B,z.A) + z.P = C.O1C : midarc (z.C,z.A) + z.Q = C.O2C : midarc (z.B,z.C) + L.O1O2 = line : new (z.O_1,z.O_2) + L.O0O1 = line : new (z.O_0,z.O_1) + L.O0O2 = line : new (z.O_0,z.O_2) + z.M_0 = L.O1O2 : harmonic_ext (z.C) + z.M_1 = L.O0O1 : harmonic_int (z.A) + z.M_2 = L.O0O2 : harmonic_int (z.B) + L.BP = line : new (z.B,z.P) + L.AQ = line : new (z.A,z.Q) + z.S = intersection (L.BP,L.AQ) + L.PpO0 = line : new (z.Pp,z.O_0) + L.PC = line : new (z.P,z.C) + z.Ap = intersection (L.PpO0,L.PC) + L.CS = line : new (z.C,z.S) + C.M1A = circle : new (z.M_1,z.A) + C.M2B = circle : new (z.M_2,z.B) + z.P_0 = intersection (L.CS,C.O0B) + z.P_1 = intersection (C.M2B,C.O1C) + z.P_2 = intersection (C.M1A,C.O2C) + T.P0P1P2 = triangle : new (z.P_0,z.P_1,z.P_2) + z.O_4 = T.P0P1P2.circumcenter + T.CP1P2 = triangle : new (z.C,z.P_1,z.P_2) + z.O_5 = T.CP1P2.circumcenter +\end{tkzelements} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawSemiCircles[teal](O_0,B) +\tkzDrawSemiCircles[teal,fill=teal!20,opacity=.5](O_1,C O_2,B) +\tkzDrawCircle[fill=green!10](O_4,P_0) +\tkzDrawCircle[purple,fill=purple!10,opacity=.5](O_5,C) +\tkzDrawSegments(A,B O_0,P' B,P A,Q) +\tkzDrawSegments(P,B Q,O_2 P,O_1) +\tkzDrawSegments[purple](O_5,P_2 O_5,P_1 O_5,C) +\tkzDrawPoints(A,B,C,P_0,P_2,P_1,O_0,O_1,O_2,O_4,O_5,Q,P,P',S) +\tkzLabelPoints[below](A,B,C,O_0,O_1,O_2,P') +\tkzLabelPoints[above](Q,P) +\tkzLabelPoints[above right](P_0,P_2,P_1,O_5,O_4,S) +\begin{scope}[font=\scriptsize] + \tkzLabelCircle[above](O_1,C)(120){$(\beta)$} + \tkzLabelCircle[above](O_2,B)(70){$(\gamma)$} + \tkzLabelCircle[above](O_0,B)(110){$(\alpha)$} + \tkzLabelCircle[left](O_4,P_2)(60){$(\delta)$} + \tkzLabelCircle[left](O_5,C)(140){$(\epsilon)$} +\end{scope} +\end{tikzpicture} +\end{tkzexample} + + +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (10 , 0) + L.AB = line : new (z.A,z.B) + z.C = L.AB: gold_ratio () + L.AC = line : new (z.A,z.C) + L.CB = line : new (z.C,z.B) + z.O_0 = L.AB.mid + z.O_1 = L.AC.mid + z.O_2 = L.CB.mid + C.O0B = circle : new (z.O_0,z.B) + C.O1C = circle : new (z.O_1,z.C) + C.O2C = circle : new (z.O_2,z.B) + z.Pp = C.O0B : midarc (z.B,z.A) + z.P = C.O1C : midarc (z.C,z.A) + z.Q = C.O2C : midarc (z.B,z.C) + L.O1O2 = line : new (z.O_1,z.O_2) + L.O0O1 = line : new (z.O_0,z.O_1) + L.O0O2 = line : new (z.O_0,z.O_2) + z.M_0 = L.O1O2 : harmonic_ext (z.C) + z.M_1 = L.O0O1 : harmonic_int (z.A) + z.M_2 = L.O0O2 : harmonic_int (z.B) + L.BP = line : new (z.B,z.P) + L.AQ = line : new (z.A,z.Q) + z.S = intersection (L.BP,L.AQ) + L.PpO0 = line : new (z.Pp,z.O_0) + L.PC = line : new (z.P,z.C) + z.Ap = intersection (L.PpO0,L.PC) + L.CS = line : new (z.C,z.S) + C.M1A = circle : new (z.M_1,z.A) + C.M2B = circle : new (z.M_2,z.B) + z.P_0 = intersection (L.CS,C.O0B) + z.P_1 = intersection (C.M2B,C.O1C) + z.P_2 = intersection (C.M1A,C.O2C) + T.P0P1P2 = triangle : new (z.P_0,z.P_1,z.P_2) + z.O_4 = T.P0P1P2.circumcenter + T.CP1P2 = triangle : new (z.C,z.P_1,z.P_2) + z.O_5 = T.CP1P2.circumcenter +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawSemiCircles[teal](O_0,B) +\tkzDrawSemiCircles[teal,fill=teal!20,opacity=.5](O_1,C O_2,B) +\tkzDrawCircle[fill=green!10](O_4,P_0) +\tkzDrawCircle[purple,fill=purple!10,opacity=.5](O_5,C) +\tkzDrawSegments(A,B O_0,P' B,P A,Q) +\tkzDrawSegments(P,B Q,O_2 P,O_1) +\tkzDrawSegments[purple](O_5,P_2 O_5,P_1 O_5,C) +\tkzDrawPoints(A,B,C,P_0,P_2,P_1,O_0,O_1,O_2,O_4,O_5,Q,P,P',S) +\tkzLabelPoints[below](A,B,C,O_0,O_1,O_2,P') +\tkzLabelPoints[above](Q,P) +\tkzLabelPoints[above right](P_0,P_2,P_1,O_5,O_4,S) +\begin{scope}[font=\scriptsize] + \tkzLabelCircle[above](O_1,C)(120){$(\beta)$} + \tkzLabelCircle[above](O_2,B)(70){$(\gamma)$} + \tkzLabelCircle[above](O_0,B)(110){$(\alpha)$} + \tkzLabelCircle[left](O_4,P_2)(60){$(\delta)$} + \tkzLabelCircle[left](O_5,C)(140){$(\epsilon)$} +\end{scope} +\end{tikzpicture} +\hspace*{\fill} +%\caption{Bankoff circle} + + +% subsection bankoff_circle (end) + +\subsection{Excircles} % (fold) +\label{sub:excircles} + + +\begin{tkzexample}[small,code only] +\begin{tkzelements} + scale = 0.7 + z.A = point: new (0,0) + z.B = point: new (6,0) + z.C = point: new (.8,4) + T = triangle: new ( z.A, z.B, z.C) + z.K = T.centroid + z.J_a,z.J_b,z.J_c = get_points (T: excentral()) + z.T_a,z.T_b,z.T_c = get_points (T: extouch()) + la = line: new ( z.A, z.T_a) + lb = line: new ( z.B, z.T_b) + z.G = intersection (la,lb) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints[new](J_a,J_b,J_c) + \tkzClipBB + \tkzDrawCircles[gray](J_a,T_a J_b,T_b J_c,T_c) + \tkzDrawLines[add=1 and 1](A,B B,C C,A) + \tkzDrawSegments[new](A,T_a B,T_b C,T_c) + \tkzDrawSegments[new](J_a,T_a J_b,T_b J_c,T_c) + \tkzDrawPolygon(A,B,C) + \tkzDrawPolygon[new](T_a,T_b,T_c) + \tkzDrawPoints(A,B,C,K) + \tkzDrawPoints[new](T_a,T_b,T_c) + \tkzLabelPoints[below left](A) + \tkzLabelPoints[below](B) + \tkzLabelPoints[above](C) + \tkzLabelPoints[new,below left](T_b) + \tkzLabelPoints[new,below right](T_c) + \tkzLabelPoints[new,right=6pt](T_a) + \tkzMarkRightAngles[fill=gray!15](J_a,T_a,B J_b,T_b,C J_c,T_c,A) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} + scale=0.7 + z.A = point: new (0,0) + z.B = point: new (6,0) + z.C = point: new (.8,4) + T = triangle: new ( z.A, z.B, z.C) + z.K = T.centroid + z.J_a,z.J_b,z.J_c = get_points (T: excentral()) + z.T_a,z.T_b,z.T_c = get_points (T: extouch()) + la = line: new ( z.A, z.T_a) + lb = line: new ( z.B, z.T_b) + z.G = intersection (la,lb) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPoints[new](J_a,J_b,J_c) +\tkzClipBB +\tkzDrawCircles[gray](J_a,T_a J_b,T_b J_c,T_c) +\tkzDrawLines[add=1 and 1](A,B B,C C,A) +\tkzDrawSegments[new](A,T_a B,T_b C,T_c) +\tkzDrawSegments[new](J_a,T_a J_b,T_b J_c,T_c) +\tkzDrawPolygon(A,B,C) +\tkzDrawPolygon[new](T_a,T_b,T_c) +\tkzDrawPoints(A,B,C,K) +\tkzDrawPoints[new](T_a,T_b,T_c) +\tkzLabelPoints[below left](A) +\tkzLabelPoints[below](B) +\tkzLabelPoints[above](C) +\tkzLabelPoints[new,below left](T_b) +\tkzLabelPoints[new,below right](T_c) +\tkzLabelPoints[new,right=6pt](T_a) +\tkzMarkRightAngles[fill=gray!15](J_a,T_a,B J_b,T_b,C J_c,T_c,A) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Ex-circles} + + + +% subsection excircles (end) + +\subsection{Harmonic division and bisector} % (fold) +\label{sub:harmonic_division_and_bisector} + +\begin{tkzexample}[small,code only] +\begin{tkzelements} + scale = .75 + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.M = point: new (5 , 4) + T.AMB = triangle : new (z.A,z.M,z.B) + L.AB = T.AMB.ac + L.bis = T.AMB : bisector (1) + z.C = L.bis.pb + L.bisext = T.AMB : bisector_ext (1) + z.D = intersection (L.bisext,L.AB) + L.CD = line: new (z.C,z.D) + z.O = L.CD.mid + L.AM = line: new (z.A,z.M) + L.LL = L.AM : ll_from (z.B) + L.MC = line: new (z.M,z.C) + L.MD = line: new (z.M,z.D) + z.E = intersection (L.LL,L.MC) + z.F = intersection (L.LL,L.MD) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,M) + \tkzDrawCircle[purple](O,C) + \tkzDrawSegments[purple](M,E M,D E,F) + \tkzDrawSegments(D,B) + \tkzDrawPoints(A,B,M,C,D,E,F) + \tkzLabelPoints[below right](A,B,C,D,E) + \tkzLabelPoints[above](M,F) + \tkzFillAngles[opacity=.4,cyan!20](A,M,B B,E,M) + \tkzFillAngles[opacity=.4,purple!20](B,M,F M,F,B) + \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D) + \tkzMarkAngles[mark=||](A,M,E E,M,B B,E,M) + \tkzMarkAngles[mark=|](B,M,F M,F,B) + \tkzMarkSegments(B,E B,M B,F) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} + scale =.75 + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.M = point: new (5 , 4) + T.AMB = triangle : new (z.A,z.M,z.B) + L.AB = T.AMB.ac + L.bis = T.AMB : bisector (1) + z.C = L.bis.pb + L.bisext = T.AMB : bisector_ext (1) + z.D = intersection (L.bisext,L.AB) + L.CD = line: new (z.C,z.D) + z.O = L.CD.mid + L.AM = line: new (z.A,z.M) + L.LL = L.AM : ll_from (z.B) + L.MC = line: new (z.M,z.C) + L.MD = line: new (z.M,z.D) + z.E = intersection (L.LL,L.MC) + z.F = intersection (L.LL,L.MD) +\end{tkzelements} + + + \hspace*{\fill} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,M) + \tkzDrawCircle[purple](O,C) + \tkzDrawSegments[purple](M,E M,D E,F) + \tkzDrawSegments(D,B) + \tkzDrawPoints(A,B,M,C,D,E,F) + \tkzLabelPoints[below right](A,B,C,D,E) + \tkzLabelPoints[above](M,F) + \tkzFillAngles[opacity=.4,cyan!20](A,M,B B,E,M) + \tkzFillAngles[opacity=.4,purple!20](B,M,F M,F,B) + \tkzMarkRightAngle[opacity=.4,fill=gray!20](C,M,D) + \tkzMarkAngles[mark=||](A,M,E E,M,B B,E,M) + \tkzMarkAngles[mark=|](B,M,F M,F,B) + \tkzMarkSegments(B,E B,M B,F) + \end{tikzpicture} + \hspace*{\fill} + %\caption{Harmonic division and bisector} + + + + +% subsection harmonic_division_and_bisector (end) + +\subsection{Excircle} % (fold) +\label{sub:excircle} + + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.a = point: new (1,2) + z.b = point: new (5,1) + z.c = point: new (2,4) + T.abc = triangle: new (z.a,z.b,z.c) + z.o,z.p = get_points (T.abc: ex_circle ()) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines[add=1 and 1](a,b b,c a,c) + \tkzDrawPoints(a,b,c,o,p) + \tkzDrawCircles(o,p) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} + z.a = point: new (1,2) + z.b = point: new (5,1) + z.c = point: new (2,4) + T.abc = triangle: new (z.a,z.b,z.c) + z.o,z.p = get_points (T.abc: ex_circle ()) +\end{tkzelements} + + \hspace*{\fill} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines[add=1 and 1](a,b b,c a,c) + \tkzDrawPoints(a,b,c,o,p) + \tkzDrawCircles(o,p) + \end{tikzpicture} + \hspace*{\fill} + %\caption{Ex-circles} + + +% +% subsection excircle (end) + +\subsection{In/Out of a circle} % (fold) +\label{sub:in_out_of_a_circle} + + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = 1.25 + z.A = point: new (0,0) + z.B = point: new (1,2) + z.X = point: new (-2,2) + C = circle : new (z.A,z.B) + if C:in_out(z.X) + then + tex.print("In") + else + tex.print("Out") + end +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircle(A,B) + \tkzDrawPoints(A,B,X) + \tkzLabelPoints(A,B,X) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = 2 +z.A = point: new (0,0) +z.B = point: new (1,2) +z.X = point: new (-2,2) +C = circle : new (z.A,z.B) +if C:in_out(z.X) +then + tex.print("In") +else + tex.print("Out") +end + z.M = C: point (math.pi/6) +\end{tkzelements} +\hspace*{\fill}\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircle(A,B) + \tkzDrawPoints(A,B,X,M) + \tkzLabelPoints(A,B,X,M) +\end{tikzpicture}\hspace*{\fill} + +% subsection in_out_of_a_circle (end) +% + +\subsection{Orthogonal circle through} % (fold) +\label{sub:orthogonal_circle_through} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.O = point: new (0,1) + z.A = point: new (1,0) + z.z1 = point: new (-1.5,-1.5) + z.z2 = point: new (2.5,-1.25) + C.OA = circle: new (z.O,z.A) + C = C.OA: orthogonal_through (z.z1,z.z2) + z.c = C.center +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircle(O,A) + \tkzDrawCircle[new](c,z1) + \tkzDrawPoints[new](O,A,z1,z2,c) + \tkzLabelPoints[right](O,A,z1,z2,c) +\end{tikzpicture} +\end{tkzexample}% + +\begin{tkzelements} + z.O = point: new (0,1) + z.A = point: new (1,0) + z.z1 = point: new (-1.5,-1.5) + z.z2 = point: new (2.5,-1.25) + C.OA = circle: new (z.O,z.A) + C = C.OA: orthogonal_through (z.z1,z.z2) + z.c = C.center +\end{tkzelements} + + \hspace*{\fill} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircle(O,A) + \tkzDrawCircle[orange](c,z1) + \tkzDrawPoints[orange](O,A,z1,z2,c) + \tkzLabelPoints[right](O,A,z1,z2,c) + \end{tikzpicture} + \hspace*{\fill} + %\caption{Orthogonal circle through} + + +% subsection orthogonal_circle_through (end) + +\subsection{Devine ratio} % (fold) +\label{sub:devine_ratio} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} +z.A = point: new (0 , 0) +z.B = point: new (8 , 0) +L.AB = line: new (z.A,z.B) +z.C = L.AB: gold_ratio () +L.AC = line: new (z.A,z.C) +z.O_1 = L.AC.mid +z.G,z.H = L.AB: square () +z.E,z.F = L.AC: square () +L.CB = line: new (z.C,z.B) +z.O_2 = L.CB.mid +z.O_0 = L.AB.mid +L.BE = line: new (z.B,z.E) +L.GH = line: new (z.G,z.H) +z.K = intersection (L.BE,L.GH) +C0 = circle: new (z.O_0,z.B) +z.R,_ = intersection (L.BE,C0) +C2 = circle: new (z.O_2,z.B) +z.S,_ = intersection (L.BE,C2) +L.AR = line: new (z.A,z.R) +C1 = circle: new (z.O_1,z.C) +_,z.T = intersection (L.AR,C1) +L.BG = line: new (z.B,z.G) +z.L = intersection (L.AR,L.BG) +\end{tkzelements} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygons(A,C,E,F A,B,G,H) +\tkzDrawCircles(O_1,C O_2,B O_0,B) +\tkzDrawSegments(H,C B,K A,L) +\tkzDrawPoints(A,B,C,K,E,F,G,H,O_0,O_1,O_2,R,S,T,L) +\tkzLabelPoints(A,B,C,K,E,F,G,H,O_0,O_1,O_2,R,S,T,L) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.A = point: new (0 , 0) +z.B = point: new (8 , 0) +L.AB = line: new (z.A,z.B) +z.C = L.AB: gold_ratio () +L.AC = line: new (z.A,z.C) +z.O_1 = L.AC.mid +z.G,z.H = L.AB: square () +z.E,z.F = L.AC: square () +L.CB = line: new (z.C,z.B) +z.O_2 = L.CB.mid +z.O_0 = L.AB.mid +L.BE = line: new (z.B,z.E) +L.GH = line: new (z.G,z.H) +z.K = intersection (L.BE,L.GH) +C0 = circle: new (z.O_0,z.B) +z.R,_ = intersection (L.BE,C0) +C2 = circle: new (z.O_2,z.B) +z.S,_ = intersection (L.BE,C2) +L.AR = line: new (z.A,z.R) +C1 = circle: new (z.O_1,z.C) +_,z.T = intersection (L.AR,C1) +L.BG = line: new (z.B,z.G) +z.L = intersection (L.AR,L.BG) +\end{tkzelements} + + \hspace*{\fill} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygons(A,C,E,F A,B,G,H) + \tkzDrawCircles(O_1,C O_2,B O_0,B) + \tkzDrawSegments(H,C B,K A,L) + \tkzDrawPoints(A,B,C,K,E,F,G,H,O_0,O_1,O_2,R,S,T,L) + \tkzLabelPoints(A,B,C,K,E,F,G,H,O_0,O_1,O_2,R,S,T,L) + \end{tikzpicture} + \hspace*{\fill} + %\caption{Devine or gold ratio} + + + +% subsection devine_ratio (end) + +\subsection{Director circle} % (fold) +\label{sub:director_circle} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} +scale = .5 +z.O = point: new (0 , 0) +z.F1 = point: new (4 , 0) +z.F2 = point: new (-4 , 0) +z.H = point: new (4*math.sqrt(2) , 0) +E = ellipse: foci (z.F2,z.F1,z.H) +a,b = E.Rx, E.Ry +z.A = E.covertex +T = triangle: new (z.H,z.O,z.A) +z.P = T: parallelogram () +C = circle: new (z.O,z.P) +z.L = C: point (2) +L.J,L.K = E: tangent_from (z.L) +z.J = L.J.pb +z.K = L.K.pb +set_lua_to_tex {'a','b'} +\end{tkzelements} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(F1,F2,O) +\tkzDrawCircles[teal](O,P) +\tkzDrawPolygon(H,O,A,P) +\tkzDrawEllipse[red](O,\a,\b,0) +\tkzDrawSegments[orange](O,P O,L L,J L,K) +\tkzDrawPoints(F1,F2,O,H,A,P,L,J,K) +\tkzLabelPoints(F1,F2,O,H,A,P,L,J,K) +\tkzMarkRightAngles(A,P,H J,L,K) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .5 +z.O = point: new (0 , 0) +z.F1 = point: new (4 , 0) +z.F2 = point: new (-4 , 0) +z.H = point: new (4*math.sqrt(2) , 0) +E = ellipse: foci (z.F2,z.F1,z.H) +a,b = E.Rx, E.Ry +z.A = E.covertex +T = triangle: new (z.H,z.O,z.A) +z.P = T: parallelogram () +C = circle: new (z.O,z.P) +z.L = C: point (2) +L.J,L.K = E: tangent_from (z.L) +z.J = L.J.pb +z.K = L.K.pb +set_lua_to_tex {'a','b'} +\end{tkzelements} + + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPoints(F1,F2,O) +\tkzDrawCircles[teal](O,P) +\tkzDrawPolygon(H,O,A,P) +\tkzDrawEllipse[red](O,\a,\b,0) +\tkzDrawSegments[orange](O,P O,L L,J L,K) +\tkzDrawPoints(F1,F2,O,H,A,P,L,J,K) +\tkzLabelPoints(F1,F2,O,H,A,P,L,J,K) +\tkzMarkRightAngles(A,P,H J,L,K) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Director circle} +% subsection director_circle (end) + +\subsection{Distance} % (fold) +\label{sub:distance} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point : new (0 , 0) + z.B = point : new (4 , 3) + z.C = point : new (2 , 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) + set_lua_to_tex{'d','l'} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(A,B C,H) + \tkzDrawPoints(A,B,C,H) + \tkzLabelPoints(A,B,C,H) + \tkzLabelSegment[above left,draw](C,H){$CH = \d$} + \tkzLabelSegment[below left,draw](C,H){$AB = \l$} +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.A = point : new (0 , 0) +z.B = point : new (4 , 3) +z.C = point : new (2 , 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) +set_lua_to_tex{'d','l'} +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawLines(A,B C,H) +\tkzDrawPoints(A,B,C,H) +\tkzLabelPoints(A,B,C,H) +\tkzLabelSegment[above left,draw](C,H){$CH = \d$} +\tkzLabelSegment[below left,draw](C,H){$AB = \l$} +\end{tikzpicture} +\hspace*{\fill} +%\caption{Distance to a line} + + + +% subsection distance (end) + +\subsection{Gold division} % (fold) +\label{sub:gold_division} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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 () + z.k = L.JB: ortho_from (z.K) + L.Kk = line:new (z.K,z.k) + _,z.G = intersection (L.Kk,C.BA) + L.EG = line:new (z.E,z.G) + z.C = intersection (L.EG,L.AB) + z.O = C.AB: antipode (z.B) +\end{tkzelements} +\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{tkzexample} + +\begin{tkzelements} +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) +\end{tkzelements} + + \hspace*{\fill} + \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} + \hspace*{\fill} + %\caption{gold division} + + + + +% subsection gold_division (end) + +\subsection{Ellipse} % (fold) +\label{sub:ellipse} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.C = point: new (3 , 2) + z.A = point: new (5 , 1) + L.CA = line : new (z.C,z.A) + z.b = L.CA.north_pa + L = line : new (z.C,z.b) + z.B = L : point (0.5) + E = ellipse: new (z.C,z.A,z.B) + a = E.Rx + b = E.Ry + slope = math.deg(E.slope) + set_lua_to_tex {'a','b','slope'} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles[teal](C,A) + \tkzDrawEllipse[red](C,\a,\b,\slope) + \tkzDrawPoints(C,A,B,b) + \tkzLabelPoints(C,A,B) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.C = point: new (3 , 2) +z.A = point: new (5 , 1) +L.CA = line : new (z.C,z.A) +z.b = L.CA.north_pa +L = line : new (z.C,z.b) +z.B = L : point (0.5) +E = ellipse: new (z.C,z.A,z.B) +a = E.Rx +b = E.Ry +slope = math.deg(E.slope) +set_lua_to_tex {'a','b','slope'} +\end{tkzelements} + + \hspace*{\fill} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles[teal](C,A) + \tkzDrawEllipse[red](C,\a,\b,\slope) + \tkzDrawPoints(C,A,B,b) + \tkzLabelPoints(C,A,B) + \end{tikzpicture} + \hspace*{\fill} + %\caption{Ellipse} + +% subsection ellipse (end) + +\subsection{Ellipse with radii} % (fold) +\label{sub:ellipse_with_radii} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} +z.C = point: new (0 , 4) +z.B = point: new (4 , 0) +z.D = point: new (2 , 6) +b = math.sqrt(8) +a = math.sqrt(32) +ang = math.deg(math.pi/4) +E = ellipse: radii (z.C,a,b,math.pi/4) +z.V = E : point (0) +z.CoV = E : point (math.pi/2) +set_lua_to_tex {'a','b','ang'} +\end{tkzelements} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawEllipse[blue](C,\a,\b,\ang) +\tkzDrawPoints(C,V,CoV) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.C = point: new (0 , 4) +z.B = point: new (4 , 0) +z.D = point: new (2 , 6) +b = math.sqrt(8) +a = math.sqrt(32) +ang = math.deg(math.pi/4) +E = ellipse: radii (z.C,a,b,math.pi/4) +z.V = E : point (0) +z.CoV = E : point (math.pi/2) +set_lua_to_tex {'a','b','ang'} +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawEllipse[blue](C,\a,\b,\ang) +\tkzDrawPoints(C,V,CoV) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Ellipse with radii} +% subsection ellipse_with_radii (end) + +\subsection{Ellipse\_with\_foci} % (fold) +\label{sub:ellipse_with_foci} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + local e + e = .8 + z.A = point: new (2 , 3) + z.B = point: new (5 , 4) + z.K = point: new (6, 7) + L.AB = line: new (z.A,z.B) + z.C = L.AB.mid + c = point.abs(z.B-z.C) + a = c/e + b = math.sqrt (a^2-c^2) + z.V = z.C + a*(z.B-z.C)/point.abs(z.B-z.C) + E = ellipse: foci (z.A,z.B,z.V) + z.cV = E.covertex + ang = math.deg(E.slope) + L.ta,L.tb = E: tangent_from (z.K) + z.F = L.ta.pb + z.G = L.tb.pb + set_lua_to_tex{'a','b','ang'} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(A,B,C,K,F,G,V,cV) + \tkzLabelPoints(A,B,C,K,F,G,V,cV) + \tkzDrawEllipse[teal](C,\a,\b,\ang) + \tkzDrawLines(K,F K,G) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +local e +e = .8 +z.A = point: new (2 , 3) +z.B = point: new (5 , 4) +z.K = point: new (6, 7) +L.AB = line: new (z.A,z.B) +z.C = L.AB.mid +c = point.abs(z.B-z.C) +a = c/e +b = math.sqrt (a^2-c^2) +z.V = z.C + a*(z.B-z.C)/point.abs(z.B-z.C) +E = ellipse: foci (z.A,z.B,z.V) +z.cV = E.covertex +ang = math.deg(E.slope) +L.ta,L.tb = E: tangent_from (z.K) +z.F = L.ta.pb +z.G = L.tb.pb +set_lua_to_tex{'a','b','ang'} +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(A,B,C,K,F,G,V,cV) + \tkzLabelPoints(A,B,C,K,F,G,V,cV) + \tkzDrawEllipse[teal](C,\a,\b,\ang) + \tkzDrawLines(K,F K,G) +\end{tikzpicture} + \hspace*{\fill} + %\caption{Ellipse with foci} + + + +% subsection ellipse_with_foci (end) + +\subsection{Euler relation} % (fold) +\label{sub:euler_relation} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .75 + 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.J,z.K = get_points(T.ABC: ex_circle (2)) + z.X ,z.Y,z.K = T.ABC : projection (z.J) + z.I,z.H = get_points(T.ABC : in_circle()) + z.O = T.ABC.circumcenter + C.OA = circle : new (z.O,z.A) + T.IBA = triangle: new (z.I,z.B,z.A) + z.w = T.IBA.circumcenter + L.Ow = line : new (z.O,z.w) + _,z.E = intersection (L.Ow, C.OA) +\end{tkzelements} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawArc(J,X)(Y) + \tkzDrawCircles(I,H O,A) + \tkzDrawCircle[red](w,I) + \tkzDrawLines(Y,C A,B X,C E,w E,B) + \tkzDrawSegments[blue](J,C J,K I,H I,O w,B) + \tkzDrawPoints(A,B,C,I,J,E,w,H,K,O) + \tkzLabelPoints(A,B,C,J,I,w,H,K,E,O) + \tkzMarkRightAngles[fill=gray!20,opacity=.4](C,H,I A,K,J) + \end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +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.J,z.K = get_points(T.ABC: ex_circle (2)) +z.X ,z.Y,z.K = T.ABC : projection (z.J) +z.I,z.H = get_points(T.ABC : in_circle()) +z.O = T.ABC.circumcenter +C.OA = circle : new (z.O,z.A) +T.IBA = triangle: new (z.I,z.B,z.A) +z.w = T.IBA.circumcenter +L.Ow = line : new (z.O,z.w) +_,z.E = intersection (L.Ow, C.OA) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawArc(J,X)(Y) +\tkzDrawCircles(I,H O,A) +\tkzDrawCircle[red](w,I) +\tkzDrawLines(Y,C A,B X,C E,w E,B) +\tkzDrawSegments[blue](J,C J,K I,H I,O w,B) +\tkzDrawPoints(A,B,C,I,J,E,w,H,K,O) +\tkzLabelPoints(A,B,C,J,I,w,H,K,E,O) +\tkzMarkRightAngles[fill=gray!20,opacity=.4](C,H,I A,K,J) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Euler relation} +% subsection euler_relation (end) + +\subsection{Euler line} % (fold) +\label{sub:euler_line} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.C = point: new (1.5 , 3.5) + T.ABC = triangle: new (z.A,z.B,z.C) + z.O = T.ABC.circumcenter + z.G = T.ABC.centroid + z.N = T.ABC. eulercenter + z.H = T.ABC. orthocenter + z.P,z.Q,z.R = get_points (T.ABC: orthic()) + z.K,z.I,z.J = get_points (T.ABC: medial ()) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines[blue](O,H) + \tkzDrawCircle[red](N,I) + \tkzDrawCircles[teal](O,A) + \tkzDrawSegments(A,P B,Q C,R) + \tkzDrawSegments[red](A,I B,J C,K) + \tkzDrawPolygons(A,B,C) + \tkzDrawPoints(A,B,C,N,I,J,K,O,P,Q,R,H,G) + \tkzLabelPoints(A,B,C,I,J,K,P,Q,R,H) + \tkzLabelPoints[below](N,O,G) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} + scale =1 + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.C = point: new (1.5 , 3.5) + T.ABC = triangle: new (z.A,z.B,z.C) + z.O = T.ABC.circumcenter + z.G = T.ABC.centroid + z.N = T.ABC. eulercenter + z.H = T.ABC. orthocenter + z.P,z.Q,z.R = get_points (T.ABC: orthic()) + z.K,z.I,z.J = get_points (T.ABC: medial ()) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawLines[blue](O,H) +\tkzDrawCircle[red](N,I) +\tkzDrawCircles[teal](O,A) +\tkzDrawSegments(A,P B,Q C,R) +\tkzDrawSegments[red](A,I B,J C,K) +\tkzDrawPolygons(A,B,C) +\tkzDrawPoints(A,B,C,N,I,J,K,O,P,Q,R,H,G) +\tkzLabelPoints(A,B,C,I,J,K,P,Q,R) +\tkzLabelPoints[below](N,O,G,H) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Euler line} +% subsection euler_line (end) + +\subsection{External angle} % (fold) +\label{sub:external_angle} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale =.8 + z.A = point: new (0 , 0) + z.B = point: new (5 , 0) + z.C = point: new (-2 , 4) + T.ABC = triangle: new (z.A,z.B,z.C) + T.ext = T.ABC: excentral () + z.O = T.ABC.circumcenter + z.D = intersection (T.ext.ab,T.ABC.ab) + z.E = z.C: symmetry (z.B) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \tkzDrawLine[purple,add=0 and .5](B,C) + \tkzDrawSegment[purple](A,D) + \tkzDrawSegment[orange](C,D) + \tkzFillAngles[purple!30,opacity=.2](D,C,A E,C,D) + \tkzMarkAngles[mark=|](D,C,A E,C,D) + \tkzDrawPoints(A,...,D) + \tkzLabelPoints[above](C) + \tkzLabelPoints(A,B,D) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .8 +z.A = point: new (0 , 0) +z.B = point: new (5 , 0) +z.C = point: new (-2 , 4) +T.ABC = triangle: new (z.A,z.B,z.C) +T.ext = T.ABC: excentral () +z.O = T.ABC.circumcenter +z.D = intersection (T.ext.ab,T.ABC.ab) +z.E = z.C: symmetry (z.B) +\end{tkzelements} + + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon(A,B,C) +\tkzDrawLine[purple,add=0 and .5](B,C) +\tkzDrawSegment[purple](A,D) +\tkzDrawSegment[orange](C,D) +\tkzFillAngles[purple!30,opacity=.2](D,C,A E,C,D) +\tkzMarkAngles[mark=|](D,C,A E,C,D) +\tkzDrawPoints(A,...,D) +\tkzLabelPoints[above](C) +\tkzLabelPoints(A,B,D) +\end{tikzpicture} +\hspace*{\fill} +%\caption{External angle} +% subsection external_angle (end) + +\subsection{Internal angle} % (fold) +\label{sub:internal_angle} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .8 + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.C = point: new (1 , 5) + T = triangle: new (z.A,z.B,z.C) + z.I = T.incenter + L.AI = line: new (z.A,z.I) + z.D = intersection (L.AI, T.bc) + L.LL = T.ab: ll_from (z.C) + L.AD = line: new (z.A,z.D) + z.E = intersection (L.LL,L.AD) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \tkzDrawLine[purple](C,E) + \tkzDrawSegment[purple](A,E) + \tkzFillAngles[purple!30,opacity=.4](B,A,C C,E,D) + \tkzMarkAngles[mark=|](B,A,D D,A,C C,E,D) + \tkzDrawPoints(A,...,E) + \tkzLabelPoints(A,B) + \tkzLabelPoints[above](C,D,E) + \tkzMarkSegments(A,C C,E) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale =.8 +z.A = point: new (0 , 0) +z.B = point: new (6 , 0) +z.C = point: new (1 , 5) +T = triangle: new (z.A,z.B,z.C) +z.I = T.incenter +L.AI = line: new (z.A,z.I) +z.D = intersection (L.AI, T.bc) +L.LL = T.ab: ll_from (z.C) +L.AD = line: new (z.A,z.D) +z.E = intersection (L.LL,L.AD) +\end{tkzelements} + + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon(A,B,C) +\tkzDrawLine[purple](C,E) +\tkzDrawSegment[purple](A,E) +\tkzFillAngles[purple!30,opacity=.4](B,A,C C,E,D) +\tkzMarkAngles[mark=|](B,A,D D,A,C C,E,D) +\tkzDrawPoints(A,...,E) +\tkzLabelPoints(A,B) +\tkzLabelPoints[above](C,D,E) +\tkzMarkSegments(A,C C,E) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Internal angle} +%subsection internal_angle (end) + +\subsection{Feuerbach theorem} % (fold) +\label{sub:nine_points} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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 +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLine(L,F) + \tkzDrawCircle[red](N,A') + \tkzDrawCircle[blue](I,H) + \tkzDrawCircles[teal](O,A L,C') + \tkzDrawSegments(M,L B,U Q,C C,X A,P B,Q) + \tkzDrawPolygons(A,B,C A',B',C') + \tkzDrawPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I) + \tkzLabelPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = 1 +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 +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture}[rotate=90] +\tkzGetNodes +\tkzDrawLine(L,F) +\tkzDrawCircle[red](N,A') +\tkzDrawCircle[blue](I,H) +\tkzDrawCircles[teal](O,A L,C') +\tkzDrawSegments(M,L B,U Q,C C,X A,P B,Q) +\tkzDrawPolygons(A,B,C A',B',C') +\tkzDrawPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I) +\tkzLabelPoints(A,B,C,N,H,A',B',C',U,L,M,P,Q,F,I) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Feuerbach theorem} + + + + +% subsection nine_points (end) + +\subsection{Gold ratio with segment} % (fold) +\label{sub:gold_ratio_with_segment} + + \begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (8 , 0) + L.AB = line: new (z.A,z.B) + z.X,z.Y = L.AB: square () + L.BX = line: new (z.B,z.X) + z.M = L.BX.mid + C.MA = circle: new (z.M,z.A) + _,z.K = intersection (L.BX,C.MA) + L.AK = line: new (z.Y,z.K) + z.C = intersection (L.AK,L.AB) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(A,B X,K) + \tkzDrawLine[teal](Y,K) + \tkzDrawPoints(A,B,C,X,Y,M,K) + \tkzDrawArc[delta=20](M,A)(K) + \tkzLabelPoints(A,B,C) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .5 +z.A = point: new (0 , 0) +z.B = point: new (8 , 0) +L.AB = line: new (z.A,z.B) +z.X,z.Y = L.AB: square () +L.BX = line: new (z.B,z.X) +z.M = L.BX.mid +C.MA = circle: new (z.M,z.A) +_,z.K = intersection (L.BX,C.MA) +L.AK = line: new (z.Y,z.K) +z.C = intersection (L.AK,L.AB) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawLines(A,B X,K) +\tkzDrawLine[teal](Y,K) +\tkzDrawPoints(A,B,C,X,Y,M,K) +\tkzDrawArc[delta=20](M,A)(K) +\tkzLabelPoints(A,B,C) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Gold ration with a segment} +%subsection gold_ratio_with_segment (end) + +\subsection{Gold Arbelos} % (fold) +\label{sub:gold_arbelos} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .6 + z.A = point: new (0 , 0) + z.C = point: new (6 , 0) + L.AC = line: new (z.A,z.C) + z.x,z.y = L.AC: square () + z.O_1 = L.AC . mid + C = circle: new (z.O_1,z.x) + z.B = intersection (L.AC,C) + L.CB = line: new (z.C,z.B) + z.O_2 = L.CB.mid + L.AB = line: new (z.A,z.B) + z.O_0 = L.AB.mid +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(O_1,C O_2,B O_0,B) + \tkzDrawPoints(A,C,B,O_1,O_2,O_0) + \tkzLabelPoints(A,C,B) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .4 +z.A = point: new (0 , 0) +z.C = point: new (6 , 0) +L.AC = line: new (z.A,z.C) +z.x,z.y = L.AC: square () +z.O_1 = L.AC . mid +C = circle: new (z.O_1,z.x) +z.B = intersection (L.AC,C) +L.CB = line: new (z.C,z.B) +z.O_2 = L.CB.mid +L.AB = line: new (z.A,z.B) +z.O_0 = L.AB.mid +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(O_1,C O_2,B O_0,B O_1,x) +\tkzDrawPoints(A,C,B,O_1,O_2,O_0,x) +\tkzLabelPoints(A,C,B) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Gold Arbelos} +% subsection gold_arbelos (end) + +\subsection{Harmonic division v1} % (fold) +\label{sub:harmonic_division_v1} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale=.75 + z.A = point: new (0 , 0) + z.B = point: new (4 , 0) + z.D = point: new (12,0) + L.AB = line : new (z.A,z.B) + z.X = L.AB.north_pa + L.XB = line : new (z.X,z.B) + z.E = L.XB.mid + L.DE = line : new (z.D,z.E) + L.XA = line : new (z.X,z.A) + z.F = intersection (L.DE,L.XA) + L.AE = line : new (z.A,z.E) + L.BF = line : new (z.B,z.F) + z.G = intersection (L.AE,L.BF) + L.XG = line : new (z.X,z.G) +z.C = intersection (L.XG,L.AB) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDefPoints{0/0/A,4/0/B} + \tkzDefPoints{2/2/G} + \tkzDefLine[parallel=through B,K=.5](A,G) \tkzGetPoint{E} + \tkzInterLL(G,E)(A,B) \tkzGetPoint{D} + \tkzDefPointBy[symmetry= center B](E) \tkzGetPoint{F} + \tkzInterLL(G,F)(A,B) \tkzGetPoint{C} + \tkzDrawLines(A,D A,G F,E G,F G,D) + \tkzDrawPoints(A,B,G,E,F,C,D) + \tkzLabelPoints(A,B,G,E,F,C,D) + \tkzMarkSegments(F,B B,E) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale=.75 +z.A = point: new (0 , 0) +z.B = point: new (4 , 0) +z.D = point: new (12,0) +L.AB = line : new (z.A,z.B) +z.X = L.AB.north_pa +L.XB = line : new (z.X,z.B) +z.E = L.XB.mid +L.DE = line : new (z.D,z.E) +L.XA = line : new (z.X,z.A) +z.F = intersection (L.DE,L.XA) +L.AE = line : new (z.A,z.E) +L.BF = line : new (z.B,z.F) +z.G = intersection (L.AE,L.BF) +L.XG = line : new (z.X,z.G) +z.C = intersection (L.XG,L.AB) +\end{tkzelements} +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDefPoints{0/0/A,4/0/B} +\tkzDefPoints{2/2/G} +\tkzDefLine[parallel=through B,K=.5](A,G) \tkzGetPoint{E} +\tkzInterLL(G,E)(A,B) \tkzGetPoint{D} +\tkzDefPointBy[symmetry= center B](E) \tkzGetPoint{F} +\tkzInterLL(G,F)(A,B) \tkzGetPoint{C} +\tkzDrawLines(A,D A,G F,E G,F G,D) +\tkzDrawPoints(A,B,G,E,F,C,D) +\tkzLabelPoints(A,B,G,E,F,C,D) +\tkzMarkSegments(F,B B,E) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Harmonic division V1} +% subsection harmonic_division_v1 (end) + +\subsection{Harmonic division v2} % (fold) +\label{sub:harmonic_division_v2} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .5 + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.D = point: new (12 , 0) + L.AB = line: new (z.A,z.B) + z.X = L.AB.north_pa + L.XB = line: new (z.X,z.B) + z.E = L.XB.mid + L.ED = line: new (z.E,z.D) + L.AX = line: new (z.A,z.X) + L.AE = line: new (z.A,z.E) + z.F = intersection (L.ED,L.AX) + L.BF = line: new (z.B,z.F) + z.G = intersection (L.AE,L.BF) + L.GX = line: new (z.G,z.X) + z.C = intersection (L.GX,L.AB) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines(A,D A,E B,F D,F X,A X,B X,C) + \tkzDrawPoints(A,...,G,X) + \tkzLabelPoints(A,...,G,X) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .5 +z.A = point: new (0 , 0) +z.B = point: new (6 , 0) +z.D = point: new (12 , 0) +L.AB = line: new (z.A,z.B) +z.X = L.AB.north_pa +L.XB = line: new (z.X,z.B) +z.E = L.XB.mid +L.ED = line: new (z.E,z.D) +L.AX = line: new (z.A,z.X) +L.AE = line: new (z.A,z.E) +z.F = intersection (L.ED,L.AX) +L.BF = line: new (z.B,z.F) +z.G = intersection (L.AE,L.BF) +L.GX = line: new (z.G,z.X) +z.C = intersection (L.GX,L.AB) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawLines(A,D A,E B,F D,F X,A X,B X,C) +\tkzDrawPoints(A,...,G,X) +\tkzLabelPoints(A,...,G,X) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Harmonic division V2} +% subsection harmonic_division_v2 (end) + +\subsection{Menelaus} % (fold) +\label{sub:menelaus} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (6 , 0) + z.C = point: new (5 , 4) + z.P = point: new (-1 , 0) + z.X = point: new (6 , 3) + L.AC = line: new (z.A,z.C) + L.PX = line: new (z.P,z.X) + L.BC = line: new (z.B,z.C) + z.Q = intersection (L.AC,L.PX) + z.R = intersection (L.BC,L.PX) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \tkzDrawLine[new](P,R) + \tkzDrawLines(P,B A,C B,C) + \tkzDrawPoints(P,Q,R,A,B,C) + \tkzLabelPoints(A,B,C,P,Q,R) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.A = point: new (0 , 0) +z.B = point: new (6 , 0) +z.C = point: new (5 , 4) +z.P = point: new (-1 , 0) +z.X = point: new (6 , 3) +L.AC = line: new (z.A,z.C) +L.PX = line: new (z.P,z.X) +L.BC = line: new (z.B,z.C) +z.Q = intersection (L.AC,L.PX) +z.R = intersection (L.BC,L.PX) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon(A,B,C) +\tkzDrawLine[new](P,R) +\tkzDrawLines(P,B A,C B,C) +\tkzDrawPoints(P,Q,R,A,B,C) +\tkzLabelPoints(A,B,C,P,Q,R) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Menelaus} +% subsection menelaus (end) + +\subsection{Radical axis v1} % (fold) +\label{sub:radical_axis_v1} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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 (-math.pi) + 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) +\end{tkzelements} +\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{tkzexample} + +\begin{tkzelements} +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 (-math.pi) +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) +\end{tkzelements} + +\hspace*{\fill} +\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} +\hspace*{\fill} +%\caption{Radical axis v1} +% subsection radical_axis_v1 (end) + +\subsection{Radical axis v2} % (fold) +\label{sub:radical_axis_v2} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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 (2) + 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) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(O,B O',D) + \tkzDrawLine[add=1 and 2](E,F) + \tkzDrawLine[add=.5 and .5](O,O') + \tkzDrawSegments(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{tkzexample} + +\begin{tkzelements} +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 (2) +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) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(O,B O',D) +\tkzDrawLine[add=1 and 2](E,F) +\tkzDrawLine[add=.5 and .5](O,O') +\tkzDrawSegments(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}\hspace*{\fill} +%\caption{Radical axis v2} +% subsection radical_axis_v2 (end) + +\subsection{Radical axis v3} % (fold) +\label{sub:radical_axis_v3} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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 (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{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(O,B O',B) + \tkzDrawSegments(M,T M,T') + \tkzDrawLine[add=.5 and 1](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{tkzexample} + +\begin{tkzelements} +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 (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{tkzelements} + + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(O,B O',B) +\tkzDrawSegments(M,T M,T') +\tkzDrawLine[add=.5 and 1](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} +\hspace*{\fill} +%\caption{Radical axis v3} +% subsection radical_axis_v3 (end) + +\subsection{Radical axis v4} % (fold) +\label{sub:radical_axis_v4} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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.M = L.EF : point (1.5) + 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{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(O,B O',B) + \tkzDrawSegments(M,T M,T') + \tkzDrawLine[add=1 and 1](E,F) + \tkzDrawLine[add=.3 and .3](O,O') + \tkzDrawPoints(O,O',B,E,F,T,T',M) + \tkzLabelPoints[below right](O,O',B,E,F,T,T') + \tkzDrawArc(M,T)(B) +\end{tikzpicture} +\end{tkzexample} + + +\begin{tkzelements} + 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.M = L.EF : point (1.5) + 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{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(O,B O',B) +\tkzDrawSegments(M,T M,T') +\tkzDrawLine[add=1 and 1](E,F) +\tkzDrawLine[add=.3 and .3](O,O') +\tkzDrawPoints(O,O',B,E,F,T,T',M) +\tkzLabelPoints[below right](O,O',B,E,F,T,T') +\tkzDrawArc(M,T)(B) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Radical axis v4} +% subsection radical_axis_v4 (end) + +\subsection{Radical center} % (fold) +\label{sub:radical_center} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.O = point : new (0,0) + z.x = point : new (1,0) + z.y = point : new (4,0) + z.z = point : new (2,0) + z.Op = point : new (4,2) + z.P = point : new (2,2.5) + C.Ox = circle : new (z.O,z.x) + C.Pz = circle : new (z.P,z.z) + C.Opy = circle : new (z.Op,z.y) + z.ap,z.a = intersection (C.Ox,C.Pz) + z.bp,z.b = intersection (C.Opy,C.Pz) + L.aap = line : new (z.a,z.ap) + L.bbp = line : new (z.b,z.bp) + z.X = intersection (L.aap,L.bbp) + L.OOp = line : new (z.O,z.Op) + z.H = L.OOp : projection (z.X) +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(O,a O',b P,z) + \tkzDrawLines[red](a,X b',X H,X O,O') + \tkzDrawPoints(O,O',P,a,a',b,b',X,H) + \tkzLabelPoints[below right](O,O',P,H) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.O = point : new (0,0) +z.x = point : new (1,0) +z.y = point : new (4,0) +z.z = point : new (2,0) +z.Op = point : new (4,2) +z.P = point : new (2,2.5) +C.Ox = circle : new (z.O,z.x) +C.Pz = circle : new (z.P,z.z) +C.Opy = circle : new (z.Op,z.y) +z.ap,z.a = intersection (C.Ox,C.Pz) +z.bp,z.b = intersection (C.Opy,C.Pz) +L.aap = line : new (z.a,z.ap) +L.bbp = line : new (z.b,z.bp) +z.X = intersection (L.aap,L.bbp) +L.OOp = line : new (z.O,z.Op) +z.H = L.OOp : projection (z.X) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(O,a O',b P,z) +\tkzDrawLines[red](a,X b',X H,X O,O') +\tkzDrawPoints(O,O',P,a,a',b,b',X,H) +\tkzLabelPoints[below right](O,O',P,H) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Radical center} +% subsection radical_center (end) + +\subsection{Hexagram} % (fold) +\label{sub:hexagram} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (5 , 1) + L.AB = line : new (z.A,z.B) + z.C = point: new (.8 , 3) + T.ABC = triangle: new (z.A,z.B,z.C) + z.N = T.ABC.eulercenter + z.G = T.ABC.centroid + z.O = T.ABC.circumcenter + z.H = T.ABC.orthocenter + z.Ma,z.Mb,z.Mc = get_points (T.ABC : medial ()) + z.Ha,z.Hb,z.Hc = get_points (T.ABC : orthic ()) + z.Ea,z.Eb,z.Ec = get_points (T.ABC: extouch()) + L.euler = T.ABC : euler_line () + C.circum = T.ABC : circum_circle () + C.euler = T.ABC : euler_circle () + z.I,z.J = intersection (L.euler,C.euler) + E = ellipse: foci (z.H,z.O,z.I) + a = E.Rx + b = E.Ry + ang = math.deg(E.slope) + L.AH = line: new (z.A,z.H) + L.BH = line: new (z.B,z.H) + L.CH = line: new (z.C,z.H) + z.X = intersection (L.AH,C.circum) + _,z.Y = intersection (L.BH,C.circum) + _,z.Z = intersection (L.CH,C.circum) + L.BC = line: new (z.B,z.C) + L.XO = line: new (z.X,z.O) + L.YO = line: new (z.Y,z.O) + L.ZO = line: new (z.Z,z.O) + z.x = intersection (L.BC,L.XO) + z.U = intersection (L.XO,E) + _,z.V = intersection (L.YO,E) + _,z.W = intersection (L.ZO,E) + set_lua_to_tex {'a','b','ang'} + \end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \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) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = 1.5 +E = {} +z.A = point: new (0 , 0) +z.B = point: new (5 , 1) +L.AB = line : new (z.A,z.B) +z.C = point: new (.8 , 3) +T.ABC = triangle: new (z.A,z.B,z.C) +z.N = T.ABC.eulercenter +z.G = T.ABC.centroid +z.O = T.ABC.circumcenter +z.H = T.ABC.orthocenter +z.Ma,z.Mb,z.Mc = get_points (T.ABC : medial ()) +z.Ha,z.Hb,z.Hc = get_points (T.ABC : orthic ()) +z.Ea,z.Eb,z.Ec = get_points (T.ABC: extouch()) +L.euler = T.ABC : euler_line () +C.circum = T.ABC : circum_circle () +C.euler = T.ABC : euler_circle () +z.I,z.J = intersection (L.euler,C.euler) + E = ellipse: foci (z.H,z.O,z.I) +a = E.Rx +b = E.Ry +ang = math.deg(E.slope) +L.AH = line: new (z.A,z.H) +L.BH = line: new (z.B,z.H) +L.CH = line: new (z.C,z.H) +z.X = intersection (L.AH,C.circum) +_,z.Y = intersection (L.BH,C.circum) +_,z.Z = intersection (L.CH,C.circum) +L.BC = line: new (z.B,z.C) +L.XO = line: new (z.X,z.O) +L.YO = line: new (z.Y,z.O) +L.ZO = line: new (z.Z,z.O) +z.x = intersection (L.BC,L.XO) +z.U = intersection (L.XO,E) +_,z.V = intersection (L.YO,E) +_,z.W = intersection (L.ZO,E) +set_lua_to_tex {'a','b','ang'} +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon(A,B,C) +\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) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Hexagram Lemoine,Pascal} +% subsection hexagram (end) + +\subsection{Gold Arbelos properties} % (fold) +\label{sub:gold_arbelos_properties} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point : new(0,0) + z.B = point : new(10,0) + z.C = gold_segment_ (z.A,z.B) + L.AB = line:new (z.A,z.B) + z.O_1 = L.AB.mid + L.AC = line:new (z.A,z.C) + z.O_2 = L.AC.mid + L.CB = line:new (z.C,z.B) + z.O_3 = L.CB.mid + C1 = circle:new (z.O_1,z.B) + C2 = circle:new (z.O_2,z.C) + C3 = circle:new (z.O_3,z.B) + z.Q = C2.north + z.P = C3.north + L1 = line:new (z.O_2,z.O_3) + z.M_0 = L1:harmonic_ext (z.C) + L2 = line:new (z.O_1,z.O_2) + z.M_1 = L2:harmonic_int (z.A) + L3 = line:new (z.O_1,z.O_3) + z.M_2 = L3:harmonic_int (z.B) + Lbq = line:new (z.B,z.Q) + Lap = line:new (z.A,z.P) + z.S = intersection (Lbq,Lap) + z.x = z.C: north () + L = line : new (z.C,z.x) + z.D,_ = intersection (L,C1) + L.CD = line :new (z.C,z.D) + z.O_7 = L.CD.mid + C.DC = circle: new (z.D,z.C) + z.U,z.V = intersection (C.DC,C1) + L.UV = line :new (z.U,z.V) + z.R ,z.S = L.UV : set_projection (z.O_2,z.O_3) + L.O1D = line : new (z.O_1,z.D) + z.W = intersection (L.UV,L.O1D) + z.O = C.DC : inversion (z.W) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles[teal](O_1,B) + \tkzDrawSemiCircles[thin,teal](O_2,C O_3,B) + \tkzDrawArc[purple,delta=0](D,V)(U) + \tkzDrawCircle[new](O_7,C) + \tkzDrawSegments[thin,purple](A,D D,B C,R C,S C,D U,V) + \tkzDrawSegments[thin,red](O,D A,O O,B) + \tkzDrawPoints(A,B,C,D,O_7) %, + \tkzDrawPoints(O_1,O_2,O_3,U,V,R,S,W,O) + \tkzDrawSegments[cyan](O_3,S O_2,R) + \tkzDrawSegments[very thin](A,B) + \tkzDrawSegments[cyan,thin](C,U U,D) + \tkzMarkRightAngles[size=.2,fill=gray!40,opacity=.4](D,C,A A,D,B + D,S,C D,W,V O_3,S,U O_2,R,U) + \tkzFillAngles[cyan!40,opacity=.4](B,A,D A,D,O_1 + C,D,B D,C,R B,C,S A,R,O_2) + \tkzFillAngles[green!40,opacity=.4](S,C,D W,R,D + D,B,C R,C,A O_3,S,B) + \tkzLabelPoints[below](C,O_2,O_3,O_1) + \tkzLabelPoints[above](D) + \tkzLabelPoints[below](O) + \tkzLabelPoints[below left](A) + \tkzLabelPoints[above left](R) + \tkzLabelPoints[above right](S) + \tkzLabelPoints[left](V) + \tkzLabelPoints[below right](B,U,W,O_7) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.A = point : new(0,0) +z.B = point : new(10,0) +z.C = gold_segment_ (z.A,z.B) +L.AB = line:new (z.A,z.B) +z.O_1 = L.AB.mid +L.AC = line:new (z.A,z.C) +z.O_2 = L.AC.mid +L.CB = line:new (z.C,z.B) +z.O_3 = L.CB.mid +C1 = circle:new (z.O_1,z.B) +C2 = circle:new (z.O_2,z.C) +C3 = circle:new (z.O_3,z.B) +z.Q = C2.north +z.P = C3.north +L1 = line:new (z.O_2,z.O_3) +z.M_0 = L1:harmonic_ext (z.C) +L2 = line:new (z.O_1,z.O_2) +z.M_1 = L2:harmonic_int (z.A) +L3 = line:new (z.O_1,z.O_3) +z.M_2 = L3:harmonic_int (z.B) +Lbq = line:new (z.B,z.Q) +Lap = line:new (z.A,z.P) +z.S = intersection (Lbq,Lap) +z.x = z.C: north () +L = line : new (z.C,z.x) +z.D,_ = intersection (L,C1) +L.CD = line :new (z.C,z.D) +z.O_7 = L.CD.mid +C.DC = circle: new (z.D,z.C) +z.V,z.U = intersection (C.DC,C1) +L.UV = line :new (z.U,z.V) +z.R ,z.S = L.UV : set_projection (z.O_2,z.O_3) +L.O1D = line : new (z.O_1,z.D) +z.W = intersection (L.UV,L.O1D) +z.O = C.DC : inversion (z.W) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles[teal](O_1,B) +\tkzDrawSemiCircles[thin,teal](O_2,C O_3,B) +\tkzDrawArc[purple,delta=0](D,V)(U) +\tkzDrawCircle[new](O_7,C) +\tkzDrawSegments[thin,purple](A,D D,B C,R C,S C,D U,V) +\tkzDrawSegments[thin,red](O,D A,O O,B) +\tkzDrawPoints(A,B,C,D,O_7) %, +\tkzDrawPoints(O_1,O_2,O_3,U,V,R,S,W,O) +\tkzDrawSegments[cyan](O_3,S O_2,R) +\tkzDrawSegments[very thin](A,B) +\tkzDrawSegments[cyan,thin](C,U U,D) +\tkzMarkRightAngles[size=.2,fill=gray!40,opacity=.4](D,C,A A,D,B + D,S,C D,W,V O_3,S,U O_2,R,U) +\tkzFillAngles[cyan!40,opacity=.4](B,A,D A,D,O_1 + C,D,B D,C,R B,C,S A,R,O_2) +\tkzFillAngles[green!40,opacity=.4](S,C,D W,R,D + D,B,C R,C,A O_3,S,B) +\tkzLabelPoints[below](C,O_2,O_3,O_1) +\tkzLabelPoints[above](D) +\tkzLabelPoints[below](O) +\tkzLabelPoints[below left](A) +\tkzLabelPoints[above left](R) +\tkzLabelPoints[above right](S) +\tkzLabelPoints[left](V) +\tkzLabelPoints[below right](B,U,W,O_7) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Gold Arbelos properties} +% subsection gold_arbelos_properties (end) + +\subsection{Apollonius circle v1 with inversion} % (fold) +\label{sub:apollonius_circle_v1_with_inversion} +\begin{tkzexample}[code only,small] +\begin{tkzelements} +scale = .75 + z.A = point: new (0,0) + z.B = point: new (6,0) + z.C = point: new (0.8,4) + T.ABC = triangle : new (z.A,z.B,z.C) + C.euler = T.ABC: euler_circle () + z.N,z.Ma = get_points (C.euler) + z.I_a,z.I_b,z.I_c = get_points (T.ABC : excentral()) + z.Ea,z.Eb,z.Ec = get_points (T.ABC : feuerbach ()) + -- The Feuerbach triangle is the triangle formed by the three points + -- of tangency of the nine-point circle with the excircles + z.S,z.p = get_points (T.ABC: spieker_circle ()) + -- z.Xa,z.Xb,z.Xc = get_points (T.ABC : extouch()) + C.exa = T.ABC : ex_circle () + z.Ia,z.Xa = get_points (C.exa) + C.exb = T.ABC : ex_circle (1) + z.Ib,z.Xb = get_points (C.exb) + C.exc = T.ABC : ex_circle (2) + z.Ic,z.Xc = get_points (C.exc) + -- S spieker point is the radical center of the last three circles + L.fa = line : new (z.S,z.Ea) + L.fb = line : new (z.S,z.Eb) + L.fc = line : new (z.S,z.Ec) + z.f_a = intersection (L.fa,C.exa) + z.f_b = intersection (L.fb,C.exb) + _,z.f_c = intersection (L.fc,C.exc) + T = triangle : new ( z.f_a, z.f_b , z.f_c ) + z.o = T.circumcenter + _,z.l = get_points (C.exa : orthogonal_from (z.S)) + -- S center of inversion !! +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles[red](o,f_a N,Ma) + \tkzDrawPoints[red](f_a,f_b,f_c,Ea,Eb,Ec,o,N) + \tkzClipCircle(o,f_a) + \tkzDrawLines[add=3 and 3](A,B A,C B,C) + \tkzDrawCircles(I_a,Xa I_b,Xb I_c,Xc) + \tkzDrawCircles[cyan](S,l) + \tkzDrawPoints(A,B,C) + \tkzDrawPoints[cyan](S) + \tkzDrawSegments[dashed,red](S,f_a S,f_b S,f_c) + \tkzDrawSegments[dashed,teal](o,f_a o,f_b o,f_c) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .5 +z.A = point: new (0,0) +z.B = point: new (6,0) +z.C = point: new (0.8,4) +T.ABC = triangle : new (z.A,z.B,z.C) +C.euler = T.ABC: euler_circle () +z.N,z.Ma = get_points (C.euler) +z.I_a,z.I_b,z.I_c = get_points (T.ABC : excentral()) +z.Ea,z.Eb,z.Ec = get_points (T.ABC : feuerbach ()) +-- The Feuerbach triangle is the triangle formed by the three points of tangency of the nine-point circle with the excircles +z.S,z.p = get_points (T.ABC: spieker_circle ()) + -- z.Xa,z.Xb,z.Xc = get_points (T.ABC : extouch()) +C.exa = T.ABC : ex_circle () +z.Ia,z.Xa = get_points (C.exa) +C.exb = T.ABC : ex_circle (1) +z.Ib,z.Xb = get_points (C.exb) +C.exc = T.ABC : ex_circle (2) +z.Ic,z.Xc = get_points (C.exc) + +-- S spieker point is the radical center of the last three circles +L.fa = line : new (z.S,z.Ea) +L.fb = line : new (z.S,z.Eb) +L.fc = line : new (z.S,z.Ec) +z.f_a = intersection (L.fa,C.exa) +z.f_b = intersection (L.fb,C.exb) +_,z.f_c = intersection (L.fc,C.exc) +T = triangle : new ( z.f_a, z.f_b , z.f_c ) +z.o = T.circumcenter +_,z.l = get_points (C.exa : orthogonal_from (z.S)) +-- S center of inversion !! +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles[red](o,f_a N,Ma) +\tkzDrawPoints[red](f_a,f_b,f_c,Ea,Eb,Ec,o,N) +\tkzClipCircle(o,f_a) +\tkzDrawLines[add=3 and 3](A,B A,C B,C) +\tkzDrawCircles(I_a,Xa I_b,Xb I_c,Xc) +\tkzDrawCircles[cyan](S,l) +\tkzDrawPoints(A,B,C) +\tkzDrawPoints[cyan](S) +\tkzDrawSegments[dashed,red](S,f_a S,f_b S,f_c) +\tkzDrawSegments[dashed,teal](o,f_a o,f_b o,f_c) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Apollonius circle V1} +% subsection apollonius_circle_v1_with_inversion (end) + +\subsection{Apollonius circle v2} % (fold) +\label{sub:apollonius_circle_v2} + \begin{tkzexample}[small,code only] +\begin{tkzelements} + scale = .5 + z.A = point: new (0,0) + z.B = point: new (6,0) + z.C = point: new (0.8,4) + T.ABC = triangle: new(z.A,z.B,z.C) + z.O = T.ABC.circumcenter + z.H = T.ABC.orthocenter + z.G = T.ABC.centroid + z.L = T.ABC: lemoine_point () + z.S = T.ABC: spieker_center () + C.euler = T.ABC: euler_circle () + z.N,z.Ma = get_points (C.euler) + C.exA = T.ABC : ex_circle () + z.Ja,z.Xa = get_points (C.exA) + C.exB = T.ABC : ex_circle (1) + z.Jb,z.Xb = get_points (C.exB) + 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 + 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 +\end{tkzelements} + +\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) % + \tkzClipCircle(o,t) + \tkzDrawLines[red](o,L N,o Ma,t) + \tkzDrawLines[cyan,add=4 and 4](Ma,N o,t) + \tkzDrawPoints(A,B,C,Ma,Ja,Jb,Jc) + \tkzDrawPoints[red](N,O,L,S,o,t) + \tkzLabelPoints[right,font=\tiny](A,B,C,Ja,Jb,Jc,O,N,L,S,Ma,o) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale =.5 +z.A = point: new (0,0) +z.B = point: new (6,0) +z.C = point: new (0.8,4) +T.ABC = triangle: new(z.A,z.B,z.C) +z.O = T.ABC.circumcenter +z.H = T.ABC.orthocenter +z.G = T.ABC.centroid +z.L = T.ABC: lemoine_point () +z.S = T.ABC: spieker_center () +C.euler = T.ABC: euler_circle () +z.N,z.Ma = get_points (C.euler) +C.exA = T.ABC : ex_circle () +z.Ja,z.Xa = get_points (C.exA) +C.exB = T.ABC : ex_circle (1) +z.Jb,z.Xb = get_points (C.exB) +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 +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 +\end{tkzelements} + + +\hspace*{\fill} +\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) % +\tkzClipCircle(o,t) +\tkzDrawLines[red](o,L N,o Ma,t) +\tkzDrawLines[cyan,add=4 and 4](Ma,N o,t) +\tkzDrawPoints(A,B,C,Ma,Ja,Jb,Jc) +\tkzDrawPoints[red](N,O,L,S,o,t) +\tkzLabelPoints[right,font=\tiny](A,B,C,Ja,Jb,Jc,O,N,L,S,Ma,o) +\end{tikzpicture} +\hspace*{\fill} +% subsection apollonius_circle_v2 (end) + + +\subsection{Orthogonal circles v1} % (fold) +\label{sub:orthogonal_circles_v1} + +\begin{tkzexample}[small,code only] +\begin{tkzelements} + 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)) +\end{tkzelements} +\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{tkzexample} + +\begin{tkzelements} +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)) +\end{tkzelements} + +\hspace*{\fill} +\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} +\hspace*{\fill} +%\caption{Orthogonal circles v1 } +% subsection orthogonal_circles_v1 (end) + +\subsection{Orthogonal circles v2} % (fold) +\label{sub:orthogonal_circles_v2} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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.Oz2 = C.OP : orthogonal_from (z.Op) + z.z1 = C.Oz1.through + z.z2 = C.Oz2.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 +\end{tkzelements} +\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{tkzexample} + +\begin{tkzelements} +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.Oz2 = C.OP : orthogonal_from (z.Op) +z.z1 = C.Oz1.through +z.z2 = C.Oz2.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 +\end{tkzelements} + +\hspace*{\fill} +\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} +\hspace*{\fill} +%\caption{Orthogonal circles v2} +% subsection orthogonal_circles_v2 (end) + +\subsection{Orthogonal circle to two circles} % (fold) +\label{sub:orthogonal_circle_to_two_circles} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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 (2.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 +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(O,B O',D) + \tkzDrawLine[add=1 and 2,cyan](E,F) + \tkzDrawLines[add=.5 and .5,orange](O,O' O,T O,T') + \tkzDrawSegments[cyan](M,T M,T' M,K M,K') + \tkzDrawCircle(M,T) + \tkzDrawPoints(O,O',T,M,T',K,K') + \tkzLabelPoints(O,O',T,T',M,K,K') +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +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 (2.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 +\end{tkzelements} + + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(O,B O',D) +\tkzDrawLine[add=1 and 2,cyan](E,F) +\tkzDrawLines[add=.5 and .5,orange](O,O' O,T O,T') +\tkzDrawSegments[cyan](M,T M,T' M,K M,K') +\tkzDrawCircle(M,T) +\tkzDrawPoints(O,O',T,M,T',K,K') +\tkzLabelPoints(O,O',T,T',M,K,K') +\end{tikzpicture} +\hspace*{\fill} +%\caption{Orthogonal to two circles} +% \subsection{Orthogonal to two circles} % (fold) + +\subsection{Midcircles} % (fold) +\label{sub:midcircles} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (10 , 0) + L.AB = line : new (z.A,z.B) + z.C = L.AB: gold_ratio () + L.AC = line : new (z.A,z.C) + L.CB = line : new (z.C,z.B) + z.O_0 = L.AB.mid + z.O_1 = L.AC.mid + z.O_2 = L.CB.mid + C.O0B = circle : new (z.O_0,z.B) + C.O1C = circle : new (z.O_1,z.C) + C.O2C = circle : new (z.O_2,z.B) + z.Q = C.O1C : midarc (z.C,z.A) + z.P = C.O2C : midarc (z.B,z.C) + L.O1O2 = line : new (z.O_1,z.O_2) + L.O0O1 = line : new (z.O_0,z.O_1) + L.O0O2 = line : new (z.O_0,z.O_2) + z.M_0 = L.O1O2 : harmonic_ext (z.C) + z.M_1 = L.O0O1 : harmonic_int (z.A) + z.M_2 = L.O0O2 : harmonic_int (z.B) + L.BQ = line : new (z.B,z.Q) + L.AP = line : new (z.A,z.P) + z.S = intersection (L.BQ,L.AP) + L.CS = line : new (z.C,z.S) + C.M1A = circle : new (z.M_1,z.A) + C.M2B = circle : new (z.M_2,z.B) + z.P_0 = intersection (L.CS,C.O0B) + z.P_1 = intersection (C.M2B,C.O1C) + z.P_2 = intersection (C.M1A,C.O2C) + T.P012 = triangle : new (z.P_0,z.P_1,z.P_2) + z.O_4 = T.P012.circumcenter + T.CP12 = triangle : new (z.C,z.P_1,z.P_2) + z.O_5 = T.CP12.circumcenter + z.BN = z.B : north () + L.BBN = line : new (z.B,z.BN) + L.M1P2 = line : new (z.M_1,z.P_2) + z.J = intersection (L.BBN,L.M1P2) + L.AP0 = line : new (z.A,z.P_0) + L.BP0 = line : new (z.B,z.P_0) + C.O4P0 = circle : new (z.O_4,z.P_0) + _,z.G = intersection (L.AP0,C.O4P0) + z.H = intersection (L.BP0,C.O4P0) + z.Ap = z.M_1: symmetry (z.A) + z.H_4,z.F,z.E,z.H_0 = L.AB : set_projection (z.O_4,z.G,z.H,z.P_0) +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircle[thin,fill=green!10](O_4,P_0) + \tkzDrawCircle[purple,fill=purple!10,opacity=.5](O_5,C) + \tkzDrawSemiCircles[teal](O_0,B) + \tkzDrawSemiCircles[thin,teal,fill=teal!20,opacity=.5](O_1,C O_2,B) + \tkzDrawSemiCircles[new](M_2,B) + \tkzDrawSemiCircles[new](M_1,A') + \tkzDrawArc[purple,delta=0](M_0,P_0)(C) + \tkzDrawSegments[very thin](A,B A,P B,Q) + \tkzDrawSegments[step 1](O_0,P_0 B,J G,J G,O_0 H,O_2) + \tkzDrawSegments[ultra thin,purple](M_1,P_0 M_2,P_0 M_1,M_0 M_0,P_1 M_0,P_0 M_1,J) + \tkzDrawPoints(A,B,C,P_0,P_2,P_1,M_0,M_1,M_2,J,P,Q,S) + \tkzDrawPoints(O_0,O_1,O_2,O_4,O_5,G,H) + \tkzMarkRightAngle[size=.2,fill=gray!20,opacity=.4](O_0,P_0,M_0) + \tkzLabelPoints[below](A,B,C,M_0,M_1,M_2,O_1,O_2,O_0) + \tkzLabelPoints[above](P_0,O_5,O_4) + \tkzLabelPoints[above](P_1,J) + \tkzLabelPoints[above](P_2,P,Q,S) + \tkzLabelPoints[above right](H,E) + \tkzLabelPoints[above left](F,G) + \tkzLabelPoints[below right](H_0) + \tkzLabelCircle[below=4pt,font=\scriptsize](O_1,C)(80){$(\beta)$} + \tkzLabelCircle[below=4pt,font=\scriptsize](O_2,B)(80){$(\gamma)$} + \tkzLabelCircle[below=4pt,font=\scriptsize](O_0,B)(110){$(\alpha)$} + \tkzLabelCircle[left,font=\scriptsize](O_4,P_2)(60){$(\delta)$} + \tkzLabelCircle[above left,font=\scriptsize](O_5,C)(40){$(\epsilon)$} + \end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.A = point: new (0 , 0) +z.B = point: new (10 , 0) +L.AB = line : new (z.A,z.B) +z.C = L.AB: gold_ratio () +L.AC = line : new (z.A,z.C) +L.CB = line : new (z.C,z.B) +z.O_0 = L.AB.mid +z.O_1 = L.AC.mid +z.O_2 = L.CB.mid +C.O0B = circle : new (z.O_0,z.B) +C.O1C = circle : new (z.O_1,z.C) +C.O2C = circle : new (z.O_2,z.B) +z.Q = C.O1C : midarc (z.C,z.A) +z.P = C.O2C : midarc (z.B,z.C) +L.O1O2 = line : new (z.O_1,z.O_2) +L.O0O1 = line : new (z.O_0,z.O_1) +L.O0O2 = line : new (z.O_0,z.O_2) +z.M_0 = L.O1O2 : harmonic_ext (z.C) +z.M_1 = L.O0O1 : harmonic_int (z.A) +z.M_2 = L.O0O2 : harmonic_int (z.B) +L.BQ = line : new (z.B,z.Q) +L.AP = line : new (z.A,z.P) +z.S = intersection (L.BQ,L.AP) +L.CS = line : new (z.C,z.S) +C.M1A = circle : new (z.M_1,z.A) +C.M2B = circle : new (z.M_2,z.B) +z.P_0 = intersection (L.CS,C.O0B) +z.P_1 = intersection (C.M2B,C.O1C) +z.P_2 = intersection (C.M1A,C.O2C) +T.P012 = triangle : new (z.P_0,z.P_1,z.P_2) +z.O_4 = T.P012.circumcenter +T.CP12 = triangle : new (z.C,z.P_1,z.P_2) +z.O_5 = T.CP12.circumcenter +z.BN = z.B : north () +L.BBN = line : new (z.B,z.BN) +L.M1P2 = line : new (z.M_1,z.P_2) +z.J = intersection (L.BBN,L.M1P2) +L.AP0 = line : new (z.A,z.P_0) +L.BP0 = line : new (z.B,z.P_0) +C.O4P0 = circle : new (z.O_4,z.P_0) +_,z.G = intersection (L.AP0,C.O4P0) +z.H = intersection (L.BP0,C.O4P0) +z.Ap = z.M_1: symmetry (z.A) +z.H_4,z.F,z.E,z.H_0 = L.AB : set_projection (z.O_4,z.G,z.H,z.P_0) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircle[thin,fill=green!10](O_4,P_0) +\tkzDrawCircle[purple,fill=purple!10,opacity=.5](O_5,C) +\tkzDrawSemiCircles[teal](O_0,B) +\tkzDrawSemiCircles[thin,teal,fill=teal!20,opacity=.5](O_1,C O_2,B) +\tkzDrawSemiCircles[color = orange](M_2,B) +\tkzDrawSemiCircles[color = orange](M_1,A') +\tkzDrawArc[purple,delta=0](M_0,P_0)(C) +\tkzDrawSegments[very thin](A,B A,P B,Q) +\tkzDrawSegments[color=cyan](O_0,P_0 B,J G,J G,O_0 H,O_2) +\tkzDrawSegments[ultra thin,purple](M_1,P_0 M_2,P_0 M_1,M_0 M_0,P_1 M_0,P_0 M_1,J) +\tkzDrawPoints(A,B,C,P_0,P_2,P_1,M_0,M_1,M_2,J,P,Q,S) +\tkzDrawPoints(O_0,O_1,O_2,O_4,O_5,G,H) +\tkzMarkRightAngle[size=.2,fill=gray!20,opacity=.4](O_0,P_0,M_0) +\tkzLabelPoints[below](A,B,C,M_0,M_1,M_2,O_1,O_2,O_0) +\tkzLabelPoints[above](P_0,O_5,O_4) +\tkzLabelPoints[above](P_1,J) +\tkzLabelPoints[above](P_2,P,Q,S) +\tkzLabelPoints[above right](H,E) +\tkzLabelPoints[above left](F,G) +\tkzLabelPoints[below right](H_0) +\tkzLabelCircle[below=4pt,font=\scriptsize](O_1,C)(80){$(\beta)$} +\tkzLabelCircle[below=4pt,font=\scriptsize](O_2,B)(80){$(\gamma)$} +\tkzLabelCircle[below=4pt,font=\scriptsize](O_0,B)(110){$(\alpha)$} +\tkzLabelCircle[left,font=\scriptsize](O_4,P_2)(60){$(\delta)$} +\tkzLabelCircle[above left,font=\scriptsize](O_5,C)(40){$(\epsilon)$} +\end{tikzpicture} +\hspace*{\fill} +%\caption{Midcircles} +% subsection midcircles (end) + +\subsection{Pencil v1} % (fold) +\label{sub:pencil_v1} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = .75 + z.A = point : new (0,2) + z.B = point : new (0,-2) + z.C_0 = point : new (-3,0) + z.C_1 = point : new (2,0) + z.C_3 = point : new (2.5,0) + z.C_5 = point : new (1,0) + L.BA = line : new (z.B,z.A) + z.M_0 = L.BA : point (1.25) + z.M_1 = L.BA : point (1.5) + C.C0A = circle : new (z.C_0,z.A) + z.x,z.y = get_points (C.C0A : orthogonal_from (z.M_0)) + z.xp,z.yp = get_points (C.C0A : orthogonal_from (z.M_1)) + z.O = L.BA.mid +\end{tkzelements} +\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{tkzexample} + +\begin{tkzelements} +scale=.75 +z.A = point : new (0,2) +z.B = point : new (0,-2) +z.C_0 = point : new (-3,0) +z.C_1 = point : new (2,0) +z.C_3 = point : new (2.5,0) +z.C_5 = point : new (1,0) +L.BA = line : new (z.B,z.A) +z.M_0 = L.BA : point (1.25) +z.M_1 = L.BA : point (1.5) +C.C0A = circle : new (z.C_0,z.A) +z.x,z.y = get_points (C.C0A : orthogonal_from (z.M_0)) +z.xp,z.yp = get_points (C.C0A : orthogonal_from (z.M_1)) +z.O = L.BA.mid +\end{tkzelements} + +\hspace*{\fill} +\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} +\hspace*{\fill} +%\caption{Pencil v1} +% subsection pencil_v1 (end) + +\subsection{Pencil v2} % (fold) +\label{sub:pencil_v2} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale=.75 + z.A = point : new (0,0) + z.B = point : new (1,0) + z.C_0 = point : new (-2,0) + z.C_1 = point : new (4,0) + C.C0A = circle : new (z.C_0,z.A) + C.C1B = circle : new (z.C_1,z.B) + L.EF = C.C0A : radical_axis (C.C1B) + z.M_0 = L.EF : point (2) + z.M_1 = L.EF : point (-1) + z.M_2 = L.EF : point (-2) + C.orth0 = C.C0A : orthogonal_from (z.M_0) + C.orth1 = C.C0A : orthogonal_from (z.M_1) + C.orth2 = C.C0A : orthogonal_from (z.M_2) + z.u = C.orth0.through + z.v = C.orth1.through + z.t = C.orth2.through +\end{tkzelements} +\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{tkzexample} + +\begin{tkzelements} + scale=.75 + z.A = point : new (0,0) + z.B = point : new (1,0) + z.C_0 = point : new (-2,0) + z.C_1 = point : new (4,0) + C.C0A = circle : new (z.C_0,z.A) + C.C1B = circle : new (z.C_1,z.B) + L.EF = C.C0A : radical_axis (C.C1B) + z.M_0 = L.EF : point (2) + z.M_1 = L.EF : point (-1) + z.M_2 = L.EF : point (-2) + C.orth0 = C.C0A : orthogonal_from (z.M_0) + C.orth1 = C.C0A : orthogonal_from (z.M_1) + C.orth2 = C.C0A : orthogonal_from (z.M_2) + z.u = C.orth0.through + z.v = C.orth1.through + z.t = C.orth2.through +\end{tkzelements} + +\hspace*{\fill} +\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} +\hspace*{\fill} +%subsection pencil_v2 (end) + +\subsection{Power v1} % (fold) +\label{sub:power_v1} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.O = point : new (0,0) + z.A = point : new (2,-2) + z.M = point : new (-6,0) + L.AM = line : new (z.A,z.M) + C.OA = circle : new (z.O,z.A) + z.Ap = C.OA : antipode (z.A) + z.B = intersection (L.AM, C.OA) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircle(O,A) + \tkzMarkRightAngle[fill=gray!10](A',B,M) + \tkzDrawSegments(M,O A,A' A',B) + \tkzDrawPoints(O,A,A',M,B) + \tkzLabelPoints(O,A,A',M,B) + \tkzDrawSegments[-Triangle](M,A M,A') +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = 1.25 +z.O = point : new (0,0) +z.A = point : new (2,-2) +z.M = point : new (-6,0) +L.AM = line : new (z.A,z.M) +C.OA = circle : new (z.O,z.A) +z.Ap = C.OA : antipode (z.A) +z.B = intersection (L.AM, C.OA) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircle(O,A) +\tkzMarkRightAngle[fill=gray!10](A',B,M) +\tkzDrawSegments(M,O A,A' A',B) +\tkzDrawPoints(O,A,A',M,B) +\tkzLabelPoints(O,A,A',M,B) +\tkzDrawSegments[-Triangle](M,A M,A') +\end{tikzpicture} +\hspace*{\fill} +%\caption{Power v1} +% subsection power_v1 (end) + +\subsection{Power v2} % (fold) +\label{sub:power_v2} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.O = point : new (0,0) + z.A = point : new (2,2) + z.M = point : new (-1.5,0) + L.AM = line : new (z.A,z.M) + C.OA = circle : new (z.O,z.A) + z.Ap = C.OA : antipode (z.A) + _,z.B = intersection (L.AM, C.OA) + z.m = z.M : north(1) + L.mM = line : new (z.m,z.M) + z.U,z.V = intersection (L.mM,C.OA) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircle(O,A) + \tkzMarkRightAngle[fill=gray!10](A',B,M) + \tkzDrawSegments(M,O A,A' A',B A,B U,V) + \tkzDrawPoints(O,A,A',M,B,U,V,m) + \tkzLabelPoints(O,A,M,U,V,m) + \tkzLabelPoints[below left](A',B) + \tkzDrawSegments(M,A M,A') +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = 1.25 +z.O = point : new (0,0) +z.A = point : new (2,2) +z.M = point : new (-1.5,0) +L.AM = line : new (z.A,z.M) +C.OA = circle : new (z.O,z.A) +z.Ap = C.OA : antipode (z.A) +_,z.B = intersection (L.AM, C.OA) +z.m = z.M : north(1) +L.mM = line : new (z.m,z.M) +z.U,z.V = intersection (L.mM,C.OA) +\end{tkzelements} + +\hspace*{\fill}\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircle(O,A) +\tkzMarkRightAngle[fill=gray!10](A',B,M) +\tkzDrawSegments(M,O A,A' A',B A,B U,V) +\tkzDrawPoints(O,A,A',M,B,U,V,m) +\tkzLabelPoints(O,A,M,U,V,m) +\tkzLabelPoints[below left](A',B) +\tkzDrawSegments(M,A M,A') +\end{tikzpicture}\hspace*{\fill} + %\caption{Power v2} +% subsection power_v2 (end) + +\subsection{Reim v1} % (fold) +\label{sub:reim_v1} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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 (math.pi/6) + z.D = C.AE : point (-math.pi/180*40) + z.F = C.AE : point (-math.pi/180*100) + 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) +\end{tkzelements} +\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{tkzexample} + +\begin{tkzelements} +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 (math.pi/6) +z.D = C.AE : point (-math.pi/180*40) +z.F = C.AE : point (-math.pi/180*100) +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) +\end{tkzelements} + +\hspace*{\fill} +\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} +\hspace*{\fill} +%\caption{Reim v1} +% subsection reim_v1 (end) + +\subsection{Reim v2} % (fold) +\label{sub:reim_v2} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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 (1.2*math.pi) + 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)) +\end{tkzelements} +\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{tkzexample} + +\begin{tkzelements} +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 (1.2*math.pi) +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)) +\end{tkzelements} + +\hspace*{\fill} +\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} +\hspace*{\fill} +%\caption{Reim v2} +% subsection reim_v2 (end) + +\subsection{Reim v3} % (fold) +\label{sub:reim_v3} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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) +\end{tkzelements} + +\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{tkzexample} + +\begin{tkzelements} + scale = 1.25 + 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) +\end{tkzelements} + +\hspace*{\fill} +\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} +\hspace*{\fill} +%\caption{Reim v3} +% subsection reim_v3 (end) + +\subsection{Tangent and circle} % (fold) +\label{sub:tangent_and_circle} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (1,0) + z.B = point: new (2,2) + z.E = point: new (5,-4) + L.AE = line : new (z.A,z.E) + C.AB = circle: new (z.A , z.B) + z.S = C.AB.south + z.M = L.AE.mid + L.Ti,L.Tj = C.AB: tangent_from (z.E) + z.i = L.Ti.pb + z.j = L.Tj.pb + z.k,z.l = get_points (C.AB: tangent_at (z.B)) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(A,B M,A) + \tkzDrawPoints(A,B,E,i,j,M,S) + \tkzDrawLines(E,i E,j k,l) + \tkzLabelPoints[right,font=\small](A,B,E,S,M) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.A = point: new (1,0) +z.B = point: new (2,2) +z.E = point: new (5,-4) +L.AE = line : new (z.A,z.E) +C.AB = circle: new (z.A , z.B) +z.S = C.AB.south +z.M = L.AE.mid +L.Ti,L.Tj = C.AB: tangent_from (z.E) +z.i = L.Ti.pb +z.j = L.Tj.pb +z.k,z.l = get_points (C.AB: tangent_at (z.B)) +\end{tkzelements} +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(A,B M,A) +\tkzDrawPoints(A,B,E,i,j,M,S) +\tkzDrawLines(E,i E,j k,l) +\tkzLabelPoints[right,font=\small](A,B,E,S,M) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Tangent and circle} +% subsection tangent_and_circle (end) + +\subsection{Homothety} % (fold) +\label{sub:homothety} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (0,0) + z.B = point: new (1,2) + z.E = point: new (-3,2) + z.C,z.D = z.E : set_homothety(2,z.A,z.B) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(A,B,C,E,D) + \tkzLabelPoints(A,B,C,E) + \tkzDrawCircles(A,B C,D) + \tkzDrawLines(E,C E,D) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .6 +z.A = point: new (0,0) +z.B = point: new (1,2) +z.E = point: new (-3,2) +z.C,z.D = z.E : set_homothety(2,z.A,z.B) +\end{tkzelements} +\hspace*{\fill}\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPoints(A,B,C,E,D) +\tkzLabelPoints(A,B,C,E) +\tkzDrawCircles(A,B C,D) +\tkzDrawLines(E,C E,D) +\end{tikzpicture}\hspace*{\fill} +%\caption{Homothety} +% subsection homothety (end) + +\subsection{Tangent and chord} % (fold) +\label{sub:tangent_and_chord} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + 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) +\end{tkzelements} +\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) + \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](B,D,A b2,B,A) + \tkzLabelPoints(A,B,C,D,H,O) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = 0.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) +\end{tkzelements} + +\hspace*{\fill} +\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) +\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](B,D,A b2,B,A) +\tkzLabelPoints(A,B,C,D,H,O) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Tangent and chord} +% subsection tangent_and_chord (end) + + +\subsection{Three chords} % (fold) +\label{sub:three_chords} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.O = point: new (0 , 0) + z.B = point: new (0 , 2) + z.P = point: new (1 , -.5) + C.OB = circle : new (z.O,z.B) + C.PB = circle : new (z.P,z.B) + _,z.A = intersection (C.OB,C.PB) + z.D = C.PB: point(math.pi/3) + z.C = C.PB: point(-math.pi/3) + z.E = C.OB: point(-math.pi/180*50) + L.AB = line : new (z.A,z.B) + L.CD = line : new (z.C,z.D) + z.G = intersection (L.AB,L.CD) + L.GE = line : new (z.G,z.E) + z.F,_ = intersection (L.GE,C.OB) + T.CDE = triangle: new (z.C,z.D,z.E) + T.BFD = triangle: new (z.B,z.F,z.D) + z.w = T.CDE.circumcenter + z.x = T.BFD.circumcenter + L.GB = line : new (z.G,z.B) + L.GE = line : new (z.G,z.E) + L.GD = line : new (z.G,z.D) + C.xB = circle : new (z.x,z.B) + C.xF = circle : new (z.x,z.F) + C.xD = circle : new (z.x,z.D) + z.Ap = intersection (L.GB,C.xB) + z.Ep = intersection (L.GE,C.xF) + z.Cp = intersection (L.GD,C.xD) +\end{tkzelements} +\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{tkzexample} + +\begin{tkzelements} +z.O = point: new (0 , 0) +z.B = point: new (0 , 2) +z.P = point: new (1 , -.5) +C.OB = circle : new (z.O,z.B) +C.PB = circle : new (z.P,z.B) +_,z.A = intersection (C.OB,C.PB) +z.D = C.PB: point(math.pi/3) +z.C = C.PB: point(-math.pi/3) +z.E = C.OB: point(-math.pi/180*50) +L.AB = line : new (z.A,z.B) +L.CD = line : new (z.C,z.D) +z.G = intersection (L.AB,L.CD) +L.GE = line : new (z.G,z.E) +z.F,_ = intersection (L.GE,C.OB) +T.CDE = triangle: new (z.C,z.D,z.E) +T.BFD = triangle: new (z.B,z.F,z.D) +z.w = T.CDE.circumcenter +z.x = T.BFD.circumcenter +L.GB = line : new (z.G,z.B) +L.GE = line : new (z.G,z.E) +L.GD = line : new (z.G,z.D) +C.xB = circle : new (z.x,z.B) +C.xF = circle : new (z.x,z.F) +C.xD = circle : new (z.x,z.D) +z.Ap = intersection (L.GB,C.xB) +z.Ep,_ = intersection (L.GE,C.xF) +z.Cp,_ = intersection (L.GD,C.xD) +\end{tkzelements} + +\hspace*{\fill} +\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} +\hspace*{\fill} +%\caption{Three chords} +% subsection three_chords (end) + +\subsection{Three tangents} % (fold) +\label{sub:three_tangents} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (-1 , 0) + z.C = point: new (4 , -1.5) + z.E = point: new (1 , -1) + z.F = point: new (1.5 , 2.5) + T.AEF = triangle : new (z.A,z.E,z.F) + T.CEF = triangle : new (z.C,z.E,z.F) + z.w = T.AEF.circumcenter + z.x = T.CEF.circumcenter + C.wE = circle : new (z.w,z.E) + C.xE = circle : new (z.x,z.E) + L.Aw = line : new (z.A,z.w) + L.Cx = line : new (z.C,z.x) + z.G = intersection (L.Aw,L.Cx) + L.TA = C.wE : tangent_at (z.A) + L.TC = C.xE : tangent_at (z.C) + z.I = intersection (L.TA,L.TC) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(w,E) + \tkzDrawCircles[cyan](x,E) + \tkzDrawCircles[red](G,A) + \tkzDrawLines(A,I C,I F,I) + \tkzDrawPoints(A,C,E,F) + \tkzLabelPoints[right](A) + \tkzLabelPoints[above right](E,F) + \tkzLabelPoints[below](C) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .75 +z.A = point: new (-1 , 0) +z.C = point: new (4 , -1.5) +z.E = point: new (1 , -1) +z.F = point: new (1.5 , 2.5) +T.AEF = triangle : new (z.A,z.E,z.F) +T.CEF = triangle : new (z.C,z.E,z.F) +z.w = T.AEF.circumcenter +z.x = T.CEF.circumcenter +C.wE = circle : new (z.w,z.E) +C.xE = circle : new (z.x,z.E) +L.Aw = line : new (z.A,z.w) +L.Cx = line : new (z.C,z.x) +z.G = intersection (L.Aw,L.Cx) +L.TA = C.wE : tangent_at (z.A) +L.TC = C.xE : tangent_at (z.C) +z.I = intersection (L.TA,L.TC) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(w,E) +\tkzDrawCircles[cyan](x,E) +\tkzDrawCircles[red](G,A) +\tkzDrawLines(A,I C,I F,I) +\tkzDrawPoints(A,C,E,F) +\tkzLabelPoints[right](A) +\tkzLabelPoints[above right](E,F) +\tkzLabelPoints[below](C) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Three tangents} +% subsection three_tangents (end) + +\subsection{Midarc} % (fold) +\label{sub:midarc} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (-1,0) + z.B = point: new (2,4) + C.AB = circle: new (z.A,z.B) + z.C = z.A: rotation (math.pi/3,z.B) + z.D = C.AB: midarc (z.B,z.C) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(A,B,C) + \tkzDrawCircles(A,B) + \tkzDrawPoints(A,...,D) + \tkzLabelPoints(A,...,D) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .5 +z.A = point: new (-1,0) +z.B = point: new (2,4) +C.AB = circle: new (z.A,z.B) +z.C = z.A: rotation (math.pi/3,z.B) +z.D = C.AB: midarc (z.B,z.C) +\end{tkzelements} + +\hspace*{\fill}\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPoints(A,B,C) +\tkzDrawCircles(A,B) +\tkzDrawPoints(A,...,D) +\tkzLabelPoints(A,...,D) +\end{tikzpicture}\hspace*{\fill} +%\caption{Midarc} +% subsection midarc (end) + +\subsection{Lemoine Line without macro} % (fold) +\label{sub:lemoine_line_without_macro} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = 1.6 + z.A = point: new (1,0) + z.B = point: new (5,2) + z.C = point: new (1.2,2) + T = triangle: new(z.A,z.B,z.C) + z.O = T.circumcenter + L.AB = line: new (z.A,z.B) + L.AC = line: new (z.A,z.C) + L.BC = line: new (z.B,z.C) + C.OA = circle: new (z.O,z.A) + z.Ar,z.Al = get_points (C.OA: tangent_at (z.A)) + z.Br,z.Bl = get_points (C.OA: tangent_at (z.B)) + z.Cr,z.Cl = get_points (C.OA: tangent_at (z.C)) + L.tA = line: new (z.Ar,z.Al) + L.tB = line: new (z.Br,z.Bl) + L.tC = line: new (z.Cr,z.Cl) + z.P = intersection (L.tA,L.BC) + z.Q = intersection (L.tB,L.AC) + z.R = intersection (L.tC,L.AB) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon[teal](A,B,C) + \tkzDrawCircle(O,A) + \tkzDrawPoints(A,B,C,P,Q,R) + \tkzLabelPoints(A,B,C,P,Q,R) + \tkzDrawLine[blue](Q,R) + \tkzDrawLines[red](Ar,Al Br,Q Cr,Cl) + \tkzDrawSegments(A,R C,P C,Q) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = 0.75 +z.A = point: new (1,0) +z.B = point: new (5,2) +z.C = point: new (1.2,2) +T = triangle: new(z.A,z.B,z.C) +z.O = T.circumcenter +L.AB = line: new (z.A,z.B) +L.AC = line: new (z.A,z.C) +L.BC = line: new (z.B,z.C) +C.OA = circle: new (z.O,z.A) +z.Ar,z.Al = get_points (C.OA: tangent_at (z.A)) +z.Br,z.Bl = get_points (C.OA: tangent_at (z.B)) +z.Cr,z.Cl = get_points (C.OA: tangent_at (z.C)) +L.tA = line: new (z.Ar,z.Al) +L.tB = line: new (z.Br,z.Bl) +L.tC = line: new (z.Cr,z.Cl) +z.P = intersection (L.tA,L.BC) +z.Q = intersection (L.tB,L.AC) +z.R = intersection (L.tC,L.AB) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygon[teal](A,B,C) +\tkzDrawCircle(O,A) +\tkzDrawPoints(A,B,C,P,Q,R) +\tkzLabelPoints(A,B,C,P,Q,R) +\tkzDrawLine[blue](Q,R) +\tkzDrawLines[red](Ar,Al Br,Q Cr,Cl) +\tkzDrawSegments(A,R C,P C,Q) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Lemoine Line without macro} +% subsection lemoine_line_without_macro (end) + +\subsection{First Lemoine circle} % (fold) +\label{sub:first_lemoine_circle} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.A = point: new (1,1) + z.B = point: new (5,1) + z.C = point: new (2,3) + T = triangle: new (z.A,z.B,z.C) + z.O = T.circumcenter + z.o,z.w = get_points (T : first_lemoine_circle ()) + z.L = T : lemoine_point () +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygons(A,B,C) + \tkzDrawPoints(A,B,C,o,w,O,L) + \tkzLabelPoints(A,B,C,o,w,O,L) + \tkzDrawCircles(o,w O,A) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.A = point: new (1,1) +z.B = point: new (5,1) +z.C = point: new (2,3) +T = triangle: new (z.A,z.B,z.C) +z.O = T.circumcenter +z.o,z.w = get_points (T : first_lemoine_circle ()) +z.L = T : lemoine_point () +\end{tkzelements} + + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygons(A,B,C) +\tkzDrawPoints(A,B,C,o,w,O,L) +\tkzLabelPoints(A,B,C,o,w,O,L) +\tkzDrawCircles(o,w O,A) +\end{tikzpicture} +\hspace*{\fill} +%\caption{First Lemoine circle} +% subsection first_lemoine_circle (end) + +\subsection{First and second Lemoine circles} % (fold) +\label{sub:first_and_second_lemoine_circles} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = 2 + z.a = point: new (0,0) + z.b = point: new (5,0) + z.c = point: new (2,3) + T = triangle: new (z.a,z.b,z.c) + z.O = T.circumcenter + z.o,z.p = get_points (T : first_lemoine_circle ()) + 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.L,z.x = get_points (T : second_lemoine_circle ()) + C.first_lemoine = circle : new (z.o,z.p) + z.y1,z.y2 = intersection (L.ab,C.first_lemoine) + z.y5,z.y6 = intersection (L.bc,C.first_lemoine) + z.y3,z.y4 = intersection (L.ac,C.first_lemoine) + C.second_lemoine = circle : new (z.L,z.x) + z.x1,z.x2 = intersection (L.ab,C.second_lemoine) + z.x3,z.x4 = intersection (L.bc,C.second_lemoine) + z.x5,z.x6 = intersection (L.ac,C.second_lemoine) + L.y1y6 = line : new (z.y1,z.y6) + L.y4y5 = line : new (z.y4,z.y5) + L.y2y3 = line : new (z.y2,z.y3) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygons(a,b,c y1,y2,y3,y4,y5,y6) + \tkzDrawPoints(x1,x2,x3,x4,x5,x6,L) + \tkzDrawPoints(a,b,c,o,O,y1,y2,y3,y4,y5,y6) + \tkzLabelPoints[below right](a,b,c,o,O,y1,y2,y3,y4,y5,y6) + \tkzLabelPoints[below left](x1,x2,x3,x4,x5,x6) + \tkzLabelPoints[above](L) + \tkzDrawCircles(L,x o,p O,a) + \tkzDrawSegments(L,O x1,x4 x2,x5 x3,x6) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = 2 +z.a = point: new (0,0) +z.b = point: new (5,0) +z.c = point: new (2,3) +T = triangle: new (z.a,z.b,z.c) +z.O = T.circumcenter +z.o,z.p = get_points (T : first_lemoine_circle ()) +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.L,z.x = get_points (T : second_lemoine_circle ()) +C.first_lemoine = circle : new (z.o,z.p) +z.y1,z.y2 = intersection (L.ab,C.first_lemoine) +z.y5,z.y6 = intersection (L.bc,C.first_lemoine) +z.y3,z.y4 = intersection (L.ac,C.first_lemoine) +C.second_lemoine = circle : new (z.L,z.x) +z.x1,z.x2 = intersection (L.ab,C.second_lemoine) +z.x3,z.x4 = intersection (L.bc,C.second_lemoine) +z.x5,z.x6 = intersection (L.ac,C.second_lemoine) +L.y1y6 = line : new (z.y1,z.y6) +L.y4y5 = line : new (z.y4,z.y5) +L.y2y3 = line : new (z.y2,z.y3) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygons(a,b,c y1,y2,y3,y4,y5,y6) +\tkzDrawPoints(x1,x2,x3,x4,x5,x6,L) +\tkzDrawPoints(a,b,c,o,O,y1,y2,y3,y4,y5,y6) +\tkzLabelPoints[below right](a,b,c,o,O,y1,y2,y3,y4,y5,y6) +\tkzLabelPoints[below left](x1,x2,x3,x4,x5,x6) +\tkzLabelPoints[above](L) +\tkzDrawCircles(L,x o,p O,a) +\tkzDrawSegments(L,O x1,x4 x2,x5 x3,x6) +\end{tikzpicture} +\hspace*{\fill} +%\caption{First and second Lemoine circles} +% subsection first_and_second_lemoine_circles (end) + +\subsection{Inversion} % (fold) +\label{sub:inversion} + +\begin{tkzexample}[latex=0cm,small,code only] + \begin{tkzelements} + z.A = point: new (-1,0) + z.B = point: new (2,2) + z.C = point: new (2,4) + z.E = point: new (1,6) + C.AC = circle: new (z.A,z.C) + L.Tt1,L.Tt2 = C.AC: tangent_from (z.E) + z.t1 = L.Tt1.pb + z.t2 = L.Tt2.pb + L.AE = line: new (z.A,z.E) + z.H = L.AE : projection (z.t1) + z.Bp, + z.Ep, + z.Cp = C.AC: set_inversion ( z.B, z.E, z.C ) +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(A,B,C) + \tkzDrawCircles(A,C A,B) + \tkzDrawLines(A,B' E,t1 E,t2 t1,t2 A,E) + \tkzDrawPoints(A,B,C,E,t1,t2,H,B',E') + \tkzLabelPoints(A,B,C,E,t1,t2,B',E') + \tkzLabelPoints[above](C') +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +scale = .75 +z.A = point: new (-1,0) +z.B = point: new (2,2) +z.C = point: new (2,4) +z.E = point: new (1,6) +C.AC = circle: new (z.A,z.C) +L.Tt1,L.Tt2 = C.AC: tangent_from (z.E) +z.t1 = L.Tt1.pb +z.t2 = L.Tt2.pb +L.AE = line: new (z.A,z.E) +z.H = L.AE : projection (z.t1) +z.Bp, +z.Ep, +z.Cp = C.AC: set_inversion ( z.B, z.E, z.C ) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPoints(A,B,C) + \tkzDrawCircles(A,C A,B) + \tkzDrawLines(A,B' E,t1 E,t2 t1,t2 A,E) + \tkzDrawPoints(A,B,C,E,t1,t2,H,B',E') + \tkzLabelPoints(A,B,C,E,t1,t2,B',E') + \tkzLabelPoints[above](C') +\end{tikzpicture} +\hspace*{\fill} +%\caption{Inversion} +% subsection inversion (end) + +\subsection{Gergonne point} % (fold) +\label{sub:gergonne_point} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.a = point: new(1,0) + z.b = point: new(6,2) + z.c = point: new(2,5) + T = triangle : new (z.a,z.b,z.c) + z.g = T : gergonne_point () + z.i = T.incenter + z.ta,z.tb,z.tc = get_points (T : intouch ()) +end{elements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygons(a,b,c) + \tkzDrawPoints(a,b,c,g) + \tkzLabelPoints(a,b,c) + \tkzDrawSegments (a,ta b,tb c,tc) + \tkzDrawCircle(i,ta) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.a = point: new(1,0) +z.b = point: new(6,2) +z.c = point: new(2,5) +T = triangle : new (z.a,z.b,z.c) +z.g = T : gergonne_point () +z.i = T.incenter +z.ta,z.tb,z.tc = get_points (T : intouch ()) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygons(a,b,c) +\tkzDrawPoints(a,b,c,g) +\tkzLabelPoints(a,b,c) +\tkzDrawSegments (a,ta b,tb c,tc) +\tkzDrawCircle(i,ta) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Gergonne point} +% subsection gergonne_point (end) + +\subsection{Antiparallel through Lemoine point} % (fold) +\label{sub:antiparallel_through_lemoine_point} + +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + z.a = point: new (0,0) + z.b = point: new (5,0) + z.c = point: new (1,4) + T = triangle: new (z.a,z.b,z.c) + z.L = T : lemoine_point () + L.anti = T : antiparallel (z.L,0) + z.x_0,z.x_1 = get_points (L.anti) + L.anti = T : antiparallel (z.L,1) + z.y_0,z.y_1 = get_points (L.anti) + L.anti = T : antiparallel (z.L,2) + z.z_0,z.z_1 = get_points (L.anti) +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygons(a,b,c) + \tkzDrawPoints(a,b,c,L,x_0,x_1,y_0,y_1,z_0,z_1) + \tkzLabelPoints(a,b) + \tkzLabelPoints[above](L,c) + \tkzDrawSegments(x_0,x_1 y_0,y_1 z_0,z_1) + \tkzDrawCircle(L,x_0) +\end{tikzpicture} +\end{tkzexample} + +\begin{tkzelements} +z.a = point: new (0,0) +z.b = point: new (5,0) +z.c = point: new (1,4) +T = triangle: new (z.a,z.b,z.c) +z.L = T : lemoine_point () +L.anti = T : antiparallel (z.L,0) +z.x_0,z.x_1 = get_points (L.anti) +L.anti = T : antiparallel (z.L,1) +z.y_0,z.y_1 = get_points (L.anti) +L.anti = T : antiparallel (z.L,2) +z.z_0,z.z_1 = get_points (L.anti) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawPolygons(a,b,c) +\tkzDrawPoints(a,b,c,L,x_0,x_1,y_0,y_1,z_0,z_1) +\tkzLabelPoints(a,b) +\tkzLabelPoints[above](L,c) +\tkzDrawSegments(x_0,x_1 y_0,y_1 z_0,z_1) +\tkzDrawCircle(L,x_0) +\end{tikzpicture} +\hspace*{\fill} +%\caption{Antiparallels} +% subsection antiparallel_through_lemoine_point (end)
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-howtouse.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-howtouse.tex new file mode 100644 index 0000000000..0b94576633 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-howtouse.tex @@ -0,0 +1,193 @@ +\newpage +\section{How to use} % (fold) +\label{sec:how_to_use} + +You need to load either \TIKZ{} or \pkg{tkz-euclide} if you want to use these packages to get your plots, then you need to load \pkg{tkz-elements}. + +Loading \pkg{tkz-elements} allows you to use the \env{elements} environment. However, you can use the macro \tkzcname{directlua} or the \env{luacode} environment (the package \pkg{luacode} is loaded automatically). + + +\subsection{Environment elements} % (fold) +\label{sub:environment_elements} + +You must first create an environment \tkzNameEnv{tkzelements}, then in this environment you create the fixed points of your figure. (For the moment, you place the environment \env{elements} before the environment \env{tikzpicture} but it is possible to place it inside the latter.) + +In the following example, three fixed points are used (lines 8, 9 and 10), the first object \tkzNameObj{point} $A$ is created by + +|z.A = point: new (2 , 4)|. + +Then we create a \tkzNameObj{triangle} (line 11) + +|T.ABC = triangle: new (z.A,z.B,z.C)| + +Once the triangle has been created, you can either use its attributes or a method associated with the triangle object. In all cases, the result is either a number or a new object. + +In order to obtain the circle inscribed in this triangle, we use a method of the \tkzname{triangle}. We obtain a new object, a circle, which I call |C.Ii|. A circle is defined by its center and a point through which it passes. $I$ is the center and $i$ is the projection of this center on the side opposed to the first point of the triangle. + +There are several ways of obtaining these two points. As in the example, |get_points| is a function that extracts the points from the object given as an argument. You can also use the circle attributes: |z.I = C.Ii.center| and |z.i = CIi.through|. The first method is obviously simpler, but less explicit. Another possibility would be to obtain the center as an attribute of the triangle |z.I = T.ABC.incircle| and then project this center onto one of the sides, for example |z.i = T.ABC.bc : projection (z.I)|. An explanation is in order: |T.ABC.bc | is the straight line defined by the last two points of the triangle (see triangle attributes \ref{sec:classe_triangle}). + +Then we look for the circumscribed circle, which is obtained using a method of the triangle object. We define the circumscribed \tkzNameObj{circle} named |C.WA|. + +|C.WA = T.ABC : circum_circle ()| (line 16) + +| z.W,_ = get_points (C.WA)| is used to get the center but possible is + + |z.W = T.ABC.circumcircle| + +The south pole of the circle with center $W$ passing through $A$ is given by an attribute of the object \tkzNameObj{circle}. + +We finally look for the intersection of two lines. + +Line 17 an object line is created. Line 18 I name a line object already created (it's a triangle attribute). + +All points are defined and stored in the |z| table. The macro \tkzcname{tkzGetNodes} retrieves the keys and associated values from this table and creates the nodes to be used by \TIKZ\ or \pkg{tkz-euclide}. + +\begin{tkzexample}[small,code only,num] +% !TEX TS-program = lualatex +\documentclass{article} +\usepackage{tkz-euclide} +\usepackage{tkz-elements} +\begin{document} + +\begin{tkzelements} + z.A = point: new (2 , 4) + z.B = point: new (0 , 0) + z.C = point: new (8 , 0) + T.ABC = triangle: new (z.A,z.B,z.C) + C.Ii = T.ABC: in_circle () + z.I,z.i = get_points (C.Ii) + C.WA = T.ABC : circum_circle () + z.W,_ = get_points (C.WA) + z.O = C.WA.south + L.AO = line: new (z.A,z.O) + L.BC = T.ABC.bc + z.I_A = intersection (L.AO,L.BC) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(W,A I,i) + \tkzDrawArc(O,C)(B) + \tkzDrawPolygon(A,B,C) + \tkzDrawSegments[new](A,O B,O C,O) + \tkzDrawLine(B,I) + \tkzDrawPoints(A,B,C,I,I_A,W,O) + \tkzFillAngles[green!20,opacity=.3](A,O,B A,C,B) + \tkzFillAngles[teal!20,opacity=.3](O,B,C B,C,O B,A,O O,A,C) + \tkzLabelPoints(I,I_A,W,B,C) + \tkzLabelPoints[above](A) +\end{tikzpicture} +\end{document} +\end{tkzexample} + +\begin{tkzelements} + scale =.75 + z.A = point: new (2 , 4) + z.B = point: new (0 , 0) + z.C = point: new (8 , 0) + T.ABC = triangle: new (z.A,z.B,z.C) + C.Ii = T.ABC: in_circle () + z.I,z.i = get_points (C.Ii) + C.WA = T.ABC : circum_circle () + z.W,_ = get_points (C.WA) + z.O = C.WA.south + L.AO = line: new (z.A,z.O) + L.BC = T.ABC.bc + z.I_A = intersection (L.AO,L.BC) +\end{tkzelements} + +\hspace*{\fill} +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(W,A I,i) +\tkzDrawArc(O,C)(B) +\tkzDrawPolygon(A,B,C) +\tkzDrawSegments[new](A,O B,O C,O) +\tkzDrawLine(B,I) +\tkzDrawPoints(A,B,C,I,I_A,W,O) +\tkzFillAngles[green!20,opacity=.3](A,O,B A,C,B) +\tkzFillAngles[teal!20,opacity=.3](O,B,C B,C,O B,A,O O,A,C) +\tkzLabelPoints(I,I_A,W,B,C,O) +\tkzLabelPoints[above](A) +\end{tikzpicture} +\hspace*{\fill} +% subsection environment_elements (end) + +\subsection{Fom Lua to tkz-euclide or TikZ} % (fold) +\label{sub:fom_lua_to_tkz_euclide_or_tikz} + +\subsubsection{Points transfer} % (fold) +\label{ssub:points_transfer} +We use an environment \tkzname{elements} outside an environment \tkzname{tikzpicture} which allows us to carry out all the necessary calculations, then we launch the macro \tkzcname{tkzGetNodes} which transforms the affixes of the table \tkzname{z} into a list of \tkzname{Nodes}. It only remains to draw. + +Currently the drawing program is either \TIKZ\ or \pkg{tkz-euclide}. You have the possibility to use another package to trace but for that you have to create a macro similar to \tkzcname{tkzGetNodes}. Of course, this package must be able to store the points as does \TIKZ\ or \pkg{tkz-euclide}. + +\vspace*{1em} + +\begin{tkzexample}[latex=0cm,small,code only] +\def\tkzGetNodes{\directlua{% + for K,V in pairs(z) do + local KS,n,sd,ft + KS = tostring(K) + n = string.len(KS) + if n >1 then + _,_,ft, sd = string.find( KS , "(.+)(.)" ) + if sd == "p" then K=ft.."'" end + end + tex.print("\\coordinate ("..K..") at ("..V.re..","..V.im..") ;\\\\") +end} +} +\end{tkzexample} + +The environment \tkzNameEnv{elements} allows to use the underscore |_| and the macro \tkzcname{tkzGetNodes} allows to obtain names of nodes containing \tkzname{prime}. (see the next example) + +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[latex=0cm,small,code only] +\begin{tkzelements} + scale = 1.2 + z.o = point: new (0,0) + z.a_1 = point: new (2,1) + z.a_2 = point: new (1,2) + z.ap = z.a_1 + z.a_2 +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawSegments(o,a_1 o,a_2 o,a') + \tkzDrawSegments[red](a_1,a' a_2,a') + \tkzDrawPoints(a_1,a_2,a',o) + \tkzLabelPoints(o,a_1,a_2,a') +\end{tikzpicture} +\end{tkzexample}% +\end{minipage}% +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} +scale = 1.2 +z.o = point: new (0,0) +z.a_1 = point: new (2,1) +z.a_2 = point: new (1,2) +z.ap = z.a_1 + z.a_2 +\end{tkzelements} +\begin{tikzpicture} +\tkzGetNodes + \tkzDrawSegments(o,a_1 o,a_2 o,a') + \tkzDrawSegments[red](a_1,a' a_2,a') + \tkzDrawPoints(a_1,a_2,a',o) + \tkzLabelPoints(o,a_1,a_2,a') +\end{tikzpicture} +\end{minipage}% + +% subsection fom_lua_to_tkz_euclide_or_tikz (end) +\subsubsection{Other transfers} % (fold) +\label{ssub:other_transfers} + +Sometimes it's useful to transfer angle or length measurements. For this purpose, I have created the function (see \ref{ssub:transfer_from_lua_to_tex}) +\Igfct{package}{set\_lua\_to\_tex (list)} + +% subsubsection other_transfers (end) +% subsubsection points_transfer (end) + +% section how_to_use (end) + + + + +\endinput
\ No newline at end of file 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 new file mode 100644 index 0000000000..db290e3447 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-intersection.tex @@ -0,0 +1,315 @@ +\newpage +\section{Intersections} % (fold) +\label{sec:intersections} + +It's an essential tool. For the moment, the classes concerned are lines, circles and ellipses, with the following combinations: line-line; line-circle; circle-circle and line-ellipse. The argument is a pair of objects, in any order. +Results consist of one or two values, either points, boolean \tkzname{false} or underscore |_|. + +\subsection{Line-line} % (fold) +\label{sub:line_line} + +The result is of the form: |point| or |false|. + +\begin{minipage}{0.6\textwidth} +\begin{tkzexample}[small,code only] +\begin{tkzelements} + z.A = point : new (1,-1) + z.B = point : new (4,1) + z.C = point : new (2,1) + z.D = point : new (4,-2) + z.I = point : new (0,0) + L.AB = line : new (z.A,z.B) + L.CD = line : new (z.C,z.D) + x = intersection (L.AB,L.CD) + if x == false then + tex.print('error') + else + z.I = x + end +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawSegments(A,B C,D) + \tkzDrawPoints(A,B,C,D,I) + \tkzLabelPoints(A,B,C,D,I) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.4\textwidth} +\begin{tkzelements} +z.A = point : new (1,-1) +z.B = point : new (4,1) +z.C = point : new (2,1) +z.D = point : new (4,-2) + z.I = point : new (0,0) +L.AB = line : new (z.A,z.B) +L.CD = line : new (z.C,z.D) +x = intersection (L.AB,L.CD) +if x == false then +tex.print('error') +else +z.I = x +end +\end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawSegments(A,B C,D) + \tkzDrawPoints(A,B,C,D,I) + \tkzLabelPoints(A,B,C,D,I) +\end{tikzpicture} +\end{minipage} + +Other examples: \ref{ssub:altshiller}, \ref{ssub:lemoine}, \ref{sub:alternate}, \ref{sub:environment_elements} +% subsection line_line (end) + +\newpage +\subsection{Line-circle} % (fold) +\label{sub:line_circle} +The result is of the form : |point,point| or |false,false|. If the line is tangent to the circle, then the two points are identical. You can ignore one of the points by using the underscore: |_,point| or |point,_|. When the intersection yields two solutions, the order of the points is determined by the argument of |(z.p - z.c)| with |c| center of the circle and |p| point of intersection. The first solution corresponds to the smallest argument (arguments are between 0 and $2\pi$). + +\begin{minipage}{0.6\textwidth} +\begin{tkzexample}[small,code only] +\begin{tkzelements} + z.A = point : new (1,-1) + z.B = point : new (1,2) + L.AB = line : new (z.A,z.B) + z.O = point : new (2,1) + z.D = point : new (3,1) + z.E = point : new (3,2) + L.AE = line : new (z.A,z.E) + C.OD = circle : new (z.O,z.D) + z.I,_ = intersection (L.AB,C.OD) + _,z.K = intersection (C.OD,L.AE) +\end{tkzelements} + +\begin{tikzpicture} +\tkzGetNodes + \tkzDrawLines(A,B A,E) + \tkzDrawCircle(O,D) + \tkzDrawPoints(A,B,O,D,I,K) + \tkzLabelPoints[left](A,B,O,D,I,K) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.4\textwidth} +\begin{tkzelements} + scale = 2 +z.A = point : new (1,-1) +z.B = point : new (1,2) +L.AB = line : new (z.A,z.B) +z.O = point : new (2,1) +z.D = point : new (3,1) +z.E = point : new (3,2) +L.AE = line : new (z.A,z.E) +C.OD = circle : new (z.O,z.D) +z.I,_ = intersection (L.AB,C.OD) +_,z.K = intersection (C.OD,L.AE) +\end{tkzelements} + +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawLines(A,B A,E) +\tkzDrawCircle(O,D) +\tkzDrawPoints(A,B,O,D,I,K) +\tkzLabelPoints[left](A,B,O,D,I,K) +\end{tikzpicture} +\end{minipage} + +Other examples: \ref{ssub:altshiller} +% subsection line_circle (end) + +\newpage +\subsection{Circle-circle} % (fold) +\label{sub:circle_circle} + +The result is of the form : |point,point| or |false,false|. If the circles are tangent, then the two points are identical. You can ignore one of the points by using the underscore: |_ , point| or |point , _|. As for the intersection of a line and a circle, consider the argument of |z.p-z.c| with |c| center of the first circle and |p| point of intersection. The first solution corresponds to the smallest argument (arguments are between 0 and $2\pi$). + +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[small,code only] +\begin{tkzelements} + z.A = point : new (1,1) + z.B = point : new (2,2) + z.C = point : new (3,3) + z.D = point : new (3,0) + C.AB = circle : new (z.A,z.B) + C.CB = circle : new (z.C,z.B) + z.I,_ = intersection (C.AB,C.CB) + C.DC = circle : new (z.D,z.C) + z.J,z.K = intersection (C.DC,C.CB) +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircles(A,B C,B D,C) + \tkzDrawPoints(A,I,C,D,J,K) + \tkzLabelPoints(A,I,C,D,J,K) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} +z.A = point : new (1,1) +z.B = point : new (2,2) +z.C = point : new (3,3) +z.D = point : new (3,0) +C.AB = circle : new (z.A,z.B) +C.CB = circle : new (z.C,z.B) +z.I,_ = intersection (C.AB,C.CB) +C.DC = circle : new (z.D,z.C) + z.J,z.K = intersection (C.DC,C.CB) +\end{tkzelements} + +\begin{tikzpicture} +\tkzGetNodes +\tkzDrawCircles(A,B C,B D,C) +\tkzDrawPoints(A,I,C,D,J,K) +\tkzLabelPoints(A,I,C,D,J,K) +\end{tikzpicture} +\end{minipage} + +Other examples: \ref{ssub:altshiller}, \ref{sub:the_figure_pappus_circle} +% subsection circle_circle (end) + +\newpage +\subsection{Line-ellipse} % (fold) +\label{sub:line_ellipse} +The following example is complex, but it shows the possibilities of Lua. +The designation of intersection points is a little more complicated than the previous one, as the argument characterizing the major axis must be taken into account. The principle is the same, but this argument must be subtracted. In concrete terms, you need to consider the slopes of the lines formed by the center of the ellipse and the points of intersection, and the slope of the major axis. + +\begin{minipage}{0.5\textwidth} +\begin{tkzexample}[code only,small] +\begin{tkzelements} + scale = .5 + z.a = point: new (5 , 2) + z.b = point: new (-4 , 0) + z.m = point: new (2 , 4) + z.n = point: new (4 , 4) + L.ab = line : new (z.a,z.b) + L.mn = line : new (z.m,z.n) + z.c = L.ab. mid + 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 + a = E.Rx + b = E.Ry + ang = math.deg(E.slope) + set_lua_to_tex {'a','b','ang'} +\end{tkzelements} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines[red](a,b u,v) % p,s p,t + \tkzDrawPoints(a,b,c,e,u,v) % + \tkzLabelPoints(a,b,c,u,v) + \tkzDrawEllipse[teal](c,\a,\b,\ang) + \tkzDrawSegments(c,u c,v) + \tkzFillAngles[green!30,opacity=.4](e,c,v) + \tkzFillAngles[green!80,opacity=.4](e,c,u) +\end{tikzpicture} +\end{tkzexample} +\end{minipage} +\begin{minipage}{0.5\textwidth} +\begin{tkzelements} + scale =.5 + z.a = point: new (5 , 2) + z.b = point: new (-4 , 0) + z.m = point: new (2 , 4) + z.n = point: new (4 , 4) + L.ab = line : new (z.a,z.b) + L.mn = line : new (z.m,z.n) + z.c = L.ab. mid + 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 + a = E.Rx + b = E.Ry + ang = math.deg(E.slope) + set_lua_to_tex {'a','b','ang'} +\end{tkzelements} +\hspace*{\fill} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawLines[red](a,b u,v) % p,s p,t + \tkzDrawPoints(a,b,c,e,u,v) % + \tkzLabelPoints(a,b,c,u,v) + \tkzDrawEllipse[teal](c,\a,\b,\ang) + \tkzFillAngles[green!30,opacity=.4](e,c,v) + \tkzFillAngles[green!80,opacity=.4](e,c,u) + \tkzDrawSegments(c,u c,v) +\end{tikzpicture} +\hspace*{\fill} +\end{minipage} + +Other examples: \ref{ssub:function_tkzname_ellipse__foci}, \ref{sub:hexagram} +%\caption{Intersection line and ellipse} + +% \begin{tkzexample}[code only,small] +% \begin{tkzelements} +% scale = .5 +% z.a = point: new (5 , 2) +% z.b = point: new (-4 , 0) +% z.m = point: new (2 , -3) +% z.n = point: new (4 , -3) +% L.ab = line : new (z.a,z.b) +% L.mn = line : new (z.m,z.n) +% z.c = L.ab. mid +% 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 +% a = E.Rx +% b = E.Ry +% ang = math.deg(E.slope) +% set_lua_to_tex {'a','b','ang'} +% \end{tkzelements} +% +% \begin{tikzpicture} +% \tkzGetNodes +% \tkzDrawLines[red](a,b u,v) % p,s p,t +% \tkzDrawPoints(a,b,c,e,u,v) % +% \tkzLabelPoints(a,b,c,u,v) +% \tkzDrawEllipse[teal](c,\a,\b,\ang) +% \tkzDrawSegments(c,u c,v) +% \tkzFillAngles[green!30,opacity=.4,size=1.2](e,c,v) +% \tkzFillAngles[green!80,opacity=.4](e,c,u) +% \end{tikzpicture} +% \end{tkzexample} +% +% \begin{tkzelements} +% scale=.5 +% z.a = point: new (5 , 2) +% z.b = point: new (-4 , 0) +% z.m = point: new (2 , -3) +% z.n = point: new (4 , -3) +% L.ab = line : new (z.a,z.b) +% L.mn = line : new (z.m,z.n) +% z.c = L.ab. mid +% 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 +% a = E.Rx +% b = E.Ry +% ang = math.deg(E.slope) +% set_lua_to_tex {'a','b','ang'} +% \end{tkzelements} +% +% +% \hspace*{\fill} +% \begin{tikzpicture} +% \tkzGetNodes +% \tkzDrawLines[red](a,b u,v) % p,s p,t +% \tkzDrawPoints(a,b,c,e,u,v) % +% \tkzLabelPoints(a,b,c,u,v) +% \tkzDrawEllipse[teal](c,\a,\b,\ang) +% \tkzDrawSegments(c,u c,v) +% \tkzFillAngles[green!30,opacity=.4,size=1.2](e,c,v) +% \tkzFillAngles[green!80,opacity=.4](e,c,u) +% \end{tikzpicture} +% \hspace*{\fill} +%\caption{Intersection line and ellipse} + +% subsection line_ellipse (end) +% section intersections (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 new file mode 100644 index 0000000000..6fa4bc6166 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-main.tex @@ -0,0 +1,198 @@ +% !TEX TS-program = lualatex +% encoding : utf8 +% Documentation of tkz-elements v1.00b +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. +\PassOptionsToPackage{unicode}{hyperref} + +\documentclass[DIV = 14, + fontsize = 10, + index = totoc, + twoside, + cadre, + headings = small + ]{tkz-doc} +\gdef\tkznameofpack{tkz-elements} +\gdef\tkzversionofpack{1.00b} +\gdef\tkzdateofpack{\today} +\gdef\tkznameofdoc{tkz-elements.pdf} +\gdef\tkzversionofdoc{1.00b} +\gdef\tkzdateofdoc{\today} +\gdef\tkzauthorofpack{Alain Matthes} +\gdef\tkzadressofauthor{} +\gdef\tkznamecollection{AlterMundus} +\gdef\tkzurlauthor{http://altermundus.fr} +\gdef\tkzengine{lualatex} +\gdef\tkzurlauthorcom{http://altermundus.fr} +\nameoffile{\tkznameofpack} +% -- Packages --------------------------------------------------- +\usepackage[dvipsnames,svgnames]{xcolor} +\usepackage{calc} +\usepackage{tkz-base} +\usepackage{tkz-euclide} +\usepackage{tkz-elements} +\usepackage{pgfornament} +\usetikzlibrary{backgrounds} +\usepackage[colorlinks,pdfencoding=auto, psdextra]{hyperref} +\hypersetup{ + linkcolor=Gray, + citecolor=Green, + filecolor=Mulberry, + urlcolor=NavyBlue, + menucolor=Gray, + runcolor=Mulberry, + linkbordercolor=Gray, + citebordercolor=Green, + filebordercolor=Mulberry, + urlbordercolor=NavyBlue, + menubordercolor=Gray, + runbordercolor=Mulberry, + pdfsubject={Euclidean Geometry}, + pdfauthor={\tkzauthorofpack}, + pdftitle={\tkznameofpack}, + pdfcreator={\tkzengine} +} +\usepackage{tkzexample} +\usepackage{fontspec} +\setmainfont{texgyrepagella}[ + Extension = .otf, + UprightFont = *-regular , + ItalicFont = *-italic , + BoldFont = *-bold , + BoldItalicFont = *-bolditalic +] +\setsansfont{texgyreheros}[ + Extension = .otf, + UprightFont = *-regular , + ItalicFont = *-italic , + BoldFont = *-bold , + BoldItalicFont = *-bolditalic , +] + +\setmonofont{lmmono10-regular.otf}[ + Numbers={Lining,SlashedZero}, + ItalicFont=lmmonoslant10-regular.otf, + BoldFont=lmmonolt10-bold.otf, + BoldItalicFont=lmmonolt10-boldoblique.otf, +] +\newfontfamily\ttcondensed{lmmonoltcond10-regular.otf} +%% (La)TeX font-related declarations: +\linespread{1.05} % Pagella needs more space between lines +\usepackage[math-style=literal,bold-style=literal]{unicode-math} +\usepackage{fourier-otf} +\let\rmfamily\ttfamily +\usepackage{multicol,lscape} +\usepackage[english]{babel} +\usepackage[normalem]{ulem} +\usepackage{multirow,multido,booktabs,cellspace} +\usepackage{shortvrb,fancyvrb,bookmark} +\usepackage{makeidx} +%\usepackage{float} +\makeindex + +\makeatletter +\renewenvironment{theindex} + {\section*{\indexname}\begin{multicols}{2}% + \@mkboth{\MakeUppercase\indexname}% + {\MakeUppercase\indexname}% + \thispagestyle{plain}\parindent\z@ + \parskip\z@ \@plus .3\p@\relax + \columnseprule \z@ + \columnsep 35\p@ + \let\item\@idxitem} + {\end{multicols}} +\makeatother +\newcommand*{\tkzfname}[1]{\Amacro{#1}\textbf{\texttt{\textcolor{MidnightBlue}{% + #1}}}} + \newcommand*{\tkzmname}[1]{\Amacro{#1}\textbf{\texttt{\textcolor{MidnightBlue}{% +#1}}}} + \newcommand*{\tkzaname}[1]{\Amacro{#1}\textbf{\texttt{\textcolor{MidnightBlue}{% +#1}}}} +\def\langle{} \def\rangle{} +\renewcommand*{\IargName}[2]{\texttt{#2}\index{#1_2@\texttt{#1: argument(s)}!\texttt{#2}}} +\newcommand*{\Amacro}[1]{\index{#1_1@\texttt{#1}}} +\renewcommand*{\IoptName}[2]{\texttt{#2}\index{#1_3@\texttt{#1: attribute(s)}!\texttt{#2}}} +\newcommand*{\Iattr}[2]{\texttt{#2}\index{#1_3@\texttt{#1: attribute}!\texttt{#2}}} +\newcommand*{\Imeth}[2]{\texttt{#2}\index{#1_3@\texttt{#1: method}!\texttt{#2}}} +\newcommand*{\Igfct}[2]{\texttt{#2}\index{#1_3@\texttt{#1: function}!\texttt{#2}}} +\newcommand*{\Iclass}[2]{\texttt{#2}\index{#1_3@\texttt{#1: class}!\texttt{#2}}} +\newcommand*{\tkzNameObj}[1]{\tkzname{#1}\Iobj{#1}} +\newcommand*{\Iobj}[1]{\index{Object_1@\texttt{Object}!\texttt{#1}}} + +%<---------------------------------------------------------------------------> +% settings styles +\tkzSetUpColors[background=white,text=black] +\tkzSetUpCompass[color=orange, line width=.2pt,delta=10] +\tkzSetUpArc[color=gray,line width=.2pt] +\tkzSetUpPoint[size=2,color=teal] +\tkzSetUpLine[line width=.2pt,color=teal] +\tkzSetUpStyle[color=orange,line width=.2pt]{new} +\tikzset{every picture/.style={line width=.2pt}} +\tikzset{label angle style/.append style={color=teal,font=\footnotesize}} +\tikzset{label style/.append style={below,color=teal,font=\scriptsize}} +\tikzset{new/.style={color=orange,line width=.2pt}} +\def\tkzar{\hspace{1em}-->\hspace{1em}} + +\AtBeginDocument{\MakeShortVerb{\|}} % link to shortvrb +\begin{document} + +\parindent=0pt +\tkzTitleFrame{tkz-elements \tkzversionofpack\\Euclidean Geometry} +\clearpage + +\defoffile{\lefthand\ + This document brings together some notes about \tkzname{\tkznameofpack}, the first 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 Lua\LaTeX.\\ With \pkg{tkz-elements}, the definitions and calculations are only done with \pkg{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 \pkg{tkz-euclide} or \pkg{TikZ} which allows the drawings.\\ + I discovered Lua and object-oriented programming when I created this package, so it's highly probable that I've made a few mistakes. If you'd like to participate in the development of this package or give me advice on how to proceed, please contact me via my email. \\ This version \tkzversionofpack\ is a beta version.\\ +English is not my native language so there might be some errors. +} + +\presentation + +\vspace*{1cm} + +\lefthand\ Acknowledgements : I received much valuable advice, remarks, corrections from \\ \tkzimp{Nicolas Kisselhoff}, \tkzimp{David Carlisle}, \tkzimp{Roberto Giacomelli} and \tkzimp{Qrrbrbirlbel}. + +\vspace*{12pt} +\lefthand\ I would also like to thank \tkzimp{Eric Weisstein}, creator of +\href{http://mathworld.wolfram.com/about/author.html}{MathWorld}. + +\vspace*{12pt} +\lefthand\ You can find some examples on my site: +\href{http://altermundus.fr}{altermundus.fr}. \hspace{2cm} under construction! + +\vfill +Please report typos or any other comments to this documentation to: \href{mailto:al.ma@mac.com}{\textcolor{blue}{Alain Matthes}}. + +This file can be redistributed and/or modified under the terms of the \LaTeX{} +Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ archives. + +\clearpage +\tableofcontents + +\clearpage +\newpage + +\input{TKZdoc-elements-presentation.tex} +\input{TKZdoc-elements-convention.tex} +\input{TKZdoc-elements-howtouse.tex} +\input{TKZdoc-elements-classes.tex} +\input{TKZdoc-elements-classes-point.tex} +\input{TKZdoc-elements-classes-line.tex} +\input{TKZdoc-elements-classes-circle.tex} +\input{TKZdoc-elements-classes-triangle.tex} +\input{TKZdoc-elements-classes-ellipse.tex} +\input{TKZdoc-elements-classes-misc.tex} +\input{TKZdoc-elements-intersection.tex} +\input{TKZdoc-elements-examples.tex} + +\clearpage\newpage +\small\printindex +\end{document}
\ No newline at end of file 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 new file mode 100644 index 0000000000..d837d4a826 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-presentation.tex @@ -0,0 +1,167 @@ +\section{Presentation} + +I created \pkg{tkz-euclide} to give math teachers and students a tool to draw Euclidean geometry figures. This package was created as an interface based on \pkg{TikZ}, itself based on \TEX{}. The only problem encountered with this method is, in complicated cases, the lack of precision of the calculations made by \TEX{}. + +To remedy this lack of precision, I first introduced the package \pkg{fp}, then the package \pkg{xfp}. Lately, with the arrival of lua\LATEX{}, I have been able to add a \tkzname{Lua} option whose goal was to perform some calculations with \tkzname{Lua}. It is much easier to program mathematics with \tkzname{Lua} than with \TEX{} so having prepared \pkg{tkz-euclide}, by separating the first parts of definitions and calculations from the drawing part, the idea of carrying out the first parts with only \tkzname{Lua} was necessary. + +I had received some examples of programming with \tkzname{Lua} from Nicolas Kisselhoff and I took many of his ideas. + +The essential principles of figure construction with \tkzname{tkz-euclide} are kept: definition, calculations, tracings, labels as well as the step-by-step programmation, corresponding to a construction with a ruler and a compass. + +Then, I read an article by Roberto Giacomelli on object programming based on the \tkzname{Lua} and \TIKZ\ tools. This was my second source of inspiration. Not only could the programming be done step-by-step, but the introduction of objects allowed the link between the code and the geometry. The code becomes more readable, the code is more explicit and better structured but it is less concise. Finally, as the problem of precision disappeared, I came to appreciate more and more what I was getting with object programming. So I've tried to develop this programming as much as possible. + +In order to organize and maintain all the functions and methods, I chose to use classes of objects whose main ones are \tkzname{point}, \tkzname{line}, \tkzname{triangle}, \tkzname{circle} and \tkzname{ellipse}. + +\subsection{With Lua} % (fold) +\label{sub:with_lua} + +The purpose of tkz-elements is simply to calculate dimensions and define points. This is done in Lua. You can think of tkz-elements as a kernel that will be used either by tkz-euclide or by TikZ, see MetaPost. +Definitions and calculations are done inside the environment \tkzNameEnv{tkzelements}, this environment is based on \tkzNameEnv{luacode}. +To improve precision, if it's necessary to modify the scale of your figure, it's best to change the "scale" variable at the start of the code placed in environment \tkzNameEnv{tkzelements}. +Then we need to be able to transfer the coordinates of the points to a package that can use them, in this case tkz-euclide or TikZ. +% subsection with_lua (end) + +\subsection{The main process : from tkz-elements (lua) to tkz-euclide (TikZ) with Lua\LaTeX.} % (fold) +\label{sub:the_main_process} + + +When all the points necessary for the drawing are obtained, they must be transformed into \tkzname{nodes} so that \pkg{TikZ} or \pkg{tkz-euclide} can draw the figure. This is done through the macro \tkzcname{tkzGetNodes}. This macro browse all the elements of the table |z| using the key (in fact the name of the point) and retrieves the values associated with it, i.e. the coordinates of the point (node). + +A point $A$ is defined and stored in tkz-elements as follows: +|z.A| is an element of a table |z| which contains the coordinates of $A$ in the form of a complex number (very useful for calculations). Then a macro, \tkzcname{tkzGetNodes}, transforms all elements of table |z| into nodes usable by tkz-euclide or TikZ. For another package, you'll need to adapt \tkzcname{tkzGetNodes}. + +% subsection the_main_process (end) + +\newpage +\subsection{Complete example: Pappus circle} % (fold) +\label{sub:the_figure_pappus_circle} + +The figure: + +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (10 , 0) + L.AB = line: new ( z.A, z.B) + z.C = L.AB: gold_ratio () + L.AC = line: new ( z.A, z.C) + L.CB = line: new ( z.C, z.B) + L.AB = line: new ( z.A, z.B) + z.O_0 = L.AB.mid + z.O_1 = L.AC.mid + z.O_2 = L.CB.mid + C.AB = circle: new ( z.O_0, z.B) + C.AC = circle: new ( z.O_1, z.C) + C.CB = circle: new ( z.O_2, z.B) + z.P = C.CB.north + z.Q = C.AC.north + z.O = C.AB.south + z.c = z.C : north (2) + C.PC = circle: new ( z.P, z.C) + C.QA = circle: new ( z.Q, z.A) + z.P_0 = intersection (C.PC,C.AB) + z.P_1 = intersection (C.PC,C.AC) + _,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} +\hspace*{\fill} + \begin{tikzpicture} + \tkzGetNodes + \tkzDrawCircle[black,fill=yellow!20,opacity=.4](O_0,B) + \tkzDrawCircles[teal,fill=teal!40,opacity=.6](O_1,C O_2,B) + \tkzDrawCircle[purple,fill=purple!20,opacity=.4](O_3,P_0) + \tkzDrawArc[cyan,delta=10](Q,A)(P_0) + \tkzDrawArc[cyan,delta=10](P,P_0)(B) + \tkzDrawArc[cyan,delta=10](O,B)(A) + \tkzDrawPoints(A,B,C,O_0,O_1,O_2,P,Q,P_0,P_0,P_1,P_2,O) + \tkzLabelPoints(A,B,C,O_0,O_1,O_2,P,Q,P_0,P_0,P_1,P_2,O) + \end{tikzpicture} +\hspace*{\fill} +% subsection the_figure_pappus_circle (end) + +\subsubsection{The code} % (fold) +\label{ssub:the_code} + +\begin{tkzexample}[small, code only,num] +% !TEX TS-program = lualatex +\documentclass{article} +\usepackage{tkz-euclide} +\usepackage{tkz-elements} +\begin{document} + +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (10 , 0) + L.AB = line: new ( z.A, z.B) + z.C = L.AB: gold_ratio () + L.AC = line: new ( z.A, z.C) + L.CB = line: new ( z.C, z.B) + L.AB = line: new ( z.A, z.B) + z.O_0 = L.AB.mid + z.O_1 = L.AC.mid + z.O_2 = L.CB.mid + C.AB = circle: new ( z.O_0, z.B) + C.AC = circle: new ( z.O_1, z.C) + C.CB = circle: new ( z.O_2, z.B) + z.P = C.CB.north + z.Q = C.AC.north + z.O = C.AB.south + z.c = z.C : north (2) + C.PC = circle: new ( z.P, z.C) + C.QA = circle: new ( z.Q, z.A) + z.P_0 = intersection (C.PC,C.AB) + z.P_1 = intersection (C.PC,C.AC) + _,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 + \tkzDrawCircle[black,fill=yellow!20,opacity=.4](O_0,B) + \tkzDrawCircles[teal,fill=teal!40,opacity=.6](O_1,C O_2,B) + \tkzDrawCircle[purple,fill=purple!20,opacity=.4](O_3,P_0) + \tkzDrawArc[cyan,delta=10](Q,A)(P_0) + \tkzDrawArc[cyan,delta=10](P,P_0)(B) + \tkzDrawArc[cyan,delta=10](O,B)(A) + \tkzDrawPoints(A,B,C,O_0,O_1,O_2,P,Q,P_0,P_0,P_1,P_2,O) + \tkzLabelPoints(A,B,C,O_0,O_1,O_2,P,Q,P_0,P_0,P_1,P_2,O) +\end{tikzpicture} +\end{document} +\end{tkzexample} +% subsubsection the_code (end) + +\subsubsection{Some explanations} % (fold) +\label{ssub:some_explanations} + +Half of the code concerns the direct creation of objects (|point: new |, |circle: new | etc.) + +Then points are obtained using object attributes like |L.AB.mid| which determines the middle of the segment $[AB]$ or |C.AB.south| which allows to obtain the south pole of the circle with center $A$ passing through $B$. + +About the naming of objects, see the section \ref{sec:writing_convention} + +\begin{itemize} + \item Lines 8 and 9 create two fixed points $A$ and $B$. + + \item Line 10 these two points are used to create the line. + + \item Line 11 the gold method creates a point $C$ which divides the segment $[AB]$ according to the golden ratio. + + \item Lines 12, 13 and 14 creation of 3 new lines. + +\item Lines 15, 16 and 17 creation of 3 points: the midpoints of the previous segments. These points are predefined and it is enough to use the attributes of the lines. Another possibility is to use the triangle T.ABC with the method : |medial_tr| + +\item Lines 18, 19 et 20 creation of three circles. + +\item Line 21 creation of the south pole $P$ of the circle of center C passing through B. It is also a predefined point and we still use an attribute. + +\item Lines 22 and 23 we create two new poles: north and south for two other circles. + +\item Lines 24 and 25 creation of two circles. + +\item Lines 26 and 27 search for intersections of two circles. + +\item Lines 28 and 29 we use a triangle to search for its circum center. +\end{itemize} +% subsubsection some_explanations (end) +\endinput
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf b/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf Binary files differnew file mode 100644 index 0000000000..7c2839b3f4 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/doc/tkz-elements.pdf 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 Binary files differnew file mode 100644 index 0000000000..0c97b2e50b --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo-1.pdf 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 Binary files differnew file mode 100644 index 0000000000..373dc1b0bc --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.pdf 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 new file mode 100644 index 0000000000..faa0ef52bb --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_1.tex @@ -0,0 +1,46 @@ +% !TEX TS-program = lualatex +% Author Alain Matthes 2023 +\documentclass{article} +\usepackage{tkz-euclide} +\usepackage{tkz-elements} +\begin{document} + +\begin{tkzelements} + z.A = point: new (0 , 0) + z.B = point: new (10 , 0) + L.AB = line: new ( z.A, z.B) + z.C = L.AB: gold_ratio () + L.AC = line: new ( z.A, z.C) + L.CB = line: new ( z.C, z.B) + L.AB = line: new ( z.A, z.B) + z.O_0 = L.AB.mid + z.O_1 = L.AC.mid + z.O_2 = L.CB.mid + C.AB = circle: new ( z.O_0, z.B) + C.AC = circle: new ( z.O_1, z.C) + C.CB = circle: new ( z.O_2, z.B) + z.P = C.CB.north + z.Q = C.AC.north + z.O = C.AB.south + z.c = z.C : north (2) + C.PC = circle: new ( z.P, z.C) + C.QA = circle: new ( z.Q, z.A) + z.P_0 = intersection (C.PC,C.AB) + z.P_1 = intersection (C.PC,C.AC) + _,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 + \tkzDrawCircle[black,fill=yellow!20,opacity=.4](O_0,B) + \tkzDrawCircles[teal,fill=teal!40,opacity=.6](O_1,C O_2,B) + \tkzDrawCircle[purple,fill=purple!20,opacity=.4](O_3,P_0) + \tkzDrawArc[cyan,delta=10](Q,A)(P_0) + \tkzDrawArc[cyan,delta=10](P,P_0)(B) + \tkzDrawArc[cyan,delta=10](O,B)(A) + \tkzDrawPoints(A,B,C,O_0,O_1,O_2,P,Q,P_0,P_0,P_1,P_2,O) + \tkzLabelPoints(A,B,C,O_0,O_1,O_2,P,Q,P_0,P_0,P_1,P_2,O) +\end{tikzpicture} +\end{document}
\ No newline at end of file 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 Binary files differnew file mode 100644 index 0000000000..0816322b1b --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.pdf 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 new file mode 100644 index 0000000000..337c3f8cbe --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_2.tex @@ -0,0 +1,59 @@ +% !TEX TS-program = lualatex +% Author Alain Matthes 2023 +\documentclass{article} +\usepackage{tkz-euclide} +\usepackage{tkz-elements} +\begin{document} + + The Feuerbach triangle is the triangle formed by the three points of tangency of the nine-point circle with the excircles + +\begin{tkzelements} + scale = .5 + z.A = point: new (0,0) + z.B = point: new (6,0) + z.C = point: new (0.8,4) + T.ABC = triangle : new (z.A,z.B,z.C) + C.euler = T.ABC: euler_circle () + z.N,z.Ma = get_points (C.euler) + z.I_a,z.I_b,z.I_c = get_points (T.ABC : excentral()) + z.Ea,z.Eb,z.Ec = get_points (T.ABC : feuerbach ()) + z.S,z.p = get_points (T.ABC : spieker_circle ()) + -- S spieker point is the radical center of the last three circles + C.exa = T.ABC : ex_circle () + C.exb = T.ABC : ex_circle (1) + C.exc = T.ABC : ex_circle (2) + _,z.Xa = get_points (C.exa) + _,z.Xb = get_points (C.exb) + _,z.Xc = get_points (C.exc) + L.fa = line : new (z.S,z.Ea) + L.fb = line : new (z.S,z.Eb) + L.fc = line : new (z.S,z.Ec) + z.f_a = intersection (L.fa,C.exa) + z.f_b = intersection (L.fb,C.exb) + _,z.f_c = intersection (L.fc,C.exc) + T = triangle : new ( z.f_a, z.f_b , z.f_c ) + z.o = T.circumcenter + _,z.l = get_points (C.exa : orthogonal_from (z.S)) + -- S center of inversion !! +\end{tkzelements} +\vspace*{2em} +\hfill +\begin{tikzpicture} +\tkzSetUpLine[ultra thin,color=teal] +\tkzGetNodes +\tkzDrawCircles[red](o,f_a N,Ma) +\tkzDrawPoints[red](f_a,f_b,f_c,Ea,Eb,Ec,o,N) +\tkzClipCircle(o,f_a) +\tkzDrawLines[add=3 and 3](A,B A,C B,C) +\tkzDrawCircles(I_a,Xa I_b,Xb I_c,Xc) +\tkzDrawCircles[cyan](S,l) +\tkzDrawPoints(A,B,C) +\tkzDrawPoints[cyan](S) +\tkzDrawSegments[dashed,red](S,f_a S,f_b S,f_c) +\tkzDrawSegments[dashed,teal](o,f_a o,f_b o,f_c) +\end{tikzpicture} +\hfill +\end{document} + + + 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 Binary files differnew file mode 100644 index 0000000000..1873fd5c85 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.pdf 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 new file mode 100644 index 0000000000..684475e28e --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/examples/tkz-elements-demo_3.tex @@ -0,0 +1,62 @@ +% !TEX TS-program = lualatex +% Author Alain Matthes 2023 +\documentclass{article} +\usepackage{tkz-euclide} +\usepackage{tkz-elements} +\begin{document} + +\begin{tkzelements} + scale = 2 + z.A = point: new (0 , 0) + z.B = point: new (5 , 1) + L.AB = line : new (z.A,z.B) + z.C = point: new (.8 , 3) + T.ABC = triangle: new (z.A,z.B,z.C) + z.N = T.ABC.eulercenter + z.G = T.ABC.centroid + z.O = T.ABC.circumcenter + z.H = T.ABC.orthocenter + z.Ma,z.Mb,z.Mc = get_points (T.ABC : medial ()) + z.Ha,z.Hb,z.Hc = get_points (T.ABC : orthic ()) + z.Ea,z.Eb,z.Ec = get_points (T.ABC: extouch()) + L.euler = T.ABC : euler_line () + C.circum = T.ABC : circum_circle () + C.euler = T.ABC : euler_circle () + z.I,z.J = intersection (L.euler,C.euler) + E = ellipse: foci (z.H,z.O,z.I) + a = E.Rx + b = E.Ry + ang = math.deg(E.slope) + L.AH = line: new (z.A,z.H) + L.BH = line: new (z.B,z.H) + L.CH = line: new (z.C,z.H) + z.X = intersection (L.AH,C.circum) + _,z.Y = intersection (L.BH,C.circum) + _,z.Z = intersection (L.CH,C.circum) + L.BC = line: new (z.B,z.C) + L.XO = line: new (z.X,z.O) + L.YO = line: new (z.Y,z.O) + L.ZO = line: new (z.Z,z.O) + z.x = intersection (L.BC,L.XO) + z.U = intersection (L.XO,E) + _,z.V = intersection (L.YO,E) + _,z.W = intersection (L.ZO,E) + set_lua_to_tex {'a','b','ang'} + \end{tkzelements} + +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawPolygon(A,B,C) + \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) +\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 new file mode 100644 index 0000000000..a147a045aa --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz-elements.sty @@ -0,0 +1,35 @@ +% encoding : utf8 +% tkz-elements v1.00b +% Copyright 2023 Alain Matthes +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.3 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.3 or later is part of all distributions of LaTeX +% version 2005/12/01 or later. +% This work has the LPPL maintenance status “maintained”. +% The Current Maintainer of this work is Alain Matthes. + +\ProvidesPackage{tkz-elements}[2023/10/20 v1.00b Graphic Object Library] +\RequirePackage{luacode} +\RequirePackage{filecontents} +\directlua{require "tkz_elements_main"} + +\newenvironment{tkzelements} + {\directlua{scale=1} + \luacode} + {\endluacode} +\def\tkzGetNodes{\directlua{% + for K,V in pairs(z) do + local KS,n,sd,ft + KS = tostring(K) + n = string.len(KS) + if n >1 then + _,_,ft, sd = string.find( KS , "(.+)(.)" ) + if sd == "p" then K=ft.."'" end + end + tex.print("\\coordinate ("..K..") at ("..V.re..","..V.im..") ;\\\\") +end} +} +\endinput diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circles.lua new file mode 100644 index 0000000000..52da83fc25 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_circles.lua @@ -0,0 +1,129 @@ +-- tkz_elements-circles.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. +--------------------------------------------------------------------------- +-- circles +--------------------------------------------------------------------------- +circle = {} +function circle: new (c, t) -- c --> center t --> through + local type = 'circle' + local radius = point.abs ( c - t ) + local south = c - point (0,radius) + local east = c + point (radius,0) + local north = c + point (0,radius) + local west = c - point (radius,0) + local new_circle = { center = c, through = t, radius = radius, + south=south,east=east,north=north,west=west,type = type} + setmetatable(new_circle, {__index = circle}) + return new_circle +end + +function circle: antipode (pt) + return 2 * self.center - pt +end + +function circle: power (pt) + local d + d = point.abs (self.center - pt) + return d * d - self.radius * self.radius +end + +function circle: in_out (pt) + local d + d = point.abs (pt - self.center) + if d <= self.radius + then + return true + else + return false + end +end + +-- function circle: tangent_at (pt) +-- return tangent_at_ (self.center,self.through,pt) +-- end + +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 + t1,t2 = tangent_from_ (self.center,self.through,pt) + return line :new (pt,t1),line : new (pt,t2) + end + +function circle: orthogonal_from (pt) + local t1,t2 + t1,t2 = tangent_from_ (self.center,self.through,pt) + return circle : new (pt,t1), circle : new (pt,t2) +end + +function circle: orthogonal_through (pta,ptb) + return circle : new (orthogonal_through_ (self.center,self.through,pta,ptb),pta) + end + + function circle: inversion (pt) + return inversion_ (self.center,self.through,pt) + end + + function circle: set_inversion (...) + local tp = table.pack(...) + local i + local t = {} + for i=1,tp.n do + table.insert( t , inversion_ ( self.center,self.through, tp[i] ) ) + end + return table.unpack ( t ) + end + + function circle: midarc (z1,z2) + local phi = 0.5 * get_angle_(self.center,z1,z2 ) + return rotation_ (self.center,phi,z1) + end + + function circle: point (phi) + return point (self.center.re+self.radius*math.cos(phi),self.center.im+self.radius*math.sin(phi) ) + end + +function circle: random_pt(lower, upper) +local t + math.randomseed( tonumber(tostring(os.time()):reverse():sub(1,6)) ) + phi = lower + math.random() * (upper - lower) +return point (self.center.re+self.radius*math.cos(phi),self.center.im+self.radius*math.sin(phi) ) +end + +function circle: radical_axis (C) + local t1,t2 + t1,t2 = radical_axis_ (self.center,self.through,C.center,C.through) +return line : new (t1,t2) +end + +function circle: internal_similitude (C) + return barycenter_ ({self.center,C.radius},{C.center,self.radius}) +end + +function circle: external_similitude (C) + return barycenter_ ({C.center,self.radius},{self.center,-C.radius}) +end + +function circle: draw () + local x,y + x, y = self.center: get () + local r = self.radius + local frmt = '\\draw (%0.3f,%0.3f) circle [radius=%0.3f];' + tex.sprint(string.format(frmt, x,y,r)) +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 new file mode 100644 index 0000000000..8a2564bd36 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_class.lua @@ -0,0 +1,48 @@ +-- tkz_elements_class.lua +-- 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 + +function class(base, init) + local c = {} -- a new class instance + if not init and type(base) == 'function' then + init = base + base = nil + elseif type(base) == 'table' then + -- our new class is a shallow copy of the base class! + for i,v in pairs(base) do + c[i] = v + end + c._base = base + end + -- the class will be the metatable for all its objects, + -- and they will look up their methods in it. + c.__index = c + + -- expose a constructor which can be called by <classname>(<args>) + local mt = {} + mt.__call = function(class_tbl, ...) + local obj = {} + setmetatable(obj,c) + if init then + init(obj,...) + else + -- make sure that any stuff from the base class is initialized! + if base and base.init then + base.init(obj, ...) + end + end + return obj + end + c.init = init + c.is_a = function(self, klass) + local m = getmetatable(self) + while m do + if m == klass then return true end + m = m._base + end + return false + end + setmetatable(c, mt) + return c +end
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipses.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipses.lua new file mode 100644 index 0000000000..0e15d5ab86 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_ellipses.lua @@ -0,0 +1,119 @@ +-- tkz_elements-ellipses.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +--------------------------------------------------------------------------- +-- circles +--------------------------------------------------------------------------- +ellipse = {} + +function ellipse: new(pc, pa ,pb) +-- pc --> center pa --> through big axe pb --> little axe + local type = 'ellipse' + local Rx = point.abs ( pa - pc ) + local Ry = point.abs ( pb - pc ) + local slope = slope_ (pc,pa) + local c = math.sqrt (Rx*Rx-Ry*Ry) + local Fa = pc + c*(point(math.cos(slope),math.sin(slope))) + local Fb = pc - c*(point(math.cos(slope),math.sin(slope))) + local east = pa + local north = pb + local west = 2 * pc - pa + local south = 2 * pc - pb + local vertex = pa + local covertex = pb + local new_ellipse = { center = pc, + vertex = vertex, + covertex = covertex, + Rx = Rx, + Ry = Ry, + slope = slope, + Fa = Fa, + Fb = Fb, + type = type, + north = north, + south = south, + east = east, + west = west } + setmetatable(new_ellipse, {__index = ellipse}) + return new_ellipse +end + +function ellipse: foci (f1,f2,v ) + local c,a,h,b,cov + c = midpoint_ (f1,f2) + a = point.abs(v-c) + h = point.abs(f1-c) + b = math.sqrt(a^2-h^2) + cov = (v-c)*point(0,1)/point.abs(v-c)*b+c + return ellipse: new (c,v,cov) +end + +function ellipse: radii (c,a,b,sl ) + local z,v,cov + z = point (a*math.cos(sl),a*math.sin(sl)) + v = c + z + z.V = v + cov = (v-c)*point(0,1)/point.abs(v-c)*b+c +return ellipse: new (c,v,cov) +end + +function ellipse: point (phi) + local ax,ay,bx,by,cx,cy + cx = self.center.re + cy = self.center.im + ax = self.Rx * math.cos(self.slope) * math.cos(phi) + ay = self.Rx * math.sin(self.slope) * math.cos(phi) + bx = -self.Ry * math.sin(self.slope) * math.sin(phi) + by = self.Ry * math.cos(self.slope) * math.sin(phi) +return point (cx+ax+bx,cy+ay+by) +end + +function ellipse: tangent_at (pt) + local zi,u,v + zi = in_center_ (self.Fa,pt,self.Fb) + u = pt+(zi-pt)*point(0,1) + v = pt : symmetry (u) + return line : new (u,v) +end + +function ellipse: tangent_from (pt) + local da,db,zx,zy,zz,u,v,L,U,V + zx = 2 * self.Rx * math.cos(self.slope) + zy = 2 * self.Rx * math.sin(self.slope) + zz = self.Fb + point(zx,zy) + s1,s2 = intersection_cc_ (pt,self.Fa,self.Fb,zz) + u,v = mediator_ (s2,self.Fa) + L = line: new (u,v) + U,U = intersection_le (L,self) + u,v = mediator_ (s1,self.Fa) + L = line: new (pt,u) + V,V = intersection_le (L,self) + return line : new (pt,U), line : new (pt,V) +end + +function ellipse: in_out (pt) + local d,D,an,m,epsilon + epsilon = 10^(-12) + d = point.abs (pt - self.center) + an = point.arg (pt - self.center) + m = point(self.Rx*math.cos(an),self.Ry*math.sin(an)) + D = point.abs (m - self.center) + if D-d > epsilon + then + return true + else + return false + end +end +return ellipse
\ No newline at end of file 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 new file mode 100644 index 0000000000..e1d6b4bd53 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_circles.lua @@ -0,0 +1,108 @@ +-- tkz_elements_functions_circles.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +-- define a circle by the center and a radius + +function circle_cr ( c, r ) + return c + point(r,0) +end + +function midarc_ (o,a,b) -- a -> b + local phi = 0.5 * get_angle_ ( a,o,b ) + return rotation_ (o,phi,b) +end +--------------------------------------------------------------------------- +-- -- possible (C,p) with C.center and C.through +-- function tangent_from (c,p) +-- local m = midpoint_ (c.center,p) +-- return intersection_cc_ (c.center,c.through,m,p) +-- end +--------------------------------------------------------------------------- +-- tangente à un cercle +--------------------------------------------------------------------------- +function tangent_from_ (c,p,pt) + local o + o = midpoint_ ( c,pt ) + return intersection_cc_ (o,c,c,p) +end + +function tangent_at_ (a,b,p) + return rotation_ (p,math.pi/2,a),rotation_ (p,-math.pi/2,a) +end + +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) +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)) +end + +function radical_axis_ (c1,p1,c2,p2) + local d,m,m1,m2,epsilon,ci,cj,ck,cm,cn,r1,r2 + r1 = point.abs(c1-p1) + r2 = point.abs(c2-p2) + epsilon = 10^(-12) + d = point.abs (c2 - c1) + m = d - (r1+r2) + m1 = math.abs (d - (r1+r2)) + m2 = math.abs (d - math.abs(r1-(r2))) + if m2 < epsilon then + ci = rotation_ (p1,math.pi/2,c2) + cj = rotation_ (p1,-math.pi/2,c2) + return ci,cj + elseif m1 < epsilon then -- circles tangent + ci = rotation_ (p1,math.pi/2,c2) + cj = rotation_ (p1,-math.pi/2,c2) + return ci,cj + -- circles disjoints + elseif m > 0 then + ck = rotation_ (c1,math.pi/3,c2) + ci,cj = intersection_cc_ (c1,p1,ck,c1) + cm,cn = intersection_cc_ (c2,p2,ck,c1) + ci = intersection_ll_ (ci,cj,cm,cn) + cj = projection_ (c1,c2,ci) + return ci,cj + else + ci,cj = intersection_cc_ (c1,p1,c2,p2) + return ci,cj + end +end + +function south_pole_ (c,p) + local r + r = point.abs (c-p) + return c - point (0,r) + end + +function north_pole_ (c,p) + local r + r = point.abs (c-p) + return c + point (0,r) +end + +function antipode_ (c,pt) + return 2 * c - pt +end 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 new file mode 100644 index 0000000000..8c5123129d --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_intersections.lua @@ -0,0 +1,207 @@ +-- tkz_elements_intersections.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +------------------------------------------------------------------------- +-- intersection of lines +------------------------------------------------------------------------- +function intersection_ll (la,lb) + return intersection_ll_ (la.pa,la.pb,lb.pa,lb.pb) +end +--------------------------------------------------------------------------- +-- intersection of a line and a circle +--------------------------------------------------------------------------- +function intersection_lc (D,C ) + return intersection_lc_ ( D.pa,D.pb ,C.center,C.through ) +end -- function +--------------------------------------------------------------------------- +-- intersection of two circles +--------------------------------------------------------------------------- +function intersection_cc (Ca , Cb ) + return intersection_cc_(Ca.center,Ca.through,Cb.center,Cb.through) +end -- function + +-- line ellipse +function intersection_le (L,E) + local a,b,c,d,t1,t2,z1,z2,Bx,By,Ax,Ay,Rx,Ry,epsilon,sd + A = (L.pa - E.center)*(point(math.cos(E.slope),-math.sin(E.slope))) + B = (L.pb - E.center)*(point(math.cos(E.slope),-math.sin(E.slope))) + epsilon = 10^(-6) + Rx = E.Rx + Ry = E.Ry + Ax = A.re + Ay = A.im + Bx = B.re + By = B.im + a = Rx^2 * (By-Ay)^2 +Ry^2 * (Bx-Ax)^2 + b = 2 * Rx^2 * Ay * (By-Ay)+ 2 * Ry^2 * Ax * (Bx-Ax) + c = Rx^2 * Ay^2 + Ry^2 * Ax^2 - Rx^2 * Ry^2 + d = b^2 - 4 * a * c + + if d > 0 then + sd = math.sqrt(d) + t1 = (-(b)+sd)/(2*a) + t2 = (-(b)-sd)/(2*a) + z1 = point ( Ax + (Bx-Ax)*t1 , Ay + (By-Ay)*t1 ) + z2 = point ( Ax + (Bx-Ax)*t2 , Ay + (By-Ay)*t2 ) + if angle_normalize (point.arg(z1)) < angle_normalize (point.arg(z2)) + then + return z1*(point(math.cos(E.slope),math.sin(E.slope))) + E.center, + z2*(point(math.cos(E.slope),math.sin(E.slope))) + E.center + else + return z2*(point(math.cos(E.slope),math.sin(E.slope))) + E.center, + z1*(point(math.cos(E.slope),math.sin(E.slope))) + E.center + end -- if + elseif math.abs(d) < epsilon + then + t1 = (-(b))/(2*a) + z1 = point ( Ax + (Bx-Ax)*t1 , Ay + (By-Ay)*t1 ) + return z1*(point(math.cos(E.slope),math.sin(E.slope))) + E.center, + z1*(point(math.cos(E.slope),math.sin(E.slope))) + E.center + else + return false,false + end +end + +function intersection_ll_ (a,b,c,d) + local x1,x2,x3,x4,y1,y2,y3,y4,DN,NX,NY,epsilon + epsilon = 10^(-12) + 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 ) < 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) + end +end + +function intersection_lc_ (pa,pb,c,p) + local zh, dh, arg_ab, test, phi,epsilon,c1,c2,r + r = point.mod (c-p) + epsilon = 10^(-12) + zh = projection_ (pa,pb,c) + dh = point.abs (c - zh) + arg_ab = point.arg (pa - pb) + if dh < epsilon + then + return + c + polar_ (r , math.pi + arg_ab), -- through center + c + polar_ (r , arg_ab) + elseif math.abs (r - dh) < 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 + +end -- function + +function intersection_cc_ (ca,pa,cb,pb ) + local d, cosphi, phi,ra,rb,epsilon + 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 + end + end -- if + return table.unpack ( t ) +end -- function
\ No newline at end of file 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 new file mode 100644 index 0000000000..87ea1de043 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_lines.lua @@ -0,0 +1,120 @@ +-- tkz_elements_functions_lines.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +--------------------------------------------------------------------------- +-- Lines +--------------------------------------------------------------------------- + +function ortho_from_ ( p , a , b ) + return p+(b-a)*point(0,1) +end + +function ll_from_ ( p , a , b ) + return p+b-a +end + +function slope_ (a,b) + local z = b - a + angle = point.arg(z) + return angle +end + +function gold_segment_ (a,b) + return a + (b-a)*tkzinvphi +end + +function online_ (a,b,t) + return barycenter_({a,(1-t)},{b,t}) + end + + function mediator_ (a,b) + local m = midpoint_ (a,b) + return m , rotation_ (m,math.pi/2,b) + end + + function midpoint_ (z1 , z2) + return (z1+z2)/2 + end +-- triangle specific +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) +end + +function gold_tr (a,b) + local pt + 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 +end + +function div_harmonic_int_(a,b,n) + local k = point.abs(a-n)/point.abs(b-n) + return barycenter_ ( {a,1} , {b,k} ) +end + +function div_harmonic_ext_(a,b,n) + local k = point.abs(a-n)/point.abs(b-n) + return barycenter_ ( {a,1} , {b,-k} ) +end + +function div_harmonic_both_(a,b,k) + return barycenter_ ( {a,1} , {b,k} ) , barycenter_ ( {a,1} , {b,-k} ) +end + +function golden_ratio_(a,b) + local invphi = ( math.sqrt(5) - 1 )/2 + return a + (b-a) * invphi +end +-- projection +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 +end + +function symmetry_axial_(pa,pb,pt) + local p + p = projection_ (pa,pb,pt) + return symmetry_(p,pt) +end + + +function square_ (a,b) + return rotation_ (b,-math.pi/2,a), rotation_ (a,math.pi/2,b) +end
\ No newline at end of file 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 new file mode 100644 index 0000000000..866912468a --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_maths.lua @@ -0,0 +1,123 @@ +-- tkz_elements_functions_maths.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +-- constant +tkzphi = (1+math.sqrt(5))/2 +tkzinvphi = (math.sqrt(5)-1)/2 +tkzsqrtphi = math.sqrt(tkzphi) +--------------------------------------------------------------------------- +function round(num, idp) + return topoint(string.format("%." .. (idp or 0) .. "f", num)) +end + +function tkzround( num, idp ) + local mult = 10 ^ ( idp or 0 ) + return math.floor( num * mult + 0.5 ) / mult +end + +function dot_product (a,b,c) + return (b-a)..(c-a) +end + +function Cramer33(a1,a2,a3,b1,b2,b3,c1,c2,c3) + return a1*b2*c3+a3*b1*c2+a2*b3*c1-a3*b2*c1-a1*b3*c2-a2*b1*c3 +end + +function Cramer22(a1,a2,b1,b2) + return a1*b2-a2*b1 +end + +function aligned ( m,a,b ) + local z,epsilon + epsilon = 10^(-8) + z = (b-a)/(m-b) + if math.abs(z.im) < epsilon + then + return true + else + return false + end +end + +function islinear (z1,z2,z3) + local epsilon + local dp + epsilon = 10^(-8) + dp = (z2-z1) ^ (z3-z1) + if math.abs(dp) < epsilon + then + return true + else + return false + end +end + +function isortho (z1,z2,z3) + local epsilon + local dp + epsilon = 10^(-8) + dp = (z2-z1) .. (z3-z1) + if math.abs(dp) < epsilon + then + return true + else + return false + end +end + +function set_lua_to_tex (t) + for k,v in pairs(t) do + token.set_macro(v,_ENV[v],'global') + end +end + +function parabola (a,b,c) + local xa,xb,xc,ya,yb,yc + xa = a.re + ya = a.im + xb = b.re + yb = b.im + xc = c.re + yc = c.im + D = (xa-xb)*(xa-xc)*(xb-xc) + A = (xc*(yb-ya) + xb*(ya-yc)+xa*(yc-yb))/D + B = (xc*xc*(ya-yb)+xb*xb*(yc-ya)+xa*xa*(yb-yc))/D + C = (xb*xc*(xb-xc)*ya + xc*xa*(xc-xa)*yb +xa*xb*(xa-xb)*yc)/D + return A,B,C +end + +function value (v) + return scale * v +end + +function get_angle (a,b,c) + return angle_normalize(get_angle_( a,b,c )) +end + +function get_angle_( a,b,c ) + return point.arg ((c-a)/(b-a)) +end + +function angle_normalize (a) +local dblpi + dblpi = 2 * math.pi + if a > dblpi + then + a = a - dblpi + end + if a < 0 then + a = a + dblpi + end + return a +end
\ No newline at end of file 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 new file mode 100644 index 0000000000..fcd249d891 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_points.lua @@ -0,0 +1,81 @@ +-- tkz_elements_functions_points.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +function id () +for i,k in pairs(z) do + if _G[i]==k then else _G[i]=k end + end +end + +function polar_ (radius, phi) + return point(radius * math.cos(phi), radius * math.sin(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 +end + +function rotation_ (center,alpha,pt) + local z = point( math.cos(alpha) , math.sin(alpha) ) + return z*(pt-center)+center +end + +function symmetry_(c,pt) + return 2 * c - pt +end + +function homothety_(c,t,p) + return c + t * (p - c) +end + +function translation_(a , p) + return a+p +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]) ) + end + return table.unpack ( t ) +end + +function random_point(lower, upper) + math.randomseed( tonumber(tostring(os.time()):reverse():sub(1,6)) ) + x = math.random (lower, upper) + y = math.random (lower, upper) + return scale * point (x,y) +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 ) + end + table.insert( t , (arg[n]+arg[1])/2 ) + return table.unpack ( t ) +end
\ No newline at end of file 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 new file mode 100644 index 0000000000..b4e41104d1 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_functions_triangles.lua @@ -0,0 +1,315 @@ +-- tkz_elements_functions_triangles.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +--------------------------------------------------------------------------- + -- triangle center with circle +--------------------------------------------------------------------------- +------------------------ +-- Points -- +------------------------ +function circum_center_ ( a,b,c ) + local ka = math.sin (2 * get_angle_ ( a,b,c )) + local kb = math.sin (2 * get_angle_ ( b,c,a )) + local kc = math.sin (2 * get_angle_ ( c,a,b )) + return barycenter_ ( {a,ka} , {b,kb} , {c,kc} ) +end + +function in_center_ ( a,b,c ) + local ka = point.abs (b-c) + local kc = point.abs (b-a) + local kb = point.abs (c-a) + return barycenter_ ( {a,ka} , {b,kb} , {c,kc} ) +end + +function ex_center_ ( a,b,c ) + local ka = point.abs (b-c) + local kc = point.abs (b-a) + local kb = point.abs (c-a) + return barycenter_ ( {a,-ka} , {b,kb} , {c,kc} ) + end + +-- N,G,H,O +function centroid_ (a,b,c) + return barycenter_ ( {a,1} , {b,1} , {c,1} ) +end +centroid_center_ = centroid_ + +function ortho_center_ (a,b,c) + local ka = math.tan (get_angle_ ( a,b,c )) + local kb = math.tan (get_angle_ ( b,c,a )) + local kc = math.tan (get_angle_ ( c,a,b )) + return barycenter_ ( {a,ka} , {b,kb} , {c,kc} ) +end + +function euler_center_ (a,b,c) + local ma,mb,mc = medial_tr_ ( a,b,c) + return circum_center_ (ma,mb,mc) +end + +function gergonne_point_ (a,b,c) + local u,v,w + u,v,w = intouch_tr_ (a,b,c) + return intersection_ll_ ( a,u , b,v) +end + +function lemoine_point_(a,b,c) +local ma,mb,mc,ha,hb,hc,u,v,w +u = point.abs(c-b) +v = point.abs(a-c) +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) +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) +end + +function spieker_center_ (a,b,c) +return in_center_ (medial_tr_ ( a,b,c)) +end + +function euler_points_ (a,b,c) + local H + H = ortho_center_ ( a , b , c ) + return midpoint_ ( H,a ), midpoint_ ( H,b ), midpoint_ ( H,c ) +end +-------------------- +-- lines -- +-------------------- +function euler_line_ (a,b,c) + check_equilateral_ (a,b,c) + local A = math.tan( get_angle_ ( a,b,c )) + local B = math.tan( get_angle_ ( b,c,a )) + local C = math.tan( get_angle_ ( c,a,b )) + + return euler_center_ (a,b,c), + barycenter_ ( {a,1} , {b,1} , {c,1} ) , + barycenter_ ( {a,A} , {b,B} , {c,C} ) , + barycenter_ ( {a,B+C} , {b,A+C} , {c,A+B} ) +end + +function bisector_ (a,b,c) -- possible intersection bisector with side + return in_center_ (a,b,c) +end + +function bisector_ext_ (a,b,c) + local i + i = in_center_ (a,b,c) + return rotation_ (a,math.pi/2,i) +end + +function mediators_ (a,b,c) + local o = circum_center (a,b,c) + return o , + projection_ (b,c,o) , + projection_ (a,c,o) , + projection_ (a,b,o) +end +-------------------- +-- circles -- +-------------------- +function circum_circle_ ( a,b,c ) + local ka = math.sin (2 * get_angle_ ( a,b,c )) + local kb = math.sin (2 * get_angle_ ( b,c,a )) + local kc = math.sin (2 * get_angle_ ( c,a,b )) + return barycenter_ ( {a,ka} , {b,kb} , {c,kc} ) +end + +function in_circle_ ( a,b,c ) + local ka,kb,kc,o + ka = point.abs (b-c) + kc = point.abs (b-a) + kb = point.abs (c-a) + o = barycenter_ ( {a,ka} , {b,kb} , {c,kc} ) + return o , + projection_ (a,b,o) , + projection_ (b,c,o) , + projection_ (c,a,o) +end + +function ex_circle_ ( a,b,c ) + local ka,kb,kc,o + ka = point.abs (b-c) + kc = point.abs (b-a) + kb = point.abs (c-a) + o = barycenter_ ( {a,-ka} , {b,kb} , {c,kc} ) + return o , + projection_ (b,c,o) , + projection_ (a,c,o) , + 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 ) +end +-------------------- +-- triangles -- +-------------------- +function orthic_tr_ (a,b,c) + local o = ortho_center_ (a,b,c) + return projection_ (b,c,o) , + projection_ (a,c,o) , + projection_ (b,a,o) +end + +function medial_tr_ (a,b,c) + return barycenter_ ( {a,0} , {b,1} , {c,1} ) , + barycenter_ ( {a,1} , {b,0} , {c,1} ) , + barycenter_ ( {a,1} , {b,1} , {c,0} ) +end + +function anti_tr_(a,b,c) + return barycenter_ ( {a,-1} , {b,1} , {c,1} ) , + barycenter_ ( {a,1} , {b,-1} , {c,1} ) , + 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 i,r,s,t +end + +function excentral_tr_ (a,b,c) + local r,s,t,ka,kb,kc + ka = point.abs (b-c) + kc = point.abs (b-a) + kb = point.abs (c-a) + r = barycenter_ ( {a,-ka} , {b,kb} , {c,kc} ) + s = barycenter_ ( {a,ka} , {b,-kb} , {c,kc} ) + t = barycenter_ ( {a,ka} , {b,kb} , {c,-kc} ) + return r,s,t +end + +function intouch_tr_ (a,b,c) + local i + i = in_center_ (a , b , c) + return projection_ (b,c,i), + projection_ (a,c,i), + projection_ (a,b,i) +end + +function cevian_ (a,b,c,p) + return intersection_ll_ (a,p,b,c), + intersection_ll_ (b,p,a,c), + intersection_ll_ (c,p,a,b) +end + +function extouch_tr_ (a,b,c) + local u,v,w + u,v,w = excentral_tr_ (a,b,c) + return projection_ (b,c,u) , + projection_ (a,c,v) , + projection_ (a,b,w) +end + +function tangential_tr_ (a,b,c) + local u,v,w,x,y,z,xx,yy,zz + u,v,w = orthic_tr_ (a,b,c) + x = ll_from_ ( a , v , w ) + y = ll_from_ ( b , u , w ) + z = ll_from_ ( c , u , v ) + xx = intersection_ll_ (c,z,b,y) + yy = intersection_ll_ (a,x,c,z) + zz = intersection_ll_ (a,x,b,y) +return xx,yy,zz +end + +function feuerbach_tr_ (a,b,c) + local e,m,ja,ha,jb,hb,jc,hc + e = euler_center_ (a,b,c) + m = midpoint_( b , c ) + ja,ha = ex_circle_ ( a , b , c ) + jb,hb = ex_circle_ ( b , c , a ) + jc,hc = ex_circle_ ( c , a , b ) + return intersection_cc_ (e,m,ja,ha), + intersection_cc_ (e,m,jb,hb), + intersection_cc_ (e,m,jc,hc) +end +-------------------- +-- miscellanous -- +-------------------- + +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,epsilon + epsilon = 10 ^(-8) + A = b - c + B = a - c + C = a - b + if (point.abs(A)-point.abs(B) < epsilon) and (point.abs(B)-point.abs(C) < epsilon) + then + tex.print("equilateral !!") + error("something went wrong!") + end +end + +function parallelogram_ (a,b,c) + local x = c + a - b + return x +end + +function barycentric_coordinates_ (a,b,c,pt) + local AT,AA,AB,AC,x,y,z + AT = area_(a,b,c) + AA = area_(pt,b,c) + AB = area_(a,pt,c) + AC = area_(a,b,pt) + x = AA/AT + y = AB/AT + z = AC/AT + return x,y,z +end + +function in_out_ (a,b,c,pt) + local cba,cbb,cbc,TT,AT,AA,AB,AC + AT = area_(a,b,c) + AA = area_(pt,b,c) + AB = area_(a,pt,c) + AC = area_(a,b,pt) + cba = AA/AT + cbb = AB/AT + cbc = AC/AT + if (cba >= 0 and cba <= 1) and (cbb >= 0 and cbb <= 1) and (cbc >= 0 and cbc <= 1) + then + return true + else + return false + end +end
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_lines.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_lines.lua new file mode 100644 index 0000000000..05d4196938 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_lines.lua @@ -0,0 +1,183 @@ +-- tkz_elements_lines.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +-- ------------------------------------------------------------------------- +-- Lines +-- ------------------------------------------------------------------------- +line = {} +function line: new(za, zb) + local type = 'line' + local mid = (za+zb)/2 + local north_pa = rotation_ (za,math.pi/2,zb) + local south_pa = rotation_ (za,-math.pi/2,zb) + local north_pb = rotation_ (zb,-math.pi/2,za) + local south_pb = rotation_ (zb,math.pi/2,za) + local west = rotation_ (za,math.pi/2,north_pa) + local east = rotation_ (zb,math.pi/2,south_pb) + local slope = point.arg(zb-za) + local length = point.mod(zb-za) + local new_line = {pa = za, pb = zb, + north_pa = north_pa,south_pa = south_pa,west = west,east = east, + north_pb = north_pb,south_pb = south_pb, + slope = slope,mid = mid,type = type,length = length} + setmetatable(new_line, {__index = line}) + return new_line +end +------------------- +-- Result -> point +------------------- +function line: set_projection (...) + local tp = table.pack(...) + local i + local t = {} + for i=1,tp.n do + table.insert( t , projection_ (self.pa,self.pb , tp[i]) ) + end + return table.unpack ( t ) +end + +function line: symmetry_axial ( pt ) + return symmetry_axial_ ( self.pa,self.pb,pt ) +end + +function line: set_symmetry_axial (...) + local tp = table.pack(...) + local i + local t = {} + for i=1,tp.n do + table.insert( t , symmetry_axial_ (self.pa,self.pb , tp[i]) ) + end + return table.unpack ( t ) +end +-- k_div ig "gold" or "phi" then + +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 + return barycenter_({self.pa,1-t},{self.pb,(t)}) +end + +function line: midpoint () + return (self.pa+self.pb)/2 +end + +function line: harmonic_int (pt) + return div_harmonic_int_(self.pa,self.pb,pt) +end + +function line: harmonic_ext (pt) + return div_harmonic_ext_(self.pa,self.pb,pt) +end + +function line: harmonic_both (k) + return div_harmonic_both_(self.pa,self.pb,k) +end + +function line: gold_ratio() + return self.pa + (self.pb-self.pa)*tkzinvphi +end +------------------- +-- Result -> line +------------------- +function line: ll_from ( pt ) + return line : new (pt,pt+self.pb-self.pa) +end + +function line: ortho_from ( pt ) + return line : new (pt,pt+(self.pb-self.pa)*point(0,1)) +end + +function line: projection ( pt ) + return projection_ ( self.pa,self.pb,pt ) +end + +function line: mediator () + local m + m = midpoint_ (self.pa,self.pb) + return line : new (m,rotation_ (m,math.pi/2,self.pb)) +end +------------------- +-- Result -> circle +------------------- +function line: circle () + return circle : new (self.pa,self.pb) +end + +function line: circle_swap () + return circle : new (self.pb,self.pa) +end +------------------- +-- Result -> real +------------------- +function line: distance (pt) + return point.mod(projection(self,pt)-pt) +end +------------------- +-- Result -> boolean +------------------- +function line: in_out (pt) + local sc,epsilon + epsilon = 10^(-12) + sc = math.abs ((pt-self.pa)^(pt-self.pb)) + if sc <= epsilon + then + return true + else + return false + end +end + +function line: slope () + return slope_(self.pa,self.pb) +end +---------------------- +-- Result -> triangle +---------------------- +function line: equilateral () + return triangle : new (self.pa,self.pb,rotation_ (self.pa,math.pi/3,self.pb)) +end + +function line: isosceles (phi) + local pta,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 )) + +end + +function line: gold () + local pt + pt = rotation_ (self.pa,math.pi/2,self.pb) + return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzinvphi) +end + +function line: euclide () + return triangle : new (self.pa,self.pb, rotation_ (self.pa,math.pi/5,self.pb)) + end + +function line: golden () + local pt + pt = rotation_ (self.pa,2*math.pi/5,self.pb) + return triangle : new (self.pa,self.pb, self.pa + (pt-self.pa) * tkzphi) +end +------------------------------ +-- Result -> couple of points +------------------------------ +function line: square () + return rotation_ (self.pb,-math.pi/2,self.pa), rotation_ (self.pa,math.pi/2,self.pb) +end + +return line
\ No newline at end of file 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 new file mode 100644 index 0000000000..92e006fe78 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_main.lua @@ -0,0 +1,47 @@ +-- tkz_elements-main.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + + z = {} + L = {} + C = {} + T = {} + V = {} + E = {} + Q = {} + scale = 1 + +require "tkz_elements_point.lua" + +require "tkz_elements_points.lua" +require "tkz_elements_lines.lua" +require "tkz_elements_circles.lua" +require "tkz_elements_triangles.lua" +require "tkz_elements_vectors.lua" +require "tkz_elements_ellipses.lua" + +require "tkz_elements_functions_maths.lua" +require "tkz_elements_functions_intersections.lua" +require "tkz_elements_functions_points.lua" +require "tkz_elements_functions_lines.lua" +require "tkz_elements_functions_circles.lua" +require "tkz_elements_functions_triangles.lua" + +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 +end +end
\ No newline at end of file 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 new file mode 100644 index 0000000000..0b2e3dec4a --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_point.lua @@ -0,0 +1,181 @@ +-- tkz_elements_point.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +-- point.lua +require 'tkz_elements_class' + +point = class(function(p,re,im) + if type(re) == 'number' then + p.re = re + p.im = im + else + p.re = re.re + p.im = re.im + end + p.type = 'point' + p.argument = math.atan(p.im, p.re) + p.modulus = math.sqrt(p.re*p.re + p.im*p.im) +end) + +local sqrt = math.sqrt +local cos = math.cos +local sin = math.sin +local exp = math.exp +local atan = math.atan +local min = math.min +local max = math.max +local abs = math.abs + +local function topoint (z1) + if (type(z1) == "number") then return point(z1,0) else return z1 end +end + +local function check(z1,z2) + if type(z1) == 'number' then return point(z1,0),z2 + elseif type(z2) == 'number' then return z1,point(z2,0) + else return z1,z2 + end +end +-- ------------------------------------------------------------------- +-- metamethods +-- ------------------------------------------------------------------- +-- redefine arithmetic operators! +function point.__add(z1,z2) + local c1,c2 = check(z1,z2) + return point(c1.re + c2.re, c1.im + c2.im) +end + +function point.__sub(z1,z2) + local c1,c2 = check(z1,z2) + return point(c1.re - c2.re, c1.im - c2.im) +end + +function point.__unm(z) + local z = topoint(z) + return point(-z.re, -z.im) +end + +function point.__mul(z1,z2) + local c1,c2 = check(z1,z2) + return point(c1.re*c2.re - c1.im*c2.im, c1.im*c2.re + c1.re*c2.im) +end + +-- dot product is '..' (a+ib) (c-id) = ac+bd + i(bc-ad) +function point.__concat(z1,z2) + local z + z = z1 * point.conj(z2) + return z.re +end + +-- determinant is '^' (a+ib) (a-ib) (c+id) = ac+bd + i(ad - bc) +function point.__pow(z1,z2) + local z + z = point.conj(z1) * z2 + return z.im +end + +function point.__div(x,y) + local xx = topoint(x); local yy = topoint(y) + return point( + (xx.re * yy.re + xx.im * yy.im) / (yy.re * yy.re + yy.im * yy.im), + (xx.im * yy.re - xx.re * yy.im) / (yy.re * yy.re + yy.im * yy.im) + ) +end + +function point.__tostring(z) + if (z.re == 0) then + if (z.im == 0) then + return "0" + else + if (z.im ==1) then + return "" .. "i" + else + if (z.im ==-1) then + return "" .. "-i" + else + return "" .. z.im .. "i" + end + end + end + else + if (z.im > 0) then + if (z.im ==1) then + return "" .. z.re .. "+" .. "i" + else + return "" .. z.re .. "+" .. z.im .. "i" + end + elseif (z.im < 0) then + if (z.im ==-1) then + return "" .. z.re .. "-" .. "i" + else + return "" .. z.re .. z.im .. "i" + end + else + return "" .. z.re + + end + end +end + +function point.__tonumber(z) + if (z.im == 0) then + return z.re + else + return nil + end +end + +function point.__eq(z1,z2) + return z1.re==z2.re and z1.im==z2.im +end +-- ------------------------------------------------------------------- +local function pyth(a, b) + if a == 0 and b == 0 then return 0 end + a, b = abs(a), abs(b) + a, b = max(a,b), min(a,b) + return a * sqrt(1 + (b / a)^2) +end + +function point.conj(z) + return point(z.re,-z.im) +end + +function point.mod(z) + local function sqr(x) return x*x end + return pyth (z.re,z.im) +end + +function point.abs (z) + local function sqr(x) return x*x end + return sqrt(sqr(z.re) + sqr(z.im)) +end + +function point.norm (z) + local function sqr(x) return x*x end + return (sqr(z.re) + sqr(z.im)) +end + +function point.arg (z) + return math.atan(z.im, z.re) +end + +function point.get(z) + return z.re, z.im +end + +function point.sqrt(z) + local y = sqrt((point.mod(z)-z.re)/2) + local x = z.im/(2*y) + return point(x,y) +end
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_points.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_points.lua new file mode 100644 index 0000000000..bcaff010cc --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_points.lua @@ -0,0 +1,98 @@ +-- tkz_elements_points.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +-- ---------------------------------------------------------------- +-- points create +-- ---------------------------------------------------------------- + +function point: new ( a,b ) + return scale * point (a,b ) +end + +function point: polar ( radius, phi ) + return scale * polar_ ( radius, phi ) +end + +function point: polar_deg ( radius, phi ) + return scale * polar_ ( radius, phi * math.pi/180 ) +end + +function point: north(d) + local d = d or 1 + return self+ polar_ ( d, math.pi/2 ) +end + +function point: south(d) + local d = d or 1 + return self + polar_ ( d, -math.pi/2 ) + end + +function point: east(d) + local d = d or 1 + return self+ point( d, 0 ) +end + +function point: west(d) + local d = d or 1 + return self + point ( -d, 0 ) + end +-- ---------------------------------------------------------------- +-- transformations +-- ---------------------------------------------------------------- +function point: symmetry(pt) + return symmetry_ (self ,pt) +end + +function point: set_symmetry (...) + local tp = table.pack(...) + local i + local t = {} + for i=1,tp.n do + table.insert( t , symmetry_ (self , tp[i]) ) + end + return table.unpack ( t ) +end + +function point: rotation(angle , pt) + return rotation_(self,angle,pt) +end + +function point:set_rotation (angle,...) + local tp = table.pack(...) + local i + local t = {} + for i=1,tp.n do + table.insert( t , rotation_ (self,angle , tp[i]) ) + end + return table.unpack ( t ) +end + +function point: homothety(t,pt) + return homothety_(self,t,pt) +end + +function point: set_homothety (coeff,...) + local tp = table.pack(...) + local i + local t = {} + for i=1,tp.n do + table.insert( t , homothety_ (self, coeff , tp[i]) ) + end + return table.unpack ( t ) +end + +function point: normalize() + local d = point.abs(self) + return point(self.re/d,self.im/d) +end diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangles.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangles.lua new file mode 100644 index 0000000000..1960248e50 --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_triangles.lua @@ -0,0 +1,366 @@ +-- tkz_elements_triangles.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +triangle = {} +function triangle: new (za, zb ,zc) + local type = 'triangle' + local circumcenter = circum_center_ (za , zb , zc) + local centroid = barycenter_ ( {za,1} , {zb,1} , {zc,1} ) + local incenter = in_center_ (za , zb , zc) + local orthocenter = ortho_center_ (za , zb , zc) + local eulercenter = euler_center_ (za , zb , zc) + local c = point.abs(zb-za) + local a = point.abs(zc-zb) + local b = point.abs(za-zc) + local alpha = point.arg ((zc-za) / (zb-za)) + local beta = point.arg ((za-zb) / (zc-zb)) + local gamma = point.arg ((zb-zc) / (za-zc)) + local ab =line : new (za,zb) + local ac =line : new (za,zc) + local bc =line : new (zb,zc) + local new_triangle = {pa = za, pb = zb, pc = zc, type = type, + circumcenter=circumcenter,centroid=centroid,incenter=incenter, + eulercenter=eulercenter, orthocenter=orthocenter,a=a,b=b,c=c,ab=ab,ac=ac,bc=bc, + alpha=alpha,beta=beta,gamma=gamma} + setmetatable(new_triangle, {__index = triangle}) + return new_triangle +end +----------------------- +-- points -- +----------------------- +function triangle: bevan_point () + return circum_center_ ( self : excentral_tr()) +end + +function triangle: mittenpunkt_point () + return lemoine_point_ ( self : excentral_tr()) +end + +function triangle: gergonne_point () + return gergonne_point_ ( self.pa , self.pb , self.pc) +end + +function triangle: nagel_point () +return nagel_point_ ( self.pa , self.pb , self.pc) +end + +function triangle: feuerbach_point () +return feuerbach_point_ ( self.pa , self.pb , self.pc) +end + +function triangle: lemoine_point() + return lemoine_point_ ( self.pa , self.pb , self.pc) +end + +function triangle: symmedian_point() + return lemoine_point_ ( self.pa , self.pb , self.pc) +end + +function triangle: spieker_center() +return spieker_center_ ( self.pa , self.pb , self.pc ) +end + +function triangle: barycenter (ka,kb,kc) + return barycenter_ ({self.pa,ka},{self.pb,kb},{self.pc,kc}) +end + +function triangle: base (u,v) -- (ab,ac) base coord u,v + return barycenter_ ({self.pa,(1-u-v)},{self.pb,u},{self.pc,v}) +end + +function triangle: euler_points () + local H + H = ortho_center_ ( self.pa , self.pb , self.pc ) + 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 ) +end + +------------------- +-- Result -> line +------------------- +-- N,H,G,O -- check_equilateral (a,b,c) +function triangle: euler_line () + return line : new (self.orthocenter,self.circumcenter) +end + +function triangle: symmedian_line (n) + local a,b,c,l + a = self.pa + b = self.pb + c = self.pc + l = self : lemoine_point () + if n==1 then + return line : new (b,intersection_ll_ (b,l,a,c)) + elseif n==2 then + return line : new (c,intersection_ll_ (c,l,a,b)) + else + return line : new (a,intersection_ll_ (a,l,b,c)) + end +end + +function triangle: altitude (n) + local a,b,c,o + a = self.pa + b = self.pb + c = self.pc + o = ortho_center_ (a,b,c) + if n==1 then + return line : new (b,intersection_ll_ (b,o,a,c)) + elseif n==2 then + return line : new (c,intersection_ll_ (c,o,a,b)) + else + return line : new (a,intersection_ll_ (a,o,b,c)) + 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) + if n==1 then + return line : new (b,intersection_ll_ (b,i,a,c)) + elseif n==2 then + return line : new (c,intersection_ll_ (c,i,a,b)) + else + return line : new (a,intersection_ll_ (a,i,b,c)) + end +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 + if n==1 then -- ac + return line : new (b,bisector_ext_ (b,c,a)) + elseif n==2 then -- ab + + return line : new (c,bisector_ext_ (c,a,b)) + else -- bc + return line : new (a,bisector_ext_ (a,b,c)) + end +end + +function triangle: antiparallel(pt,n) -- n =1 swap n=2 2 swap +local a,b,c,i,u,v,w + a = self.pa + b = self.pb + c = self.pc + i = in_center_ (a,b,c) + if n==1 then + u = symmetry_axial_ (b,i,a) + v = symmetry_axial_ (b,i,c) + w = ll_from_ ( pt , u , v ) + intersection_ll_ (pt,w,a,b) + return line : new (intersection_ll_ (pt,w,c,b),intersection_ll_ (pt,w,a,b)) + elseif n==2 then + u = symmetry_axial_ (c,i,a) + v = symmetry_axial_ (c,i,b) + w = ll_from_ ( pt , u , v ) + intersection_ll_ (pt,w,a,c) + return line : new (intersection_ll_ (pt,w,b,c),intersection_ll_ (pt,w,a,c)) + else + u = symmetry_axial_ (a,i,b) + v = symmetry_axial_ (a,i,c) + w = ll_from_ ( pt , u , v ) + intersection_ll_ (pt,w,b,c) + return line : new (intersection_ll_ (pt,w,c,a),intersection_ll_ (pt,w,b,a)) + end +end +----------------------- +-- circles -- +----------------------- +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() +return circle : new (circum_circle_ ( self.pa , self.pb , self.pc), self.pa ) +end + +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 + local a,b,c,o + a = self.pa + b = self.pb + c = self.pc + if n==1 then + o = ex_center_ (b,c,a) + return circle : new (o , projection_ (c,a,o)) + elseif n==2 then + o = ex_center_ (c,a,b) + return circle : new (o , projection_ (a,b,o)) + else + o = ex_center_ (a,b,c) + return circle : new (o , projection_ (b,c,o)) + end +end + +function triangle: first_lemoine_circle() +local lc,oc + lc = self: lemoine_point() + oc = self.circumcenter +return circle : new( midpoint_ (lc,oc),intersection_ll_ (lc,ll_from_ (lc,self.pa,self.pb),self.pa,self.pc)) +end + +function triangle: second_lemoine_circle() +local lc,a,b,c,r,th + lc = self: lemoine_point() + a = point.abs(self.pc-self.pb) + b = point.abs(self.pa-self.pc) + c = point.abs(self.pb-self.pa) + r = ( a*b*c) / (a*a+b*b+c*c) + th = lc + point(r,0) + return circle : new (lc, th ) +end + +function triangle: spieker_circle() +local ma,mb,mc,sp + ma,mb,mc = medial_tr_ ( self.pa , self.pb , self.pc) + sp = in_center_ (ma,mb,mc) +return circle : new (sp,projection_ (ma,mb,sp)) +end + +------------------- +-- Result -> triangle +------------------- +function triangle: orthic() +return triangle : new (orthic_tr_ ( self.pa , self.pb , self.pc)) +end + +function triangle: medial() +return triangle : new (medial_tr_ ( self.pa , self.pb , self.pc)) +end + +function triangle: incentral() + return triangle : new (incentral_tr_ ( self.pa , self.pb , self.pc)) +end + +function triangle: excentral() + return triangle : new (excentral_tr_ ( self.pa , self.pb , self.pc)) +end + +function triangle: intouch() + return triangle : new (intouch_tr_ ( self.pa , self.pb , self.pc)) +end + +function triangle: contact() + return triangle : new (intouch_tr_ ( self.pa , self.pb , self.pc)) +end + +function triangle: extouch() + return triangle : new (extouch_tr_ ( self.pa , self.pb , self.pc)) +end + +function triangle: feuerbach() + return triangle : new (feuerbach_tr_ (self.pa , self.pb , self.pc)) +end + +function triangle: anti () + return triangle : new (anti_tr_ (self.pa,self.pb,self.pc)) +end + +function triangle: tangential () + return triangle : new (tangential_tr_ (self.pa,self.pb,self.pc)) +end + +function triangle: cevian (p) + return triangle : new (cevian_ (self.pa,self.pb,self.pc,p)) +end + +function triangle: symmedian () + local p + p = lemoine_point_ ( self.pa , self.pb , self.pc) + return triangle : new (cevian_ (self.pa,self.pb,self.pc,p)) +end + +function triangle: euler () + return triangle : new (euler_points_ (self.pa,self.pb,self.pc) ) +end + +------------------- +-- Result -> miscellaneous +------------------- +function triangle: get_angle (n) + local a,b,c + a = self.pa + b = self.pb + c = self.pc + if n==1 then + return point.arg ((a-b)/(c-b)) + elseif n==2 then + return point.arg ((b-c)/(a-c)) + else + return point.arg ((c-a)/(b-a)) + end +end + +function triangle: projection (p) + local x,y,z + x = projection_ (self.pb,self.pc,p) + y = projection_ (self.pa,self.pc,p) + z = projection_ (self.pa,self.pb,p) + return x,y,z +end + +function triangle: parallelogram () + local x = self.pc + self.pa - self.pb + return x +end + +function triangle: check_equilateral () + local A,B,C,epsilon + epsilon = 10 ^(-8) + A = self.pb - self.pc + B = self.pa - self.pc + C = self.pa - self.pb + if (point.abs(A)-point.abs(B) < epsilon) and (point.abs(B)-point.abs(C) < epsilon) + then + tex.print("equilateral !!") + error("something went wrong!") + end +end + +function triangle: area () + return area_(self.pa,self.pb,self.pc) +end + +function triangle: barycentric_coordinates (pt) + return barycentric_coordinates_ (self.pa,self.pb,self.pc,pt) +end + +function triangle: in_out (pt) + return in_out_ (self.pa,self.pb,self.pc,pt) +end + +return triangle
\ No newline at end of file diff --git a/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vectors.lua b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vectors.lua new file mode 100644 index 0000000000..44ea2f7f2e --- /dev/null +++ b/macros/latex/contrib/tkz/tkz-elements/latex/tkz_elements_vectors.lua @@ -0,0 +1,35 @@ +-- tkz_elements_vectors.lua +-- date 2023/10/20 +-- version 1.00b +-- Copyright 2023 Alain Matthes +-- This work may be distributed and/or modified under the +-- conditions of the LaTeX Project Public License, either version 1.3 +-- of this license or (at your option) any later version. +-- The latest version of this license is in +-- http://www.latex-project.org/lppl.txt +-- and version 1.3 or later is part of all distributions of LaTeX +-- version 2005/12/01 or later. +-- This work has the LPPL maintenance status “maintained”. +-- The Current Maintainer of this work is Alain Matthes. + +-- ---------------------------------------------------------------------------- +vector = {} +function vector: new(z1, z2) + local type = 'vector' + local norm = point.abs(z2-z1) + local new_vector = {st = z1, ed = z2,norm = norm,type=type} + setmetatable(new_vector, {__index = vector}) + return new_vector +end + +function vector: normalize () + local z = self.ed-self.st + local d = point.abs(z) + local nz = point(z.re/d,z.im/d) + return nz + self.st +end + + function vector: add (v) + return vector :new (self.st+v.st, self.ed,v.ed) + end +return vector diff --git a/macros/latex/contrib/tkz/tkz-euclide/README.md b/macros/latex/contrib/tkz/tkz-euclide/README.md index a272f5a384..c50db0cb55 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/README.md +++ b/macros/latex/contrib/tkz/tkz-euclide/README.md @@ -1,6 +1,6 @@ # tkz-euclide — for euclidean geometry -Release 5.03c 2023/10/20 +Release 5.04c 2023/10/26 ## Description @@ -65,23 +65,25 @@ Other examples, in French, are on my site. ## History -- 5.03c. Correction of the file tkz-obj-lua-points-spc.tex. Bug in the macro `\tkzDefBarycentricPointTwo`. +- 5.04c Some files have been renamed. + +- 5.03c Correction of the file tkz-obj-lua-points-spc.tex. Bug in the macro `\tkzDefBarycentricPointTwo`. Add macro |\tkzDrawEllipse|; -- 5.02c. Correction of the file tkz-lib-eu-shape.tex. Remove duplicate macro inside tkz-draw-eu-points.tex (ex tkz-obj-eu-draw-points.tex); +- 5.02c Correction of the file tkz-lib-eu-shape.tex. Remove duplicate macro inside tkz-draw-eu-points.tex (ex tkz-obj-eu-draw-points.tex); - 5.01c Correction of the date of the file tkz-euclide.sty. Cleaned up the file tkz-tools-lua-math.tex. Added file tkz-obj-eu-points-spc.tex; - 5.00c Added the "lua" option to the package, allowing to perform most of the calculations with "lua". This saves time and precision; -- 4.25c. Remove \input{tkz-obj-eu-draw-triangles.tex} from the list of files to load. +- 4.25c Remove \input{tkz-obj-eu-draw-triangles.tex} from the list of files to load. -- 4.24c. Correction of a bug in the macro `\tkzMarkAngle`; +- 4.24c Correction of a bug in the macro `\tkzMarkAngle`; Modification of the macro `\tkzDefCircle[apollonius]`; -- 4.23c. Correction of a bug in the macro `\tkzDrawSemiCircle`, +- 4.23c Correction of a bug in the macro `\tkzDrawSemiCircle`, Modification of `\tkzDefRadicalAxis`, Remove old codes, Correction of the documentation; diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex index 8ab85da376..6e98386a2d 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/latex/TKZdoc-euclide-main.tex @@ -21,10 +21,10 @@ headings = small ]{tkz-doc} \gdef\tkznameofpack{tkz-euclide} -\gdef\tkzversionofpack{5.03c} +\gdef\tkzversionofpack{5.04c} \gdef\tkzdateofpack{\today} \gdef\tkznameofdoc{doc-tkz-euclide} -\gdef\tkzversionofdoc{5.03c} +\gdef\tkzversionofdoc{5.04c} \gdef\tkzdateofdoc{\today} \gdef\tkzauthorofpack{Alain Matthes} \gdef\tkzadressofauthor{} diff --git a/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf b/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf Binary files differindex e8ccbe8cdc..76a0b3c7f5 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf +++ b/macros/latex/contrib/tkz/tkz-euclide/doc/tkz-euclide.pdf diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex index 5f79e810fa..001c8f3226 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-angles.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tool-eu-angles.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tool-eu-angles.tex} \makeatletter %<--------------------------------------------------------------------------–> % tkzSetUpArc diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex index e083f9a96b..aef5271531 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-circles.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-draw-circles.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-draw-circles.tex} \makeatletter %<--------------------------------------------------------------------------–> % tkzSetUpCircle diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex index aea5f55ba1..046bd4b9bd 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-compass.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-compass.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-compass.tex} \makeatletter %<--------------------------------------------------------------------------–> % Author Alain Matthes diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex index f92aa7054e..cbacfdd3d4 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-ellipses.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-draw-ellipses.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-draw-ellipses.tex} \makeatletter diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex index a268113f85..0a5c9c1be8 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-lines.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-draw-lines.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-draw-lines.tex} \makeatletter %<--------------------------------------------------------------------------–> diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex index 38a6020d46..520e3159e8 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-points.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-draw-eu-points.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-draw-eu-points.tex} \makeatletter %<---------------------------------------------------------------------------> % tkzSetUpPoint définit la forme d'un point diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex index 8d15afdf16..df42073c07 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-polygons.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-polygons.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-polygons.tex} \makeatletter %<--------------------------------------------------------------------------–> % Polygon diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex index 520188ed7d..1400924439 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-protractor.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-protractor.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-protractor.tex} \makeatletter %<--------------------------------------------------------------------------–> % !!! idea from Y. Combe !!! diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex index b20d1945a8..31684e81fe 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-sectors.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-sectors.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-sectors.tex} \makeatletter %<----------------------- Sectors ------------------------------–> \gdef\tkz@nums{0} diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex index 7a13c1e0b4..7dd82c3f3b 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/drawings/tkz-draw-eu-show.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-show.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-show.tex} \makeatletter %<--------------------------------------------------------------------------–> % finding specific points in a triangle diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex index 83f04d1314..5c25cf710e 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-marks.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-lib-eu-marks.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-lib-eu-marks.tex} \makeatletter %<--------------------------------------------------------------------------–> % Création des symboles diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex index 0837f37a12..f21fa29fd9 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/libs/tkz-lib-eu-shape.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-lib-eu-shape.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-lib-eu-shape.tex} %<--------------------------------------------------------------------------–> % Création des symboles %<--------------------------------------------------------------------------–> diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-circles-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex index 6f5eb1c577..3dc06c7e29 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-circles-by.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles-by.tex @@ -11,8 +11,8 @@ % The Current Maintainer of this work is Alain Matthes. \def\fileversion{6.00} -\def\filedate{2023/10/20} -\typeout{2023/10/20 6.00 tkz-obj-eu-circles.tex} +\def\filedate{2023/10/26} +\typeout{2023/10/26 6.00 tkz-obj-eu-circles.tex} \makeatletter %<--------------------------------------------------------------------------–> % tkzCircle center and one point diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex index 68f17c42ea..b6d733b242 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-circles.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-circles.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-lua-circles.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-lua-circles.tex} \makeatletter %<--------------------------------------------------------------------------–> % tkzCircle center and one point diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex index 75c8b0629c..3333524d78 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-by.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-by.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-lua-points-by.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-lua-points-by.tex} \makeatletter %<--------------------------------------------------------------------------–> % Transformations Géométriques diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-spc.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex index ec4932d8ac..6003bb8efe 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-spc.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-spc.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} +\def\fileversion{5.04c} \def\filedate{2023/01/23} -\typeout{2023/01/23 5.03c tkz-obj-lua-points-spc.tex} +\typeout{2023/01/23 5.04c tkz-obj-lua-points-spc.tex} \makeatletter %add ExCenter %<--------------------------------------------------------------------------–> diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-with.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex index 7b4cae6c57..fe5ba902c0 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points-with.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points-with.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-lua-points-with.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-lua-points-with.tex} \makeatletter %<--------------------------------------------------------------------------–> % Vectors diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex index 936955cba0..744639a8a3 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-lua-points.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj-lua/tkz-obj-eu-lua-points.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-lua-points.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-lua-points.tex} \makeatletter %<---------------------------------------------------------------------------> % init def point diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex index 2505134139..1684d3b5cd 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-axesmin.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-axesmin} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-axesmin} \makeatletter \def\removedot#1.{#1} diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex index f74d9b8b98..05b66f6f10 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles-by.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-circles.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-circles.tex} \makeatletter %<--------------------------------------------------------------------------–> % tkzCircle center and one point diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex index 7ddc7036d4..2f57f39d16 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-circles.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-circles.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-circles.tex} \makeatletter %<--------------------------------------------------------------------------–> % tkzCircle center and one point diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex index ca51a16e94..e09d0b5b53 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-grids.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-grids.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-grids.tex} \makeatletter %<--------------------------------------------------------------------------–> % Setup Grid diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex index beb9b6dbb6..31bcc0d577 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-lines.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-lines.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-lines.tex} \makeatletter %<--------------------------------------------------------------------------–> % les lignes diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex index dc4eac8267..b23f431925 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-by.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-eu-points-by.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-eu-points-by.tex} \makeatletter %<--------------------------------------------------------------------------–> % Transformations Géométriques diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex index 63cd1dc1a8..838d573ff2 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-rnd.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-points-rnd.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-points-rnd.tex} %<--------------------------------------------------------------------------–> \makeatletter %<-------------------------------------------------------------------------–> diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex index 38693d87f5..ac65123719 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-spc.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-el-points.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-el-points.tex} \makeatletter %add ExCenter %<--------------------------------------------------------------------------–> diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex index 370a5a3e4d..9d73a8316f 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points-with.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-points-with.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-points-with.tex} \makeatletter %<--------------------------------------------------------------------------–> % Vectors diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex index 3b3b5fe730..70e6c0702a 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-points.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-points.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-points.tex} \makeatletter %<---------------------------------------------------------------------------> % init def point diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex index 7600ce7925..6bdf499aa6 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-polygons.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-polygons.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-polygons.tex} % bug in regular polygon side 2020/03/09 \makeatletter %<--------------------------------------------------------------------------–> diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex index 2faf7a305d..0312eaca5d 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/obj/tkz-obj-eu-triangles.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-triangles.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-triangles.tex} \makeatletter %<--------------------------------------------------------------------------–> % Triangle Equilateral diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg index 3fa2cfe477..b62312367e 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.cfg @@ -16,9 +16,9 @@ % and save the file in a directory part of your TEXINPUTS environment % variable. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-euclide.cfg} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-euclide.cfg} %<------ colors ---------------------------------------–> \def\tkz@backgroundcolor{white} \def\tkz@textcolor{black} diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty index 508cf3a9c9..8c8208f98a 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tkz-euclide.sty @@ -10,11 +10,11 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. %------------------------------------------------------------------------------- -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-euclide.sty} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-euclide.sty} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{tkz-euclide}[ 2023/10/20 5.03c for pure Euclidean Geometry ] +\ProvidesPackage{tkz-euclide}[ 2023/10/26 5.04c for pure Euclidean Geometry ] \newif\if@tkzlua \@tkzluafalse \DeclareOption{lua}{\@tkzluatrue} @@ -180,16 +180,16 @@ % % next from euclide \makeatletter \if@tkzlua -\input{tkz-tools-lua-base.tex} -\input{tkz-obj-lua-points.tex} -\input{tkz-tools-lua-math.tex} -\input{tkz-tools-lua-intersections.tex} -\input{tkz-obj-lua-points-by.tex} -\input{tkz-obj-lua-points-with.tex} -\input{tkz-obj-lua-points-spc.tex} -\input{tkz-tools-lua-angles.tex} -\input{tkz-obj-lua-circles.tex} -\input{tkz-obj-lua-circles-by.tex} +\input{tkz-tools-eu-lua-base.tex} +\input{tkz-obj-eu-lua-points.tex} +\input{tkz-tools-eu-lua-math.tex} +\input{tkz-tools-eu-lua-intersections.tex} +\input{tkz-obj-eu-lua-points-by.tex} +\input{tkz-obj-eu-lua-points-with.tex} +\input{tkz-obj-eu-lua-points-spc.tex} +\input{tkz-tools-eu-lua-angles.tex} +\input{tkz-obj-eu-lua-circles.tex} +\input{tkz-obj-eu-lua-circles-by.tex} \else \input{tkz-obj-eu-points.tex} \input{tkz-obj-eu-points-by.tex} diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex index c104de0808..e5c9d373c6 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-angles.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-angles.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-lua-angles.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-lua-angles.tex} \makeatletter \def\tkzmathrotatepointaround#1#2#3{% \pgf@process{% diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-base.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex index c2dc0b146b..45068a64e3 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-base.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-base.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-lua-base.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-lua-base.tex} \makeatletter %<--------------------------------------------------------------------------–> \global\let\tkz@tmp@xa\tkz@init@xmin% modif 2016 diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-intersections.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex index 1632ee208b..127db80eba 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-intersections.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-intersections.tex @@ -13,9 +13,9 @@ % The Current Maintainer of this work is Alain Matthes. % utf8 encoding -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-lua-intersections.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-lua-intersections.tex} \makeatletter %<--------------------------------------------------------------------------–> % intersection de deux lignes diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-math.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex index f7509fb217..dc92fb70ca 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-lua-math.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools-lua/tkz-tools-eu-lua-math.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-lua-math.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-lua-math.tex} \makeatletter %<--------------------------------------------------------------------------> %<--------------------------------------------------------------------------> diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex index ed1fd5387e..3212c55e44 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-BB.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-obj-eu-BB.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-obj-eu-BB.tex} \makeatletter %<--------------------------------------------------------------------------–> \def\tkzShowBB{\pgfutil@ifnextchar[{\tkz@ShowBB}{\tkz@ShowBB[]}} diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex index 8ba68fa57b..f32c105855 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-angles.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-eu-angles.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-eu-angles.tex} \makeatletter %<--------------------------------------------------------------------------–> %<--------------------------------------------------------------------------–> diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex index ce0e6db135..22a7787ae6 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-base.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-eu-base.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-eu-base.tex} \makeatletter %<--------------------------------------------------------------------------–> \global\let\tkz@tmp@xa\tkz@init@xmin% modif 2016 diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex index f91f7535ad..b991a2fd22 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-colors.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-eu-colors} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-eu-colors} \makeatletter %<------ Initialisation of the colors with tkzSetUpColors -----------------> diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex index daad8f7f9d..fdab77f658 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-intersections.tex @@ -13,9 +13,9 @@ % The Current Maintainer of this work is Alain Matthes. % utf8 encoding -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-eu-intersections.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-eu-intersections.tex} \makeatletter %<--------------------------------------------------------------------------–> % intersection de deux lignes diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex index 701b594e52..9e39d90217 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-math.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-eu-math.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-eu-math.tex} \makeatletter %<--------------------------------------------------------------------------> % \tkzpointnormalised# diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex index 4b2a86591d..916b166af9 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-modules.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-eu-utilities.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-eu-utilities.tex} \makeatletter %<------------- % chargement des modules ----------------------------------> \def\tkz@obj@all{angles,arcs,compass,defcircles,deflines,defpoints,defpointsby,defpointsrnd,defpointswith,polygons,protractor,sectors,show,triangles}% diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex index 59fce4bcb6..66dbf64bd7 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-text.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-eu-text.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-eu-text.tex} \makeatletter %<--------------------------------------------------------------------------–> % tkzText diff --git a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex index 27f6079312..0bf0b046a9 100644 --- a/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex +++ b/macros/latex/contrib/tkz/tkz-euclide/latex/tools/tkz-tools-eu-utilities.tex @@ -10,9 +10,9 @@ % This work has the LPPL maintenance status “maintained”. % The Current Maintainer of this work is Alain Matthes. -\def\fileversion{5.03c} -\def\filedate{2023/10/20} -\typeout{2023/10/20 5.03c tkz-tools-eu-utilities.tex} +\def\fileversion{5.04c} +\def\filedate{2023/10/26} +\typeout{2023/10/26 5.04c tkz-tools-eu-utilities.tex} \makeatletter \pgfkeys{/tkzClip/.cd, space/.store in = {\tkz@CLI@space}, |