TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary{intersections}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}
\draw[dotted](-10,-5) grid (5,5);
\path(0,0) node{0};
\draw(-10,0)--(5,0);
\coordinate(I')at(-2,2);
\coordinate(F'1)at(4,0);
\coordinate(F2)at(-3,0);
\draw[name path=D2](0,-5)--(0,5);
\draw(-9,2)--(I') node {};
\draw[name path=1'](I')--(F'1) node {};
\fill[red,name intersections={of=1' and D2,by={U'}}](intersection-1) circle(2pt);
\draw[shorten <=-5.5cm,name path=2'](F2)--+($(I')-(F'1)$) node {Y};
%so far so good, the intersection is at the right location (0,1.3)
\fill[green,name intersections={of=2' and D2,by={X}}](intersection-1) circle (1pt);
%here is the problem : the green circle is also located where the red circle (first intersection) is instead of (0,-1)
\end{tikzpicture}
\end{document}
share|improve this question
1  
Welcome to TeX.SX! Please add a further description of your problem. – TeXnician 2 hours ago

The extension of 2' by shorten <-5.5cm is not part of the named path. So there is no intersection between 2' and D2.

You have to change your path 2' to something like

\draw[name path=2']($(F2)+(I')-(F'1)$) node{Y}--(F2)--([turn=0]0:5.5cm);

or

\draw[name path=2']($(F2)+(I')-(F'1)$) node(Y) {Y}--($(F2)!-5.5cm!(Y)$);

enter image description here

Code:

\documentclass{book}
\usepackage{tikz}
\usetikzlibrary{intersections}
\usetikzlibrary{calc}

\begin{document}
\begin{tikzpicture}
\draw[dotted](-10,-5) grid (5,5);
\path(0,0) node{0};
\draw(-10,0)--(5,0);
\coordinate(I')at(-2,2);
\coordinate(F'1)at(4,0);
\coordinate(F2)at(-3,0);
\draw[name path=D2](0,-5)--(0,5);
\draw(-9,2)--(I') node {};
\draw[name path=1'](I')--(F'1) node {};
\fill[red,name intersections={of=1' and D2,by={U'}}](intersection-1) circle[radius=1pt];
\draw[name path=2']($(F2)+(I')-(F'1)$) node{Y}--(F2)--([turn=0]0:5.5cm);
%so far so good, the intersection is at the right location (0,1.3)
\fill[green,name intersections={of=2' and D2,by={X}}](intersection-1) circle [radius=1pt];
%here is the problem : the green circle is also located where the red circle (first intersection) is instead of (0,-1)
\end{tikzpicture}
\end{document}
share|improve this answer
    
why you use intersection name as intersection-1 if you for it define name U'? – Zarko 1 hour ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.