summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/tkz/tkz-elements/doc/latex/TKZdoc-elements-classes-square.tex
blob: fae6d71b2b7db160cabf55bb53b1bca496aa056b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
\newpage
\section{Classe \Iclass{square}} % (fold)

\subsection{Square attributes} % (fold)
\label{sub:square_attributes}

% subsection square_attributes (end)
Points are created in the direct direction. A test is performed to check whether the points form a square, otherwise compilation is blocked.
\begin{mybox}
Creation | S.AB = square : new (z.A,z.B,z.C,z.D)|
\end{mybox}

\bgroup
\catcode`_=12
\small
\captionof{table}{Square attributes.}\label{square:att}
\begin{tabular}{lll}
\toprule
\textbf{Attributes}        & \textbf{Application}  &  \\
\Iattr{square}{pa}         & |z.A = S.AB.pa|       &  \\
\Iattr{square}{pb}         & |z.B = S.AB.pb|       &  \\
\Iattr{square}{pc}         & |z.C = S.AB.pc|       &  \\
\Iattr{square}{pd}         & |z.D = S.AB.pd|       &  \\
\Iattr{square}{type}       & |S.AB.type= 'square'| &  \\
\Iattr{square}{side}       & |s = S.AB.center|     & s = length of side   \\
\Iattr{square}{center}     & |z.I = S.AB.center|   & center of the square \\
\Iattr{square}{exradius}   & |S.AB.exradius|       & radius of the circumscribed circle \\
\Iattr{square}{inradius}   & |S.AB.inxradius|      & radius of the inscribed circle   \\
\Iattr{square}{proj}       & |S.AB.proj|           & projection of the center on one side \\
\Iattr{square}{ab}         & |S.AB.ab|             &  line passing through two vertices   \\
\Iattr{square}{ac}         & |S.AB.ca|             &  idem. \\
\Iattr{square}{ad}         & |S.AB.ad|             &  idem. \\
\Iattr{square}{bc}         & |S.AB.bc|             &  idem. \\
\Iattr{square}{bd}         & |S.AB.bd|             &  idem. \\
\Iattr{square}{cd}         & |S.AB.cd|             &  idem. \\
\bottomrule %
\end{tabular}
\egroup
\subsubsection{Example: square attributes } % (fold)
\label{ssub:example_square_attributes}

\begin{minipage}{.5\textwidth}
\begin{verbatim}
\begin{tkzelements}
z.A        = point  : new ( 0 , 0 )
z.B        = point  : new ( 4 , 0 )
z.C        = point  : new ( 4 , 4)
z.D        = point  : new ( 0 , 4)
S.new      = square : new ( z.A , z.B ,z.C,z.D)
z.I        = S.new.center
z.H        = S.new.proj
\end{tkzelements}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawCircles[orange](I,A I,H)
\tkzDrawPolygon(A,B,C,D)
\tkzDrawPoints(A,B,C,D,H,I)
\tkzLabelPoints(A,B,H,I)
\tkzLabelPoints[above](C,D)
\tkzDrawSegments(I,B I,H)
\tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.exradius}}}
\tkzLabelSegment[sloped](I,H){\pmpn{\tkzUseLua{S.new.inradius}}}
\tkzLabelSegment[sloped](D,C){\pmpn{\tkzUseLua{S.new.side}}}
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.5\textwidth}
   \begin{tkzelements}
   z.A        = point  : new ( 0 , 0 )
   z.B        = point  : new ( 4 , 0 )
   z.C        = point  : new ( 4 , 4)
   z.D        = point  : new ( 0 , 4)
   S.new      = square : new ( z.A , z.B ,z.C,z.D)
   z.I        = S.new.center
   z.H        = S.new.proj
   \end{tkzelements}
   \hspace{\fill}
   \begin{tikzpicture}
   \tkzGetNodes
   \tkzDrawCircles[orange](I,A I,H)
   \tkzDrawPolygon(A,B,C,D)
   \tkzDrawPoints(A,B,C,D,H,I)
   \tkzLabelPoints(A,B,H,I)
   \tkzLabelPoints[above](C,D)
   \tkzDrawSegments(I,B I,H)
   \tkzLabelSegment[sloped](I,B){\pmpn{\tkzUseLua{S.new.exradius}}}
   \tkzLabelSegment[sloped](I,H){\pmpn{\tkzUseLua{S.new.inradius}}}
   \tkzLabelSegment[sloped](D,C){\pmpn{\tkzUseLua{S.new.side}}}
   \end{tikzpicture}
\end{minipage}


\newpage

\subsection{Square methods} % (fold)
\label{sub:square_methods}

\bgroup
\catcode`_=12
\small
\captionof{table}{Square methods.}\label{square:met}
\begin{tabular}{lll}
\toprule
\textbf{Methods} & \textbf{Comments}&    \\
\midrule  
\Imeth{square}{rotation (zi,za)} &|S.IA = square : rotation (z.I,z.A)| &$I$ square center $A$ first vertex\\
\midrule 
\Imeth{square}{side (za,zb)} & |S.AB = square : side (z.A,z.B)|& AB is the first side (direct)\\
\bottomrule %
\end{tabular}
\egroup

\subsubsection{Square with side method} % (fold)
\label{ssub:square_with_side_method}
%
\begin{minipage}{.5\textwidth}
\begin{verbatim}
\begin{tkzelements}
   scale       = 2
   z.A         = point : new ( 0 , 0 )
   z.B         = point : new ( 2 , 1 )
   S.side      = square : side (z.A,z.B)
   z.B         = S.side.pb
   z.C         = S.side.pc
   z.D         = S.side.pd
   z.I         = S.side.center
\end{tkzelements}

\begin{tikzpicture}
   \tkzGetNodes
   \tkzDrawPolygon(A,B,C,D)
   \tkzDrawPoints(A,B,C,D)
   \tkzLabelPoints(A,B)
   \tkzLabelPoints[above](C,D)
   \tkzDrawPoints[red](I)
\end{tikzpicture}
\end{verbatim}
\end{minipage}
\begin{minipage}{.5\textwidth}
   \begin{tkzelements}
scale       = 2
z.A         = point : new ( 0 , 0 )
z.B         = point : new ( 2 , 1 )
S.side      = square : side (z.A,z.B)
z.B         = S.side.pb
z.C         = S.side.pc
z.D         = S.side.pd
z.I         = S.side.center
\end{tkzelements}
\hspace{\fill}
\begin{tikzpicture}
\tkzGetNodes
\tkzDrawPolygon(A,B,C,D)
\tkzDrawPoints(A,B,C,D)
\tkzLabelPoints(A,B)
\tkzLabelPoints[above](C,D)
\tkzDrawPoints[red](I)
\end{tikzpicture}
\end{minipage}
% subsubsection square_with_side_method (end)
% subsubsection example_square_attributes (end)

% subsection square_methods (end)