\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 is, as much ,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 & see (\ref{ssub:example_class_line})\\ \Iattr{line}{length} &|l = L.AB.length|&see (\ref{sub:transfer_from_lua_to_tex} ; \ref{ssub:example_class_line})\\ \Iattr{line}{north\_pa} & &See (\ref{ssub:example_class_line}) \\ \Iattr{line}{north\_pb} & &\\ \Iattr{line}{south\_pa} & &\\ \Iattr{line}{south\_pb} & &See (\ref{ssub:example_class_line}) \\ \Iattr{line}{east} & &\\ \Iattr{line}{west} & &\\ \Iattr{line}{vec} & |V.AB = L.AB.vec|& defines $\overrightarrow{AB}$ See (\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} Notation |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{tkzexample}[latex=0cm,small,code only] \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{tkzexample} \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 are either reals, 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 \Imeth{line}{new(pt, pt)} & |L.AB = line : new(z.A,z.B)| line $(AB)$& see (\ref{ssub:altshiller})\\ \midrule \textbf{Points} &&\\ \midrule \Imeth{line}{gold\_ratio ()} & |z.C = L.AB : gold_ratio()| & see (\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)$ see (\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)| & see (\ref{ssub:barycenter_with_a_line})\\ \Imeth{line}{point (r)} & |z.C = L.AB : point (2)| & $\overrightarrow{AC} = 2\overrightarrow{AB}$ See (\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)| & See (\ref{sub:bankoff_circle})\\ \Imeth{line}{harmonic\_ext (pt)} & |z.D = L.AB : harmonic_ext (z.C)| & See (\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}{square ()} & |S.AB = L.AB : square () | & create a square |S.AB|.\footnote{ |_,_,z.C,z.D = get_points(S.AB)|}\\ \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} see ( ) \\ \Imeth{line}{school ()} & Angle measurements are 30°,60° and 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$ and $(\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 ()} & & \\ \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)|& Ensemble des 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)| & see \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} \vspace{1 em} Here are a few examples. \subsubsection{Triangle with 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{Triangle with three given sides} % (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} scale =1.25 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} scale =1.25 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.2 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(C,B,A){$\pi/3$} \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.2 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(C,B,A){$\pi/3$} \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 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{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{Barycenter with a line} % (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{Example: new line from a defined line} % (fold) \label{ssub:new_line_from_a_defined_line} \begin{minipage}{0.5\textwidth} \begin{tkzexample}[latex=0cm,small,code only] \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{tkzexample} \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{Example: projection of several points} % (fold) \label{ssub:example_projection_of_several_points} \begin{minipage}{0.5\textwidth} \begin{tkzexample}[latex=0cm,small,code only] \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{tkzexample} \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{tkzexample}[small,code only] \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(A,B,C,H,O) \end{tikzpicture} \end{tkzexample} \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(A,B,C,H,O) \end{tikzpicture} \hspace*{\fill} \end{minipage} % subsubsection example_combination_of_methods (end) \subsubsection{Example: translation} % (fold) \label{ssub:example_translation} \begin{minipage}{0.6\textwidth} \begin{tkzexample}[small,code only] \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{tkzexample} \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{Example: distance and projection} % (fold) \label{ssub:example_distance_and_projection} \begin{minipage}{0.5\textwidth} \begin{tkzexample}[latex=0cm,small,code only] \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{tkzexample} \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{Reflection of 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{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