Draw this image in the TIKZ package












2















enter image description here



I need to draw this image using TikZ.










share|improve this question









New contributor




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
















  • 3





    Welcome to TeX.se. I've changed your Portuguese request to English, which is the language of the site. But questions which just post an image and ask people to draw it for you are really not the best way to ask a question. Much of this diagram is quite simple, so can you edit your question to include a minimal document that shows at least some of what you've tried. Then we could help you with what you're having trouble with.

    – Alan Munn
    2 hours ago
















2















enter image description here



I need to draw this image using TikZ.










share|improve this question









New contributor




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
















  • 3





    Welcome to TeX.se. I've changed your Portuguese request to English, which is the language of the site. But questions which just post an image and ask people to draw it for you are really not the best way to ask a question. Much of this diagram is quite simple, so can you edit your question to include a minimal document that shows at least some of what you've tried. Then we could help you with what you're having trouble with.

    – Alan Munn
    2 hours ago














2












2








2


1






enter image description here



I need to draw this image using TikZ.










share|improve this question









New contributor




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












enter image description here



I need to draw this image using TikZ.







tikz-pgf






share|improve this question









New contributor




Ícaro Viterbre 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




Ícaro Viterbre 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 2 hours ago









Alan Munn

162k28431706




162k28431706






New contributor




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









asked 2 hours ago









Ícaro ViterbreÍcaro Viterbre

111




111




New contributor




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





New contributor





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






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








  • 3





    Welcome to TeX.se. I've changed your Portuguese request to English, which is the language of the site. But questions which just post an image and ask people to draw it for you are really not the best way to ask a question. Much of this diagram is quite simple, so can you edit your question to include a minimal document that shows at least some of what you've tried. Then we could help you with what you're having trouble with.

    – Alan Munn
    2 hours ago














  • 3





    Welcome to TeX.se. I've changed your Portuguese request to English, which is the language of the site. But questions which just post an image and ask people to draw it for you are really not the best way to ask a question. Much of this diagram is quite simple, so can you edit your question to include a minimal document that shows at least some of what you've tried. Then we could help you with what you're having trouble with.

    – Alan Munn
    2 hours ago








3




3





Welcome to TeX.se. I've changed your Portuguese request to English, which is the language of the site. But questions which just post an image and ask people to draw it for you are really not the best way to ask a question. Much of this diagram is quite simple, so can you edit your question to include a minimal document that shows at least some of what you've tried. Then we could help you with what you're having trouble with.

– Alan Munn
2 hours ago





Welcome to TeX.se. I've changed your Portuguese request to English, which is the language of the site. But questions which just post an image and ask people to draw it for you are really not the best way to ask a question. Much of this diagram is quite simple, so can you edit your question to include a minimal document that shows at least some of what you've tried. Then we could help you with what you're having trouble with.

– Alan Munn
2 hours ago










4 Answers
4






active

oldest

votes


















2














A PSTricks solution just for fun.



documentclass[pstricks,12pt]{standalone}
usepackage{pst-eucl}
begin{document}
begin{pspicture}[arrowinset=0](-5,-1)(1,5.5)
pstGeonode[PointSymbol=none,PosAngle=-45](0,0){S}
pnodes(5;150){A}(5;100){B}
pswedge(S){5}{(B)}{(A)}
psframe(A|S)(S|B)
rput{0}(5.4;130){$c(h)$}
pcline(A)(S)ncput*{$h$}
pcline[offset=-.5]{|<->|}(A|S)(S)ncput*{$p$}
pcline[offset=.5]{|<->|}(S|B)(S)ncput*{$q$}
end{pspicture}
end{document}


enter image description here






share|improve this answer































    2














    Using a local bounding box saves us from a lot of hassle here.



    documentclass[border=3.14mm,tikz]{standalone}
    begin{document}
    begin{tikzpicture}
    node[fill,inner sep=1.5pt,circle] (O) at (0,0){};
    begin{scope}[local bounding box=box]
    draw (O.center) -- (100:4) arc(100:140:4) node[pos=0.7,above,sloped,inner
    xsep=0pt] {$c(h)$}
    -- node[midway,below] {$h$} cycle;
    end{scope}
    draw (box.south west) rectangle (box.north east);
    draw[|-|] (1,0|-box.south) -- (1,0|-box.north)node[midway,fill=white]{$p$};
    draw[|-|] (0,-1 -|box.west) -- (0,-1 -|box.east)node[midway,fill=white]{$q$};
    end{tikzpicture}
    end{document}


    enter image description here






    share|improve this answer
























    • +1 for the use of the local bounding box. You can simplify the drawing of the lengths p and q : draw[|-|] (1,0)node{a} -- (1,0|-box.north)node[midway,fill=white]{$p$}; draw[|-|] (0,-1 -|box.west) -- (0,-1)node[midway,fill=white]{$q$};

      – AndréC
      59 mins ago





















    1














    Here is a way to build this figure that uses several key concepts from TikZ:




    • the scope

    • clip

    • the use of the intersections library

    • the use of node to place text.


    • sloped to write text tangent to a path


    Their use is explained in the written comments in the code.



    screenshot



    documentclass[border=5mm]{standalone}
    usepackage{tikz}
    usetikzlibrary{intersections}

    begin{document}

    begin{tikzpicture}
    % This scope allows you to draw the part of the circle inside the rectangle. The outer part is cut off.
    begin{scope}% use of intersections library to define the intersections between circle and rectangle
    draw[name path global=cadre,clip] (0,0) rectangle (3.5,4.5);
    draw[name path global=cercle] (3.5,0)circle(4.6cm);
    end{scope}

    % draw both sides of the angular sector
    draw[name intersections={of=cercle and cadre}](intersection-2)--(3.5,0)--(intersection-1)node[above right,midway]{h};

    % sloped allow to write text tangent to the path
    path[above] (intersection-1)to[bend left=15]node[sloped]{$c(h)$}(intersection-2);

    % dimension of rectangle wrtien in 2 differents way
    draw [<->](4.2,0)--node[right]{q}(4.2,4.5);
    draw [<->](0,-.6)--(3.5,-.6)node[below,midway]{p};
    end{tikzpicture}

    end{document}





    share|improve this answer

































      0














      Here you go :)



      documentclass{standalone}
      usepackage{tikz}

      begin{document}
      begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1,line width=0.75pt]
      draw (46.5,25) -- (145.5,25) -- (145.5,156.33) -- (46.5,156.33) -- cycle ;
      draw (46.5,176.33) -- (145.5,176.33) ;
      draw [shift={(145.5,176.33)}, rotate = 180] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
      draw [shift={(46.5,176.33)}, rotate = 0] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
      draw (165.5,156.33) -- (165.5,25) ;
      draw [shift={(165.5,25)}, rotate = 450] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
      draw [shift={(165.5,156.33)}, rotate = 270] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
      draw (46.88,52.66) -- (145.5,156.33) ;
      draw (117.77,25) -- (145.5,156.33) ;
      draw [draw opacity=0] (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) -- (117.08,127.92) -- cycle ; draw (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) ;

      % Text Nodes
      draw (99,163) node [align=left] {$displaystyle p$};
      draw (174,91) node [align=left] {$displaystyle q$};
      draw (101,96) node [align=left] {$displaystyle h$};
      draw (153,160) node [align=left] {$displaystyle s$};
      draw (82,40) node [scale=0.8] [align=left] {$displaystyle c( h)$};
      end{tikzpicture}
      end{document}


      enter image description here






      share|improve this answer










      New contributor




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
















      • 2





        As always here -- please make your code snippet compilable, then we do not have to guess what you are doing with documentclass, used packages etc.

        – Kurt
        1 hour ago






      • 1





        And do you really want to set a style for every picture? This will affect all other tikzpictures, which is probably not desirable.

        – Alan Munn
        1 hour ago













      • It's compilable now @Kurt, enjoy :) You can change document class if you like. Any should work, really... And only one package.

        – Superuser27
        1 hour ago











      • @AlanMunn you're right, thanks. Fixed it.

        – Superuser27
        1 hour ago











      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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });






      Ícaro Viterbre 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%2ftex.stackexchange.com%2fquestions%2f478465%2fdraw-this-image-in-the-tikz-package%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      A PSTricks solution just for fun.



      documentclass[pstricks,12pt]{standalone}
      usepackage{pst-eucl}
      begin{document}
      begin{pspicture}[arrowinset=0](-5,-1)(1,5.5)
      pstGeonode[PointSymbol=none,PosAngle=-45](0,0){S}
      pnodes(5;150){A}(5;100){B}
      pswedge(S){5}{(B)}{(A)}
      psframe(A|S)(S|B)
      rput{0}(5.4;130){$c(h)$}
      pcline(A)(S)ncput*{$h$}
      pcline[offset=-.5]{|<->|}(A|S)(S)ncput*{$p$}
      pcline[offset=.5]{|<->|}(S|B)(S)ncput*{$q$}
      end{pspicture}
      end{document}


      enter image description here






      share|improve this answer




























        2














        A PSTricks solution just for fun.



        documentclass[pstricks,12pt]{standalone}
        usepackage{pst-eucl}
        begin{document}
        begin{pspicture}[arrowinset=0](-5,-1)(1,5.5)
        pstGeonode[PointSymbol=none,PosAngle=-45](0,0){S}
        pnodes(5;150){A}(5;100){B}
        pswedge(S){5}{(B)}{(A)}
        psframe(A|S)(S|B)
        rput{0}(5.4;130){$c(h)$}
        pcline(A)(S)ncput*{$h$}
        pcline[offset=-.5]{|<->|}(A|S)(S)ncput*{$p$}
        pcline[offset=.5]{|<->|}(S|B)(S)ncput*{$q$}
        end{pspicture}
        end{document}


        enter image description here






        share|improve this answer


























          2












          2








          2







          A PSTricks solution just for fun.



          documentclass[pstricks,12pt]{standalone}
          usepackage{pst-eucl}
          begin{document}
          begin{pspicture}[arrowinset=0](-5,-1)(1,5.5)
          pstGeonode[PointSymbol=none,PosAngle=-45](0,0){S}
          pnodes(5;150){A}(5;100){B}
          pswedge(S){5}{(B)}{(A)}
          psframe(A|S)(S|B)
          rput{0}(5.4;130){$c(h)$}
          pcline(A)(S)ncput*{$h$}
          pcline[offset=-.5]{|<->|}(A|S)(S)ncput*{$p$}
          pcline[offset=.5]{|<->|}(S|B)(S)ncput*{$q$}
          end{pspicture}
          end{document}


          enter image description here






          share|improve this answer













          A PSTricks solution just for fun.



          documentclass[pstricks,12pt]{standalone}
          usepackage{pst-eucl}
          begin{document}
          begin{pspicture}[arrowinset=0](-5,-1)(1,5.5)
          pstGeonode[PointSymbol=none,PosAngle=-45](0,0){S}
          pnodes(5;150){A}(5;100){B}
          pswedge(S){5}{(B)}{(A)}
          psframe(A|S)(S|B)
          rput{0}(5.4;130){$c(h)$}
          pcline(A)(S)ncput*{$h$}
          pcline[offset=-.5]{|<->|}(A|S)(S)ncput*{$p$}
          pcline[offset=.5]{|<->|}(S|B)(S)ncput*{$q$}
          end{pspicture}
          end{document}


          enter image description here







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 1 hour ago









          The Inventor of GodThe Inventor of God

          4,55711041




          4,55711041























              2














              Using a local bounding box saves us from a lot of hassle here.



              documentclass[border=3.14mm,tikz]{standalone}
              begin{document}
              begin{tikzpicture}
              node[fill,inner sep=1.5pt,circle] (O) at (0,0){};
              begin{scope}[local bounding box=box]
              draw (O.center) -- (100:4) arc(100:140:4) node[pos=0.7,above,sloped,inner
              xsep=0pt] {$c(h)$}
              -- node[midway,below] {$h$} cycle;
              end{scope}
              draw (box.south west) rectangle (box.north east);
              draw[|-|] (1,0|-box.south) -- (1,0|-box.north)node[midway,fill=white]{$p$};
              draw[|-|] (0,-1 -|box.west) -- (0,-1 -|box.east)node[midway,fill=white]{$q$};
              end{tikzpicture}
              end{document}


              enter image description here






              share|improve this answer
























              • +1 for the use of the local bounding box. You can simplify the drawing of the lengths p and q : draw[|-|] (1,0)node{a} -- (1,0|-box.north)node[midway,fill=white]{$p$}; draw[|-|] (0,-1 -|box.west) -- (0,-1)node[midway,fill=white]{$q$};

                – AndréC
                59 mins ago


















              2














              Using a local bounding box saves us from a lot of hassle here.



              documentclass[border=3.14mm,tikz]{standalone}
              begin{document}
              begin{tikzpicture}
              node[fill,inner sep=1.5pt,circle] (O) at (0,0){};
              begin{scope}[local bounding box=box]
              draw (O.center) -- (100:4) arc(100:140:4) node[pos=0.7,above,sloped,inner
              xsep=0pt] {$c(h)$}
              -- node[midway,below] {$h$} cycle;
              end{scope}
              draw (box.south west) rectangle (box.north east);
              draw[|-|] (1,0|-box.south) -- (1,0|-box.north)node[midway,fill=white]{$p$};
              draw[|-|] (0,-1 -|box.west) -- (0,-1 -|box.east)node[midway,fill=white]{$q$};
              end{tikzpicture}
              end{document}


              enter image description here






              share|improve this answer
























              • +1 for the use of the local bounding box. You can simplify the drawing of the lengths p and q : draw[|-|] (1,0)node{a} -- (1,0|-box.north)node[midway,fill=white]{$p$}; draw[|-|] (0,-1 -|box.west) -- (0,-1)node[midway,fill=white]{$q$};

                – AndréC
                59 mins ago
















              2












              2








              2







              Using a local bounding box saves us from a lot of hassle here.



              documentclass[border=3.14mm,tikz]{standalone}
              begin{document}
              begin{tikzpicture}
              node[fill,inner sep=1.5pt,circle] (O) at (0,0){};
              begin{scope}[local bounding box=box]
              draw (O.center) -- (100:4) arc(100:140:4) node[pos=0.7,above,sloped,inner
              xsep=0pt] {$c(h)$}
              -- node[midway,below] {$h$} cycle;
              end{scope}
              draw (box.south west) rectangle (box.north east);
              draw[|-|] (1,0|-box.south) -- (1,0|-box.north)node[midway,fill=white]{$p$};
              draw[|-|] (0,-1 -|box.west) -- (0,-1 -|box.east)node[midway,fill=white]{$q$};
              end{tikzpicture}
              end{document}


              enter image description here






              share|improve this answer













              Using a local bounding box saves us from a lot of hassle here.



              documentclass[border=3.14mm,tikz]{standalone}
              begin{document}
              begin{tikzpicture}
              node[fill,inner sep=1.5pt,circle] (O) at (0,0){};
              begin{scope}[local bounding box=box]
              draw (O.center) -- (100:4) arc(100:140:4) node[pos=0.7,above,sloped,inner
              xsep=0pt] {$c(h)$}
              -- node[midway,below] {$h$} cycle;
              end{scope}
              draw (box.south west) rectangle (box.north east);
              draw[|-|] (1,0|-box.south) -- (1,0|-box.north)node[midway,fill=white]{$p$};
              draw[|-|] (0,-1 -|box.west) -- (0,-1 -|box.east)node[midway,fill=white]{$q$};
              end{tikzpicture}
              end{document}


              enter image description here







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered 1 hour ago









              marmotmarmot

              106k5129243




              106k5129243













              • +1 for the use of the local bounding box. You can simplify the drawing of the lengths p and q : draw[|-|] (1,0)node{a} -- (1,0|-box.north)node[midway,fill=white]{$p$}; draw[|-|] (0,-1 -|box.west) -- (0,-1)node[midway,fill=white]{$q$};

                – AndréC
                59 mins ago





















              • +1 for the use of the local bounding box. You can simplify the drawing of the lengths p and q : draw[|-|] (1,0)node{a} -- (1,0|-box.north)node[midway,fill=white]{$p$}; draw[|-|] (0,-1 -|box.west) -- (0,-1)node[midway,fill=white]{$q$};

                – AndréC
                59 mins ago



















              +1 for the use of the local bounding box. You can simplify the drawing of the lengths p and q : draw[|-|] (1,0)node{a} -- (1,0|-box.north)node[midway,fill=white]{$p$}; draw[|-|] (0,-1 -|box.west) -- (0,-1)node[midway,fill=white]{$q$};

              – AndréC
              59 mins ago







              +1 for the use of the local bounding box. You can simplify the drawing of the lengths p and q : draw[|-|] (1,0)node{a} -- (1,0|-box.north)node[midway,fill=white]{$p$}; draw[|-|] (0,-1 -|box.west) -- (0,-1)node[midway,fill=white]{$q$};

              – AndréC
              59 mins ago













              1














              Here is a way to build this figure that uses several key concepts from TikZ:




              • the scope

              • clip

              • the use of the intersections library

              • the use of node to place text.


              • sloped to write text tangent to a path


              Their use is explained in the written comments in the code.



              screenshot



              documentclass[border=5mm]{standalone}
              usepackage{tikz}
              usetikzlibrary{intersections}

              begin{document}

              begin{tikzpicture}
              % This scope allows you to draw the part of the circle inside the rectangle. The outer part is cut off.
              begin{scope}% use of intersections library to define the intersections between circle and rectangle
              draw[name path global=cadre,clip] (0,0) rectangle (3.5,4.5);
              draw[name path global=cercle] (3.5,0)circle(4.6cm);
              end{scope}

              % draw both sides of the angular sector
              draw[name intersections={of=cercle and cadre}](intersection-2)--(3.5,0)--(intersection-1)node[above right,midway]{h};

              % sloped allow to write text tangent to the path
              path[above] (intersection-1)to[bend left=15]node[sloped]{$c(h)$}(intersection-2);

              % dimension of rectangle wrtien in 2 differents way
              draw [<->](4.2,0)--node[right]{q}(4.2,4.5);
              draw [<->](0,-.6)--(3.5,-.6)node[below,midway]{p};
              end{tikzpicture}

              end{document}





              share|improve this answer






























                1














                Here is a way to build this figure that uses several key concepts from TikZ:




                • the scope

                • clip

                • the use of the intersections library

                • the use of node to place text.


                • sloped to write text tangent to a path


                Their use is explained in the written comments in the code.



                screenshot



                documentclass[border=5mm]{standalone}
                usepackage{tikz}
                usetikzlibrary{intersections}

                begin{document}

                begin{tikzpicture}
                % This scope allows you to draw the part of the circle inside the rectangle. The outer part is cut off.
                begin{scope}% use of intersections library to define the intersections between circle and rectangle
                draw[name path global=cadre,clip] (0,0) rectangle (3.5,4.5);
                draw[name path global=cercle] (3.5,0)circle(4.6cm);
                end{scope}

                % draw both sides of the angular sector
                draw[name intersections={of=cercle and cadre}](intersection-2)--(3.5,0)--(intersection-1)node[above right,midway]{h};

                % sloped allow to write text tangent to the path
                path[above] (intersection-1)to[bend left=15]node[sloped]{$c(h)$}(intersection-2);

                % dimension of rectangle wrtien in 2 differents way
                draw [<->](4.2,0)--node[right]{q}(4.2,4.5);
                draw [<->](0,-.6)--(3.5,-.6)node[below,midway]{p};
                end{tikzpicture}

                end{document}





                share|improve this answer




























                  1












                  1








                  1







                  Here is a way to build this figure that uses several key concepts from TikZ:




                  • the scope

                  • clip

                  • the use of the intersections library

                  • the use of node to place text.


                  • sloped to write text tangent to a path


                  Their use is explained in the written comments in the code.



                  screenshot



                  documentclass[border=5mm]{standalone}
                  usepackage{tikz}
                  usetikzlibrary{intersections}

                  begin{document}

                  begin{tikzpicture}
                  % This scope allows you to draw the part of the circle inside the rectangle. The outer part is cut off.
                  begin{scope}% use of intersections library to define the intersections between circle and rectangle
                  draw[name path global=cadre,clip] (0,0) rectangle (3.5,4.5);
                  draw[name path global=cercle] (3.5,0)circle(4.6cm);
                  end{scope}

                  % draw both sides of the angular sector
                  draw[name intersections={of=cercle and cadre}](intersection-2)--(3.5,0)--(intersection-1)node[above right,midway]{h};

                  % sloped allow to write text tangent to the path
                  path[above] (intersection-1)to[bend left=15]node[sloped]{$c(h)$}(intersection-2);

                  % dimension of rectangle wrtien in 2 differents way
                  draw [<->](4.2,0)--node[right]{q}(4.2,4.5);
                  draw [<->](0,-.6)--(3.5,-.6)node[below,midway]{p};
                  end{tikzpicture}

                  end{document}





                  share|improve this answer















                  Here is a way to build this figure that uses several key concepts from TikZ:




                  • the scope

                  • clip

                  • the use of the intersections library

                  • the use of node to place text.


                  • sloped to write text tangent to a path


                  Their use is explained in the written comments in the code.



                  screenshot



                  documentclass[border=5mm]{standalone}
                  usepackage{tikz}
                  usetikzlibrary{intersections}

                  begin{document}

                  begin{tikzpicture}
                  % This scope allows you to draw the part of the circle inside the rectangle. The outer part is cut off.
                  begin{scope}% use of intersections library to define the intersections between circle and rectangle
                  draw[name path global=cadre,clip] (0,0) rectangle (3.5,4.5);
                  draw[name path global=cercle] (3.5,0)circle(4.6cm);
                  end{scope}

                  % draw both sides of the angular sector
                  draw[name intersections={of=cercle and cadre}](intersection-2)--(3.5,0)--(intersection-1)node[above right,midway]{h};

                  % sloped allow to write text tangent to the path
                  path[above] (intersection-1)to[bend left=15]node[sloped]{$c(h)$}(intersection-2);

                  % dimension of rectangle wrtien in 2 differents way
                  draw [<->](4.2,0)--node[right]{q}(4.2,4.5);
                  draw [<->](0,-.6)--(3.5,-.6)node[below,midway]{p};
                  end{tikzpicture}

                  end{document}






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 1 hour ago

























                  answered 1 hour ago









                  AndréCAndréC

                  10.1k11547




                  10.1k11547























                      0














                      Here you go :)



                      documentclass{standalone}
                      usepackage{tikz}

                      begin{document}
                      begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1,line width=0.75pt]
                      draw (46.5,25) -- (145.5,25) -- (145.5,156.33) -- (46.5,156.33) -- cycle ;
                      draw (46.5,176.33) -- (145.5,176.33) ;
                      draw [shift={(145.5,176.33)}, rotate = 180] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
                      draw [shift={(46.5,176.33)}, rotate = 0] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
                      draw (165.5,156.33) -- (165.5,25) ;
                      draw [shift={(165.5,25)}, rotate = 450] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
                      draw [shift={(165.5,156.33)}, rotate = 270] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
                      draw (46.88,52.66) -- (145.5,156.33) ;
                      draw (117.77,25) -- (145.5,156.33) ;
                      draw [draw opacity=0] (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) -- (117.08,127.92) -- cycle ; draw (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) ;

                      % Text Nodes
                      draw (99,163) node [align=left] {$displaystyle p$};
                      draw (174,91) node [align=left] {$displaystyle q$};
                      draw (101,96) node [align=left] {$displaystyle h$};
                      draw (153,160) node [align=left] {$displaystyle s$};
                      draw (82,40) node [scale=0.8] [align=left] {$displaystyle c( h)$};
                      end{tikzpicture}
                      end{document}


                      enter image description here






                      share|improve this answer










                      New contributor




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
















                      • 2





                        As always here -- please make your code snippet compilable, then we do not have to guess what you are doing with documentclass, used packages etc.

                        – Kurt
                        1 hour ago






                      • 1





                        And do you really want to set a style for every picture? This will affect all other tikzpictures, which is probably not desirable.

                        – Alan Munn
                        1 hour ago













                      • It's compilable now @Kurt, enjoy :) You can change document class if you like. Any should work, really... And only one package.

                        – Superuser27
                        1 hour ago











                      • @AlanMunn you're right, thanks. Fixed it.

                        – Superuser27
                        1 hour ago
















                      0














                      Here you go :)



                      documentclass{standalone}
                      usepackage{tikz}

                      begin{document}
                      begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1,line width=0.75pt]
                      draw (46.5,25) -- (145.5,25) -- (145.5,156.33) -- (46.5,156.33) -- cycle ;
                      draw (46.5,176.33) -- (145.5,176.33) ;
                      draw [shift={(145.5,176.33)}, rotate = 180] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
                      draw [shift={(46.5,176.33)}, rotate = 0] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
                      draw (165.5,156.33) -- (165.5,25) ;
                      draw [shift={(165.5,25)}, rotate = 450] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
                      draw [shift={(165.5,156.33)}, rotate = 270] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
                      draw (46.88,52.66) -- (145.5,156.33) ;
                      draw (117.77,25) -- (145.5,156.33) ;
                      draw [draw opacity=0] (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) -- (117.08,127.92) -- cycle ; draw (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) ;

                      % Text Nodes
                      draw (99,163) node [align=left] {$displaystyle p$};
                      draw (174,91) node [align=left] {$displaystyle q$};
                      draw (101,96) node [align=left] {$displaystyle h$};
                      draw (153,160) node [align=left] {$displaystyle s$};
                      draw (82,40) node [scale=0.8] [align=left] {$displaystyle c( h)$};
                      end{tikzpicture}
                      end{document}


                      enter image description here






                      share|improve this answer










                      New contributor




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
















                      • 2





                        As always here -- please make your code snippet compilable, then we do not have to guess what you are doing with documentclass, used packages etc.

                        – Kurt
                        1 hour ago






                      • 1





                        And do you really want to set a style for every picture? This will affect all other tikzpictures, which is probably not desirable.

                        – Alan Munn
                        1 hour ago













                      • It's compilable now @Kurt, enjoy :) You can change document class if you like. Any should work, really... And only one package.

                        – Superuser27
                        1 hour ago











                      • @AlanMunn you're right, thanks. Fixed it.

                        – Superuser27
                        1 hour ago














                      0












                      0








                      0







                      Here you go :)



                      documentclass{standalone}
                      usepackage{tikz}

                      begin{document}
                      begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1,line width=0.75pt]
                      draw (46.5,25) -- (145.5,25) -- (145.5,156.33) -- (46.5,156.33) -- cycle ;
                      draw (46.5,176.33) -- (145.5,176.33) ;
                      draw [shift={(145.5,176.33)}, rotate = 180] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
                      draw [shift={(46.5,176.33)}, rotate = 0] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
                      draw (165.5,156.33) -- (165.5,25) ;
                      draw [shift={(165.5,25)}, rotate = 450] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
                      draw [shift={(165.5,156.33)}, rotate = 270] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
                      draw (46.88,52.66) -- (145.5,156.33) ;
                      draw (117.77,25) -- (145.5,156.33) ;
                      draw [draw opacity=0] (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) -- (117.08,127.92) -- cycle ; draw (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) ;

                      % Text Nodes
                      draw (99,163) node [align=left] {$displaystyle p$};
                      draw (174,91) node [align=left] {$displaystyle q$};
                      draw (101,96) node [align=left] {$displaystyle h$};
                      draw (153,160) node [align=left] {$displaystyle s$};
                      draw (82,40) node [scale=0.8] [align=left] {$displaystyle c( h)$};
                      end{tikzpicture}
                      end{document}


                      enter image description here






                      share|improve this answer










                      New contributor




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










                      Here you go :)



                      documentclass{standalone}
                      usepackage{tikz}

                      begin{document}
                      begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1,line width=0.75pt]
                      draw (46.5,25) -- (145.5,25) -- (145.5,156.33) -- (46.5,156.33) -- cycle ;
                      draw (46.5,176.33) -- (145.5,176.33) ;
                      draw [shift={(145.5,176.33)}, rotate = 180] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
                      draw [shift={(46.5,176.33)}, rotate = 0] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
                      draw (165.5,156.33) -- (165.5,25) ;
                      draw [shift={(165.5,25)}, rotate = 450] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-4.9) .. controls (6.95,-2.3) and (3.31,-0.67) .. (0,0) .. controls (3.31,0.67) and (6.95,2.3) .. (10.93,4.9) ;
                      draw [shift={(165.5,156.33)}, rotate = 270] [color={rgb, 255:red, 0; green, 0; blue, 0 } ][line width=0.75] (0,5.59) -- (0,-5.59)(10.93,-3.29) .. controls (6.95,-1.4) and (3.31,-0.3) .. (0,0) .. controls (3.31,0.3) and (6.95,1.4) .. (10.93,3.29) ;
                      draw (46.88,52.66) -- (145.5,156.33) ;
                      draw (117.77,25) -- (145.5,156.33) ;
                      draw [draw opacity=0] (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) -- (117.08,127.92) -- cycle ; draw (46.88,52.66) .. controls (65.27,35.5) and (89.95,25) .. (117.08,25) .. controls (117.31,25) and (117.54,25) .. (117.77,25) ;

                      % Text Nodes
                      draw (99,163) node [align=left] {$displaystyle p$};
                      draw (174,91) node [align=left] {$displaystyle q$};
                      draw (101,96) node [align=left] {$displaystyle h$};
                      draw (153,160) node [align=left] {$displaystyle s$};
                      draw (82,40) node [scale=0.8] [align=left] {$displaystyle c( h)$};
                      end{tikzpicture}
                      end{document}


                      enter image description here







                      share|improve this answer










                      New contributor




                      Superuser27 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 answer



                      share|improve this answer








                      edited 1 hour ago





















                      New contributor




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









                      answered 1 hour ago









                      Superuser27Superuser27

                      33813




                      33813




                      New contributor




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





                      New contributor





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






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








                      • 2





                        As always here -- please make your code snippet compilable, then we do not have to guess what you are doing with documentclass, used packages etc.

                        – Kurt
                        1 hour ago






                      • 1





                        And do you really want to set a style for every picture? This will affect all other tikzpictures, which is probably not desirable.

                        – Alan Munn
                        1 hour ago













                      • It's compilable now @Kurt, enjoy :) You can change document class if you like. Any should work, really... And only one package.

                        – Superuser27
                        1 hour ago











                      • @AlanMunn you're right, thanks. Fixed it.

                        – Superuser27
                        1 hour ago














                      • 2





                        As always here -- please make your code snippet compilable, then we do not have to guess what you are doing with documentclass, used packages etc.

                        – Kurt
                        1 hour ago






                      • 1





                        And do you really want to set a style for every picture? This will affect all other tikzpictures, which is probably not desirable.

                        – Alan Munn
                        1 hour ago













                      • It's compilable now @Kurt, enjoy :) You can change document class if you like. Any should work, really... And only one package.

                        – Superuser27
                        1 hour ago











                      • @AlanMunn you're right, thanks. Fixed it.

                        – Superuser27
                        1 hour ago








                      2




                      2





                      As always here -- please make your code snippet compilable, then we do not have to guess what you are doing with documentclass, used packages etc.

                      – Kurt
                      1 hour ago





                      As always here -- please make your code snippet compilable, then we do not have to guess what you are doing with documentclass, used packages etc.

                      – Kurt
                      1 hour ago




                      1




                      1





                      And do you really want to set a style for every picture? This will affect all other tikzpictures, which is probably not desirable.

                      – Alan Munn
                      1 hour ago







                      And do you really want to set a style for every picture? This will affect all other tikzpictures, which is probably not desirable.

                      – Alan Munn
                      1 hour ago















                      It's compilable now @Kurt, enjoy :) You can change document class if you like. Any should work, really... And only one package.

                      – Superuser27
                      1 hour ago





                      It's compilable now @Kurt, enjoy :) You can change document class if you like. Any should work, really... And only one package.

                      – Superuser27
                      1 hour ago













                      @AlanMunn you're right, thanks. Fixed it.

                      – Superuser27
                      1 hour ago





                      @AlanMunn you're right, thanks. Fixed it.

                      – Superuser27
                      1 hour ago










                      Ícaro Viterbre is a new contributor. Be nice, and check out our Code of Conduct.










                      draft saved

                      draft discarded


















                      Ícaro Viterbre is a new contributor. Be nice, and check out our Code of Conduct.













                      Ícaro Viterbre is a new contributor. Be nice, and check out our Code of Conduct.












                      Ícaro Viterbre is a new contributor. Be nice, and check out our Code of Conduct.
















                      Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f478465%2fdraw-this-image-in-the-tikz-package%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      What are all the squawk codes?

                      What are differences between VBoxVGA, VMSVGA and VBoxSVGA in VirtualBox?

                      Hudsonelva