draw a major arc and fill it with a gray color
I am trying to draw the major sector below:
I have made some progress with the following code, but not quite what I want as I am having trouble filling the last bit of the sector.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage{pgfplots}
renewcommand{thesection}{arabic{section}}
usepackage{booktabs, makecell, multirow}
usepackage{stackengine,graphicx,xcolor}
usepackage{lscape}
usetikzlibrary{arrows}
usepackage{flexisym}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations.markings}
newenvironment{tightcenter}{
setlengthtopsep{0pt}
setlengthparskip{0pt}
begin{center}}{end{center}}
begin{document}
begin{tikzpicture}[scale=1.2]
%cylinder
draw[black,thick,dotted] (0,0) circle (1.3cm);
fill[fill=black,opacity=0.8] (-0.2,0.2) circle (0.8mm);
%fill[fill=black,opacity=0.8] (+0.2,0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (-0.2,-0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (+0.2,-0.2) circle (0.8mm);
%draw [thick,dashed] (7,1) -- (8.2,1);
%draw[thick,<->](3.4,-1.52) to node[fill=white] {$3.5$ cm} (3.4,-3.22);
draw [thick,domain=95:355] plot ({1.3*cos(x)}, {1.3*sin(x)});
%
draw [thick,domain=94:270,fill=gray,opacity=0.5] plot ({1.3*cos(x)}, {1.3*sin(x)});
%draw [thick,domain=270:300,fill=red,opacity=0.5] plot ({1.3*cos(x)}, {1.3*sin(x)});
draw [thick] (1.3,-0.15) -- (0,0) -- (-0.15,1.3);
%\
draw [thick](0,0)++(0:0.25) arc (0:79:0.3);
node[above] at (0.4,0.2) {$50^{circ}$};
end{tikzpicture}
end{document}
tikz-pgf technical-drawing
add a comment |
I am trying to draw the major sector below:
I have made some progress with the following code, but not quite what I want as I am having trouble filling the last bit of the sector.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage{pgfplots}
renewcommand{thesection}{arabic{section}}
usepackage{booktabs, makecell, multirow}
usepackage{stackengine,graphicx,xcolor}
usepackage{lscape}
usetikzlibrary{arrows}
usepackage{flexisym}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations.markings}
newenvironment{tightcenter}{
setlengthtopsep{0pt}
setlengthparskip{0pt}
begin{center}}{end{center}}
begin{document}
begin{tikzpicture}[scale=1.2]
%cylinder
draw[black,thick,dotted] (0,0) circle (1.3cm);
fill[fill=black,opacity=0.8] (-0.2,0.2) circle (0.8mm);
%fill[fill=black,opacity=0.8] (+0.2,0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (-0.2,-0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (+0.2,-0.2) circle (0.8mm);
%draw [thick,dashed] (7,1) -- (8.2,1);
%draw[thick,<->](3.4,-1.52) to node[fill=white] {$3.5$ cm} (3.4,-3.22);
draw [thick,domain=95:355] plot ({1.3*cos(x)}, {1.3*sin(x)});
%
draw [thick,domain=94:270,fill=gray,opacity=0.5] plot ({1.3*cos(x)}, {1.3*sin(x)});
%draw [thick,domain=270:300,fill=red,opacity=0.5] plot ({1.3*cos(x)}, {1.3*sin(x)});
draw [thick] (1.3,-0.15) -- (0,0) -- (-0.15,1.3);
%\
draw [thick](0,0)++(0:0.25) arc (0:79:0.3);
node[above] at (0.4,0.2) {$50^{circ}$};
end{tikzpicture}
end{document}
tikz-pgf technical-drawing
add a comment |
I am trying to draw the major sector below:
I have made some progress with the following code, but not quite what I want as I am having trouble filling the last bit of the sector.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage{pgfplots}
renewcommand{thesection}{arabic{section}}
usepackage{booktabs, makecell, multirow}
usepackage{stackengine,graphicx,xcolor}
usepackage{lscape}
usetikzlibrary{arrows}
usepackage{flexisym}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations.markings}
newenvironment{tightcenter}{
setlengthtopsep{0pt}
setlengthparskip{0pt}
begin{center}}{end{center}}
begin{document}
begin{tikzpicture}[scale=1.2]
%cylinder
draw[black,thick,dotted] (0,0) circle (1.3cm);
fill[fill=black,opacity=0.8] (-0.2,0.2) circle (0.8mm);
%fill[fill=black,opacity=0.8] (+0.2,0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (-0.2,-0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (+0.2,-0.2) circle (0.8mm);
%draw [thick,dashed] (7,1) -- (8.2,1);
%draw[thick,<->](3.4,-1.52) to node[fill=white] {$3.5$ cm} (3.4,-3.22);
draw [thick,domain=95:355] plot ({1.3*cos(x)}, {1.3*sin(x)});
%
draw [thick,domain=94:270,fill=gray,opacity=0.5] plot ({1.3*cos(x)}, {1.3*sin(x)});
%draw [thick,domain=270:300,fill=red,opacity=0.5] plot ({1.3*cos(x)}, {1.3*sin(x)});
draw [thick] (1.3,-0.15) -- (0,0) -- (-0.15,1.3);
%\
draw [thick](0,0)++(0:0.25) arc (0:79:0.3);
node[above] at (0.4,0.2) {$50^{circ}$};
end{tikzpicture}
end{document}
tikz-pgf technical-drawing
I am trying to draw the major sector below:
I have made some progress with the following code, but not quite what I want as I am having trouble filling the last bit of the sector.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage{pgfplots}
renewcommand{thesection}{arabic{section}}
usepackage{booktabs, makecell, multirow}
usepackage{stackengine,graphicx,xcolor}
usepackage{lscape}
usetikzlibrary{arrows}
usepackage{flexisym}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations.markings}
newenvironment{tightcenter}{
setlengthtopsep{0pt}
setlengthparskip{0pt}
begin{center}}{end{center}}
begin{document}
begin{tikzpicture}[scale=1.2]
%cylinder
draw[black,thick,dotted] (0,0) circle (1.3cm);
fill[fill=black,opacity=0.8] (-0.2,0.2) circle (0.8mm);
%fill[fill=black,opacity=0.8] (+0.2,0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (-0.2,-0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (+0.2,-0.2) circle (0.8mm);
%draw [thick,dashed] (7,1) -- (8.2,1);
%draw[thick,<->](3.4,-1.52) to node[fill=white] {$3.5$ cm} (3.4,-3.22);
draw [thick,domain=95:355] plot ({1.3*cos(x)}, {1.3*sin(x)});
%
draw [thick,domain=94:270,fill=gray,opacity=0.5] plot ({1.3*cos(x)}, {1.3*sin(x)});
%draw [thick,domain=270:300,fill=red,opacity=0.5] plot ({1.3*cos(x)}, {1.3*sin(x)});
draw [thick] (1.3,-0.15) -- (0,0) -- (-0.15,1.3);
%\
draw [thick](0,0)++(0:0.25) arc (0:79:0.3);
node[above] at (0.4,0.2) {$50^{circ}$};
end{tikzpicture}
end{document}
tikz-pgf technical-drawing
tikz-pgf technical-drawing
edited 37 mins ago
Henri Menke
75.7k8165277
75.7k8165277
asked Aug 25 '18 at 7:59
Will KimWill Kim
728519
728519
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You could draw your outline and fill it in one line of Code with draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage{pgfplots}
renewcommand{thesection}{arabic{section}}
usepackage{booktabs, makecell, multirow}
usepackage{stackengine,graphicx,xcolor}
usepackage{lscape}
usetikzlibrary{arrows}
usepackage{flexisym}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations.markings}
newenvironment{tightcenter}{
setlengthtopsep{0pt}
setlengthparskip{0pt}
begin{center}}{end{center}}
begin{document}
begin{tikzpicture}[scale=1.2]
%cylinder
draw[black,thick,dotted] (0,0) circle (1.3cm);
fill[fill=black,opacity=0.8] (-0.2,0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (-0.2,-0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (+0.2,-0.2) circle (0.8mm);
draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
draw [thick](0,0)++(0:0.25) arc (0:79:0.3);
node[above] at (0.4,0.2) {$50^{circ}$};
end{tikzpicture}
end{document}
The (95:1.3)
moves you to the starting point of your outer perimeter, after that you draw the arc arc (95:355:1.3)
with the starting angle of 95, end angle of 355 and a radius of 1.3. Then you don't have to fiddle around with sine and cosine.
I hope I didn't misunderstood, what you wanted to achieve!
Best Regards!
Frieder
EDIT: I changed opacity=...
to fill opacity=...
. Otherwise, the dotted line would shine through.
And here is a picture:
add a comment |
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%2f447635%2fdraw-a-major-arc-and-fill-it-with-a-gray-color%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
You could draw your outline and fill it in one line of Code with draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage{pgfplots}
renewcommand{thesection}{arabic{section}}
usepackage{booktabs, makecell, multirow}
usepackage{stackengine,graphicx,xcolor}
usepackage{lscape}
usetikzlibrary{arrows}
usepackage{flexisym}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations.markings}
newenvironment{tightcenter}{
setlengthtopsep{0pt}
setlengthparskip{0pt}
begin{center}}{end{center}}
begin{document}
begin{tikzpicture}[scale=1.2]
%cylinder
draw[black,thick,dotted] (0,0) circle (1.3cm);
fill[fill=black,opacity=0.8] (-0.2,0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (-0.2,-0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (+0.2,-0.2) circle (0.8mm);
draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
draw [thick](0,0)++(0:0.25) arc (0:79:0.3);
node[above] at (0.4,0.2) {$50^{circ}$};
end{tikzpicture}
end{document}
The (95:1.3)
moves you to the starting point of your outer perimeter, after that you draw the arc arc (95:355:1.3)
with the starting angle of 95, end angle of 355 and a radius of 1.3. Then you don't have to fiddle around with sine and cosine.
I hope I didn't misunderstood, what you wanted to achieve!
Best Regards!
Frieder
EDIT: I changed opacity=...
to fill opacity=...
. Otherwise, the dotted line would shine through.
And here is a picture:
add a comment |
You could draw your outline and fill it in one line of Code with draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage{pgfplots}
renewcommand{thesection}{arabic{section}}
usepackage{booktabs, makecell, multirow}
usepackage{stackengine,graphicx,xcolor}
usepackage{lscape}
usetikzlibrary{arrows}
usepackage{flexisym}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations.markings}
newenvironment{tightcenter}{
setlengthtopsep{0pt}
setlengthparskip{0pt}
begin{center}}{end{center}}
begin{document}
begin{tikzpicture}[scale=1.2]
%cylinder
draw[black,thick,dotted] (0,0) circle (1.3cm);
fill[fill=black,opacity=0.8] (-0.2,0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (-0.2,-0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (+0.2,-0.2) circle (0.8mm);
draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
draw [thick](0,0)++(0:0.25) arc (0:79:0.3);
node[above] at (0.4,0.2) {$50^{circ}$};
end{tikzpicture}
end{document}
The (95:1.3)
moves you to the starting point of your outer perimeter, after that you draw the arc arc (95:355:1.3)
with the starting angle of 95, end angle of 355 and a radius of 1.3. Then you don't have to fiddle around with sine and cosine.
I hope I didn't misunderstood, what you wanted to achieve!
Best Regards!
Frieder
EDIT: I changed opacity=...
to fill opacity=...
. Otherwise, the dotted line would shine through.
And here is a picture:
add a comment |
You could draw your outline and fill it in one line of Code with draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage{pgfplots}
renewcommand{thesection}{arabic{section}}
usepackage{booktabs, makecell, multirow}
usepackage{stackengine,graphicx,xcolor}
usepackage{lscape}
usetikzlibrary{arrows}
usepackage{flexisym}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations.markings}
newenvironment{tightcenter}{
setlengthtopsep{0pt}
setlengthparskip{0pt}
begin{center}}{end{center}}
begin{document}
begin{tikzpicture}[scale=1.2]
%cylinder
draw[black,thick,dotted] (0,0) circle (1.3cm);
fill[fill=black,opacity=0.8] (-0.2,0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (-0.2,-0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (+0.2,-0.2) circle (0.8mm);
draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
draw [thick](0,0)++(0:0.25) arc (0:79:0.3);
node[above] at (0.4,0.2) {$50^{circ}$};
end{tikzpicture}
end{document}
The (95:1.3)
moves you to the starting point of your outer perimeter, after that you draw the arc arc (95:355:1.3)
with the starting angle of 95, end angle of 355 and a radius of 1.3. Then you don't have to fiddle around with sine and cosine.
I hope I didn't misunderstood, what you wanted to achieve!
Best Regards!
Frieder
EDIT: I changed opacity=...
to fill opacity=...
. Otherwise, the dotted line would shine through.
And here is a picture:
You could draw your outline and fill it in one line of Code with draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
.
documentclass{article}
usepackage[margin=0.5in]{geometry}
usepackage{pgfplots}
renewcommand{thesection}{arabic{section}}
usepackage{booktabs, makecell, multirow}
usepackage{stackengine,graphicx,xcolor}
usepackage{lscape}
usetikzlibrary{arrows}
usepackage{flexisym}
usetikzlibrary{shapes.geometric}
usetikzlibrary{decorations.markings}
newenvironment{tightcenter}{
setlengthtopsep{0pt}
setlengthparskip{0pt}
begin{center}}{end{center}}
begin{document}
begin{tikzpicture}[scale=1.2]
%cylinder
draw[black,thick,dotted] (0,0) circle (1.3cm);
fill[fill=black,opacity=0.8] (-0.2,0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (-0.2,-0.2) circle (0.8mm);
fill[fill=black,opacity=0.8] (+0.2,-0.2) circle (0.8mm);
draw [thick, fill=gray, fill opacity=0.5] (0,0) -- (95:1.3) arc (95:355:1.3) -- cycle;
draw [thick](0,0)++(0:0.25) arc (0:79:0.3);
node[above] at (0.4,0.2) {$50^{circ}$};
end{tikzpicture}
end{document}
The (95:1.3)
moves you to the starting point of your outer perimeter, after that you draw the arc arc (95:355:1.3)
with the starting angle of 95, end angle of 355 and a radius of 1.3. Then you don't have to fiddle around with sine and cosine.
I hope I didn't misunderstood, what you wanted to achieve!
Best Regards!
Frieder
EDIT: I changed opacity=...
to fill opacity=...
. Otherwise, the dotted line would shine through.
And here is a picture:
edited Aug 25 '18 at 8:17
answered Aug 25 '18 at 8:11
WulleWulle
17518
17518
add a comment |
add a comment |
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%2f447635%2fdraw-a-major-arc-and-fill-it-with-a-gray-color%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