# Calculating intersections of paths

TikZ drawings are often built step by step. We choose coordinates and draw lines, curves, and shapes. At some point, we may need to know the intersection of such paths to proceed with further drawing steps, such as adding text or arrows at such positions.

We could calculate the intersection point of two lines ourselves by solving a system of two linear equations. To get the intersection points of a circle and a line, we can solve a quadratic equation. Remember polygons or shapes consisting of curvy paths such as bent lines? It can become hard to compute a point on such a path that overlaps with another path.

TikZ provides the `intersections`

library that solves such challenges. You can load it in the usual way:

\usetikzlibrary{intersections}

Now, TikZ can do all the hard work and calculate all intersection points of arbitrary paths, generating named coordinates for them.

Let’s dive into a basic example to see how it works. We&...