diff options
author | Norbert Preining <norbert@preining.info> | 2023-12-25 03:00:43 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2023-12-25 03:00:43 +0000 |
commit | 04394251f8dab08ff9ce469f57fd910ae79ecf3b (patch) | |
tree | 7d5e1b982233557d1191afd1d85791c9edc2c6b2 /macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex | |
parent | 4730d615ef9f92ac5b55492b0eadad6023d991e0 (diff) |
CTAN sync 202312250300
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex')
-rw-r--r-- | macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex index 53646eb6c3..c8623799ee 100644 --- a/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex +++ b/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-indepthstudy.tex @@ -216,7 +216,7 @@ The class is provided with two specific metamethods. |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} + There's also a mathematical function, |dot_product|, which takes three arguments. See example \ref{sub:dot_or_scalar_product} \item With the same idea, the operation associated with |^| is the determinant i.e. @@ -667,7 +667,7 @@ You obtain a point on the object by entering a real number between 0 and 1. \end{tkzelements} \begin{tikzpicture} \tkzGetNodes - \tkzDrawline(A,B) + \tkzDrawLine(A,B) \tkzDrawCircle(A,B) \tkzDrawPolygon(A,B,C) \tkzDrawPoints(A,B,C,I,J,K) @@ -699,4 +699,37 @@ You obtain a point on the object by entering a real number between 0 and 1. % subsection point_method (end) +\subsection{Behind the objects} % (fold) +\label{sub:behind_the_objects} + +Before introducing objects, I only used functions whose parameters were points (comlexes). +For example, |z.m = midpoint_ (z.a,z.b)| defines the midpoint of points $a$ and $b$. Avec les objets, il faut d'abord définir la droite/sgment |L.ab| puis on obtient le milieu avec |z.m = L.ab.mid|. + +I've kept the functions (which I'll call "primary") whose only arguments are points. They are distinguished from the others by a terminal underscore. In fact, all (almost) object-related functions depend on a primary function. + +We've just seen the case of the midpoint of a point, so let's look at two other cases: + +\begin{itemize} + \item Rotation around a point. |c| is the center of rotation, |a| the angle and |pt| the point to be affected. + For example: |z.Mp = rotation (z.A,math.pi/6,z.M)| + +\begin{mybox} + function rotation\_ (c,a,pt)\\ + local z = point( math.cos(a) , math.sin(a) )\\ + return z*(pt-c)+c\\ + end \end{mybox} + + With objects, this gives |z.Mp = z.A : rotation (math.pi/6,z.M)| + + +\item The intersection of a line and a circle is obtained using |intersection_lc_ (z.A,z.B,z.O,z.T)|. + using the straight line $(A,B)$ and the circle $C(O,T)$. + + This will result in the objects: | intersection (L.AB,C.OT)| +\end{itemize} + +The difference is that programming is more direct with primary functions and a little more efficient, but loses visibility. + + +% subsection behind_the_objects (end) % section in_depth_study (end)
\ No newline at end of file |