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

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












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.










share|improve this question









New contributor




Lorenzo F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 2




    Do not use _ in variable names, since _ has a special meaning in Mathematica.
    – J. M. is somewhat okay.♦
    1 hour ago














up vote
2
down vote

favorite












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.










share|improve this question









New contributor




Lorenzo F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.















  • 2




    Do not use _ in variable names, since _ has a special meaning in Mathematica.
    – J. M. is somewhat okay.♦
    1 hour ago












up vote
2
down vote

favorite









up vote
2
down vote

favorite











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.










share|improve this question









New contributor




Lorenzo F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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.







plotting graphics3d






share|improve this question









New contributor




Lorenzo F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Lorenzo F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 15 mins ago









m_goldberg

82.3k869190




82.3k869190






New contributor




Lorenzo F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 1 hour ago









Lorenzo F.

111




111




New contributor




Lorenzo F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Lorenzo F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Lorenzo F. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







  • 2




    Do not use _ in variable names, since _ has a special meaning in Mathematica.
    – J. M. is somewhat okay.♦
    1 hour ago












  • 2




    Do not use _ in variable names, since _ has a special meaning in Mathematica.
    – J. M. is somewhat okay.♦
    1 hour ago







2




2




Do not use _ in variable names, since _ has a special meaning in Mathematica.
– J. M. is somewhat okay.♦
1 hour ago




Do not use _ in variable names, since _ has a special meaning in Mathematica.
– J. M. is somewhat okay.♦
1 hour ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote













Using RegionIntersection is the most straightforward route for finding the intersection points:



With[α = π/5, r1 = 5, r2 = 2, h = 3, n = 20,
plane = InfinitePlane[0, 0, 0, Cos[α], 0, Sin[α], 0, 1, 0];
lines = Table[InfiniteLine[r1 Cos[2 π x/n], r1 Sin[2 π x/n], 0,
r2 Cos[2 π x/n], r2 Sin[2 π x/n], h], x, n];]

pts = RegionIntersection[plane, #] & /@ lines;

Graphics3D[plane, lines, Sphere[#, 1/4] & @@@ pts, Axes -> True, PlotRange -> 10]


intersection points of a cone and a plane






share|improve this answer




















    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "387"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    Lorenzo F. is a new contributor. Be nice, and check out our Code of Conduct.









     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182818%2ffinding-the-intersection-of-a-pencil-of-lines-with-a-plane-and-making-a-3d-plot%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    3
    down vote













    Using RegionIntersection is the most straightforward route for finding the intersection points:



    With[α = π/5, r1 = 5, r2 = 2, h = 3, n = 20,
    plane = InfinitePlane[0, 0, 0, Cos[α], 0, Sin[α], 0, 1, 0];
    lines = Table[InfiniteLine[r1 Cos[2 π x/n], r1 Sin[2 π x/n], 0,
    r2 Cos[2 π x/n], r2 Sin[2 π x/n], h], x, n];]

    pts = RegionIntersection[plane, #] & /@ lines;

    Graphics3D[plane, lines, Sphere[#, 1/4] & @@@ pts, Axes -> True, PlotRange -> 10]


    intersection points of a cone and a plane






    share|improve this answer
























      up vote
      3
      down vote













      Using RegionIntersection is the most straightforward route for finding the intersection points:



      With[α = π/5, r1 = 5, r2 = 2, h = 3, n = 20,
      plane = InfinitePlane[0, 0, 0, Cos[α], 0, Sin[α], 0, 1, 0];
      lines = Table[InfiniteLine[r1 Cos[2 π x/n], r1 Sin[2 π x/n], 0,
      r2 Cos[2 π x/n], r2 Sin[2 π x/n], h], x, n];]

      pts = RegionIntersection[plane, #] & /@ lines;

      Graphics3D[plane, lines, Sphere[#, 1/4] & @@@ pts, Axes -> True, PlotRange -> 10]


      intersection points of a cone and a plane






      share|improve this answer






















        up vote
        3
        down vote










        up vote
        3
        down vote









        Using RegionIntersection is the most straightforward route for finding the intersection points:



        With[α = π/5, r1 = 5, r2 = 2, h = 3, n = 20,
        plane = InfinitePlane[0, 0, 0, Cos[α], 0, Sin[α], 0, 1, 0];
        lines = Table[InfiniteLine[r1 Cos[2 π x/n], r1 Sin[2 π x/n], 0,
        r2 Cos[2 π x/n], r2 Sin[2 π x/n], h], x, n];]

        pts = RegionIntersection[plane, #] & /@ lines;

        Graphics3D[plane, lines, Sphere[#, 1/4] & @@@ pts, Axes -> True, PlotRange -> 10]


        intersection points of a cone and a plane






        share|improve this answer












        Using RegionIntersection is the most straightforward route for finding the intersection points:



        With[α = π/5, r1 = 5, r2 = 2, h = 3, n = 20,
        plane = InfinitePlane[0, 0, 0, Cos[α], 0, Sin[α], 0, 1, 0];
        lines = Table[InfiniteLine[r1 Cos[2 π x/n], r1 Sin[2 π x/n], 0,
        r2 Cos[2 π x/n], r2 Sin[2 π x/n], h], x, n];]

        pts = RegionIntersection[plane, #] & /@ lines;

        Graphics3D[plane, lines, Sphere[#, 1/4] & @@@ pts, Axes -> True, PlotRange -> 10]


        intersection points of a cone and a plane







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 1 hour ago









        J. M. is somewhat okay.♦

        93.4k10289445




        93.4k10289445




















            Lorenzo F. is a new contributor. Be nice, and check out our Code of Conduct.









             

            draft saved


            draft discarded


















            Lorenzo F. is a new contributor. Be nice, and check out our Code of Conduct.












            Lorenzo F. is a new contributor. Be nice, and check out our Code of Conduct.











            Lorenzo F. is a new contributor. Be nice, and check out our Code of Conduct.













             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182818%2ffinding-the-intersection-of-a-pencil-of-lines-with-a-plane-and-making-a-3d-plot%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            Long meetings (6-7 hours a day): Being “babysat” by supervisor

            Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

            Confectionery