Debian Codegraph @

texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-coordinates.tex

raw
1 \newpage\section{Coordinates}
2
3 This section outlines the various coordinate systems available to users. Given the removal of scaling operations from the \tkzname{Lua} layer, such clarification seems more necessary than ever.
4
5 \subsection{Common Use of Coordinates}
6 As with \tkzNamePack{tkz-euclide}, \tkzNamePack{tkz-elements} is based on a two-dimensional orthonormal Cartesian coordinate system, using centimeters as the default unit.
7
8 It would be inconsistent to use what we will see as an \emph{occs} (orthogonal coordinate coordinate system) in a context focused on Euclidean geometry.
9
10 Moreover, the concept of a point in \tkzNamePack{tkz-elements} is tied to the affix of a complex number. To maintain code clarity and consistency, the option to modify units within Lua has been deliberately omitted.
11
12 \medskip
13
14 \textbf{Conclusion:} For any figure created with \tkzNamePack{tkz-elements}, all points are placed within a 2D orthonormal system using centimeters.
15
16 \begin{tikzpicture}
17 \pgfkeys{/pgf/number format/.cd,std,precision=2}
18 \let\pmpn\pgfmathprintnumber
19 \tkzDefPoints{2/3/M,0/0/O,2/0/A,0/3/B}
20 \tkzLabelPoints(O)
21 \tkzLabelPoint[right](M){$M: z_M = 2 + 3i$}
22 \tkzDrawPoints(M,O)
23 \tkzPointShowCoord(M)
24 \tkzLabelPoint[below,teal](A){$2$}
25 \tkzLabelPoint[left,teal](B){$3$}
26 \tkzDrawSegments[->,add = 0 and 0.25](O,B O,A)
27 \begin{scope}[every annotation/.style={fill=lightgray!15,anchor = east}]
28 \node [annotation,font =\small,text width=6cm] at (current bounding box.west) {
29 Coordinates of $M$
30 \begin{mybox}{}
31 \code{ z.A = point(2, 3)}
32 \end{mybox}
33 };
34 \end{scope}
35 \end{tikzpicture}
36
37 \subsection{Use of barycentric coordinates.}
38
39 A barycentric coordinate system describes the position of a point relative to a reference triangle. Any point in the plane can be expressed with barycentric coordinates, which are defined up to a scalar multiple (homothety). Alternatively, they may be normalized so their sum equals 1.
40
41 Barycentric coordinates are particularly useful in triangle geometry, especially when analyzing properties invariant under affine transformations—those not dependent on angles.
42
43 Consider a triangle $ABC$. One can define key points like the centroid and orthocenter using barycentric coordinates.
44
45 \medskip
46 \texttt{About the Orthocenter.}
47
48 Computing barycentric coordinates for the orthocenter requires knowledge of the triangle's angles. These are stored as attributes in the table \texttt{T.ABC}:
49 \begin{itemize}
50 \item \texttt{T.ABC.alpha} — angle $\widehat{A}$ at vertex $A$
51 \item \texttt{T.ABC.beta} — angle $\widehat{B}$ at vertex $B$
52 \item \texttt{T.ABC.gamma} — angle $\widehat{C}$ at vertex $C$
53 \end{itemize}
54
55 See [\ref{ssub:_triangle_barycentric_ka_kb_kc}]
56
57 \medskip
58 \texttt{Retrieving Barycentric Coordinates.}
59
60 It is possible to compute the barycentric coordinates of a given point with respect to a triangle. The returned values are automatically normalized. See Section~[\ref{ssub:_triangle_barycentric__coordinates_pt}] for usage.
61
62
63 \begin{minipage}{.5\textwidth}
64 \directlua{
65 z.A = point(0, 0)
66 z.B = point(3, 1)
67 z.C = point(1, 3)
68 T.ABC = triangle(z.A, z.B, z.C)
69 z.G = T.ABC:barycentric(1,1,1)
70 z.H = T.ABC:barycentric(math.tan(T.ABC.alpha),
71 math.tan(T.ABC.beta),
72 math.tan(T.ABC.gamma))}
73 \begin{tikzpicture}
74 \tkzGetNodes
75 \tkzDrawPolygon(A,B,C)
76 \tkzDrawPoints(A,B,C,G,H)
77 \tkzLabelPoints(A,B,G)
78 \tkzLabelPoints[above](C,H)
79 \end{tikzpicture}
80 \end{minipage}
81 \begin{minipage}{.5\textwidth}
82 \begin{tkzexample}[code only]
83 \directlua{
84 z.A = point(0, 0)
85 z.B = point(3, 1)
86 z.C = point(1, 3)
87 T.ABC = triangle(z.A, z.B, z.C)
88 z.G = T.ABC:barycentric(1, 1, 1)
89 z.H = T.ABC:barycentric(math.tan(T.ABC.alpha),
90 math.tan(T.ABC.beta),
91 math.tan(T.ABC.gamma))}
92 \end{tkzexample}
93 \end{minipage}
94
95 \subsection{Use of Trilinear Coordinates}
96 \label{sub:use_of_trilinear_coordinates}
97
98 The trilinear coordinates of a point $P$ with respect to a triangle $ABC$ are a triple of values proportional to the directed distances from $P$ to each of the triangle’s sides. These coordinates are homogeneous and typically written as $x : y : z$ or $(x, y, z)$.
99
100 Since only the ratio between the coordinates is relevant, trilinear coordinates are particularly well suited for expressing geometric relationships that are invariant under scaling.
101
102 So $ a' : b' : c' = ka : kb : kc$ in the next example ($a = BC, b = AC, c = AB$).
103
104 \begin{minipage}{.5\textwidth}
105 \directlua{
106 z.A = point(0, 0)
107 z.B = point(5, 0)
108 z.C = point(1, 3)
109 T.ABC = triangle(z.A, z.B, z.C)
110 z.L = T.ABC:trilinear(T.ABC.a,
111 T.ABC.b,
112 T.ABC.c)
113 z.a, z.b, z.c = T.ABC:projections(z.L)}
114 \begin{tikzpicture}
115 \tkzGetNodes
116 \tkzDrawPolygon(A,B,C)
117 \tkzDrawSegments(L,a L,b L,c)
118 \tkzDrawPoints(A,B,C,L)
119 \tkzLabelPoints(A,B)
120 \tkzLabelPoints[above](C,L)
121 \tkzLabelSegment[left](L,a){$ka$}
122 \tkzLabelSegment[above](L,b){$kb$}
123 \tkzLabelSegment[right](L,c){$kc$}
124 \end{tikzpicture}
125 \end{minipage}
126 \begin{minipage}{.5\textwidth}
127 \begin{tkzexample}[code only]
128 \directlua{
129 z.A = point(0, 0)
130 z.B = point(5, 0)
131 z.C = point(1, 3)
132 T.ABC = triangle(z.A, z.B, z.C)
133 z.L = T.ABC:trilinear(T.ABC.a,
134 T.ABC.b,
135 T.ABC.c)
136 z.a, z.b, z.c = T.ABC:projections(z.L)}
137 \end{tkzexample}
138 \end{minipage}
139
140 \subsection{OCCS}
141
142 Objects in this class are \emph{orthonormal Cartesian coordinate system}. They are obtained from the reference system by translation and rotation. They can be used to simplify certain expressions and coordinates.
143 See [\ref{sec:orthonormal_cartesian_coordinate_system}
144 ]
145 \endinput