Example: Handling the crossover of intersecting lines

Published 2014-02-02 | Author: Steffen Knoll

This example shows handling of the crossover of intersecting lines. It makes use of the intersections library and tkz-euklide to be more flexible in drawing the arc.

It uses the tikz library intersections to find the intersection of both lines and a circle pathed around this intersection. The arc is then drawed using tkzDrawArc, which uses the center, start and end coordinate instead of the angles of the normal arc command.

Only problem so far are the corners of the line, since it is not drawn in one draw command.

Download as: [PDF] [TEX]  •  [Open in Overleaf]

Handling the crossover of intersecting lines

Do you have a question regarding this example, TikZ or LaTeX in general? Just ask in the LaTeX Forum.
Oder frag auf Deutsch auf TeXwelt.de. En français: TeXnique.fr.

% Handling the crossover of intersecting lines
% Author: Steffen Knoll


% Radius for arc over intersection

  \coordinate (A) at (0,0);
  \coordinate (B) at (0,3);
  \coordinate (C) at (2,0);
  \coordinate (D) at (3,3);

  % first line
  \draw [->,name path=line 1] (B) -- (C);

  % second line (defined as path)
  \path[name path=line 2] (D) -- (A);	

  % find intersection of first and second line
  \path [name intersections={of = line 1 and line 2}];
  \coordinate (S)  at (intersection-1);

  % path a circle around this intersection for the arc
  \path[name path=circle] (S) circle(\radius);

  % find intersections of second line and circle
  \path [name intersections={of = circle and line 2}];
  \coordinate (I1)  at (intersection-1);
  \coordinate (I2)  at (intersection-2);

  % draw normal line segments
  \draw (D) -- (I1);
  \draw[->] (I2) -- (A);

  % draw arc at intersection



Adding comments is currently not enabled.