For didactic purposes I'd like to find an equation of the 3D-straight line passing through the origin and intersecting both 3D-straight lines $\{x-y+z-2=0, x-2 y+3 z-8=0\}$ and $\{y - z + 1 = 0 , x + y - 2 z + 4 = 0\}$.
I do it in such a way.
p1 = FindInstance[x - y + z - 2 == 0 && x - 2 y + 3 z - 8 == 0, {x, y, z}, Reals, 2];
L1 = InfiniteLine[Table[{x, y, z} /. p1[[j]], {j, 1, 2}]];
p2 = FindInstance[y - z + 1 == 0 && x + y - 2 z + 4 == 0, {x, y, z},Reals, 2];
L2 = InfiniteLine[Table[{x, y, z} /. p2[[j]], {j, 1, 2}]];
Now
Resolve[Exists[t, {a*t, b*t, c*t} \[Element] L1] &&
Exists[s, {a*s, b*s, c*s} \[Element] L2], Reals]
a - b != 0 && a - c != 0 && 3 a - 2 b + c == 0 && a - 3 b + 2 c == 0
FindInstance[a - b != 0 && a - c != 0 && 3 a - 2 b + c == 0 &&
a - 3 b + 2 c == 0, {a, b, c},Reals]
{{a -> 1, b -> 5, c -> 7}}
Therefore, the requested line is InfiniteLine[{0,0,0},{1,5,7}]
and its parametric equations are {t,5*t,7*t}
.
Is there a simpler and shorter way to do the job (The usage of a long formula from a thick handbook on analytical geometry is not allowed.)?
FindInstance
in the latest command results in{}
,) and the given two lines intersect. One may tryp1 = FindInstance[x - 2 == 0 && 3 z - 8 == 0, {x, y, z}, Reals, 2];p2 = FindInstance[x - 3 == 0 && 3 z - 8 == 0, {x, y, z}, Reals, 2]
. $\endgroup$