EDIT Here's what I intended to ask, but didn't clearly formulate initially. The Tikz package intersections
allows one to calculate and manipulate the intersection point of two non-parallel lines defined by (non intersecting) line segments. The link in my original question shows how to do this, it is how the point (F)
is defined. In the example below, the point (0)
is defined as the intersection of the lines extending the line segments vertline
and horline
. What I want to do is calculate and manipulate intersection points of an ellipse with the line extending a given line segment, without having to rely on extending the line segment ''by hand'' as it were, to ensure it actually intersects the ellipse. When I copy the syntax used in the code from the link, and naively adapt it,
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\usetikzlibrary{intersections}
\path[name path=ellipse] (0,0) ellipse (4 and 3);
\path[name path=horline] (1,0) -- (2,0);
\path[name path=vertline] (0,1) -- (0,2);
\path[name intersections={of = horline and vertline, by={origin}}, draw]
(origin) node [above right] {$0$} circle (1.5pt);
\path[name intersections={of = ellipse and vertline}]
\coordinate (I) at (intersection-1);
\coordinate (J) at (intersection-2);
\draw (I) circle (1.5pt);
\draw (J) circle (1.5pt);
\end{tikzpicture}
\end{document}
it doesn't give me the desired result : the intersections (I)
and (J)
are of ellipse
and vertline
are totally misplaced. Moreover, the code is faulty, but I don't understand where the error lies. Please tell me if you'd code things differently, I don't want to develop bad habits.
Further Edit It appears (I)
and(J)
aren't misplaced, they simply aren't calculated at all, and what appeared on the pdf were points (I)
and(J)
defined in a previous drawing.
Oringinal Question - May be dicarded In this Example, the author gets tikz to calculate the coordinates of the two intersections (X and Y) of an ellipse with the line defined by a certain segment, and also the coordinates of the intersection (F) of two lines defined by two line segments.
On my machine, I have no problem with the second problem, finding the intersection point of two lines defined by (non intersecting line segments), but i get non-sense when I try to perform the intersection of an ellipse with the line defined by a line segment that doesn't intersect the ellipse.
\documentclass{...}
and ending with\end{document}
.