diff options
Diffstat (limited to 'Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex')
-rw-r--r-- | Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex | 197 |
1 files changed, 139 insertions, 58 deletions
diff --git a/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex b/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex index acf50a22a1b..ef30d48d61c 100644 --- a/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex +++ b/Master/texmf-dist/doc/latex/tkz-elements/TKZdoc-elements-intersection.tex @@ -2,7 +2,9 @@ \section{Intersections} % (fold) \label{sec:intersections} -It's an essential tool. For the moment, the classes concerned are lines, circles and ellipses, with the following combinations: line-line; line-circle; circle-circle and line-ellipse. The argument is a pair of objects, in any order. +It's an essential tool. For the moment, the classes concerned are lines, circles and ellipses, with the following combinations: line-line; line-circle; circle-circle and line-conic. +Note that circles form a separate class from conics, which represent parabolas, hyperbolas and ellipses. +The argument is a pair of objects, in any order. Results consist of one or two values, either points, boolean \tkzname{false} or underscore |_|. \subsection{Line-line} % (fold) @@ -55,7 +57,7 @@ z.I = x end } -\begin{tikzpicture} +\begin{tikzpicture}[scale = 2] \tkzGetNodes \tkzDrawSegments(A,B C,D) \tkzDrawPoints(A,B,C,D,I) @@ -99,7 +101,6 @@ init_elements () \begin{minipage}{0.4\textwidth} \directlua{% init_elements () - scale = 2 z.A = point : new (1,-1) z.B = point : new (1,2) L.AB = line : new (z.A,z.B) @@ -112,7 +113,7 @@ z.I,_ = intersection (L.AB,C.OD) _,z.K = intersection (C.OD,L.AE) } -\begin{tikzpicture} +\begin{tikzpicture}[ scale = 2] \tkzGetNodes \tkzDrawLines[add=.1 and .1](A,B A,E) \tkzDrawCircle(O,D) @@ -179,8 +180,8 @@ Other examples: \ref{sub:altshiller}, \ref{sub:the_figure_pappus_circle} % subsection circle_circle (end) \newpage -\subsection{Line-ellipse} % (fold) -\label{sub:line_ellipse} +\subsection{Line-conic} % (fold) +\label{sub:line_conic} The following example is complex, but it shows the possibilities of Lua. The designation of intersection points is a little more complicated than the previous one, as the argument characterizing the major axis must be taken into account. The principle is the same, but this argument must be subtracted. In concrete terms, you need to consider the slopes of the lines formed by the center of the ellipse and the points of intersection, and the slope of the major axis. \vspace{1em} @@ -188,69 +189,149 @@ The designation of intersection points is a little more complicated than the pre \begin{minipage}{0.5\textwidth} \begin{Verbatim} \directlua{% -init_elements () - scale = .5 - z.a = point: new (5 , 2) - z.b = point: new (-4 , 0) - z.m = point: new (2 , 4) - z.n = point: new (4 , 4) - L.ab = line : new (z.a,z.b) - L.mn = line : new (z.m,z.n) - z.c = L.ab. mid - z.e = L.ab: point (-.2) - E = ellipse: foci (z.a,z.b,z.e) - z.u,z.v = intersection (E,L.mn) - % transfer to tex - a = E.Rx - b = E.Ry - ang = math.deg(E.slope) + init_elements () + z.a = point: new (5 , 2) + z.b = point: new (-4 , 0) + L.ab = line : new (z.a,z.b) + z.c = L.ab.mid + z.v = L.ab: point (-.2) + local a = length (z.c,z.v) + local c = .5 * length(z.a, z.b) + local e = c / a + z.K = L.ab : report (a^2 / c, z.c) + z.Kp = (z.K-z.a) : orthogonal(2): at (z.K) + L.dir = line : new (z.K,z.Kp) + EL = conic: new (z.b,L.dir,e) + curve = EL : points (0,1,50) + z.m = point: new (2 , 4) + z.n = point: new (4 , 4) + L.mn = line : new (z.m,z.n) + z.r,z.s = intersection (EL,L.mn) } -\begin{tikzpicture} +\begin{tikzpicture}[scale =.5] \tkzGetNodes - \tkzDrawLines[red](a,b u,v) % p,s p,t - \tkzDrawPoints(a,b,c,e,u,v) % - \tkzLabelPoints(a,b,c,u,v) - \tkzDrawEllipse[teal](c,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{ang}) - \tkzDrawSegments(c,u c,v) - \tkzFillAngles[green!30,opacity=.4](e,c,v) - \tkzFillAngles[green!80,opacity=.4](e,c,u) + \tkzDrawLines[red](a,b r,s) + \tkzDrawSegments(c,r c,s) + \tkzDrawPoints(a,b,c,r,s) + \tkzLabelPoints(a,b,c,r,s) + \tkzDrawCoordinates[smooth,red](curve) + \tkzFillAngles[green!30,opacity=.4](v,c,s) + \tkzFillAngles[green!80,opacity=.4](v,c,r) \end{tikzpicture} \end{Verbatim} \end{minipage} \begin{minipage}{0.5\textwidth} \directlua{% -init_elements () - scale =.5 - z.a = point: new (5 , 2) - z.b = point: new (-4 , 0) - z.m = point: new (2 , 4) - z.n = point: new (4 , 4) - L.ab = line : new (z.a,z.b) - L.mn = line : new (z.m,z.n) - z.c = L.ab. mid - z.e = L.ab: point (-.2) - E = ellipse: foci (z.a,z.b,z.e) - z.u,z.v = intersection (E,L.mn) - % transfer to tex - a = E.Rx - b = E.Ry - ang = math.deg(E.slope) + init_elements () + z.a = point: new (5 , 2) + z.b = point: new (-4 , 0) + L.ab = line : new (z.a,z.b) + z.c = L.ab.mid + z.v = L.ab: point (-.2) + local a = length (z.c,z.v) + local c = .5 * length(z.a, z.b) + local e = c / a + z.K = L.ab : report (a^2 / c, z.c) + z.Kp = (z.K-z.a) : orthogonal(2): at (z.K) + L.dir = line : new (z.K,z.Kp) + EL = conic: new (z.b,L.dir,e) + curve = EL : points (0,1,50) + z.m = point: new (2 , 4) + z.n = point: new (4 , 4) + L.mn = line : new (z.m,z.n) + z.r,z.s = intersection (EL,L.mn) } -\hspace*{\fill} -\begin{tikzpicture} + + +\begin{center} +\begin{tikzpicture}[scale =.5] \tkzGetNodes - \tkzDrawLines[red](a,b u,v) % p,s p,t - \tkzDrawPoints(a,b,c,e,u,v) % - \tkzLabelPoints(a,b,c,u,v) - \tkzDrawEllipse[teal](c,\tkzUseLua{a},\tkzUseLua{b},\tkzUseLua{ang}) - \tkzFillAngles[green!30,opacity=.4](e,c,v) - \tkzFillAngles[green!80,opacity=.4](e,c,u) - \tkzDrawSegments(c,u c,v) + \tkzDrawLines[red](a,b r,s) + \tkzDrawSegments(c,r c,s) + \tkzDrawPoints(a,b,c,r,s) + \tkzLabelPoints(a,b,c,r,s) + \tkzDrawCoordinates[smooth,red](curve) + \tkzFillAngles[green!30,opacity=.4](v,c,s) + \tkzFillAngles[green!80,opacity=.4](v,c,r) \end{tikzpicture} -\hspace*{\fill} +\end{center} \end{minipage} -Other examples: \ref{ssub:function_tkzname_ellipse__foci}, \ref{sub:hexagram} +Other examples: \ref{sub:hexagram} + +\subsubsection{Intersection all subtypes of conics} % (fold) +\label{ssub:intersection_all_subtypes_of_conics} + +\begin{Verbatim} +\directlua{ + z.A = point : new ( 0 , 0 ) + z.B = point : new ( 4 , -2 ) + L.dir = line : new (z.A,z.B) + z.F = point : new ( 2 , 2) + CO1 = conic : new(z.F,L.dir,.8) + CO2 = conic : new(z.F,L.dir, 1) + CO3 = conic : new(z.F,L.dir, 1.2) + curve1 = CO1 : points ( 0,1,50) + curve2 = CO2 : points (-5,5,50) + curve3 = CO3 : points (-5,5,50) + z.K = CO1.K + z.u,z.v = get_points(CO1.major_axis) + z.x = L.dir : report (-4,z.K) + z.y = L.dir : report ( 4,z.K) + z.r = point : new ( 0 , 4 ) + z.s = point : new ( 4 , 1 ) + L.rs = line : new (z.r,z.s) + z.u_1,z.u_2 = intersection (L.rs,CO1) + z.v_1,z.v_2 = intersection (L.rs,CO2) + z.w_1,z.w_2 = intersection (L.rs,CO3) +} +\begin{tikzpicture} + \tkzGetNodes + \tkzDrawCoordinates[smooth](curve1) + \tkzDrawCoordinates[smooth](curve2) + \tkzDrawCoordinates[smooth](curve3) + \tkzDrawLines[add =.5 and .5](r,s u,v) + \tkzDrawLines(x,y) + \tkzDrawPoints[red](u_1,u_2,v_2,v_1,w_1,w_2) +\end{tikzpicture} +\end{Verbatim} +\directlua{ +z.A = point : new ( 0 , 0 ) +z.B = point : new ( 4 , -2 ) +L.dir = line : new (z.A,z.B) +z.F = point : new ( 2 , 2) +CO1 = conic : new(z.F,L.dir,.8) +CO2 = conic : new(z.F,L.dir, 1) +CO3 = conic : new(z.F,L.dir, 1.2) +curve1 = CO1 : points ( 0,1,50) +curve2 = CO2 : points (-5,5,50) +curve3 = CO3 : points (-5,5,50) +z.K = CO1.K +z.u,z.v = get_points(CO1.major_axis) +z.x = L.dir : report (-4,z.K) +z.y = L.dir : report ( 4,z.K) +z.r = point : new ( 0 , 4 ) +z.s = point : new ( 4 , 1 ) +L.rs = line : new (z.r,z.s) +z.u_1,z.u_2 = intersection (L.rs,CO1) +z.v_1,z.v_2 = intersection (L.rs,CO2) +z.w_1,z.w_2 = intersection (L.rs,CO3) +} + +\begin{center} + \begin{tikzpicture}[scale =.75] + \tkzGetNodes + \tkzDrawCoordinates[smooth](curve1) + \tkzDrawCoordinates[smooth](curve2) + \tkzDrawCoordinates[smooth](curve3) + \tkzDrawLines[add =.5 and .5](r,s u,v) + \tkzDrawLines(x,y) + \tkzDrawPoints[red](u_1,u_2,v_2,v_1,w_1,w_2) + \end{tikzpicture} +\end{center} + + +% subsubsection intersection_all_subtypes_of_conics (end) -% subsection line_ellipse (end) +% subsection line_conic (end) % section intersections (end)
\ No newline at end of file |