quality:correction
Nearest points

Expressing the two lines as vectors:

The cross product of d 1 {\displaystyle \mathbf {d_{1}} } and d 2 {\displaystyle \mathbf {d_{2}} } is perpendicular to the lines.

The plane formed by the translations of Line 2 along n {\displaystyle \mathbf {n} } contains the point p 2 {\displaystyle \mathbf {p_{2}} } and is perpendicular to n 2 = d 2 × n {\displaystyle \mathbf {n_{2}} =\mathbf {d_{2}} \times \mathbf {n} }.

Therefore, the intersecting point of Line 1 with the above-mentioned plane, which is also the point on Line 1 that is nearest to Line 2 is given by

Similarly, the point on Line 2 nearest to Line 1 is given by (where n 1 = d 1 × n {\displaystyle \mathbf {n_{1}} =\mathbf {d_{1}} \times \mathbf {n} })