Multiple Tangents in Tikz

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











up vote
1
down vote

favorite












I would like to draw an ellipse with a large number of tangents drawn on it. Currently my code is very tedious to draw a lot of tangents for and the compiling time takes considerably longer for more and more tangents. Here is my current code:



documentclass[english]article
usepackage[T1]fontenc
usepackage[latin9]luainputenc
makeatletter
usepackagetikz
usetikzlibrarydecorations.markings

makeatother

usepackagebabel
begindocument
begintikzpicture[
tangent/.style=
decoration=
markings,% switch on markings
mark=
at position #1
with

coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);

,
postaction=decorate
,
use tangent/.style=
shift=(tangent point-#1),
x=(tangent unit vector-#1),
y=(tangent orthogonal unit vector-#1)
,
use tangent/.default=1
]
foreach x in 0,0.05,...,1.1
draw [
tangent=0,
tangent=0.1,
tangent=0.2,
tangent=0.2,
tangent=0.3,
tangent=0.4,
tangent=0.5,
tangent=0.6,
tangent=0.7,
tangent=0.8,
tangent=0.9,
tangent=1.0,
tangent=1.1,
] (-0.25,0)
to [out=-90,in=-90] (1.25,0)
to [out=90,in=90] (-0.25,0);
beginscope
clip (0,0) circle (1.5);
draw [thick, use tangent] (-3,0) -- (3,0);
draw [thick, use tangent=2] (-3,0) -- (3,0);
draw [thick, use tangent=3] (-3,0) -- (3,0);
draw [thick, use tangent=4] (-3,0) -- (3,0);
draw [thick, use tangent=5] (-3,0) -- (3,0);
draw [thick, use tangent=6] (-3,0) -- (3,0);
draw [thick, use tangent=7] (-3,0) -- (3,0);
draw [thick, use tangent=8] (-3,0) -- (3,0);
draw [thick, use tangent=9] (-3,0) -- (3,0);
draw [thick, use tangent=10] (-3,0) -- (3,0);
draw [thick, use tangent=11] (-3,0) -- (3,0);
endscope
draw (0,0) circle (1.5);
fill (0,0) circle (0.1) (1,0) circle (0.1);
endtikzpicture
enddocument


The code produces the following image, which is not that many tangents.
enter image description here
So I would like an easy way to draw more tangents around the ellipse inside the circle










share|improve this question

























    up vote
    1
    down vote

    favorite












    I would like to draw an ellipse with a large number of tangents drawn on it. Currently my code is very tedious to draw a lot of tangents for and the compiling time takes considerably longer for more and more tangents. Here is my current code:



    documentclass[english]article
    usepackage[T1]fontenc
    usepackage[latin9]luainputenc
    makeatletter
    usepackagetikz
    usetikzlibrarydecorations.markings

    makeatother

    usepackagebabel
    begindocument
    begintikzpicture[
    tangent/.style=
    decoration=
    markings,% switch on markings
    mark=
    at position #1
    with

    coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
    coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
    coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);

    ,
    postaction=decorate
    ,
    use tangent/.style=
    shift=(tangent point-#1),
    x=(tangent unit vector-#1),
    y=(tangent orthogonal unit vector-#1)
    ,
    use tangent/.default=1
    ]
    foreach x in 0,0.05,...,1.1
    draw [
    tangent=0,
    tangent=0.1,
    tangent=0.2,
    tangent=0.2,
    tangent=0.3,
    tangent=0.4,
    tangent=0.5,
    tangent=0.6,
    tangent=0.7,
    tangent=0.8,
    tangent=0.9,
    tangent=1.0,
    tangent=1.1,
    ] (-0.25,0)
    to [out=-90,in=-90] (1.25,0)
    to [out=90,in=90] (-0.25,0);
    beginscope
    clip (0,0) circle (1.5);
    draw [thick, use tangent] (-3,0) -- (3,0);
    draw [thick, use tangent=2] (-3,0) -- (3,0);
    draw [thick, use tangent=3] (-3,0) -- (3,0);
    draw [thick, use tangent=4] (-3,0) -- (3,0);
    draw [thick, use tangent=5] (-3,0) -- (3,0);
    draw [thick, use tangent=6] (-3,0) -- (3,0);
    draw [thick, use tangent=7] (-3,0) -- (3,0);
    draw [thick, use tangent=8] (-3,0) -- (3,0);
    draw [thick, use tangent=9] (-3,0) -- (3,0);
    draw [thick, use tangent=10] (-3,0) -- (3,0);
    draw [thick, use tangent=11] (-3,0) -- (3,0);
    endscope
    draw (0,0) circle (1.5);
    fill (0,0) circle (0.1) (1,0) circle (0.1);
    endtikzpicture
    enddocument


    The code produces the following image, which is not that many tangents.
    enter image description here
    So I would like an easy way to draw more tangents around the ellipse inside the circle










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I would like to draw an ellipse with a large number of tangents drawn on it. Currently my code is very tedious to draw a lot of tangents for and the compiling time takes considerably longer for more and more tangents. Here is my current code:



      documentclass[english]article
      usepackage[T1]fontenc
      usepackage[latin9]luainputenc
      makeatletter
      usepackagetikz
      usetikzlibrarydecorations.markings

      makeatother

      usepackagebabel
      begindocument
      begintikzpicture[
      tangent/.style=
      decoration=
      markings,% switch on markings
      mark=
      at position #1
      with

      coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
      coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
      coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);

      ,
      postaction=decorate
      ,
      use tangent/.style=
      shift=(tangent point-#1),
      x=(tangent unit vector-#1),
      y=(tangent orthogonal unit vector-#1)
      ,
      use tangent/.default=1
      ]
      foreach x in 0,0.05,...,1.1
      draw [
      tangent=0,
      tangent=0.1,
      tangent=0.2,
      tangent=0.2,
      tangent=0.3,
      tangent=0.4,
      tangent=0.5,
      tangent=0.6,
      tangent=0.7,
      tangent=0.8,
      tangent=0.9,
      tangent=1.0,
      tangent=1.1,
      ] (-0.25,0)
      to [out=-90,in=-90] (1.25,0)
      to [out=90,in=90] (-0.25,0);
      beginscope
      clip (0,0) circle (1.5);
      draw [thick, use tangent] (-3,0) -- (3,0);
      draw [thick, use tangent=2] (-3,0) -- (3,0);
      draw [thick, use tangent=3] (-3,0) -- (3,0);
      draw [thick, use tangent=4] (-3,0) -- (3,0);
      draw [thick, use tangent=5] (-3,0) -- (3,0);
      draw [thick, use tangent=6] (-3,0) -- (3,0);
      draw [thick, use tangent=7] (-3,0) -- (3,0);
      draw [thick, use tangent=8] (-3,0) -- (3,0);
      draw [thick, use tangent=9] (-3,0) -- (3,0);
      draw [thick, use tangent=10] (-3,0) -- (3,0);
      draw [thick, use tangent=11] (-3,0) -- (3,0);
      endscope
      draw (0,0) circle (1.5);
      fill (0,0) circle (0.1) (1,0) circle (0.1);
      endtikzpicture
      enddocument


      The code produces the following image, which is not that many tangents.
      enter image description here
      So I would like an easy way to draw more tangents around the ellipse inside the circle










      share|improve this question













      I would like to draw an ellipse with a large number of tangents drawn on it. Currently my code is very tedious to draw a lot of tangents for and the compiling time takes considerably longer for more and more tangents. Here is my current code:



      documentclass[english]article
      usepackage[T1]fontenc
      usepackage[latin9]luainputenc
      makeatletter
      usepackagetikz
      usetikzlibrarydecorations.markings

      makeatother

      usepackagebabel
      begindocument
      begintikzpicture[
      tangent/.style=
      decoration=
      markings,% switch on markings
      mark=
      at position #1
      with

      coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
      coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
      coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);

      ,
      postaction=decorate
      ,
      use tangent/.style=
      shift=(tangent point-#1),
      x=(tangent unit vector-#1),
      y=(tangent orthogonal unit vector-#1)
      ,
      use tangent/.default=1
      ]
      foreach x in 0,0.05,...,1.1
      draw [
      tangent=0,
      tangent=0.1,
      tangent=0.2,
      tangent=0.2,
      tangent=0.3,
      tangent=0.4,
      tangent=0.5,
      tangent=0.6,
      tangent=0.7,
      tangent=0.8,
      tangent=0.9,
      tangent=1.0,
      tangent=1.1,
      ] (-0.25,0)
      to [out=-90,in=-90] (1.25,0)
      to [out=90,in=90] (-0.25,0);
      beginscope
      clip (0,0) circle (1.5);
      draw [thick, use tangent] (-3,0) -- (3,0);
      draw [thick, use tangent=2] (-3,0) -- (3,0);
      draw [thick, use tangent=3] (-3,0) -- (3,0);
      draw [thick, use tangent=4] (-3,0) -- (3,0);
      draw [thick, use tangent=5] (-3,0) -- (3,0);
      draw [thick, use tangent=6] (-3,0) -- (3,0);
      draw [thick, use tangent=7] (-3,0) -- (3,0);
      draw [thick, use tangent=8] (-3,0) -- (3,0);
      draw [thick, use tangent=9] (-3,0) -- (3,0);
      draw [thick, use tangent=10] (-3,0) -- (3,0);
      draw [thick, use tangent=11] (-3,0) -- (3,0);
      endscope
      draw (0,0) circle (1.5);
      fill (0,0) circle (0.1) (1,0) circle (0.1);
      endtikzpicture
      enddocument


      The code produces the following image, which is not that many tangents.
      enter image description here
      So I would like an easy way to draw more tangents around the ellipse inside the circle







      tikz-pgf






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 1 hour ago









      sab hoque

      1,023317




      1,023317




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          With a bit of code reorganisation ;)



          documentclass[english]article
          usepackage[T1]fontenc
          usepackage[latin9]luainputenc
          makeatletter
          usepackagetikz
          usetikzlibrarydecorations.markings

          makeatother

          usepackagebabel
          begindocument
          begintikzpicture[
          tangent/.style=
          decoration=
          markings,% switch on markings
          mark=
          at position #1
          with

          coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
          coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
          coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);

          ,
          postaction=decorate
          ,
          use tangent/.style=
          shift=(tangent point-#1),
          x=(tangent unit vector-#1),
          y=(tangent orthogonal unit vector-#1)
          ,
          use tangent/.default=1
          ]
          beginscope
          clip (0,0) circle (1.5);
          foreach x in 0,0.02,...,1.1
          draw [tangent=x] (-0.25,0) to [out=-90,in=-90] (1.25,0) to [out=90,in=90] (-0.25,0);
          draw [thick, use tangent] (-3,0) -- (3,0);

          endscope
          draw (0,0) circle (1.5);
          fill (0,0) circle (0.1) (1,0) circle (0.1);
          endtikzpicture
          enddocument


          enter image description here






          share|improve this answer






















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "85"
            ;
            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
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f452237%2fmultiple-tangents-in-tikz%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
            4
            down vote



            accepted










            With a bit of code reorganisation ;)



            documentclass[english]article
            usepackage[T1]fontenc
            usepackage[latin9]luainputenc
            makeatletter
            usepackagetikz
            usetikzlibrarydecorations.markings

            makeatother

            usepackagebabel
            begindocument
            begintikzpicture[
            tangent/.style=
            decoration=
            markings,% switch on markings
            mark=
            at position #1
            with

            coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
            coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
            coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);

            ,
            postaction=decorate
            ,
            use tangent/.style=
            shift=(tangent point-#1),
            x=(tangent unit vector-#1),
            y=(tangent orthogonal unit vector-#1)
            ,
            use tangent/.default=1
            ]
            beginscope
            clip (0,0) circle (1.5);
            foreach x in 0,0.02,...,1.1
            draw [tangent=x] (-0.25,0) to [out=-90,in=-90] (1.25,0) to [out=90,in=90] (-0.25,0);
            draw [thick, use tangent] (-3,0) -- (3,0);

            endscope
            draw (0,0) circle (1.5);
            fill (0,0) circle (0.1) (1,0) circle (0.1);
            endtikzpicture
            enddocument


            enter image description here






            share|improve this answer


























              up vote
              4
              down vote



              accepted










              With a bit of code reorganisation ;)



              documentclass[english]article
              usepackage[T1]fontenc
              usepackage[latin9]luainputenc
              makeatletter
              usepackagetikz
              usetikzlibrarydecorations.markings

              makeatother

              usepackagebabel
              begindocument
              begintikzpicture[
              tangent/.style=
              decoration=
              markings,% switch on markings
              mark=
              at position #1
              with

              coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
              coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
              coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);

              ,
              postaction=decorate
              ,
              use tangent/.style=
              shift=(tangent point-#1),
              x=(tangent unit vector-#1),
              y=(tangent orthogonal unit vector-#1)
              ,
              use tangent/.default=1
              ]
              beginscope
              clip (0,0) circle (1.5);
              foreach x in 0,0.02,...,1.1
              draw [tangent=x] (-0.25,0) to [out=-90,in=-90] (1.25,0) to [out=90,in=90] (-0.25,0);
              draw [thick, use tangent] (-3,0) -- (3,0);

              endscope
              draw (0,0) circle (1.5);
              fill (0,0) circle (0.1) (1,0) circle (0.1);
              endtikzpicture
              enddocument


              enter image description here






              share|improve this answer
























                up vote
                4
                down vote



                accepted







                up vote
                4
                down vote



                accepted






                With a bit of code reorganisation ;)



                documentclass[english]article
                usepackage[T1]fontenc
                usepackage[latin9]luainputenc
                makeatletter
                usepackagetikz
                usetikzlibrarydecorations.markings

                makeatother

                usepackagebabel
                begindocument
                begintikzpicture[
                tangent/.style=
                decoration=
                markings,% switch on markings
                mark=
                at position #1
                with

                coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
                coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
                coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);

                ,
                postaction=decorate
                ,
                use tangent/.style=
                shift=(tangent point-#1),
                x=(tangent unit vector-#1),
                y=(tangent orthogonal unit vector-#1)
                ,
                use tangent/.default=1
                ]
                beginscope
                clip (0,0) circle (1.5);
                foreach x in 0,0.02,...,1.1
                draw [tangent=x] (-0.25,0) to [out=-90,in=-90] (1.25,0) to [out=90,in=90] (-0.25,0);
                draw [thick, use tangent] (-3,0) -- (3,0);

                endscope
                draw (0,0) circle (1.5);
                fill (0,0) circle (0.1) (1,0) circle (0.1);
                endtikzpicture
                enddocument


                enter image description here






                share|improve this answer














                With a bit of code reorganisation ;)



                documentclass[english]article
                usepackage[T1]fontenc
                usepackage[latin9]luainputenc
                makeatletter
                usepackagetikz
                usetikzlibrarydecorations.markings

                makeatother

                usepackagebabel
                begindocument
                begintikzpicture[
                tangent/.style=
                decoration=
                markings,% switch on markings
                mark=
                at position #1
                with

                coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
                coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
                coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);

                ,
                postaction=decorate
                ,
                use tangent/.style=
                shift=(tangent point-#1),
                x=(tangent unit vector-#1),
                y=(tangent orthogonal unit vector-#1)
                ,
                use tangent/.default=1
                ]
                beginscope
                clip (0,0) circle (1.5);
                foreach x in 0,0.02,...,1.1
                draw [tangent=x] (-0.25,0) to [out=-90,in=-90] (1.25,0) to [out=90,in=90] (-0.25,0);
                draw [thick, use tangent] (-3,0) -- (3,0);

                endscope
                draw (0,0) circle (1.5);
                fill (0,0) circle (0.1) (1,0) circle (0.1);
                endtikzpicture
                enddocument


                enter image description here







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 46 mins ago

























                answered 1 hour ago









                BambOo

                2,632323




                2,632323



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f452237%2fmultiple-tangents-in-tikz%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    One-line joke