How to fill the area between n intersecting points in TikZ












2















Given two shapes, which are intersecting, how can we fill the area common to them in TikZ (i.e. the area between their intersecting points).



Here, the even odd rule might not work as it is not alternate filling but intersecting points.



Please note to determine the intersecting points, I am using the intersections library.



In the below MWE, how do I fill the area between C and C':



documentclass{article}
usepackage{tikz}
usetikzlibrary{intersections,through}
begin{document}
begin{tikzpicture}
coordinate (A) at (0,0);
coordinate (B) at (1.25,0.25);


node (E) [name path=E,draw,circle through=(B)] at (A) {};
node (F) [name path=F,draw,circle through=(A)] at (B) {};

path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


end{tikzpicture}
end{document}


enter image description here










share|improve this question



























    2















    Given two shapes, which are intersecting, how can we fill the area common to them in TikZ (i.e. the area between their intersecting points).



    Here, the even odd rule might not work as it is not alternate filling but intersecting points.



    Please note to determine the intersecting points, I am using the intersections library.



    In the below MWE, how do I fill the area between C and C':



    documentclass{article}
    usepackage{tikz}
    usetikzlibrary{intersections,through}
    begin{document}
    begin{tikzpicture}
    coordinate (A) at (0,0);
    coordinate (B) at (1.25,0.25);


    node (E) [name path=E,draw,circle through=(B)] at (A) {};
    node (F) [name path=F,draw,circle through=(A)] at (B) {};

    path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


    end{tikzpicture}
    end{document}


    enter image description here










    share|improve this question

























      2












      2








      2








      Given two shapes, which are intersecting, how can we fill the area common to them in TikZ (i.e. the area between their intersecting points).



      Here, the even odd rule might not work as it is not alternate filling but intersecting points.



      Please note to determine the intersecting points, I am using the intersections library.



      In the below MWE, how do I fill the area between C and C':



      documentclass{article}
      usepackage{tikz}
      usetikzlibrary{intersections,through}
      begin{document}
      begin{tikzpicture}
      coordinate (A) at (0,0);
      coordinate (B) at (1.25,0.25);


      node (E) [name path=E,draw,circle through=(B)] at (A) {};
      node (F) [name path=F,draw,circle through=(A)] at (B) {};

      path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


      end{tikzpicture}
      end{document}


      enter image description here










      share|improve this question














      Given two shapes, which are intersecting, how can we fill the area common to them in TikZ (i.e. the area between their intersecting points).



      Here, the even odd rule might not work as it is not alternate filling but intersecting points.



      Please note to determine the intersecting points, I am using the intersections library.



      In the below MWE, how do I fill the area between C and C':



      documentclass{article}
      usepackage{tikz}
      usetikzlibrary{intersections,through}
      begin{document}
      begin{tikzpicture}
      coordinate (A) at (0,0);
      coordinate (B) at (1.25,0.25);


      node (E) [name path=E,draw,circle through=(B)] at (A) {};
      node (F) [name path=F,draw,circle through=(A)] at (B) {};

      path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


      end{tikzpicture}
      end{document}


      enter image description here







      tikz-pgf






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      subham sonisubham soni

      4,32083183




      4,32083183






















          1 Answer
          1






          active

          oldest

          votes


















          5














          The common area is obtained by clipping against one of the circles and filling the other.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          enter image description here



          In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,backgrounds}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}[on background layer]
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          You can always fill intersection segments. (You can combine this with the background stuff above.)



          documentclass{article}
          usepackage{tikz}
          usepackage{pgfplots}
          usepgfplotslibrary{fillbetween}
          pgfplotsset{compat=1.16}
          usetikzlibrary{through}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];

          path[%draw,red,thick,
          fill=blue,
          intersection segments={of=E and F,sequence={L1--R2--L3}}];
          end{tikzpicture}
          end{document}


          (Same output as above.)



          The analytic determination of the arcs is another possibility.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,calc}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];
          path[fill=blue] let p1=($(A.center)-(B.center)$),p2=($(C.center)-(A.center)$),
          p3=($(C'.center)-(A.center)$),p4=($(C.center)-(B.center)$),
          p5=($(C'.center)-(B.center)$),
          n1={veclen(x2,y2)}, % radius A
          n2={veclen(x4,y4)}, % radius B
          n3={atan2(y2,x2)}, % angle A 1
          n4={atan2(y3,x3)}, % angle A 2
          n5={atan2(y4,x4)}, % angle B 1
          n6={atan2(y5,x5)} % angle B 2
          in (C) arc(n3:n4:n1) arc(n6:n5-360:n2);

          end{tikzpicture}
          end{document}





          share|improve this answer


























          • Thanks . Is there alternate to using clipping in TikZ.

            – subham soni
            yesterday











          • I feel clipping might not be a generic solution to the requirement. As mentioned in the question , the area can be anything between the n points. Is there a generic approach to solve this apart from clipping.

            – subham soni
            yesterday











          • Analytic determination of arcs will be tedious. Can you please elaborate the pgfplots solution as well

            – subham soni
            yesterday











          • @subhamsoni OK, I added the fillbetween stuff.

            – marmot
            yesterday






          • 2





            Thanks marmot. The answer and explanation is quite helpful

            – subham soni
            yesterday











          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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f479873%2fhow-to-fill-the-area-between-n-intersecting-points-in-tikz%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          5














          The common area is obtained by clipping against one of the circles and filling the other.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          enter image description here



          In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,backgrounds}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}[on background layer]
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          You can always fill intersection segments. (You can combine this with the background stuff above.)



          documentclass{article}
          usepackage{tikz}
          usepackage{pgfplots}
          usepgfplotslibrary{fillbetween}
          pgfplotsset{compat=1.16}
          usetikzlibrary{through}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];

          path[%draw,red,thick,
          fill=blue,
          intersection segments={of=E and F,sequence={L1--R2--L3}}];
          end{tikzpicture}
          end{document}


          (Same output as above.)



          The analytic determination of the arcs is another possibility.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,calc}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];
          path[fill=blue] let p1=($(A.center)-(B.center)$),p2=($(C.center)-(A.center)$),
          p3=($(C'.center)-(A.center)$),p4=($(C.center)-(B.center)$),
          p5=($(C'.center)-(B.center)$),
          n1={veclen(x2,y2)}, % radius A
          n2={veclen(x4,y4)}, % radius B
          n3={atan2(y2,x2)}, % angle A 1
          n4={atan2(y3,x3)}, % angle A 2
          n5={atan2(y4,x4)}, % angle B 1
          n6={atan2(y5,x5)} % angle B 2
          in (C) arc(n3:n4:n1) arc(n6:n5-360:n2);

          end{tikzpicture}
          end{document}





          share|improve this answer


























          • Thanks . Is there alternate to using clipping in TikZ.

            – subham soni
            yesterday











          • I feel clipping might not be a generic solution to the requirement. As mentioned in the question , the area can be anything between the n points. Is there a generic approach to solve this apart from clipping.

            – subham soni
            yesterday











          • Analytic determination of arcs will be tedious. Can you please elaborate the pgfplots solution as well

            – subham soni
            yesterday











          • @subhamsoni OK, I added the fillbetween stuff.

            – marmot
            yesterday






          • 2





            Thanks marmot. The answer and explanation is quite helpful

            – subham soni
            yesterday
















          5














          The common area is obtained by clipping against one of the circles and filling the other.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          enter image description here



          In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,backgrounds}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}[on background layer]
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          You can always fill intersection segments. (You can combine this with the background stuff above.)



          documentclass{article}
          usepackage{tikz}
          usepackage{pgfplots}
          usepgfplotslibrary{fillbetween}
          pgfplotsset{compat=1.16}
          usetikzlibrary{through}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];

          path[%draw,red,thick,
          fill=blue,
          intersection segments={of=E and F,sequence={L1--R2--L3}}];
          end{tikzpicture}
          end{document}


          (Same output as above.)



          The analytic determination of the arcs is another possibility.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,calc}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];
          path[fill=blue] let p1=($(A.center)-(B.center)$),p2=($(C.center)-(A.center)$),
          p3=($(C'.center)-(A.center)$),p4=($(C.center)-(B.center)$),
          p5=($(C'.center)-(B.center)$),
          n1={veclen(x2,y2)}, % radius A
          n2={veclen(x4,y4)}, % radius B
          n3={atan2(y2,x2)}, % angle A 1
          n4={atan2(y3,x3)}, % angle A 2
          n5={atan2(y4,x4)}, % angle B 1
          n6={atan2(y5,x5)} % angle B 2
          in (C) arc(n3:n4:n1) arc(n6:n5-360:n2);

          end{tikzpicture}
          end{document}





          share|improve this answer


























          • Thanks . Is there alternate to using clipping in TikZ.

            – subham soni
            yesterday











          • I feel clipping might not be a generic solution to the requirement. As mentioned in the question , the area can be anything between the n points. Is there a generic approach to solve this apart from clipping.

            – subham soni
            yesterday











          • Analytic determination of arcs will be tedious. Can you please elaborate the pgfplots solution as well

            – subham soni
            yesterday











          • @subhamsoni OK, I added the fillbetween stuff.

            – marmot
            yesterday






          • 2





            Thanks marmot. The answer and explanation is quite helpful

            – subham soni
            yesterday














          5












          5








          5







          The common area is obtained by clipping against one of the circles and filling the other.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          enter image description here



          In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,backgrounds}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}[on background layer]
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          You can always fill intersection segments. (You can combine this with the background stuff above.)



          documentclass{article}
          usepackage{tikz}
          usepackage{pgfplots}
          usepgfplotslibrary{fillbetween}
          pgfplotsset{compat=1.16}
          usetikzlibrary{through}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];

          path[%draw,red,thick,
          fill=blue,
          intersection segments={of=E and F,sequence={L1--R2--L3}}];
          end{tikzpicture}
          end{document}


          (Same output as above.)



          The analytic determination of the arcs is another possibility.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,calc}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];
          path[fill=blue] let p1=($(A.center)-(B.center)$),p2=($(C.center)-(A.center)$),
          p3=($(C'.center)-(A.center)$),p4=($(C.center)-(B.center)$),
          p5=($(C'.center)-(B.center)$),
          n1={veclen(x2,y2)}, % radius A
          n2={veclen(x4,y4)}, % radius B
          n3={atan2(y2,x2)}, % angle A 1
          n4={atan2(y3,x3)}, % angle A 2
          n5={atan2(y4,x4)}, % angle B 1
          n6={atan2(y5,x5)} % angle B 2
          in (C) arc(n3:n4:n1) arc(n6:n5-360:n2);

          end{tikzpicture}
          end{document}





          share|improve this answer















          The common area is obtained by clipping against one of the circles and filling the other.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          enter image description here



          In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,backgrounds}
          makeatletter % from https://tex.stackexchange.com/a/127045/121799
          tikzset{use path/.code=tikz@addmode{pgfsyssoftpath@setcurrentpath#1}}
          makeatother
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B),save path=pathA] at (A) {};
          node (F) [name path=F,draw,circle through=(A),save path=pathB] at (B) {};
          begin{scope}[on background layer]
          clip[use path=pathA];
          fill[blue,use path=pathB];
          end{scope}

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];


          end{tikzpicture}
          end{document}


          You can always fill intersection segments. (You can combine this with the background stuff above.)



          documentclass{article}
          usepackage{tikz}
          usepackage{pgfplots}
          usepgfplotslibrary{fillbetween}
          pgfplotsset{compat=1.16}
          usetikzlibrary{through}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];

          path[%draw,red,thick,
          fill=blue,
          intersection segments={of=E and F,sequence={L1--R2--L3}}];
          end{tikzpicture}
          end{document}


          (Same output as above.)



          The analytic determination of the arcs is another possibility.



          documentclass{article}
          usepackage{tikz}
          usetikzlibrary{intersections,through,calc}
          begin{document}
          begin{tikzpicture}
          coordinate (A) at (0,0);
          coordinate (B) at (1.25,0.25);


          node (E) [name path=E,draw,circle through=(B)] at (A) {};
          node (F) [name path=F,draw,circle through=(A)] at (B) {};

          path [name intersections={of=E and F, by={[label=above:$C$]C,[label=below:$C'$]C'}}];
          path[fill=blue] let p1=($(A.center)-(B.center)$),p2=($(C.center)-(A.center)$),
          p3=($(C'.center)-(A.center)$),p4=($(C.center)-(B.center)$),
          p5=($(C'.center)-(B.center)$),
          n1={veclen(x2,y2)}, % radius A
          n2={veclen(x4,y4)}, % radius B
          n3={atan2(y2,x2)}, % angle A 1
          n4={atan2(y3,x3)}, % angle A 2
          n5={atan2(y4,x4)}, % angle B 1
          n6={atan2(y5,x5)} % angle B 2
          in (C) arc(n3:n4:n1) arc(n6:n5-360:n2);

          end{tikzpicture}
          end{document}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday

























          answered yesterday









          marmotmarmot

          109k5136255




          109k5136255













          • Thanks . Is there alternate to using clipping in TikZ.

            – subham soni
            yesterday











          • I feel clipping might not be a generic solution to the requirement. As mentioned in the question , the area can be anything between the n points. Is there a generic approach to solve this apart from clipping.

            – subham soni
            yesterday











          • Analytic determination of arcs will be tedious. Can you please elaborate the pgfplots solution as well

            – subham soni
            yesterday











          • @subhamsoni OK, I added the fillbetween stuff.

            – marmot
            yesterday






          • 2





            Thanks marmot. The answer and explanation is quite helpful

            – subham soni
            yesterday



















          • Thanks . Is there alternate to using clipping in TikZ.

            – subham soni
            yesterday











          • I feel clipping might not be a generic solution to the requirement. As mentioned in the question , the area can be anything between the n points. Is there a generic approach to solve this apart from clipping.

            – subham soni
            yesterday











          • Analytic determination of arcs will be tedious. Can you please elaborate the pgfplots solution as well

            – subham soni
            yesterday











          • @subhamsoni OK, I added the fillbetween stuff.

            – marmot
            yesterday






          • 2





            Thanks marmot. The answer and explanation is quite helpful

            – subham soni
            yesterday

















          Thanks . Is there alternate to using clipping in TikZ.

          – subham soni
          yesterday





          Thanks . Is there alternate to using clipping in TikZ.

          – subham soni
          yesterday













          I feel clipping might not be a generic solution to the requirement. As mentioned in the question , the area can be anything between the n points. Is there a generic approach to solve this apart from clipping.

          – subham soni
          yesterday





          I feel clipping might not be a generic solution to the requirement. As mentioned in the question , the area can be anything between the n points. Is there a generic approach to solve this apart from clipping.

          – subham soni
          yesterday













          Analytic determination of arcs will be tedious. Can you please elaborate the pgfplots solution as well

          – subham soni
          yesterday





          Analytic determination of arcs will be tedious. Can you please elaborate the pgfplots solution as well

          – subham soni
          yesterday













          @subhamsoni OK, I added the fillbetween stuff.

          – marmot
          yesterday





          @subhamsoni OK, I added the fillbetween stuff.

          – marmot
          yesterday




          2




          2





          Thanks marmot. The answer and explanation is quite helpful

          – subham soni
          yesterday





          Thanks marmot. The answer and explanation is quite helpful

          – subham soni
          yesterday


















          draft saved

          draft discarded




















































          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%2f479873%2fhow-to-fill-the-area-between-n-intersecting-points-in-tikz%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

          Plaza Victoria

          Puebla de Zaragoza

          Musa