I want to use \usetikzlibrary{intersections}

enter image description here

%\draw [color=gray,help lines, step=.5] (-1.3,-1.3) grid (5.3,5.3);

\draw[-stealth ] (-1.3,0) -- (5.3,0) node[below] {\footnotesize $x$};
\draw[-stealth ](0,-1.3) -- (0,5.3) node[left] {\footnotesize $y$};
\draw (0pt,-10pt) node[left] {\footnotesize $0$};
\draw[ dashed] (0,1.9 )node[ left]{\footnotesize $f(b)$} -| (1.144,0)
node[below]{\footnotesize $b$} ;
\draw[ dashed] (0,3.1928)node[ left]{\footnotesize $f(a)$} -| (3.2 ,0)
node[ below]{\footnotesize $a$} ;
\pgfsetroundjoin \pgfpathmoveto{\pgfxy(0.582,0.7937)}
  • Please forgive if I have missed your question... but what is your question? – darthbith Sep 26 '15 at 12:08
  • how do use commande intersections – HB khaled Sep 26 '15 at 12:15
  • 1
    @khaledhariz, your image is drawn with pure pgfs. As far as know, library intersection work with TikZ macros. Draw your curve and lines which intersect it with draw macro, give the names to curve and line and then look for intersection. – Zarko Sep 26 '15 at 12:32
  • So we can not use intersection, except in the case of function name . the curve drawing using texgraph – HB khaled Sep 26 '15 at 12:39

Hi Khaled you can name your paths with name path=patha, name path=pathb. then to find coordinate for intersection of patha and pathb with name intersections={of=patha and pathb}. where intersections are named intersection-1, intersection-2,... and so on.



\draw[->](-1.3,0) -- (5.3,0) node[below] {\footnotesize $x$};
\draw[->](0,-1.3) -- (0,5.3) node[left] {\footnotesize $y$};
\node[below left]at(0,0) {\footnotesize $0$};
\draw[red,line width=1pt,name path=plot](0.5,0.5)..controls(1,3)and(3,2)..(4,4.5);
\path[name path=froma](a)--+(0,4);
\path[name path=fromb](b)--+(0,4);
\draw[dashed,name intersections={of=froma and plot}](a)--(intersection-1)--(0,0|-intersection-1)node[left]{f(a)};
\draw[dashed,name intersections={of=fromb and plot}](b)--(intersection-1)--(0,0|-intersection-1)node[left]{f(b)};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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