19 votes
Accepted

How to get intersection points of a self intersecting path?

A trick which seems to work here: searching the intersection of the curve… and its reverse. Applied with MetaPost. u := 3cm; path curve[]; curve1 = ((0,0)--(3,0)--(2,1)--(1,-1)) scaled u; curve2 = ((...
15 votes

How to fill space between dotted lines in tikz picture?

Just for fun and learn, an option using let to calculate the angle of the shadow lines to draw from the top and bottom of the sun to certain distance to the planet (0,2) -- +(-\n1:9.5), then save this ...
  • 10.4k
14 votes
Accepted

tikz intersection of named path

With a real intersection you can write (I changed the coordinates of D) \begin{tikzpicture} \tikzset{dot/.style={circle,inner sep=1pt,fill,label={\tiny #1},name=#1}} \node[dot=A] (A) at (0,0) {}; \...
14 votes

Tangent Lines Diagram Along Smooth Curve

A PSTricks solution just for comparison purpose. \documentclass[pstricks]{standalone} \usepackage{pstricks-add,pst-vehicle,tikzducks} \def\V{\rput(1,1.5){\psscalebox{-2 2}{\tikz{\duck[alien=red]}}}} ...
13 votes
Accepted

Intersection of 5 ellipses

or \documentclass[border=3pt]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \def\firstellip{(0, 1.6) ellipse [x radius=4cm, y radius=1.5cm, rotate=90]} \\ \def\secondellip{(2....
  • 16.5k
12 votes

TikZ: Intersection of two lines

For the intersection of two segments, we don't need the intersections library. We can use directly in tikz points like (intersection of A--B and C--D). \documentclass[tikz,border=5pt]{standalone} \...
  • 22.5k
12 votes

Multiple graphs in TikZ with intersections and naming

You already loaded the intersections library, but then just didn't make use of it. Here one possible way to achieve the desired result. For details please have a look at the comments in the code. % ...
11 votes

Draw all existing intersections

Apparently Tikz doesn't like when you extend the lines artificially using shorten >=-5cm so that's the problem. Your lines don't actually reach the circle, so there are no intersections. This is ...
  • 36.4k
11 votes
Accepted

Planes' intersection in Asymptote

Note that I know nothing about Asymptote. Caveat emptor ... This answer is almost exclusively drawn from Charles Staats's fantastic tutorial and the interested reader is encouraged to look ...
  • 184k
11 votes
Accepted

pgfplots fillbetween with multiple curves

Here a workaround, you can divide your area on two parts: first between curve A and C, and the second between A and B and use soft clip to limit filling \documentclass[border=5mm]{standalone} \...
  • 16.1k
10 votes

Stereographic projection of a circle to a plane in Asymptote

Note: I edited the code a couple of times (mostly small cosmetic changes). So, here is the code I finally used (pardon all the commented code, part of it is dedicated to creating raster output). I ...
  • 529
10 votes

tikz intersection of named path

There must be a real intersection between path P1 and path P2. You could use something like \path[name path=P1,overlay] (A) -- (B)--([turn]0:5cm); \path[name path=P2,overlay] (C) -- (D)--([turn]0:5cm)...
  • 82.5k
10 votes

Using functions like sine, cosine and tangent to calculate coordinates in Tikz

Since in cos(30) and tan(30) there are parentheses you must put these functions inside curly brackets {} \documentclass{article} \usepackage{tikz} \usetikzlibrary{angles,quotes} \tikzset{help lines/...
9 votes

Tikz: Shifting a curve to get a tangent condition

Here's an Asymptote version. The idea is to rotate everything virtually so that the red line is horizontal, and then compute the bounding box of the gray curve. Its minimum coordinate (i.e., "height") ...
9 votes
Accepted

Why does `\coordinate` fail but `\node` succeed at an intersection of two paths?

In essence, \coordinate is an alias for \node[shape=coordinate]. Looking through tikz.code.tex, it would appear that \coordinate[options] becomes \node[shape=coordinate,options] and so your \...
9 votes
Accepted

Intersection library and Differential approximations

If you instead of shorten use the syntax of the calc library to draw the tangent line, you can use the intersections library to find the intersection. \documentclass{article} \usepackage{tikz} \...
8 votes

TikZ: Intersection point with a double-line path

You can use the calc TikZ package to do the job: \documentclass[tikz,border=1mm]{standalone} \usetikzlibrary{intersections,calc} \begin{document} \begin{tikzpicture} \def \borderSep {3pt} % Define ...
  • 5,335
8 votes

Draw all existing intersections

You can also use the calc library to extend lines. Note that when \t=0 the \foreach will still execute \s=1, hence the \ifnum ... \fi test. \documentclass{standalone} \usepackage{tikz} \...
  • 71.4k
8 votes

how to shade the intersection of 3 lines

Here is a way: \documentclass{article} \usepackage{pgfplots} \usepgfplotslibrary{fillbetween} \usetikzlibrary{intersections} \begin{document} \begin{tikzpicture} \begin{axis}[ axis lines = left, ...
  • 19.4k
8 votes
Accepted

Determining point of intersection in a triangle

E is the easiest point to find, that's just a matter of using polar coordinates. If D is at (0,0), and B is at (90:1) (polar coordinate, angle 90 radius 1), then E is at (140:1). \documentclass[...
8 votes

How to fill space between dotted lines in tikz picture?

Here is another suggestion using nodes instead circles and the tangent cs: \documentclass[a4paper,twoside]{article} \usepackage{tikz} \usetikzlibrary{backgrounds} \usetikzlibrary{calc} \begin{...
  • 82.5k

Only top scored, non community-wiki answers of a minimum length are eligible