\newpage \section{Class \Iclass{line}} % (fold) \label{sec:class_line} \subsection{Attributes of a line} % (fold) \label{sub:attributes_of_a_line} Writing |L.AB = line: new (z.A,z.B)| creates an object of the class \tkzname{line} (the notation is arbitrary for the moment). Geometrically, it represents both the line passing through the points $A$ and $B$ as the segment $[AB]$. Thus, we can use the midpoint of |L.AB|, which is, of course, the midpoint of the segment $[AB]$. This medium is obtained with |L.AB.mid|. Note that |L.AB.pa = z.A| and |L.AB.pb = z.B|. Finally, if a line $L$ is the result of a method, you can obtain the points with |z.A,z.B = get_points (L)| or with the previous remark. \begin{mybox} Creation |L.AB = line : new ( z.A , z.B ) | \end{mybox} The attributes are : \vspace{1em} \bgroup \catcode`_=12 \small \captionof{table}{Line attributes.}\label{line:att} \begin{tabular}{lll} \toprule \textbf{Attributes} & \textbf{Application} & \\ \Iattr{line}{pa} & First point of the segment & |z.A = L.AB.pa| \\ \Iattr{line}{pb} & Second point of the segment & \\ \Iattr{line}{type} & Type is 'line' & |L.AB.type = 'line'| \\ \Iattr{line}{mid} & Middle of the segment& |z.M = L.AB.mid|\\ \Iattr{line}{slope} & Slope of the line & Refer to (\ref{ssub:example_class_line})\\ \Iattr{line}{length} &|l = L.AB.length|&Refer to (\ref{sub:transfer_from_lua_to_tex} ; \ref{ssub:example_class_line})\\ \Iattr{line}{north\_pa} & &Refer to (\ref{ssub:example_class_line}) \\ \Iattr{line}{north\_pb} & &\\ \Iattr{line}{south\_pa} & &\\ \Iattr{line}{south\_pb} & &Refer to (\ref{ssub:example_class_line}) \\ \Iattr{line}{east} & &\\ \Iattr{line}{west} & &\\ \Iattr{line}{vec} & |V.AB = L.AB.vec|& defines $\overrightarrow{AB}$ Refer to (\ref{sec:class_vector})\\ \bottomrule \end{tabular} \egroup \subsubsection{Example: attributes of class line} % (fold) \label{ssub:example_class_line} \begin{minipage}{.5\textwidth} \begin{Verbatim} \begin{tkzelements} scale = .5 z.a = point: new (1, 1) z.b = point: new (5, 4) L.ab = line : new (z.a,z.b) z.m = L.ab.mid z.w = L.ab.west z.e = L.ab.east z.r = L.ab.north_pa z.s = L.ab.south_pb sl = L.ab.slope len = L.ab.length \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawPoints(a,b,m,e,r,s,w) \tkzLabelPoints(a,b,e,r,s,w) \tkzLabelPoints[above](m) \tkzDrawLine(a,b) \tkzLabelSegment[sloped](a,b){ab = \tkzUseLua{len}} \tkzLabelSegment[above=12pt,sloped](a,b){slope of (ab) = \tkzUseLua{sl}} \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.5\textwidth}\begin{tkzelements} scale = .5 z.a = point: new (1, 1) z.b = point: new (5, 4) L.ab = line : new (z.a,z.b) z.m = L.ab.mid z.w = L.ab.west z.e = L.ab.east z.r = L.ab.north_pa z.s = L.ab.south_pb sl = L.ab.slope len = L.ab.length \end{tkzelements} \hspace*{\fill} \begin{tikzpicture} \tkzGetNodes \tkzDrawPoints(a,b,m,e,r,s,w) \tkzLabelPoints(a,b) \tkzLabelPoint(r){north\_pa} \tkzLabelPoint(s){south\_pb} \tkzLabelPoint[below](m){mid} \tkzLabelPoint[right](w){west} \tkzLabelPoint[left](e){east} \tkzDrawLine(a,b) \tkzLabelSegment[above = 1em,sloped](a,b){ab = \pmpn{\tkzUseLua{len}}} \tkzLabelSegment[above=2em,sloped](a,b){slope of (ab) = \pmpn{\tkzUseLua{sl}}} \end{tikzpicture} \end{minipage} % subsubsection example_class_line (end) \subsubsection{Method \Imeth{line}{new} and line attributes} \label{ssub:example_line_attributes} The notation can be |L| or |L.AB| or |L.euler|. The notation is actually free. |L.AB| can also represent the segment. With | L.AB = line : new (z.A,z.B)|, a line is defined. \begin{minipage}{0.5\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point : new (1,1) z.B = point : new (3,2) L.AB = line : new (z.A,z.B) z.C = L.AB.north_pa z.D = L.AB.south_pa \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawLines(A,B C,D) \tkzDrawPoints(A,...,D) \tkzLabelPoints(A,...,D) \tkzMarkRightAngle(B,A,C) \tkzMarkSegments(A,C A,B A,D) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{0.5\textwidth} \begin{tkzelements} scale = 1 z.A = point : new (1,1) z.B = point : new (3,2) L.AB = line : new (z.A,z.B) z.C = L.AB.north_pa z.D = L.AB.south_pa \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawLines(A,B C,D) \tkzDrawPoints(A,...,D) \tkzLabelPoints(A,...,D) \tkzMarkRightAngle(B,A,C) \tkzMarkSegments(A,C A,B A,D) \end{tikzpicture} \end{minipage} % subsubsection example_line_attributes (end) % subsection attributes_of_a_line (end) \newpage \subsection{Methods of the class line} % (fold) \label{sub:methods_from_class_line} Here's the list of methods for the \tkzNameObj{line} object. The results can be real numbers, points, lines, circles or triangles. The triangles obtained are similar to the triangles defined below. \begin{minipage}{\textwidth} \bgroup \catcode`_=12 \small \captionof{table}{Methods of the class line.(part 1)}\label{line:methods1} \begin{tabular}{lll} \toprule \textbf{Methods} & \textbf{Comments} & \\ \midrule \Igfct{line}{new(pt, pt)} & |L.AB = line : new(z.A,z.B)| & Create line $(AB)$ ; Refer to (\ref{ssub:altshiller})\\ \midrule \textbf{Points} &&\\ \midrule \Imeth{line}{gold\_ratio ()} & |z.C=L.AB : gold_ratio()| & Refer to (\ref{sub:gold_ratio_with_segment} ; \ref{sub:the_figure_pappus_circle} ; \ref{sub:bankoff_circle}) \\ \Imeth{line}{normalize ()} & |z.C=L.AB : normalize()| & AC =1 and $C\in (AB)$ Refer to (\ref{ssub:normalize}) \\ \Imeth{line}{normalize\_inv ()} & |z.C=L.AB : normalize_inv()| & CB=1 and $C\in (AB)$ \\ \Imeth{line}{barycenter (r,r)} & |z.C=L.AB : barycenter (1,2)| & Refer to (\ref{ssub:barycenter_with_a_line})\\ \Imeth{line}{point (r)} & |z.C=L.AB : point (2)| & $\overrightarrow{AC} = 2\overrightarrow{AB}$ Refer to (\ref{sub:ellipse} ; \ref{ssub:method_point})\\ \Imeth{line}{midpoint ()} & |z.M=L.AB : midpoint ()| & better is |z.M = L.AB.mid| \\ \Imeth{line}{harmonic\_int (pt)} & |z.D=L.AB : harmonic_int (z.C)| & Refer to (\ref{sub:bankoff_circle})\\ \Imeth{line}{harmonic\_ext (pt)} & |z.D=L.AB : harmonic_ext (z.C)| & Refer to (\ref{sub:bankoff_circle})\\ \Imeth{line}{harmonic\_both (r)} & |z.C,z.D=L.AB : harmonic_both|($\varphi$) & \ref{sub:harmonic_division_with_tkzphi}\\ \Imeth{line}{\_east(d)} & |z.M=L.AB : _east(2)| & |BM = 2| $A,B,M$ aligned \\ \Imeth{line}{\_west(d)} & |z.M=L.AB : _east(2)| & |BM = 2| $A,B,M$ aligned \\ \Imeth{line}{\_north\_pa(d)} &|z.M=L.AB: _north_pa(2)| &|AM=2| $AM\perp AB$ ; $\overrightarrow{AB},\overrightarrow{AM}$ counterclockwise \\ \Imeth{line}{\_south\_pa(d)} &|z.M=L.AB:_south_pa(2)| &|AM=2|; $AM\perp AB$ ; $\overrightarrow{AB},\overrightarrow{AM}$ clockwise \\ \Imeth{line}{\_north\_pb(d)} &|z.M=L.AB:_north_pb(2)| &|BM=2|; $BM\perp BA$ ; $\overrightarrow{BA},\overrightarrow{BM}$ clockwise \\ \Imeth{line}{\_south\_pb(d)} &|z.M=L.AB:_south_pb(2)| &|BM=2|; $BM\perp BA$ ; $\overrightarrow{AB},\overrightarrow{AM}$ counterclockwise \\ \Imeth{line}{report(d,pt)} &|z.M=L.AB:report(2,z.N)| &|MN=2|; $AB\parallel MN$ ; Refer to ex. (\ref{ssub:method_report})\\ \Imeth{line}{colinear\_at(pt,k)} &|z.D=L.AB:colinear_at(z.C,2)| &|CD=2AB|; $AB\parallel CD$ ; Refer to ex. (\ref{ssub:method_imeth_line_colinear__at})\\ \midrule \textbf{Lines} &&\\ \midrule \Imeth{line}{ll\_from ( pt )} &|L.CD=L.AB: ll_from(z.C)| &$(CD) \parallel (AB)$ \\ \Imeth{line}{ortho\_from ( pt )} &|L.CD=L.AB: ortho_from(z.C)|&$(CD) \perp (AB)$\\ \Imeth{line}{mediator ()}&|L.uv=L.AB: mediator()| & $(u,v)$mediator of $(A,B)$\\ \midrule \textbf{Triangles}&&\\ \midrule \Imeth{line}{equilateral ()} & |T.ABC=L.AB:equilateral()| & $(\overrightarrow{AB},\overrightarrow{AC})>0$ or $<0$ with swap \footnote{Triangles are defined in the direct sense of rotation, unless the "swap" option is present.} \\ \Imeth{line}{isosceles (an<,swap>)}&|T.ABC=L.AB:isosceles(math.pi/6)|&\\ \Imeth{line}{two\_angles (an,an)} &|T.ABC=L.AB:two_angles(an,an)|¬e \footnote{The given side is between the two angles} Refer to (\ref{ssub:triangle_with_two__angles}) \\ \Imeth{line}{school ()} & 30°,60°, 90° & \\ \Imeth{line}{sss (r,r)} & $AC=r$ $BC=r$ & \\ \Imeth{line}{as (r,an)} & $AC =r$ $\widehat{BAC} = an$& \\ \Imeth{line}{sa (r,an)} & $AC =r$ $\widehat{ABC} = an$& \\ \midrule \textbf{Sacred triangles}&&\\ \midrule \Imeth{line}{gold ()} &|T.ABC=L.AB:gold()| & right in $B$ and $AC = \varphi \times AB $ \\ \Imeth{line}{euclide ()} &|T.ABC=L.AB:euclide()| &$AB=AC$ ; $(\overrightarrow{AB},\overrightarrow{AC}) = \pi/5$ \\ \Imeth{line}{golden ()} &|T.ABC=L.AB:golden()| & $(\overrightarrow{AB},\overrightarrow{AC}) = 2\times \pi/5$ \\ \Imeth{line}{divine ()} & & \\ \Imeth{line}{egyptian ()} & & \\ \Imeth{line}{cheops ()} & & \\ \midrule \textbf{Squares}&&\\ \midrule \Imeth{line}{square ()} &|S.AB=L.AB : square () | & create a square |S.AB|.\footnote{ |_,_,z.C,z.D = get_points(S.AB)|}\\ \bottomrule \end{tabular} \egroup \end{minipage} \begin{minipage}{\textwidth} \bgroup \catcode`_=12 \small \captionof{table}{Methods of the class line.(part 2)}\label{line:methods2} \begin{tabular}{lll} \toprule \textbf{Methods} & \textbf{Comments} & \\ \midrule \textbf{Circles} &&\\ \midrule \Imeth{line}{circle ()} & |C.AB = L.AB : circle ()| & center pa through pb \\ \Imeth{line}{circle\_swap ()} & |C.BA = L.AB : circle_swap ()|& center pb through pa \\ \Imeth{line}{apollonius (r)} & |C.apo = L.AB : apollonius (2)|& Set of points tq. |MA/MB = 2| \\ \midrule \textbf{Transformations} &&\\ \midrule \Imeth{line}{reflection ( obj )} & |new obj = L.AB : reflection (obj|&\\ \Imeth{line}{translation ( obj )} & |new obj = L.AB : translation (obj)|&\\ \Imeth{line}{projection ( obj )} & |z.H = L.AB : projection (z.C)| & $CH \perp (AB)$ and $H\in (AB)$\\ \midrule \textbf{Miscellaneous} &&\\ \midrule \Imeth{line}{distance (pt)} & |d = L.Ab : distance (z.C)| & Refer to \ref{ssub:example_distance_and_projection}\\ \Imeth{line}{in\_out (pt)} & |b = L.AB: in_out(z.C)| & b=true if $C\in (AB)$ \\ \Imeth{line}{slope ()} & |a = L.AB : slope()| & better is L.AB.slope \\ \Imeth{line}{in\_out\_segment (pt)} & |b = L.AB : in_out_segment(z.C)| & b=true if $C\in [AB$] \\ \bottomrule \end{tabular} \egroup \end{minipage} \subsubsection{Method \Imeth{line}{report}} % (fold) \label{ssub:method_report} |report (d,pt)| If the point is absent, the transfer is made from the first point that defines the line. \begin{minipage}{.5\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point : new (1,-1) z.B = point : new (5,0) L.AB = line : new ( z.A , z.B ) z.M = point : new (2,3) z.N = L.AB : report (3,z.M) z.O = L.AB : report (3) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawSegments(A,B M,N) \tkzDrawPoints(A,B,M,N,O) \tkzLabelPoints(A,B,M,N,O) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.5\textwidth} \begin{tkzelements} z.A = point : new (1,-1) z.B = point : new (5,0) L.AB = line : new ( z.A , z.B ) z.M = point : new (2,3) z.N = L.AB : report (3,z.M) z.O = L.AB : report (3) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawSegments(A,B M,N) \tkzDrawPoints(A,B,M,N,O) \tkzLabelPoints(A,B,M,N,O) \end{tikzpicture} \end{minipage} % subsubsection method_report (end) \subsubsection{Method \Imeth{line}{two\_angles} } % (fold) \label{ssub:triangle_with_two__angles} The angles are on either side of the given segment \begin{minipage}{.4\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 4 , 0 ) L.AB = line : new ( z.A , z.B ) T.ABC = L.AB : two_angles (math.pi/6,math.pi/2) z.C = T.ABC.pc \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawPolygons(A,B,C) \tkzDrawPoints(A,B,C) \tkzLabelPoints(A,B) \tkzLabelPoints[above](C) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.6\textwidth} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 4 , 0 ) L.AB = line : new ( z.A , z.B ) T.ABC= L.AB : two_angles (math.pi/6,math.pi/2) z.C = T.ABC.pc \end{tkzelements} \hspace*{\fill} \begin{tikzpicture} \tkzGetNodes \tkzDrawPolygons(A,B,C) \tkzDrawPoints(A,B,C) \tkzLabelPoints(A,B) \tkzLabelPoints[above](C) \end{tikzpicture} \hspace*{\fill} \end{minipage} % subsubsection triangle_with_two__angles (end) \subsubsection{Method \Imeth{line}{sss}} % (fold) \label{ssub:triangle_with_three_given_sides} In the following example, a small difficulty arises. The given lengths are not affected by scaling, so it's necessary to use the \Igfct{math}{value (r) } function, which will modify the lengths according to the scale. \begin{minipage}{.4\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 5 , 0 ) L.AB = line : new ( z.A , z.B ) T.ABC = L.AB : sss (value(3),value(4)) z.C = T.ABC.pc \end{tkzelements} \begin{tikzpicture}[gridded] \tkzGetNodes \tkzDrawPolygons(A,B,C) \tkzDrawPoints(A,B,C) \tkzLabelPoints(A,B) \tkzLabelPoints[above](C) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.6\textwidth} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 5 , 0 ) L.AB = line : new ( z.A , z.B ) T.ABC = L.AB : sss (value(3),value(4)) z.C = T.ABC.pc \end{tkzelements} \hspace{\fill} \begin{tikzpicture}[gridded] \tkzGetNodes \tkzDrawPolygons(A,B,C) \tkzDrawPoints(A,B,C) \tkzLabelPoints(A,B) \tkzLabelPoints[above](C) \end{tikzpicture} \end{minipage} % subsubsection triangle_with_three_given_sides (end) \subsubsection{Triangle with side between side and angle} % (fold) \label{ssub:triangle_with_side_between_side_and_angle} In some cases, two solutions are possible. \begin{minipage}{.4\textwidth} \begin{Verbatim} \begin{tkzelements} scale =1 z.A = point : new ( 0 , 0 ) z.B = point : new ( 5 , 0 ) L.AB = line : new ( z.A , z.B ) T.ABC,T.ABD = L.AB : ssa (value(3),math.pi/6) z.C = T.ABC.pc z.D = T.ABD.pc \end{tkzelements} \begin{tikzpicture}[gridded] \tkzGetNodes \tkzDrawPolygons(A,B,C A,B,D) \tkzDrawPoints(A,B,C,D) \tkzLabelPoints(A,B) \tkzLabelPoints[above](C,D) \tkzLabelAngle[teal](C,B,A){$\pi/6$} \tkzLabelSegment[below left](A,C){$7$} \tkzLabelSegment[below left](A,D){$7$} \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.6\textwidth} \begin{tkzelements} scale =1 z.A = point : new ( 0 , 0 ) z.B = point : new ( 5 , 0 ) L.AB = line : new ( z.A , z.B ) T.ABC,T.ABD = L.AB : ssa (value(3),math.pi/6) z.C = T.ABC.pc z.D = T.ABD.pc \end{tkzelements} \hspace{\fill} \begin{tikzpicture}[gridded] \tkzGetNodes \tkzDrawPolygons(A,B,C A,B,D) \tkzDrawPoints(A,B,C,D) \tkzLabelPoints(A,B) \tkzLabelPoints[above](C,D) \tkzLabelAngle[teal](C,B,A){$\pi/6$} \tkzLabelSegment[below left](A,C){$7$} \tkzLabelSegment[below left](A,D){$7$} \end{tikzpicture} \end{minipage} % subsubsection triangle_with_side_between_side_and_angle (end) \subsubsection{About sacred triangles} % (fold) \label{ssub:about_triangles} The side lengths are proportional to the lengths given in the table. They depend on the length of the initial segment. \captionof{table}{Sacred triangles.}\label{line:met} \begin{tabular}{ll} \toprule \textbf{Name} & \textbf{definition} \\ \midrule \Imeth{line}{gold ()} & Right triangle with $a=\varphi$, $b=1$ and $c=\sqrt{\varphi}$\\ \Imeth{line}{golden ()} &Right triangle $b=\varphi$ $c=1$ ; half of gold rectangle \\ \Imeth{line}{divine ()} & Isosceles $a=\varphi$, $b=c=1$ and $\beta = \gamma=\pi/5$ \\ \Imeth{line}{pythagoras ()} & $a=5$, $b=4$, $c=3$ and other names: isis or egyptian\\ \Imeth{line}{sublime ()} & Isosceles $a=1$, $b=c=\varphi$ and $\beta =\gamma=2\pi/5$ ; other name: euclid\\ \Imeth{line}{cheops ()} & Isosceles $a=2$, $b=c=\varphi$ and height = $\sqrt{\varphi}$ \\ \bottomrule \end{tabular} \begin{minipage}{.4\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 4 , 0 ) L.AB = line : new ( z.A , z.B ) T.ABC = L.AB : cheops () z.C = T.ABC.pc T.ABD = L.AB : gold () z.D = T.ABD.pc T.ABE = L.AB : euclide () z.E = T.ABE.pc T.ABF = L.AB : golden () z.F = T.ABF.pc T.ABG = L.AB : divine () z.G = T.ABG.pc T.ABH = L.AB : pythagoras () z.H = T.ABH.pc \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H) \tkzDrawPoints(A,...,H) \tkzLabelPoints(A,...,H) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.6\textwidth} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 4 , 0 ) L.AB = line : new ( z.A , z.B ) T.ABC = L.AB : cheops () z.C = T.ABC.pc T.ABD = L.AB : gold () z.D = T.ABD.pc T.ABE = L.AB : euclide () z.E = T.ABE.pc T.ABF = L.AB : golden () z.F = T.ABF.pc T.ABG = L.AB : divine () z.G = T.ABG.pc T.ABH = L.AB : pythagoras () z.H = T.ABH.pc \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawPolygons(A,B,C A,B,D A,B,E A,B,F A,B,G A,B,H) \tkzDrawPoints(A,...,H) \tkzLabelPoints(A,...,H) \end{tikzpicture} \end{minipage} % subsubsection about_triangles (end) \subsubsection{Method \Imeth{line}{point} }% (fold) \label{ssub:method_point} This method is very useful. It allows you to place a point on the line under consideration. If |r = 0| then the point is |pa|, if |r = 1| it's |pb|. If |r = .5| the point obtained is the midpoint of the segment. |r| can be negative or greater than 1. This method exists for all objects except quadrilaterals. \begin{minipage}{.4\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point : new (-1,-1) z.B = point : new (1,1) L.AB = line : new (z.A,z.B) z.I = L.AB : point (0.5) z.J = L.AB : point (-0.5) z.K = L.AB : point (2) \end{tkzelements} \begin{tikzpicture}[gridded] \tkzGetNodes \tkzDrawLine(J,K) \tkzDrawPoints(A,B,I,J,K) \tkzLabelPoints(A,B,I,J,K) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.6\textwidth} \begin{tkzelements} z.A = point : new (-1,-1) z.B = point : new (1,1) L.AB = line : new (z.A,z.B) z.I = L.AB : point (0.5) z.J = L.AB : point (-0.5) z.K = L.AB : point (2) \end{tkzelements} \begin{tikzpicture}[gridded] \tkzGetNodes \tkzDrawLine(J,K) \tkzDrawPoints(A,B,I,J,K) \tkzLabelPoints(A,B,I,J,K) \end{tikzpicture} \end{minipage} % subsubsection method_point (end) \subsubsection{Method \Imeth{line}{colinear\_at}} % (fold) \label{ssub:method_imeth_line_colinear__at} If the coefficient is missing then it defaults to $1$ and in the following example we obtain: $CE=AB$ and $(AB)\parallel (CE)$. For point $D$: $CD = .5AB$ and $(AB)\parallel (CD)$. \begin{minipage}{.5\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point: new (0 , 0) z.B = point: new (4 , 0) z.C = point: new (1 , 3) L.AB = line : new (z.A,z.B) z.D = L.AB : colinear_at (z.C,.5) z.E = L.AB : colinear_at (z.C) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawSegments(A,B C,E) \tkzDrawPoints(A,B,C,D,E) \tkzLabelPoints(A,B,C,D,E) \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 (1 , 3) L.AB = line : new (z.A,z.B) z.D = L.AB : colinear_at (z.C,.5) z.E = L.AB : colinear_at (z.C) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawSegments(A,B C,E) \tkzDrawPoints(A,B,C,D,E) \tkzLabelPoints(A,B,C,D,E) \end{tikzpicture} \end{minipage} % subsubsection method_imeth_line_colinear__at (end) \subsubsection{Method \Imeth{line}{normalize}} % (fold) \label{ssub:normalize} \begin{minipage}{.4\textwidth} \begin{Verbatim} \begin{tkzelements} z.a = point: new (1, 1) z.b = point: new (5, 4) L.ab = line : new (z.a,z.b) z.c = L.ab : normalize () \end{tkzelements} \begin{tikzpicture}[gridded] \tkzGetNodes \tkzDrawSegments(a,b) \tkzDrawCircle(a,c) \tkzDrawPoints(a,b,c) \tkzLabelPoints(a,b,c) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.6\textwidth} \begin{tkzelements} z.a = point: new (1, 1) z.b = point: new (5, 4) L.ab = line : new (z.a,z.b) z.c = L.ab : normalize () \end{tkzelements} \hspace*{\fill} \begin{tikzpicture}[gridded] \tkzGetNodes \tkzDrawSegments(a,b) \tkzDrawCircle(a,c) \tkzDrawPoints(a,b,c) \tkzLabelPoints(a,b,c) \end{tikzpicture} \hspace*{\fill} \end{minipage} % subsubsection normalize (end) \subsubsection{Method \Imeth{line}{barycenter}} % (fold) \label{ssub:barycenter_with_a_line} \begin{minipage}{.4\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point : new ( 0 , -1 ) z.B = point : new ( 4 , 2 ) L.AB = line : new ( z.A , z.B ) z.G = L.AB : barycenter (1,2) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawLine(A,B) \tkzDrawPoints(A,B,G) \tkzLabelPoints(A,B,G) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.6\textwidth} \begin{tkzelements} z.A = point : new ( 0 , -1 ) z.B = point : new ( 4 , 2 ) L.AB = line : new ( z.A , z.B ) z.G = L.AB : barycenter (1,2) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawLine(A,B) \tkzDrawPoints(A,B,G) \tkzLabelPoints(A,B,G) \end{tikzpicture} \end{minipage} % subsubsection barycenter_with_a_line (end) \subsubsection{method \Imeth{line}{ll\_from}} % (fold) \label{ssub:new_line_from_a_defined_line} \begin{minipage}{0.5\textwidth} \begin{Verbatim} \begin{tkzelements} scale = 1.25 z.A = point : new (1,1) z.B = point : new (3,2) L.AB = line : new (z.A,z.B) z.C = L.AB.north_pa z.D = L.AB.south_pa L.CD = line : new (z.C,z.D) _,z.E = get_points ( L.CD: ll_from (z.B)) -- z.E = L2.pb \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawLines(A,B C,D B,E) \tkzDrawPoints(A,...,E) \tkzLabelPoints(A,...,E) \tkzMarkRightAngle(B,A,C) \tkzMarkSegments(A,C A,B A,D) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{0.5\textwidth} \begin{tkzelements} scale = 1.25 z.A = point : new (1,1) z.B = point : new (3,2) L.AB = line : new (z.A,z.B) z.C = L.AB.north_pa z.D = L.AB.south_pa L.CD = line : new (z.C,z.D) _,z.E = get_points ( L.CD: ll_from (z.B)) -- or z.E = L2.pb with |L2 = L.CD: ll_from (z.B)| \end{tkzelements} \hspace*{\fill} \begin{tikzpicture} \tkzGetNodes \tkzDrawLines(A,B C,D B,E) \tkzDrawPoints(A,...,E) \tkzLabelPoints(A,...,E) \tkzMarkRightAngle(B,A,C) \tkzMarkSegments(A,C A,B A,D) \end{tikzpicture} \hspace*{\fill} \end{minipage} % \caption{New line from defined line} % subsubsection new_line_from_a_defined_line (end) \subsubsection{Method \Imeth{line}{projection}} % (fold) \label{ssub:example_projection_of_several_points} \begin{minipage}{0.5\textwidth} \begin{Verbatim} \begin{tkzelements} scale = .8 z.a = point: new (0, 0) z.b = point: new (4, 1) z.c = point: new (2, 5) z.d = point: new (5, 2) L.ab = line: new (z.a,z.b) z.cp,z.dp = L.ab: projection(z.c,z.d) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawLines(a,b c,c' d,d') \tkzDrawPoints(a,...,d,c',d') \tkzLabelPoints(a,...,d,c',d') \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{0.5\textwidth} \begin{tkzelements} scale = .8 z.a = point: new (0, 0) z.b = point: new (4, 1) z.c = point: new (2, 5) z.d = point: new (5, 2) L.ab = line: new (z.a,z.b) z.cp,z.dp = L.ab : projection(z.c,z.d) \end{tkzelements} \hspace*{\fill} \begin{tikzpicture} \tkzGetNodes \tkzDrawLines(a,b c,c' d,d') \tkzDrawPoints(a,...,d,c',d') \tkzLabelPoints(a,...,d,c',d') \end{tikzpicture} \hspace*{\fill} \end{minipage} % \caption{Projection of several points} % subsubsection example_projection_of_several_points (end) \subsubsection{Example: combination of methods} % (fold) \label{ssub:example_combination_of_methods} \begin{minipage}{0.6\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point: new (0 , 0) z.B = point: new (6 , 0) z.C = point: new (1 , 5) T.ABC = triangle: new (z.A,z.B,z.C) L.AB = T.ABC.ab z.O = T.ABC.circumcenter C.OA = circle: new (z.O,z.A) z.H = L.AB: projection (z.O) L.ab = C.OA: tangent_at (z.A) z.a,z.b = L.ab.pa,L.ab.pb -- or z.a,z.b = get_points (L.ab) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawPolygon(A,B,C) \tkzDrawCircle(O,A) \tkzDrawSegments[purple](O,A O,B O,H) \tkzDrawArc[red](O,A)(B) \tkzDrawArc[blue](O,B)(A) \tkzDrawLine[add = 2 and 1](A,a) \tkzFillAngles[teal!30,opacity=.4](A,C,B b,A,B A,O,H) \tkzMarkAngles[mark=|](A,C,B b,A,B A,O,H H,O,B) \tkzDrawPoints(A,B,C,H,O) \tkzLabelPoints(B,H) \tkzLabelPoints[above](O,C) \tkzLabelPoints[left](A) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{0.4\textwidth} \begin{tkzelements} scale = .5 z.A = point: new (0 , 0) z.B = point: new (6 , 0) z.C = point: new (1 , 5) T.ABC = triangle: new (z.A,z.B,z.C) L.AB = T.ABC.ab z.O = T.ABC.circumcenter C.OA = circle: new (z.O,z.A) z.H = L.AB : projection (z.O) L.ab = C.OA : tangent_at (z.A) z.a,z.b = L.ab.pa,L.ab.pb -- or z.a,z.b = get_points (L.ab) \end{tkzelements} \hspace*{\fill} \begin{tikzpicture} \tkzGetNodes \tkzDrawPolygon(A,B,C) \tkzDrawCircle(O,A) \tkzDrawSegments[purple](O,A O,B O,H) \tkzDrawArc[red](O,A)(B) \tkzDrawArc[blue](O,B)(A) \tkzDrawLine[add = 2 and 1](A,a) \tkzFillAngles[teal!30,opacity=.4,,size=.5](A,C,B b,A,B A,O,H) \tkzMarkAngles[mark=|,size=.5](A,C,B b,A,B A,O,H H,O,B) \tkzDrawPoints(A,B,C,H,O) \tkzLabelPoints(B,H) \tkzLabelPoints[above](O,C) \tkzLabelPoints[left](A) \end{tikzpicture} \hspace*{\fill} \end{minipage} % subsubsection example_combination_of_methods (end) \subsubsection{Method \Imeth{line}{translation}} % (fold) \label{ssub:example_translation} \begin{minipage}{0.6\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point: new (0,0) z.B = point: new (1,2) z.C = point: new (-3,2) z.D = point: new (0,2) L.AB = line : new (z.A,z.B) z.E,z.F = L.AB : translation (z.C,z.D) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawPoints(A,...,F) \tkzLabelPoints(A,...,F) \tkzDrawSegments[->,red,> =latex](C,E D,F A,B) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{0.4\textwidth} \begin{tkzelements} z.A = point: new (0,0) z.B = point: new (1,2) z.C = point: new (-3,2) z.D = point: new (0,2) L.AB = line : new (z.A,z.B) z.E,z.F = L.AB : translation (z.C,z.D) \end{tkzelements} \hspace*{\fill} \begin{tikzpicture} \tkzGetNodes \tkzDrawPoints(A,...,F) \tkzLabelPoints(A,...,F) \tkzDrawSegments[->,red,> =latex](C,E D,F A,B) ) \end{tikzpicture} \hspace*{\fill} \end{minipage} % subsubsection example_translation (end) \subsubsection{Method \Imeth{line}{distance}} % (fold) \label{ssub:example_distance_and_projection} \begin{minipage}{0.5\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point : new (0 , 0) z.B = point : new (5 , -2) z.C = point : new (3 , 3) L.AB = line : new (z.A,z.B) d = L.AB : distance (z.C) z.H = L.AB : projection (z.C) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawLines(A,B C,H) \tkzDrawPoints(A,B,C,H) \tkzLabelPoints(A,B,C,H) \tkzLabelSegment[above left, draw](C,H){$CH = \tkzUseLua{d}$} \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{0.5\textwidth} \begin{tkzelements} z.A = point : new (0 , 0) z.B = point : new (5 , -2) z.C = point : new (3 , 3) L.AB = line : new (z.A,z.B) d = L.AB : distance (z.C) z.H = L.AB : projection (z.C) \end{tkzelements} \hspace*{\fill} \begin{tikzpicture} \tkzGetNodes \tkzDrawLines(A,B C,H) \tkzDrawPoints(A,B,C,H) \tkzLabelPoints(A,B,C,H) \tkzLabelSegment[above left,draw](C,H){$CH = \tkzUseLua{d}$} \end{tikzpicture} \hspace*{\fill} \end{minipage} % \caption{Method distance with line object} % subsubsection example_distance_and_projection (end) \subsubsection{Method \Imeth{line}{reflection} of an object} % (fold) \label{ssub:reflection_of_object} \begin{minipage}{.5\textwidth} \begin{Verbatim} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 4 , 1 ) z.E = point : new ( 0 , 2 ) z.F = point : new ( 3 , 3 ) z.G = point : new ( 4 , 2 ) L.AB = line : new ( z.A , z.B ) T.EFG = triangle : new (z.E,z.F,z.G) T.new = L.AB : reflection (T.EFG) z.Ep,z.Fp,z.Gp = get_points(T.new) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzDrawLine(A,B) \tkzDrawPolygon(E,F,G) \tkzDrawPolygon[new](E',F',G') \tkzDrawSegment[red,dashed](E,E') \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{.5\textwidth} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 4 , 1 ) z.E = point : new ( 0 , 2 ) z.F = point : new ( 3 , 3 ) z.G = point : new ( 4 , 2 ) L.AB = line : new ( z.A , z.B ) T.EFG = triangle : new (z.E,z.F,z.G) T.new = L.AB : reflection (T.EFG) z.Ep,z.Fp,z.Gp = get_points(T.new) \end{tkzelements} \hspace{\fill}\begin{tikzpicture} \tkzGetNodes \tkzDrawLine(A,B) \tkzDrawPolygon(E,F,G) \tkzDrawPolygon[new](E',F',G') \tkzDrawSegment[red,dashed](E,E') \end{tikzpicture} \end{minipage} % subsubsection reflection_of_object (end) \subsection{Method \Imeth{line}{apollonius} Apollonius circle MA/MB = k} % (fold) \label{sub:apollonius_circle_ma_mb_k} \begin{Verbatim} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 6 , 0 ) L.AB =line: new (z.A,z.B) C.apo = L.AB : apollonius (2) z.O,z.C = get_points ( C.apo ) z.D = C.apo : antipode (z.C) z.P = C.apo : point (0.30) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzFillCircle[blue!20,opacity=.2](O,C) \tkzDrawCircle[blue!50!black](O,C) \tkzDrawPoints(A,B,O,C,D,P) \tkzLabelPoints[below right](A,B,O,C,D,P) \tkzDrawSegments[orange](P,A P,B P,D B,D P,C) \tkzDrawSegments[red](A,C) \tkzDrawPoints(A,B) \tkzLabelCircle[draw,fill=green!10,% text width=3cm,text centered,left=24pt](O,D)(60)% {$CA/CB=2$\\$PA/PB=2$\\$DA/DB=2$} \tkzMarkRightAngle[opacity=.3,fill=lightgray](O,P,C) \tkzMarkAngles[mark=||](A,P,D D,P,B) \end{tikzpicture} \end{Verbatim} \begin{tkzelements} z.A = point : new ( 0 , 0 ) z.B = point : new ( 6 , 0 ) L.AB =line: new (z.A,z.B) C.apo = L.AB : apollonius (2) z.O,z.C = get_points ( C.apo ) z.D = C.apo : antipode (z.C) z.P = C.apo : point (0.30) \end{tkzelements} \begin{tikzpicture} \tkzGetNodes \tkzFillCircle[blue!20,opacity=.2](O,C) \tkzDrawCircle[blue!50!black](O,C) \tkzDrawPoints(A,B,O,C,D,P) \tkzLabelPoints[below right](A,B,O,C,D,P) \tkzDrawSegments[orange](P,A P,B P,D B,D P,C) \tkzDrawSegments[red](A,C) \tkzDrawPoints(A,B) \tkzLabelCircle[draw,fill=green!10,% text width=3cm,text centered,left=24pt](O,D)(60)% {$CA/CB=2$\\$PA/PB=2$\\$DA/DB=2$} \tkzMarkRightAngle[opacity=.3,fill=lightgray](O,P,C) \tkzMarkAngles[mark=||](A,P,D D,P,B) \end{tikzpicture} Remark: |\tkzUseLua{length(z.P,z.A)/length(z.P,z.B)}| = \tkzUseLua{length(z.P,z.A)/length(z.P,z.B)} % subsection apollonius_circle_ma_mb_k (end) % subsection methods_from_class_line (end) % section class_line (end) \endinput