# Finding the intersection of a pencil of lines with a plane and making a 3D plot of the ensemble

I've computed the intersection of a plane with some lines. It looks OK until I try to make a 3D graph from intersec_lines.

alpha = Pi/5;
r1 = 5;
r2 = 2;
h = 3;
n = 20;
plane = InfinitePlane[{{0, 0, 0}, {Cos[alpha], 0, Sin[alpha]}, {0, 1, 0}}];
lines =
Table[
InfiniteLine[
{r1*Cos[2*Pi*x/n], r1*Sin[2*Pi*x/n], 0},
{r2*Cos[2*Pi*x/n], r2*Sin[2*Pi*x/n], h}],
{x, n}];
intersec_points = NSolve[{x, y, z} ∈ plane && {x, y, z} ∈ #]& /@ lines


Does anyone know how to do it? It seem it should be pretty basic, but I'm just starting to use Mathematica.

• Do not use _ in variable names, since _ has a special meaning in Mathematica. Sep 29, 2018 at 14:06
• To make it even clearer: Your code works except the variable named in not allowed because it has "_" in it. Then you have to write {x,y,z} /. Flatten[intersecPoints, 1] to get a list of points. Sep 29, 2018 at 16:17

Using RegionIntersection[] is the most straightforward route for finding the intersection points:
With[{α = π/5, r1 = 5, r2 = 2, h = 3, n = 20},