| 1 |
\newpage |
| 2 |
\section{Global Variables and constants} |
| 3 |
This module defines default values and mathematical constants used for precision control and symbolic computations in \tkzNamePack{tkz-elements}. |
| 4 |
|
| 5 |
|
| 6 |
\subsection{Global Variables} |
| 7 |
|
| 8 |
|
| 9 |
\bgroup |
| 10 |
\catcode`_=12 |
| 11 |
\small |
| 12 |
\captionof{table}{Default settings and constants.}\label{tab:tkz_settings} |
| 13 |
\begin{tabular}{ll} |
| 14 |
\toprule |
| 15 |
\textbf{Variable} & \textbf{Description} \\ |
| 16 |
\midrule |
| 17 |
\tkzSysVar{tkz.nb\_dec} & Number of decimals used for formatting (default: 10) \\ |
| 18 |
\tkzSysVar{tkz.epsilon} & Tolerance used for floating-point comparisons ($10^{-\texttt{tkz.nb\_dec}}$) \\ |
| 19 |
\tkzSysVar{tkz.dc} & Number of decimals shown in output (default: 2) \\ |
| 20 |
\midrule |
| 21 |
\textbf{Constant} & \textbf{Description} \\ |
| 22 |
\midrule |
| 23 |
|
| 24 |
\tkzConst{tkz.phi} & Golden ratio $\varphi = \dfrac{1 + \sqrt{5}}{2}$ \\ |
| 25 |
\tkzConst{tkz.invphi} & Inverse golden ratio $1/\varphi = \dfrac{\sqrt{5} - 1}{2}$ \\ |
| 26 |
\tkzConst{tkz.sqrtphi} & Square root of the golden ratio $\sqrt{\varphi}$ \\ |
| 27 |
\tkzConst{tkz.pt} & 254 / 7227 \\ |
| 28 |
\tkzConst{tkz.deg} & math.pi /1 80\\ |
| 29 |
\tkzConst{tkz.rad} & 180 / math.pi \\ |
| 30 |
\bottomrule |
| 31 |
\end{tabular} |
| 32 |
\egroup |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
\subsection{Functions} |
| 37 |
|
| 38 |
\bgroup |
| 39 |
\catcode`\_=12 |
| 40 |
\small |
| 41 |
\captionof{table}{Functions related to settings.}\label{tab:tkz_settings_functions} |
| 42 |
\begin{tabular}{ll} |
| 43 |
\toprule |
| 44 |
\textbf{Function} & \texttt{Reference} \\ |
| 45 |
\midrule |
| 46 |
\tkzFct{tkz}{tkz.reset\_defaults()} & Section~\ref{ssub:tkz_reset_defaults} \\ |
| 47 |
\tkzFct{tkz}{tkz.set\_nb\_dec(n)} & Section~\ref{ssub:tkz_set_nb_dec} \\ |
| 48 |
\bottomrule |
| 49 |
\end{tabular} |
| 50 |
\egroup |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
\subsubsection{Function \tkzFct{tkz-elements}{reset\_defaults()}} |
| 55 |
\label{ssub:tkz_reset_defaults} |
| 56 |
|
| 57 |
Restores default values for numerical precision and formatting: |
| 58 |
\begin{itemize} |
| 59 |
\item \code{tkz.nb\_dec = 10} |
| 60 |
\item \code{tkz.epsilon = 1e-10} |
| 61 |
\item \code{tkz.dc = 2} |
| 62 |
\end{itemize} |
| 63 |
|
| 64 |
|
| 65 |
\subsubsection{Function \tkzFct{tkz}{tkz.set\_nb\_dec(n)}} |
| 66 |
\label{ssub:tkz_set_nb_dec} |
| 67 |
|
| 68 |
|
| 69 |
Sets the number of decimals used in floating-point comparisons and updates the tolerance accordingly: |
| 70 |
\begin{itemize} |
| 71 |
\item \code{tkz.nb\_dec = $n$} |
| 72 |
\item \code{tkz.epsilon = $10^{-n}$} |
| 73 |
\end{itemize} |
| 74 |
\endinput |