| 1 |
% !TEX TS-program = lualatex |
| 2 |
% Documentation of tkz-elements v5.04c |
| 3 |
% Copyright (c) 2023–2025 Alain Matthes |
| 4 |
% SPDX-License-Identifier: LPPL-1.3c |
| 5 |
% Maintainer: Alain Matthes |
| 6 |
|
| 7 |
\documentclass[ |
| 8 |
DIV=16, |
| 9 |
fontsize=10, |
| 10 |
index=totoc, |
| 11 |
twoside, |
| 12 |
cadre, |
| 13 |
headings=small |
| 14 |
]{tkz-doc} |
| 15 |
%\overfullrule=5pt |
| 16 |
\gdef\tkznameofpack{tkz-elements} |
| 17 |
\gdef\tkzversionofpack{5.06c} |
| 18 |
\gdef\tkzdateofpack{\today} |
| 19 |
\gdef\tkznameofdoc{tkz-elements.pdf} |
| 20 |
\let\tkzversionofdoc\tkzversionofpack |
| 21 |
\let\tkzdateofdoc\tkzdateofpack |
| 22 |
\gdef\tkzauthorofpack{Alain Matthes} |
| 23 |
\gdef\tkzadressofauthor{} |
| 24 |
\gdef\tkznamecollection{AlterMundus} |
| 25 |
\gdef\tkzurlauthor{http://altermundus.fr} |
| 26 |
\gdef\tkzengine{lualatex} |
| 27 |
\nameoffile{\tkznameofpack} |
| 28 |
\let\tkzurlauthorcom\tkzurlauthor |
| 29 |
% -- Packages --------------------------------------------------- |
| 30 |
\usepackage[dvipsnames,svgnames]{xcolor} |
| 31 |
% my packages |
| 32 |
\usepackage{tkz-base} |
| 33 |
\usetikzlibrary{mindmap,shapes.multipart} |
| 34 |
\usepackage[mini]{tkz-euclide} |
| 35 |
\usepackage{tkz-elements} |
| 36 |
\usepackage{tkzexample} |
| 37 |
\usepackage{pgfornament} |
| 38 |
|
| 39 |
% mdf warning silence (optionnel) |
| 40 |
\makeatletter |
| 41 |
\renewcommand*\mdf@PackageWarning[1]{} |
| 42 |
\renewcommand*\mdf@PackageInfo[1]{} |
| 43 |
\makeatother |
| 44 |
|
| 45 |
% for metapost |
| 46 |
\usepackage{luamplib} |
| 47 |
\everymplib{input mpcolornames; beginfig(1);} |
| 48 |
\everyendmplib{endfig;} |
| 49 |
|
| 50 |
% for index |
| 51 |
\usepackage{scrindex} |
| 52 |
\makeindex |
| 53 |
|
| 54 |
|
| 55 |
\usepackage[colorlinks,pdfencoding=auto, psdextra]{hyperref} |
| 56 |
\hypersetup{ |
| 57 |
linkcolor=black, |
| 58 |
citecolor=Green, |
| 59 |
filecolor=Mulberry, |
| 60 |
urlcolor=orange, |
| 61 |
menucolor=black, |
| 62 |
runcolor=Mulberry, |
| 63 |
linkbordercolor=black, |
| 64 |
citebordercolor=Green, |
| 65 |
filebordercolor=Mulberry, |
| 66 |
urlbordercolor=NavyBlue, |
| 67 |
menubordercolor=black, |
| 68 |
runbordercolor=Mulberry, |
| 69 |
pdfsubject={Euclidean Geometry}, |
| 70 |
pdfauthor={\tkzauthorofpack}, |
| 71 |
pdftitle={\tkznameofpack}, |
| 72 |
pdfcreator={\tkzengine} |
| 73 |
} |
| 74 |
|
| 75 |
% ...then bookmark |
| 76 |
\usepackage{bookmark} |
| 77 |
|
| 78 |
% fonts |
| 79 |
%<---------------------------------------------------------------------------> |
| 80 |
\usepackage{fontspec} |
| 81 |
\setmainfont{Linux Libertine O} |
| 82 |
\usepackage{unicode-math} |
| 83 |
\usepackage{concmath-otf} |
| 84 |
\let\rmfamily\ttfamily |
| 85 |
%<---------------------------------------------------------------------------> |
| 86 |
% load other packages |
| 87 |
\usepackage{pifont} |
| 88 |
\newcommand{\cmark}{\colorbox{green}{\textcolor{white}{\ding{51}}}} |
| 89 |
\newcommand{\xmark}{\colorbox{red}{\textcolor{white}{\ding{55}}}} |
| 90 |
\usepackage{multicol} |
| 91 |
\usepackage[english]{babel} |
| 92 |
\usepackage[normalem]{ulem} |
| 93 |
\usepackage{booktabs} |
| 94 |
\usepackage{array} |
| 95 |
\usepackage{cellspace} |
| 96 |
\usepackage{shortvrb} |
| 97 |
\usepackage{fancyvrb} |
| 98 |
\usepackage{enumitem} |
| 99 |
\usepackage{moreenum} |
| 100 |
\usepackage{textcomp} |
| 101 |
\usepackage{mathtools} |
| 102 |
\usepackage{amsthm} |
| 103 |
\usepackage{thmtools} |
| 104 |
|
| 105 |
\usepackage[most]{tcolorbox} |
| 106 |
\newtcolorbox{mybox}{ |
| 107 |
enhanced, |
| 108 |
boxrule=0pt,frame hidden, |
| 109 |
borderline west={3pt}{0pt}{cyan!75!black}, |
| 110 |
colback=lightgray!10!white, |
| 111 |
sharp corners |
| 112 |
} |
| 113 |
% end load packages |
| 114 |
%<---------------------------------------------------------------------------> |
| 115 |
% Indexation style |
| 116 |
\makeatletter |
| 117 |
\renewenvironment{theindex} |
| 118 |
{\section*{\indexname}\begin{multicols}{2}% |
| 119 |
\@mkboth{\MakeUppercase\indexname}% |
| 120 |
{\MakeUppercase\indexname}% |
| 121 |
\thispagestyle{plain}\parindent\z@ |
| 122 |
\parskip\z@ \@plus .3\p@\relax |
| 123 |
\columnseprule \z@ |
| 124 |
\columnsep 35\p@ |
| 125 |
\let\item\@idxitem} |
| 126 |
{\end{multicols}} |
| 127 |
\makeatother |
| 128 |
% end indexation style |
| 129 |
%<---------------------------------------------------------------------------> |
| 130 |
% Indexation |
| 131 |
\newcommand{\tkzAttr}[2]{\textbf{\texttt{#2}}\index{#1_3@\texttt{#1: Attributes}!\texttt{#2}}} |
| 132 |
\newcommand{\tkzVar}[2]{\textbf{\texttt{#2}}\index{#1_3@\texttt{#1: Reserved variable}!\texttt{#2}}} |
| 133 |
\newcommand{\tkzMeth}[2]{\textbf{\texttt{#2}}\index{#1_3@\texttt{#1: Methods}!\texttt{#2}}} |
| 134 |
\newcommand{\tkzMeta}[2]{\textbf{\texttt{#2}}\index{#1_3@\texttt{#1: Metamethods}!\texttt{#2}}} |
| 135 |
\newcommand{\tkzFct}[2]{\textbf{\texttt{#2}}\index{#1_3@\texttt{#1: Functions}!\texttt{#2}}} |
| 136 |
\newcommand{\tkzMod}[1]{\textbf{\texttt{#1}}\index{Modules!#1@\texttt{#1}}} |
| 137 |
\newcommand{\tkzClass}[1]{\textbf{\texttt{#1}}\index{Classes!#1@\texttt{#1}}} |
| 138 |
\newcommand{\tkzNameObj}[1]{\textbf{\texttt{#1}}\index{Objects!#1@\texttt{#1}}} |
| 139 |
\newcommand{\tkzMacro}[2]{\textbf{\texttt{\textbackslash#2}}\index{#1_3@\texttt{#1: Macro}!\texttt{#2}}} |
| 140 |
\newcommand{\tkzEngine}[1]{\textbf{\texttt{#1}}\index{Engine !#1@\texttt{#1}}} |
| 141 |
\newcommand{\tkzPopt}[2]{\texttt{#2}\index{#1_3@\texttt{#1: options}!\texttt{#2}}} |
| 142 |
\newcommand{\tkzEnv}[2]{\textbf{\texttt{#2}}\index{#1_3@\texttt{#1: Environments}!\texttt{#2}}} |
| 143 |
\newcommand{\tkzConst}[1]{\textbf{\texttt{#1}}\index{Constants!#1@\texttt{#1}}} |
| 144 |
\newcommand{\tkzSysVar}[1]{\textbf{\texttt{#1}}\index{Variables system!#1@\texttt{#1}}} |
| 145 |
% Keyword for function options or parameters |
| 146 |
\newcommand{\tkzKey}[1]{\texttt{#1}} |
| 147 |
|
| 148 |
% Optional argument notation, e.g., (pt) |
| 149 |
\newcommand{\tkzOptArg}[1]{\ensuremath{(#1)}} |
| 150 |
% Keyword used as an optional key in a function call (e.g., known, near) |
| 151 |
%\newcommand{\tkzKey}[1]{\texttt{#1}\index{#1@\texttt{#1}}} |
| 152 |
|
| 153 |
% end indexation |
| 154 |
%<---------------------------------------------------------------------------> |
| 155 |
% decoration |
| 156 |
\newcommand{\lefthand}{\ding{43}} |
| 157 |
\newcommand{\tkzimpbf}[1]{\texttt{tkzPopt#1}} |
| 158 |
\newcommand{\tkzRHand}{\textcolor{red}{\lefthand}} |
| 159 |
\newcommand{\smallbf}[1]{\textbf{\small #1}} |
| 160 |
\newcommand{\parallelsum}{\mathbin{\!/\mkern-5mu/\!}} |
| 161 |
\newcommand\LUALATEX{Lua\kern-.01em\LaTeX}% |
| 162 |
% end decoration |
| 163 |
%<---------------------------------------------------------------------------> |
| 164 |
% settings styles |
| 165 |
\tkzSetUpColors[background=white,text=black] |
| 166 |
\tkzSetUpPoint[size=2,color=teal,fill=teal!10] |
| 167 |
\tkzSetUpLine[ultra thin,color=teal] |
| 168 |
\tkzSetUpCompass[color=orange,ultra thin,/tkzcompass/delta=10] |
| 169 |
\tikzset{label style/.append style={below,color=teal,font=\scriptsize}} |
| 170 |
\tikzset{new/.style={color=orange,ultra thin}} |
| 171 |
\tikzset{step 1/.style={color=cyan,ultra thin}} |
| 172 |
\tikzset{step 2/.style={color=purple,ultra thin}} |
| 173 |
\def\tkzar{\hspace{1em}-->\hspace{1em}} |
| 174 |
% end settings styles |
| 175 |
%<---------------------------------------------------------------------------> |
| 176 |
% misc |
| 177 |
\makeatletter\let\percentchar\@percentchar\makeatother |
| 178 |
\def\luaveclen#1#2{% |
| 179 |
\directlua{tex.print(string.format( |
| 180 |
'\percentchar.5f',math.sqrt((#1)*(#1)+(#2)*(#2)))) |
| 181 |
}} |
| 182 |
\let\pmpn\pgfmathprintnumber |
| 183 |
\let\code\tkzname |
| 184 |
% end misc |
| 185 |
%<---------------------------------------------------------------------------> |
| 186 |
% Generate a new TOC |
| 187 |
%---------------------------------------------------------- |
| 188 |
% Mini-TOC "Overview" (stoc) with styled parts |
| 189 |
%---------------------------------------------------------- |
| 190 |
%---------------------------------------------------------- |
| 191 |
% Mini-TOC "Overview" (stoc) : now includes \part + \section |
| 192 |
%---------------------------------------------------------- |
| 193 |
%========================================================== |
| 194 |
% Mini-TOC "Overview" (stoc) |
| 195 |
%========================================================== |
| 196 |
|
| 197 |
\DeclareNewTOC[ |
| 198 |
type=overview, |
| 199 |
listname={Overview} |
| 200 |
]{stoc} |
| 201 |
|
| 202 |
%---------------------------------------------------------- |
| 203 |
% Save original KOMA macros |
| 204 |
%---------------------------------------------------------- |
| 205 |
|
| 206 |
\NewCommandCopy{\AddPartTocEntry}{\addparttocentry} |
| 207 |
\NewCommandCopy{\AddSectionTocEntry}{\addsectiontocentry} |
| 208 |
|
| 209 |
%---------------------------------------------------------- |
| 210 |
% Mirror \part into stoc (+ blank line after) |
| 211 |
%---------------------------------------------------------- |
| 212 |
|
| 213 |
\renewcommand{\addparttocentry}[2]{% |
| 214 |
\AddPartTocEntry{#1}{#2}% |
| 215 |
\addxcontentsline{stoc}{part}[{#1}]{#2}% |
| 216 |
\addtocontents{stoc}{\protect\addvspace{\baselineskip}}% |
| 217 |
} |
| 218 |
|
| 219 |
%---------------------------------------------------------- |
| 220 |
% Mirror \section into stoc |
| 221 |
%---------------------------------------------------------- |
| 222 |
|
| 223 |
\renewcommand{\addsectiontocentry}[2]{% |
| 224 |
\AddSectionTocEntry{#1}{#2}% |
| 225 |
\addxcontentsline{stoc}{section}[{#1}]{#2}% |
| 226 |
} |
| 227 |
|
| 228 |
%---------------------------------------------------------- |
| 229 |
% Style of the Overview (stoc) |
| 230 |
%---------------------------------------------------------- |
| 231 |
|
| 232 |
\BeforeStartingTOC[stoc]{% |
| 233 |
|
| 234 |
% PART entries — code style |
| 235 |
\DeclareTOCStyleEntry[ |
| 236 |
beforeskip=.6\baselineskip, |
| 237 |
entryformat=\ttfamily\bfseries, |
| 238 |
pagenumberformat=\ttfamily\bfseries, |
| 239 |
linefill=\hfill |
| 240 |
]{part}{part} |
| 241 |
|
| 242 |
% SECTION entries — compact |
| 243 |
\DeclareTOCStyleEntry[ |
| 244 |
beforeskip=0pt |
| 245 |
]{section}{section} |
| 246 |
} |
| 247 |
%========================================================== |
| 248 |
%-------------------------------------------------------------------------------------------------------------------- |
| 249 |
|
| 250 |
\hbadness=10000 |
| 251 |
%<---------------------------------------------------------------------------> |
| 252 |
\AtBeginDocument{\MakeShortVerb{\|}} |
| 253 |
|
| 254 |
\begin{document} |
| 255 |
|
| 256 |
\parindent=0pt |
| 257 |
\tkzTitleFrame{tkz-elements \tkzversionofpack\\Euclidean Geometry} |
| 258 |
\clearpage |
| 259 |
|
| 260 |
|
| 261 |
\defoffile{ |
| 262 |
This document gathers notes on \tkzNamePack{\tkznameofpack}, a comprehensive \tkzname{Lua} library designed to handle all necessary computations for constructing objects in Euclidean geometry. The document must be compiled with Lua\LATEX.\\ |
| 263 |
|
| 264 |
With \tkzNamePack{tkz-elements}, all definitions and calculations are carried out exclusively in Lua, following an object-oriented programming model. Core geometric entities such as points, lines, triangles, and conics are implemented as object classes.\\ |
| 265 |
Once the computations are complete, graphical rendering is typically handled using \tkzNamePack{tkz-euclide}, although you may also use \TIKZ{} directly if desired.\\ |
| 266 |
|
| 267 |
I discovered Lua and object-oriented programming while developing this package, so it’s possible that some parts could be improved. If you'd like to contribute or offer suggestions, feel free to contact me by email. |
| 268 |
} |
| 269 |
|
| 270 |
\presentation |
| 271 |
|
| 272 |
\vspace*{4em} |
| 273 |
|
| 274 |
\lefthand\ Acknowledgements: I received much valuable advice, remarks, and corrections from \\ \tkzimp{Nicolas Kisselhoff}, \tkzimp{David Carlisle}, \tkzimp{Roberto Giacomelli} and \tkzimp{Qrrbrbirlbel}.\\ |
| 275 |
Special thanks to \tkzimp{Wolfgang Büchel} for his invaluable contribution in correcting the examples. |
| 276 |
|
| 277 |
\vspace*{1em} |
| 278 |
\lefthand\ I would also like to extend my gratitude to \tkzimp{Eric Weisstein}, creator of |
| 279 |
\href{http://mathworld.wolfram.com/about/author.html}{MathWorld}. |
| 280 |
|
| 281 |
\vspace*{1em} |
| 282 |
\lefthand\ You can find some examples on my site and a french documentation: |
| 283 |
\href{http://altermundus.fr}{altermundus.fr}. |
| 284 |
|
| 285 |
\vfill |
| 286 |
Please report typos or any other comments to this documentation to: \href{mailto:[email protected]}{\textcolor{blue}{Alain Matthes}}. |
| 287 |
|
| 288 |
This file can be redistributed and/or modified under the terms of the \LaTeX{} |
| 289 |
Project Public License Distributed from \href{http://www.ctan.org/}{CTAN}\ archives. |
| 290 |
|
| 291 |
\clearpage |
| 292 |
\listofoverviews |
| 293 |
|
| 294 |
\clearpage |
| 295 |
\section*{Attributes Overview} |
| 296 |
\begin{tabular}{ll} |
| 297 |
\textbf{Class} & \textbf{Attributes} \\ |
| 298 |
\hline |
| 299 |
point & \hyperref[point:attributes]{see table} \\ |
| 300 |
line & \hyperref[line:attributes]{see table} \\ |
| 301 |
triangle & \hyperref[triangle:attributes]{see table} \\ |
| 302 |
circle & \hyperref[circle:attributes]{see table} \\ |
| 303 |
occs & \hyperref[occs:attributes]{see table} \\ |
| 304 |
conic & \hyperref[conic:attributes]{see table} \\ |
| 305 |
quadrilateral & \hyperref[quadrilateral:attributes]{see table}\\ |
| 306 |
square & \hyperref[square:attributes]{see table} \\ |
| 307 |
rectangle & \hyperref[rectangle:attributes]{see table} \\ |
| 308 |
parallelogram & \hyperref[parallelogram:attributes]{see table}\\ |
| 309 |
regular & \hyperref[regular:attributes]{see table} \\ |
| 310 |
vector & \hyperref[vector:attributes]{see table} \\ |
| 311 |
matrix & \hyperref[matrix:attributes]{see table} \\ |
| 312 |
angle & \hyperref[angle:attributes]{see table} \\ |
| 313 |
list\_point & \hyperref[list_point:attributes]{see table} \\ |
| 314 |
\end{tabular} |
| 315 |
\section*{Methods Overview} |
| 316 |
\begin{tabular}{ll} |
| 317 |
\textbf{Class} & \textbf{Methods} \\ |
| 318 |
\hline |
| 319 |
point & \hyperref[point:methods]{see table} \\ |
| 320 |
line & \hyperref[line:methods part 1]{see table 1} \\ |
| 321 |
line & \hyperref[line:methods part 2]{see table 2} \\ |
| 322 |
triangle & \hyperref[triangle:methods]{see table} \\ |
| 323 |
circle & \hyperref[circle:methods]{see table} \\ |
| 324 |
circle & \hyperref[circle:methods 2]{see table 2} \\ |
| 325 |
occs & \hyperref[occs:methods]{see table} \\ |
| 326 |
conic & \hyperref[conic:methods]{see table} \\ |
| 327 |
path & \hyperref[path:methods]{see table} \\ |
| 328 |
quadrilateral & \hyperref[quadrilateral:methods]{see table} \\ |
| 329 |
square & \hyperref[square:methods]{see table} \\ |
| 330 |
rectangle & \hyperref[rectangle:methods]{see table} \\ |
| 331 |
parallelogram & \hyperref[parallelogram:methods]{see table} \\ |
| 332 |
regular & \hyperref[regular:methods]{see table} \\ |
| 333 |
vector & \hyperref[vector:methods]{see table} \\ |
| 334 |
matrix & \hyperref[matrix:methods]{see table} \\ |
| 335 |
angle & \hyperref[angle:methods]{see table} \\ |
| 336 |
list\_point & \hyperref[list_point:methods]{see table} \\ |
| 337 |
fct & \hyperref[fct:methods]{see table} \\ |
| 338 |
pfct & \hyperref[pfct:methods]{see table} \\ |
| 339 |
\end{tabular} |
| 340 |
\section*{Metamethods Overview} |
| 341 |
\begin{tabular}{ll} |
| 342 |
\textbf{Class} & \textbf{Methods} \\ |
| 343 |
\hline |
| 344 |
point & \hyperref[point:methods]{see table} \\ |
| 345 |
occs & \hyperref[occs:methods]{see table} \\ |
| 346 |
vector & \hyperref[vector:methods]{see table} \\ |
| 347 |
matrix & \hyperref[matrix:methods]{see table} \\ |
| 348 |
path & \hyperref[path:methods]{see table} \\ |
| 349 |
\end{tabular} |
| 350 |
\clearpage |
| 351 |
\tableofcontents |
| 352 |
|
| 353 |
\clearpage |
| 354 |
\newpage |
| 355 |
|
| 356 |
\part{Geometry Core} |
| 357 |
|
| 358 |
\input{TKZdoc-elements-beginning.tex} |
| 359 |
\input{TKZdoc-elements-structure.tex} |
| 360 |
\input{TKZdoc-elements-why.tex} |
| 361 |
\input{TKZdoc-elements-presentation.tex} |
| 362 |
\input{TKZdoc-elements-convention.tex} |
| 363 |
\input{TKZdoc-elements-organization.tex} |
| 364 |
\input{TKZdoc-elements-coordinates.tex} |
| 365 |
\input{TKZdoc-elements-eps.tex} |
| 366 |
\input{TKZdoc-elements-foundations.tex} |
| 367 |
\input{TKZdoc-elements-classes.tex} |
| 368 |
\input{TKZdoc-elements-classes-point.tex} |
| 369 |
\input{TKZdoc-elements-classes-line.tex} |
| 370 |
\input{TKZdoc-elements-classes-circle.tex} |
| 371 |
\input{TKZdoc-elements-classes-triangle.tex} |
| 372 |
\input{TKZdoc-elements-classes-occs.tex} |
| 373 |
\input{TKZdoc-elements-classes-conic.tex} |
| 374 |
\input{TKZdoc-elements-classes-quadrilateral.tex} |
| 375 |
\input{TKZdoc-elements-classes-square.tex} |
| 376 |
\input{TKZdoc-elements-classes-rectangle.tex} |
| 377 |
\input{TKZdoc-elements-classes-parallelogram.tex} |
| 378 |
\input{TKZdoc-elements-classes-regular.tex} |
| 379 |
|
| 380 |
\part{Algebra and Tools} |
| 381 |
|
| 382 |
\input{TKZdoc-elements-classes-vectors.tex} |
| 383 |
\input{TKZdoc-elements-classes-matrices.tex} |
| 384 |
\input{TKZdoc-elements-classes-path.tex} |
| 385 |
\input{TKZdoc-elements-classes-list-point.tex} |
| 386 |
\input{TKZdoc-elements-classes-angle.tex} |
| 387 |
\input{TKZdoc-elements-intersection.tex} |
| 388 |
\input{TKZdoc-elements-constants.tex} |
| 389 |
\input{TKZdoc-elements-tkz.tex} |
| 390 |
\input{TKZdoc-elements-utils.tex} |
| 391 |
\input{TKZdoc-elements-maths.tex} |
| 392 |
|
| 393 |
\part{Lua and Integration} |
| 394 |
|
| 395 |
|
| 396 |
\input{TKZdoc-elements-lua.tex} |
| 397 |
\input{TKZdoc-elements-transfers.tex} |
| 398 |
\input{TKZdoc-elements-macros-transfert.tex} |
| 399 |
\input{TKZdoc-elements-classes-fct.tex} |
| 400 |
\input{TKZdoc-elements-classes-pfct.tex} |
| 401 |
\input{TKZdoc-elements-metapost.tex} |
| 402 |
|
| 403 |
|
| 404 |
\part{Mathematical and Computational Foundations} |
| 405 |
\input{TKZdoc-elements-CMGE.tex} |
| 406 |
|
| 407 |
|
| 408 |
|
| 409 |
\clearpage\newpage |
| 410 |
\small\printindex |
| 411 |
|
| 412 |
\end{document} |