How do I know the exact point of intersection of the graph , I have denoted the point of intersection as B ( taken some random coordinates (1,2). Please guide how do i find the exact point of intersection in the given figure to place the point B at that intersection point :

\draw (0,5)--(0,0)--(5,0)(2,0)node(b){D}--(0,4)node{A} (3,0)node(b){C}--(0,2)node(b){E} (1,2)node(b){B};

Please guide will be of great help.. Thanks a lot ..

1 Answer 1


You can use the intersections library of tikz. Then you can define paths and get their point of intersection!

\tikzset{dot/.style={circle,inner sep=1pt,fill,label={#1},name=#1}}
\draw (0,5)--(0,0)--(5,0);
\draw [name path=P1] (2,0)node(b){D} -- (0,4)node{A}; 
\draw [name path=P2] (3,0)node(b){C} -- (0,2)node(b){E}; 
\path [name intersections={of=P1 and P2,by=B}];
\node [dot=B]  at (B) {};

The result cannot be deemed as beautiful, but the intersection was found automatically. Tweak the code to your will and so that it looks nice!

enter image description here

  • Thank you so much , it is really great... thanks a lot ...God bless you
    – Sachin
    Commented Mar 17, 2020 at 8:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .