Filling circular segment using Tkz-Euclide

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











up vote
2
down vote

favorite












I tried to fill a circular segment but I'm having trouble doing it. Here's my MWE:



documentclass[10pt]scrartcl
usepackagetikz
usepackagetkz-euclide
usetikzlibrarycalc,backgrounds
usetkzobjall
begindocument

begintikzpicture
tkzDefPoints0/0/C, 4/0/B
tkzDrawTriangle[pythagore](C,B)
tkzGetPointA
tkzDefCircle[circum](A,B,C)
tkzGetPointO
tkzGetLengthcr
tkzDrawCircle[R](O,cr pt)
tkzDrawPoints(O)
tkzLabelPoints[left](A)
tkzLabelPoints[right](C)
tkzLabelPoints[above left](B)
tkzLabelPoints[below](O)
tkzLabelSegment[above left](A,B)Large 6 cm
tkzLabelSegment[above right](B,C)Large 8 cm
beginscope[fill=gray, opacity=0.5]
fill[clip] (B) -- (A) arc (90:-90:1.5cm) -- cycle;
endscope
endtikzpicture

enddocument


enter image description here



I'll rotate the picture by 143 degrees.










share|improve this question























  • I added usetkzobjall to make your code compile.
    – marmot
    1 hour ago










  • Oops, forgot. Thanks!
    – Mark Fantini
    1 hour ago














up vote
2
down vote

favorite












I tried to fill a circular segment but I'm having trouble doing it. Here's my MWE:



documentclass[10pt]scrartcl
usepackagetikz
usepackagetkz-euclide
usetikzlibrarycalc,backgrounds
usetkzobjall
begindocument

begintikzpicture
tkzDefPoints0/0/C, 4/0/B
tkzDrawTriangle[pythagore](C,B)
tkzGetPointA
tkzDefCircle[circum](A,B,C)
tkzGetPointO
tkzGetLengthcr
tkzDrawCircle[R](O,cr pt)
tkzDrawPoints(O)
tkzLabelPoints[left](A)
tkzLabelPoints[right](C)
tkzLabelPoints[above left](B)
tkzLabelPoints[below](O)
tkzLabelSegment[above left](A,B)Large 6 cm
tkzLabelSegment[above right](B,C)Large 8 cm
beginscope[fill=gray, opacity=0.5]
fill[clip] (B) -- (A) arc (90:-90:1.5cm) -- cycle;
endscope
endtikzpicture

enddocument


enter image description here



I'll rotate the picture by 143 degrees.










share|improve this question























  • I added usetkzobjall to make your code compile.
    – marmot
    1 hour ago










  • Oops, forgot. Thanks!
    – Mark Fantini
    1 hour ago












up vote
2
down vote

favorite









up vote
2
down vote

favorite











I tried to fill a circular segment but I'm having trouble doing it. Here's my MWE:



documentclass[10pt]scrartcl
usepackagetikz
usepackagetkz-euclide
usetikzlibrarycalc,backgrounds
usetkzobjall
begindocument

begintikzpicture
tkzDefPoints0/0/C, 4/0/B
tkzDrawTriangle[pythagore](C,B)
tkzGetPointA
tkzDefCircle[circum](A,B,C)
tkzGetPointO
tkzGetLengthcr
tkzDrawCircle[R](O,cr pt)
tkzDrawPoints(O)
tkzLabelPoints[left](A)
tkzLabelPoints[right](C)
tkzLabelPoints[above left](B)
tkzLabelPoints[below](O)
tkzLabelSegment[above left](A,B)Large 6 cm
tkzLabelSegment[above right](B,C)Large 8 cm
beginscope[fill=gray, opacity=0.5]
fill[clip] (B) -- (A) arc (90:-90:1.5cm) -- cycle;
endscope
endtikzpicture

enddocument


enter image description here



I'll rotate the picture by 143 degrees.










share|improve this question















I tried to fill a circular segment but I'm having trouble doing it. Here's my MWE:



documentclass[10pt]scrartcl
usepackagetikz
usepackagetkz-euclide
usetikzlibrarycalc,backgrounds
usetkzobjall
begindocument

begintikzpicture
tkzDefPoints0/0/C, 4/0/B
tkzDrawTriangle[pythagore](C,B)
tkzGetPointA
tkzDefCircle[circum](A,B,C)
tkzGetPointO
tkzGetLengthcr
tkzDrawCircle[R](O,cr pt)
tkzDrawPoints(O)
tkzLabelPoints[left](A)
tkzLabelPoints[right](C)
tkzLabelPoints[above left](B)
tkzLabelPoints[below](O)
tkzLabelSegment[above left](A,B)Large 6 cm
tkzLabelSegment[above right](B,C)Large 8 cm
beginscope[fill=gray, opacity=0.5]
fill[clip] (B) -- (A) arc (90:-90:1.5cm) -- cycle;
endscope
endtikzpicture

enddocument


enter image description here



I'll rotate the picture by 143 degrees.







tikz-pgf draw tkz-euclide






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 1 hour ago









marmot

59.9k463128




59.9k463128










asked 1 hour ago









Mark Fantini

153127




153127











  • I added usetkzobjall to make your code compile.
    – marmot
    1 hour ago










  • Oops, forgot. Thanks!
    – Mark Fantini
    1 hour ago
















  • I added usetkzobjall to make your code compile.
    – marmot
    1 hour ago










  • Oops, forgot. Thanks!
    – Mark Fantini
    1 hour ago















I added usetkzobjall to make your code compile.
– marmot
1 hour ago




I added usetkzobjall to make your code compile.
– marmot
1 hour ago












Oops, forgot. Thanks!
– Mark Fantini
1 hour ago




Oops, forgot. Thanks!
– Mark Fantini
1 hour ago










2 Answers
2






active

oldest

votes

















up vote
2
down vote













Really easy with the calc library. Perhaps even easier with tkz-euclide if you speak French, which I don't.



documentclass[10pt]scrartcl
usepackagetikz
usepackagetkz-euclide
usetikzlibrarycalc,backgrounds
usetkzobjall
begindocument

begintikzpicture
tkzDefPoints0/0/C, 4/0/B
tkzDrawTriangle[pythagore](C,B)
tkzGetPointA
tkzDefCircle[circum](A,B,C)
tkzGetPointO
tkzGetLengthcr
tkzDrawCircle[R](O,cr pt)
tkzDrawPoints(O)
tkzLabelPoints[left](A)
tkzLabelPoints[right](C)
tkzLabelPoints[above left](B)
tkzLabelPoints[below](O)
tkzLabelSegment[above left](A,B)Large 6 cm
tkzLabelSegment[above right](B,C)Large 8 cm
beginscope[fill=gray, opacity=0.5]
fill let p1=($(A)-(O)$),p2=($(B)-(O)$),
n1=atan2(y1,x1),n2=atan2(y2,x2),n3=veclen(x1,y1) in
(B) -- (A) arc (n1:n2:n3) -- cycle;
endscope
endtikzpicture
enddocument


enter image description here



Explanation: p1=($(A)-(O)$) means that the coordinates of p1, x1 and y1 will be the x- and y-coordinates of the vector O-A, likewise for p2 and B. Correspondingly, n1 and n2 will be the angles of A and B, respectively, and n3 the radius of the circle. These are the quantities needed to draw the arc.






share|improve this answer





























    up vote
    2
    down vote













    It is simply a calculation error of half the angle AOB which measures arcsin(3/5) or about 36.8699 degrees with a radius of 2.5 cm.



    This give:



    fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;


    Full code:



    documentclass[10pt]scrartcl
    usepackagetikz
    usepackagetkz-euclide
    usetikzlibrarycalc,backgrounds
    usetkzobjall
    begindocument

    begintikzpicture
    tkzDefPoints0/0/C, 4/0/B
    tkzDrawTriangle[pythagore](C,B)
    tkzGetPointA
    tkzDefCircle[circum](A,B,C)
    tkzGetPointO
    tkzGetLengthcr
    tkzDrawCircle[R](O,cr pt)
    tkzDrawPoints(O)
    tkzLabelPoints[left](A)
    tkzLabelPoints[right](C)
    tkzLabelPoints[above left](B)
    tkzLabelPoints[below](O)
    tkzLabelSegment[above left](A,B)Large 6 cm
    tkzLabelSegment[above right](B,C)Large 8 cm
    beginscope[fill=gray, opacity=0.5]
    fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;
    endscope
    endtikzpicture

    enddocument


    fill-rect-trian






    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%2f452333%2ffilling-circular-segment-using-tkz-euclide%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      2
      down vote













      Really easy with the calc library. Perhaps even easier with tkz-euclide if you speak French, which I don't.



      documentclass[10pt]scrartcl
      usepackagetikz
      usepackagetkz-euclide
      usetikzlibrarycalc,backgrounds
      usetkzobjall
      begindocument

      begintikzpicture
      tkzDefPoints0/0/C, 4/0/B
      tkzDrawTriangle[pythagore](C,B)
      tkzGetPointA
      tkzDefCircle[circum](A,B,C)
      tkzGetPointO
      tkzGetLengthcr
      tkzDrawCircle[R](O,cr pt)
      tkzDrawPoints(O)
      tkzLabelPoints[left](A)
      tkzLabelPoints[right](C)
      tkzLabelPoints[above left](B)
      tkzLabelPoints[below](O)
      tkzLabelSegment[above left](A,B)Large 6 cm
      tkzLabelSegment[above right](B,C)Large 8 cm
      beginscope[fill=gray, opacity=0.5]
      fill let p1=($(A)-(O)$),p2=($(B)-(O)$),
      n1=atan2(y1,x1),n2=atan2(y2,x2),n3=veclen(x1,y1) in
      (B) -- (A) arc (n1:n2:n3) -- cycle;
      endscope
      endtikzpicture
      enddocument


      enter image description here



      Explanation: p1=($(A)-(O)$) means that the coordinates of p1, x1 and y1 will be the x- and y-coordinates of the vector O-A, likewise for p2 and B. Correspondingly, n1 and n2 will be the angles of A and B, respectively, and n3 the radius of the circle. These are the quantities needed to draw the arc.






      share|improve this answer


























        up vote
        2
        down vote













        Really easy with the calc library. Perhaps even easier with tkz-euclide if you speak French, which I don't.



        documentclass[10pt]scrartcl
        usepackagetikz
        usepackagetkz-euclide
        usetikzlibrarycalc,backgrounds
        usetkzobjall
        begindocument

        begintikzpicture
        tkzDefPoints0/0/C, 4/0/B
        tkzDrawTriangle[pythagore](C,B)
        tkzGetPointA
        tkzDefCircle[circum](A,B,C)
        tkzGetPointO
        tkzGetLengthcr
        tkzDrawCircle[R](O,cr pt)
        tkzDrawPoints(O)
        tkzLabelPoints[left](A)
        tkzLabelPoints[right](C)
        tkzLabelPoints[above left](B)
        tkzLabelPoints[below](O)
        tkzLabelSegment[above left](A,B)Large 6 cm
        tkzLabelSegment[above right](B,C)Large 8 cm
        beginscope[fill=gray, opacity=0.5]
        fill let p1=($(A)-(O)$),p2=($(B)-(O)$),
        n1=atan2(y1,x1),n2=atan2(y2,x2),n3=veclen(x1,y1) in
        (B) -- (A) arc (n1:n2:n3) -- cycle;
        endscope
        endtikzpicture
        enddocument


        enter image description here



        Explanation: p1=($(A)-(O)$) means that the coordinates of p1, x1 and y1 will be the x- and y-coordinates of the vector O-A, likewise for p2 and B. Correspondingly, n1 and n2 will be the angles of A and B, respectively, and n3 the radius of the circle. These are the quantities needed to draw the arc.






        share|improve this answer
























          up vote
          2
          down vote










          up vote
          2
          down vote









          Really easy with the calc library. Perhaps even easier with tkz-euclide if you speak French, which I don't.



          documentclass[10pt]scrartcl
          usepackagetikz
          usepackagetkz-euclide
          usetikzlibrarycalc,backgrounds
          usetkzobjall
          begindocument

          begintikzpicture
          tkzDefPoints0/0/C, 4/0/B
          tkzDrawTriangle[pythagore](C,B)
          tkzGetPointA
          tkzDefCircle[circum](A,B,C)
          tkzGetPointO
          tkzGetLengthcr
          tkzDrawCircle[R](O,cr pt)
          tkzDrawPoints(O)
          tkzLabelPoints[left](A)
          tkzLabelPoints[right](C)
          tkzLabelPoints[above left](B)
          tkzLabelPoints[below](O)
          tkzLabelSegment[above left](A,B)Large 6 cm
          tkzLabelSegment[above right](B,C)Large 8 cm
          beginscope[fill=gray, opacity=0.5]
          fill let p1=($(A)-(O)$),p2=($(B)-(O)$),
          n1=atan2(y1,x1),n2=atan2(y2,x2),n3=veclen(x1,y1) in
          (B) -- (A) arc (n1:n2:n3) -- cycle;
          endscope
          endtikzpicture
          enddocument


          enter image description here



          Explanation: p1=($(A)-(O)$) means that the coordinates of p1, x1 and y1 will be the x- and y-coordinates of the vector O-A, likewise for p2 and B. Correspondingly, n1 and n2 will be the angles of A and B, respectively, and n3 the radius of the circle. These are the quantities needed to draw the arc.






          share|improve this answer














          Really easy with the calc library. Perhaps even easier with tkz-euclide if you speak French, which I don't.



          documentclass[10pt]scrartcl
          usepackagetikz
          usepackagetkz-euclide
          usetikzlibrarycalc,backgrounds
          usetkzobjall
          begindocument

          begintikzpicture
          tkzDefPoints0/0/C, 4/0/B
          tkzDrawTriangle[pythagore](C,B)
          tkzGetPointA
          tkzDefCircle[circum](A,B,C)
          tkzGetPointO
          tkzGetLengthcr
          tkzDrawCircle[R](O,cr pt)
          tkzDrawPoints(O)
          tkzLabelPoints[left](A)
          tkzLabelPoints[right](C)
          tkzLabelPoints[above left](B)
          tkzLabelPoints[below](O)
          tkzLabelSegment[above left](A,B)Large 6 cm
          tkzLabelSegment[above right](B,C)Large 8 cm
          beginscope[fill=gray, opacity=0.5]
          fill let p1=($(A)-(O)$),p2=($(B)-(O)$),
          n1=atan2(y1,x1),n2=atan2(y2,x2),n3=veclen(x1,y1) in
          (B) -- (A) arc (n1:n2:n3) -- cycle;
          endscope
          endtikzpicture
          enddocument


          enter image description here



          Explanation: p1=($(A)-(O)$) means that the coordinates of p1, x1 and y1 will be the x- and y-coordinates of the vector O-A, likewise for p2 and B. Correspondingly, n1 and n2 will be the angles of A and B, respectively, and n3 the radius of the circle. These are the quantities needed to draw the arc.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 48 mins ago

























          answered 58 mins ago









          marmot

          59.9k463128




          59.9k463128




















              up vote
              2
              down vote













              It is simply a calculation error of half the angle AOB which measures arcsin(3/5) or about 36.8699 degrees with a radius of 2.5 cm.



              This give:



              fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;


              Full code:



              documentclass[10pt]scrartcl
              usepackagetikz
              usepackagetkz-euclide
              usetikzlibrarycalc,backgrounds
              usetkzobjall
              begindocument

              begintikzpicture
              tkzDefPoints0/0/C, 4/0/B
              tkzDrawTriangle[pythagore](C,B)
              tkzGetPointA
              tkzDefCircle[circum](A,B,C)
              tkzGetPointO
              tkzGetLengthcr
              tkzDrawCircle[R](O,cr pt)
              tkzDrawPoints(O)
              tkzLabelPoints[left](A)
              tkzLabelPoints[right](C)
              tkzLabelPoints[above left](B)
              tkzLabelPoints[below](O)
              tkzLabelSegment[above left](A,B)Large 6 cm
              tkzLabelSegment[above right](B,C)Large 8 cm
              beginscope[fill=gray, opacity=0.5]
              fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;
              endscope
              endtikzpicture

              enddocument


              fill-rect-trian






              share|improve this answer
























                up vote
                2
                down vote













                It is simply a calculation error of half the angle AOB which measures arcsin(3/5) or about 36.8699 degrees with a radius of 2.5 cm.



                This give:



                fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;


                Full code:



                documentclass[10pt]scrartcl
                usepackagetikz
                usepackagetkz-euclide
                usetikzlibrarycalc,backgrounds
                usetkzobjall
                begindocument

                begintikzpicture
                tkzDefPoints0/0/C, 4/0/B
                tkzDrawTriangle[pythagore](C,B)
                tkzGetPointA
                tkzDefCircle[circum](A,B,C)
                tkzGetPointO
                tkzGetLengthcr
                tkzDrawCircle[R](O,cr pt)
                tkzDrawPoints(O)
                tkzLabelPoints[left](A)
                tkzLabelPoints[right](C)
                tkzLabelPoints[above left](B)
                tkzLabelPoints[below](O)
                tkzLabelSegment[above left](A,B)Large 6 cm
                tkzLabelSegment[above right](B,C)Large 8 cm
                beginscope[fill=gray, opacity=0.5]
                fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;
                endscope
                endtikzpicture

                enddocument


                fill-rect-trian






                share|improve this answer






















                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  It is simply a calculation error of half the angle AOB which measures arcsin(3/5) or about 36.8699 degrees with a radius of 2.5 cm.



                  This give:



                  fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;


                  Full code:



                  documentclass[10pt]scrartcl
                  usepackagetikz
                  usepackagetkz-euclide
                  usetikzlibrarycalc,backgrounds
                  usetkzobjall
                  begindocument

                  begintikzpicture
                  tkzDefPoints0/0/C, 4/0/B
                  tkzDrawTriangle[pythagore](C,B)
                  tkzGetPointA
                  tkzDefCircle[circum](A,B,C)
                  tkzGetPointO
                  tkzGetLengthcr
                  tkzDrawCircle[R](O,cr pt)
                  tkzDrawPoints(O)
                  tkzLabelPoints[left](A)
                  tkzLabelPoints[right](C)
                  tkzLabelPoints[above left](B)
                  tkzLabelPoints[below](O)
                  tkzLabelSegment[above left](A,B)Large 6 cm
                  tkzLabelSegment[above right](B,C)Large 8 cm
                  beginscope[fill=gray, opacity=0.5]
                  fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;
                  endscope
                  endtikzpicture

                  enddocument


                  fill-rect-trian






                  share|improve this answer












                  It is simply a calculation error of half the angle AOB which measures arcsin(3/5) or about 36.8699 degrees with a radius of 2.5 cm.



                  This give:



                  fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;


                  Full code:



                  documentclass[10pt]scrartcl
                  usepackagetikz
                  usepackagetkz-euclide
                  usetikzlibrarycalc,backgrounds
                  usetkzobjall
                  begindocument

                  begintikzpicture
                  tkzDefPoints0/0/C, 4/0/B
                  tkzDrawTriangle[pythagore](C,B)
                  tkzGetPointA
                  tkzDefCircle[circum](A,B,C)
                  tkzGetPointO
                  tkzGetLengthcr
                  tkzDrawCircle[R](O,cr pt)
                  tkzDrawPoints(O)
                  tkzLabelPoints[left](A)
                  tkzLabelPoints[right](C)
                  tkzLabelPoints[above left](B)
                  tkzLabelPoints[below](O)
                  tkzLabelSegment[above left](A,B)Large 6 cm
                  tkzLabelSegment[above right](B,C)Large 8 cm
                  beginscope[fill=gray, opacity=0.5]
                  fill[clip] (B) -- (A) arc (36.8699:-36.8699:2.5cm) -- cycle;
                  endscope
                  endtikzpicture

                  enddocument


                  fill-rect-trian







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 43 mins ago









                  AndréC

                  3,211729




                  3,211729



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f452333%2ffilling-circular-segment-using-tkz-euclide%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      What does second last employer means? [closed]

                      Installing NextGIS Connect into QGIS 3?

                      One-line joke