tikz add tag
Anonymous 1123
I have two lines `d1` has equation 
`x = 1 + t, y = 2 + t, z=3+t`
and `d2` has equation
`x = 1 + 2t', y = 2  -3 t', z=3+t`.
I know that, two this lines cut at the point `P(1,2,3)`. By using `3dtools`, 

How can I input the line `d1` in the form
like this

`\path[3d/line with direction={(1,1,1) through (1,2,3) named d1}]`
and 

input the line `d2` in the form
like this

`\path[3d/line with direction={(2,-3,1) through (1,2,3) named d2}]` 

Is there command to find intersection of two lines `d1` and `d2`? like this

`\path[3d/intersection of={d1 with d2}] coordinate (I);`

I want like this
```
\documentclass[tikz,border=3mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3dtools,intersections}

\begin{document}
\tdplotsetmaincoords{70}{80}
\begin{tikzpicture}
   \path
   (1,2,3) coordinate (A);
  
 \path[3d/line with direction={(1,1,1) through (A) named d1}];
  \path[3d/line with direction={(2,-3,1) through (A) named d2}];
  \path[3d/intersection of={d1 with d2}] coordinate (I);
  
\end{tikzpicture}
\end{document}  
```
Top Answer
user 3.14159
I added a routine for this to the [`3dtools` library](https://github.com/marmotghost/tikz-3dtools). The example you have is a bit special in that you define the two lines to run through the same point (which is why I had to add this case to the library). The computation follows [this post](https://math.stackexchange.com/a/271366).
```
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools}% https://github.com/marmotghost/tikz-3dtools
\begin{document}
\begin{tikzpicture}[line cap=butt,line join=round,
	3d/install view={phi=110,psi=0,theta=60}]
 \path[3d/line with direction={(1,1,1) through (1,2,3) named d1},
 	3d/line with direction={(2,-3,1) through (1,2,3) named d2}];
 \draw[red] (1,1,1) -- (1,2,3);
 \draw[blue] (2,-3,1) -- (1,2,3);
 \path[3d/intersection of={d1 with d2}] coordinate (I)
  node[circle,fill,inner sep=0.5pt,
  label=above:{$(I)=(\pgfmathparse{TD("(I)")}\pgfmathprintvector\pgfmathresult)$}]{};
\end{tikzpicture}
\end{document}
```
![Screen Shot 2020-11-20 at 9.58.14 PM.png](/image?hash=974d189f5e25b512f5463fd04eb0b05710251eea92026b5e79975f400e46253c)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.