summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex')
-rw-r--r--macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-point.tex217
1 files changed, 217 insertions, 0 deletions
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