Filling circular segment using Tkz-Euclide
Clash 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
I'll rotate the picture by 143 degrees.
tikz-pgf draw tkz-euclide
add a comment |Â
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
I'll rotate the picture by 143 degrees.
tikz-pgf draw tkz-euclide
I addedusetkzobjall
to make your code compile.
â marmot
1 hour ago
Oops, forgot. Thanks!
â Mark Fantini
1 hour ago
add a comment |Â
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
I'll rotate the picture by 143 degrees.
tikz-pgf draw tkz-euclide
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
I'll rotate the picture by 143 degrees.
tikz-pgf draw tkz-euclide
tikz-pgf draw tkz-euclide
edited 1 hour ago
marmot
59.9k463128
59.9k463128
asked 1 hour ago
Mark Fantini
153127
153127
I addedusetkzobjall
to make your code compile.
â marmot
1 hour ago
Oops, forgot. Thanks!
â Mark Fantini
1 hour ago
add a comment |Â
I addedusetkzobjall
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
add a comment |Â
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
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.
add a comment |Â
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
add a comment |Â
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
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.
add a comment |Â
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
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.
add a comment |Â
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
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.
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
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.
edited 48 mins ago
answered 58 mins ago
marmot
59.9k463128
59.9k463128
add a comment |Â
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered 43 mins ago
AndréC
3,211729
3,211729
add a comment |Â
add a comment |Â
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
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
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
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
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
I added
usetkzobjall
to make your code compile.â marmot
1 hour ago
Oops, forgot. Thanks!
â Mark Fantini
1 hour ago