How to fill the area between n intersecting points in TikZ“Stroke” a predefined pathHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?Fill a section between two circles with TikZTikZ: how to fill area defined by intersections?How to shade the area between two paths in tikz/pgf?How to fill a solid defined by x^2+y^2<=9, z<=16-x^2-y^2 and z>=0 using PGFPlots
Why is the President allowed to veto a cancellation of emergency powers?
What favor did Moody owe Dumbledore?
I am trying to parse json data using jq
Is it ever recommended to use mean/multiple imputation when using tree-based predictive models?
Should Stotras and Mantras be recited aloud?
What is the term when voters dishonestly choose something that they do not want to choose?
Why one should not leave fingerprints on bulbs and plugs?
How to terminate ping <dest> &
Have the tides ever turned twice on any open problem?
How difficult is it to simply disable/disengage the MCAS on Boeing 737 Max 8 & 9 Aircraft?
PTIJ: Who should I vote for? (21st Knesset Edition)
About the actual radiative impact of greenhouse gas emission over time
HP P840 HDD RAID 5 many strange drive faiures
Comparison of acidities
Four married couples attend a party. Each person shakes hands with every other person, except their own spouse, exactly once. How many handshakes?
Bacteria contamination inside a thermos bottle
I got the following comment from a reputed math journal. What does it mean?
Do I need life insurance if I can cover my own funeral costs?
Book: Young man exiled to a penal colony, helps to lead revolution
Why does a Star of David appear at a rally with Francisco Franco?
How to pronounce "I ♥ Huckabees"?
How could a scammer know the apps on my phone / iTunes account?
Could the Saturn V actually have launched astronauts around Venus?
Is there a hypothetical scenario that would make Earth uninhabitable for humans, but not for (the majority of) other animals?
How to fill the area between n intersecting points in TikZ
“Stroke” a predefined pathHow to define the default vertical distance between nodes?Numerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionDrawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themHow to draw a square and its diagonals with arrows?Fill a section between two circles with TikZTikZ: how to fill area defined by intersections?How to shade the area between two paths in tikz/pgf?How to fill a solid defined by x^2+y^2<=9, z<=16-x^2-y^2 and z>=0 using PGFPlots
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'
:
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through
begindocument
begintikzpicture
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'];
endtikzpicture
enddocument
tikz-pgf
add a comment |
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'
:
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through
begindocument
begintikzpicture
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'];
endtikzpicture
enddocument
tikz-pgf
add a comment |
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'
:
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through
begindocument
begintikzpicture
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'];
endtikzpicture
enddocument
tikz-pgf
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'
:
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through
begindocument
begintikzpicture
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'];
endtikzpicture
enddocument
tikz-pgf
tikz-pgf
asked 8 hours ago
subham sonisubham soni
4,32083183
4,32083183
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The common area is obtained by clipping against one of the circles and filling the other.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds
.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,backgrounds
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope[on background layer]
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
You can always fill intersection segments. (You can combine this with the background stuff above.)
documentclassarticle
usepackagetikz
usepackagepgfplots
usepgfplotslibraryfillbetween
pgfplotssetcompat=1.16
usetikzlibrarythrough
begindocument
begintikzpicture
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];
endtikzpicture
enddocument
(Same output as above.)
The analytic determination of the arcs is another possibility.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,calc
begindocument
begintikzpicture
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);
endtikzpicture
enddocument
Thanks . Is there alternate to using clipping in TikZ.
– subham soni
7 hours ago
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
7 hours ago
Analytic determination of arcs will be tedious. Can you please elaborate thepgfplots
solution as well
– subham soni
7 hours ago
@subhamsoni OK, I added the fillbetween stuff.
– marmot
7 hours ago
2
Thanks marmot. The answer and explanation is quite helpful
– subham soni
7 hours ago
|
show 2 more comments
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
The common area is obtained by clipping against one of the circles and filling the other.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds
.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,backgrounds
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope[on background layer]
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
You can always fill intersection segments. (You can combine this with the background stuff above.)
documentclassarticle
usepackagetikz
usepackagepgfplots
usepgfplotslibraryfillbetween
pgfplotssetcompat=1.16
usetikzlibrarythrough
begindocument
begintikzpicture
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];
endtikzpicture
enddocument
(Same output as above.)
The analytic determination of the arcs is another possibility.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,calc
begindocument
begintikzpicture
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);
endtikzpicture
enddocument
Thanks . Is there alternate to using clipping in TikZ.
– subham soni
7 hours ago
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
7 hours ago
Analytic determination of arcs will be tedious. Can you please elaborate thepgfplots
solution as well
– subham soni
7 hours ago
@subhamsoni OK, I added the fillbetween stuff.
– marmot
7 hours ago
2
Thanks marmot. The answer and explanation is quite helpful
– subham soni
7 hours ago
|
show 2 more comments
The common area is obtained by clipping against one of the circles and filling the other.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds
.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,backgrounds
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope[on background layer]
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
You can always fill intersection segments. (You can combine this with the background stuff above.)
documentclassarticle
usepackagetikz
usepackagepgfplots
usepgfplotslibraryfillbetween
pgfplotssetcompat=1.16
usetikzlibrarythrough
begindocument
begintikzpicture
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];
endtikzpicture
enddocument
(Same output as above.)
The analytic determination of the arcs is another possibility.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,calc
begindocument
begintikzpicture
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);
endtikzpicture
enddocument
Thanks . Is there alternate to using clipping in TikZ.
– subham soni
7 hours ago
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
7 hours ago
Analytic determination of arcs will be tedious. Can you please elaborate thepgfplots
solution as well
– subham soni
7 hours ago
@subhamsoni OK, I added the fillbetween stuff.
– marmot
7 hours ago
2
Thanks marmot. The answer and explanation is quite helpful
– subham soni
7 hours ago
|
show 2 more comments
The common area is obtained by clipping against one of the circles and filling the other.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds
.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,backgrounds
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope[on background layer]
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
You can always fill intersection segments. (You can combine this with the background stuff above.)
documentclassarticle
usepackagetikz
usepackagepgfplots
usepgfplotslibraryfillbetween
pgfplotssetcompat=1.16
usetikzlibrarythrough
begindocument
begintikzpicture
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];
endtikzpicture
enddocument
(Same output as above.)
The analytic determination of the arcs is another possibility.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,calc
begindocument
begintikzpicture
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);
endtikzpicture
enddocument
The common area is obtained by clipping against one of the circles and filling the other.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
In case you are concerned by the fact that the circle contour gets partly overpainted, use backgrounds
.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,backgrounds
makeatletter % from https://tex.stackexchange.com/a/127045/121799
tikzsetuse path/.code=tikz@addmodepgfsyssoftpath@setcurrentpath#1
makeatother
begindocument
begintikzpicture
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) ;
beginscope[on background layer]
clip[use path=pathA];
fill[blue,use path=pathB];
endscope
path [name intersections=of=E and F, by=[label=above:$C$]C,[label=below:$C'$]C'];
endtikzpicture
enddocument
You can always fill intersection segments. (You can combine this with the background stuff above.)
documentclassarticle
usepackagetikz
usepackagepgfplots
usepgfplotslibraryfillbetween
pgfplotssetcompat=1.16
usetikzlibrarythrough
begindocument
begintikzpicture
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];
endtikzpicture
enddocument
(Same output as above.)
The analytic determination of the arcs is another possibility.
documentclassarticle
usepackagetikz
usetikzlibraryintersections,through,calc
begindocument
begintikzpicture
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);
endtikzpicture
enddocument
edited 7 hours ago
answered 8 hours ago
marmotmarmot
109k5135253
109k5135253
Thanks . Is there alternate to using clipping in TikZ.
– subham soni
7 hours ago
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
7 hours ago
Analytic determination of arcs will be tedious. Can you please elaborate thepgfplots
solution as well
– subham soni
7 hours ago
@subhamsoni OK, I added the fillbetween stuff.
– marmot
7 hours ago
2
Thanks marmot. The answer and explanation is quite helpful
– subham soni
7 hours ago
|
show 2 more comments
Thanks . Is there alternate to using clipping in TikZ.
– subham soni
7 hours ago
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
7 hours ago
Analytic determination of arcs will be tedious. Can you please elaborate thepgfplots
solution as well
– subham soni
7 hours ago
@subhamsoni OK, I added the fillbetween stuff.
– marmot
7 hours ago
2
Thanks marmot. The answer and explanation is quite helpful
– subham soni
7 hours ago
Thanks . Is there alternate to using clipping in TikZ.
– subham soni
7 hours ago
Thanks . Is there alternate to using clipping in TikZ.
– subham soni
7 hours ago
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
7 hours ago
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
7 hours ago
Analytic determination of arcs will be tedious. Can you please elaborate the
pgfplots
solution as well– subham soni
7 hours ago
Analytic determination of arcs will be tedious. Can you please elaborate the
pgfplots
solution as well– subham soni
7 hours ago
@subhamsoni OK, I added the fillbetween stuff.
– marmot
7 hours ago
@subhamsoni OK, I added the fillbetween stuff.
– marmot
7 hours ago
2
2
Thanks marmot. The answer and explanation is quite helpful
– subham soni
7 hours ago
Thanks marmot. The answer and explanation is quite helpful
– subham soni
7 hours ago
|
show 2 more comments
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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