Using functions like sine, cosine and tangent to calculate coordinates in TikzIntersection of paths with...
In a post apocalypse world, with no power and few survivors, would Satnav still work?
Plotting Laguerre Gaussian beam intensity in transverse and line profile via center?
Is layered encryption more secure than long passwords?
Create a line break in a subscript-position term
Manager has noticed coworker's excessive breaks. Should I warn him?
How do I narratively explain how in-game circumstances do not mechanically allow a PC to instantly kill an NPC?
Why is Shelob considered evil?
Using functions like sine, cosine and tangent to calculate coordinates in Tikz
Is the percentage symbol a constant?
Is Developer Console going to be deprecated?
What does "don't have a baby" imply or mean in this sentence?
Is there any way to play D&D without a DM?
How can I make my enemies feel real and make combat more engaging?
Two oatmeal pies a day keep the doctor away?
Expression for "unconsciously using words (or accents) used by a person you often talk with or listen to"?
Why does a single AND gate need 60 transistors?
How can I give a Ranger advantage on a check due to Favored Enemy without spoiling the story for the player?
Is there a way to pause a running process on Linux systems and resume later?
What is the meaning of "usr"?
How do I avoid the "chosen hero" feeling?
Buying a "Used" Router
Including proofs of known theorems in master's thesis
Can you say "leftside right"?
Reason for small-valued feedback resistors in low noise Op Amp
Using functions like sine, cosine and tangent to calculate coordinates in Tikz
Intersection of paths with constructed namesTikZ scaling graphic and adjust node position and keep font sizeHow can I shade from red to green along a curve?Numerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionHow to calculate geometric functions of tikz coordinates?Drawing rectilinear curves in Tikz, aka an Etch-a-Sketch drawingLine up nested tikz enviroments or how to get rid of themCalculate coordinates using components of other coordinatesHow to split a (Hobby) path in two
I am learning TikZ with the pgfmanual. The example given is as follows:
I have achieved the following so far:
The code is as follows:
documentclass{article}
usepackage{tikz}
tikzset{help lines/.style=very thin}
tikzset{My Grid/.style={help lines,color=blue!50}}
begin{document}
begin{tikzpicture}
draw[My Grid] (-4,-4) grid (4,4);
draw (-5,0) node[left] {$(-5,0)$} -- (5,0) node[right] {$(5,0)$};
draw (0,-5) node[below] {$(0,-5)$} -- (0,5) node[above] {$(0,5)$};
draw (0,0) circle [radius=3cm];
shadedraw[left color=gray, right color=green, draw=green!50!black] (0,0) -- (0.75,0) arc [start angle=0, end angle=30, radius=1cm] -- cycle;
draw[red, very thick] (30:3cm) -- (2.6,0);
draw [very thick,orange] (3,0) -- (3,1.7);
end{tikzpicture}
end{document}
To achieve the intersection of the slope and tangent, pgfmanual uses the concept of path and intersections library which is very confusing.
Is there an easier way to tell the system to draw a line from point A to sin(30) as point B and to draw tangent of the angle proportionately instead of using direct numbers.
Please suggest alternative apart from intersections, polar coordinates and paths. Because the pgfmanual already uses them which is hard to understand.
tikz-pgf intersections
add a comment |
I am learning TikZ with the pgfmanual. The example given is as follows:
I have achieved the following so far:
The code is as follows:
documentclass{article}
usepackage{tikz}
tikzset{help lines/.style=very thin}
tikzset{My Grid/.style={help lines,color=blue!50}}
begin{document}
begin{tikzpicture}
draw[My Grid] (-4,-4) grid (4,4);
draw (-5,0) node[left] {$(-5,0)$} -- (5,0) node[right] {$(5,0)$};
draw (0,-5) node[below] {$(0,-5)$} -- (0,5) node[above] {$(0,5)$};
draw (0,0) circle [radius=3cm];
shadedraw[left color=gray, right color=green, draw=green!50!black] (0,0) -- (0.75,0) arc [start angle=0, end angle=30, radius=1cm] -- cycle;
draw[red, very thick] (30:3cm) -- (2.6,0);
draw [very thick,orange] (3,0) -- (3,1.7);
end{tikzpicture}
end{document}
To achieve the intersection of the slope and tangent, pgfmanual uses the concept of path and intersections library which is very confusing.
Is there an easier way to tell the system to draw a line from point A to sin(30) as point B and to draw tangent of the angle proportionately instead of using direct numbers.
Please suggest alternative apart from intersections, polar coordinates and paths. Because the pgfmanual already uses them which is hard to understand.
tikz-pgf intersections
May be If you specify exactly what is hard for you to understand someone will try to explain it to you
– Hafid Boukhoulda
4 hours ago
@hafid The slope lines and connecting the tangent for the time being
– subham soni
4 hours ago
Do you need to usecos(30)
andtan(30)
to indicate point coordinates instead of(2.6,0)
and(3,1.7)
– Hafid Boukhoulda
4 hours ago
Yes @hafid. That is exactly the requirement.
– subham soni
4 hours ago
add a comment |
I am learning TikZ with the pgfmanual. The example given is as follows:
I have achieved the following so far:
The code is as follows:
documentclass{article}
usepackage{tikz}
tikzset{help lines/.style=very thin}
tikzset{My Grid/.style={help lines,color=blue!50}}
begin{document}
begin{tikzpicture}
draw[My Grid] (-4,-4) grid (4,4);
draw (-5,0) node[left] {$(-5,0)$} -- (5,0) node[right] {$(5,0)$};
draw (0,-5) node[below] {$(0,-5)$} -- (0,5) node[above] {$(0,5)$};
draw (0,0) circle [radius=3cm];
shadedraw[left color=gray, right color=green, draw=green!50!black] (0,0) -- (0.75,0) arc [start angle=0, end angle=30, radius=1cm] -- cycle;
draw[red, very thick] (30:3cm) -- (2.6,0);
draw [very thick,orange] (3,0) -- (3,1.7);
end{tikzpicture}
end{document}
To achieve the intersection of the slope and tangent, pgfmanual uses the concept of path and intersections library which is very confusing.
Is there an easier way to tell the system to draw a line from point A to sin(30) as point B and to draw tangent of the angle proportionately instead of using direct numbers.
Please suggest alternative apart from intersections, polar coordinates and paths. Because the pgfmanual already uses them which is hard to understand.
tikz-pgf intersections
I am learning TikZ with the pgfmanual. The example given is as follows:
I have achieved the following so far:
The code is as follows:
documentclass{article}
usepackage{tikz}
tikzset{help lines/.style=very thin}
tikzset{My Grid/.style={help lines,color=blue!50}}
begin{document}
begin{tikzpicture}
draw[My Grid] (-4,-4) grid (4,4);
draw (-5,0) node[left] {$(-5,0)$} -- (5,0) node[right] {$(5,0)$};
draw (0,-5) node[below] {$(0,-5)$} -- (0,5) node[above] {$(0,5)$};
draw (0,0) circle [radius=3cm];
shadedraw[left color=gray, right color=green, draw=green!50!black] (0,0) -- (0.75,0) arc [start angle=0, end angle=30, radius=1cm] -- cycle;
draw[red, very thick] (30:3cm) -- (2.6,0);
draw [very thick,orange] (3,0) -- (3,1.7);
end{tikzpicture}
end{document}
To achieve the intersection of the slope and tangent, pgfmanual uses the concept of path and intersections library which is very confusing.
Is there an easier way to tell the system to draw a line from point A to sin(30) as point B and to draw tangent of the angle proportionately instead of using direct numbers.
Please suggest alternative apart from intersections, polar coordinates and paths. Because the pgfmanual already uses them which is hard to understand.
tikz-pgf intersections
tikz-pgf intersections
edited 3 hours ago
Hafid Boukhoulda
3,9021622
3,9021622
asked 4 hours ago
subham sonisubham soni
3,96382981
3,96382981
May be If you specify exactly what is hard for you to understand someone will try to explain it to you
– Hafid Boukhoulda
4 hours ago
@hafid The slope lines and connecting the tangent for the time being
– subham soni
4 hours ago
Do you need to usecos(30)
andtan(30)
to indicate point coordinates instead of(2.6,0)
and(3,1.7)
– Hafid Boukhoulda
4 hours ago
Yes @hafid. That is exactly the requirement.
– subham soni
4 hours ago
add a comment |
May be If you specify exactly what is hard for you to understand someone will try to explain it to you
– Hafid Boukhoulda
4 hours ago
@hafid The slope lines and connecting the tangent for the time being
– subham soni
4 hours ago
Do you need to usecos(30)
andtan(30)
to indicate point coordinates instead of(2.6,0)
and(3,1.7)
– Hafid Boukhoulda
4 hours ago
Yes @hafid. That is exactly the requirement.
– subham soni
4 hours ago
May be If you specify exactly what is hard for you to understand someone will try to explain it to you
– Hafid Boukhoulda
4 hours ago
May be If you specify exactly what is hard for you to understand someone will try to explain it to you
– Hafid Boukhoulda
4 hours ago
@hafid The slope lines and connecting the tangent for the time being
– subham soni
4 hours ago
@hafid The slope lines and connecting the tangent for the time being
– subham soni
4 hours ago
Do you need to use
cos(30)
and tan(30)
to indicate point coordinates instead of (2.6,0)
and (3,1.7)
– Hafid Boukhoulda
4 hours ago
Do you need to use
cos(30)
and tan(30)
to indicate point coordinates instead of (2.6,0)
and (3,1.7)
– Hafid Boukhoulda
4 hours ago
Yes @hafid. That is exactly the requirement.
– subham soni
4 hours ago
Yes @hafid. That is exactly the requirement.
– subham soni
4 hours ago
add a comment |
1 Answer
1
active
oldest
votes
Since in cos(30)
and tan(30)
there are parentheses you must put these functions inside curly brackets {}
documentclass{article}
usepackage{tikz}
usetikzlibrary{angles,quotes}
tikzset{help lines/.style=very thin}
tikzset{My Grid/.style={help lines,color=blue!50}}
begin{document}
begin{tikzpicture}
draw[My Grid] (-4,-4) grid (4,4);
draw (-5,0) node[left] {$(-5,0)$} -- (5,0) node[right] {$(5,0)$};
draw (0,-5) node[below] {$(0,-5)$} -- (0,5) node[above] {$(0,5)$};
draw (0,0) circle [radius=3cm];
% shadedraw[left color=gray, right color=green, draw=green!50!black]
% (0,0) -- (0.75,0) arc [start angle=0, end angle=30, radius=0.75cm] -- cycle;
coordinate(O)at(0,0);
draw[red, very thick] (30:3cm)coordinate(A)
--({3*cos(30)},0)coordinate(B);
draw [very thick,orange] (3,0) -- (3,{3*tan(30)})coordinate(C);
pic[fill=green!50!black,
angle radius=0.75cm,
angle eccentricity=1.2,
"(alpha)"] {angle=B--O--A};
draw (O)--(C);
end{tikzpicture}
end{document}
Will this ensure that the length is actual value when computed as well or plotted manually with pencil and graph?
– subham soni
4 hours ago
@subhamsoni I notice that the green angle is greeter than 30° I suppose you needed to be 30°
– Hafid Boukhoulda
4 hours ago
I have mentioned end angle as 30. Is there anything I am missing
– subham soni
4 hours ago
@subhamsoni Yes you need the specify the correct radius 0.75 cm and not 1cm since the start point is (0.75,0). Also in Tikz there is another manner to draw angles.
– Hafid Boukhoulda
3 hours ago
it would be great if you can share the other way because precision is always better.
– subham soni
3 hours ago
|
show 4 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%2f476287%2fusing-functions-like-sine-cosine-and-tangent-to-calculate-coordinates-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
Since in cos(30)
and tan(30)
there are parentheses you must put these functions inside curly brackets {}
documentclass{article}
usepackage{tikz}
usetikzlibrary{angles,quotes}
tikzset{help lines/.style=very thin}
tikzset{My Grid/.style={help lines,color=blue!50}}
begin{document}
begin{tikzpicture}
draw[My Grid] (-4,-4) grid (4,4);
draw (-5,0) node[left] {$(-5,0)$} -- (5,0) node[right] {$(5,0)$};
draw (0,-5) node[below] {$(0,-5)$} -- (0,5) node[above] {$(0,5)$};
draw (0,0) circle [radius=3cm];
% shadedraw[left color=gray, right color=green, draw=green!50!black]
% (0,0) -- (0.75,0) arc [start angle=0, end angle=30, radius=0.75cm] -- cycle;
coordinate(O)at(0,0);
draw[red, very thick] (30:3cm)coordinate(A)
--({3*cos(30)},0)coordinate(B);
draw [very thick,orange] (3,0) -- (3,{3*tan(30)})coordinate(C);
pic[fill=green!50!black,
angle radius=0.75cm,
angle eccentricity=1.2,
"(alpha)"] {angle=B--O--A};
draw (O)--(C);
end{tikzpicture}
end{document}
Will this ensure that the length is actual value when computed as well or plotted manually with pencil and graph?
– subham soni
4 hours ago
@subhamsoni I notice that the green angle is greeter than 30° I suppose you needed to be 30°
– Hafid Boukhoulda
4 hours ago
I have mentioned end angle as 30. Is there anything I am missing
– subham soni
4 hours ago
@subhamsoni Yes you need the specify the correct radius 0.75 cm and not 1cm since the start point is (0.75,0). Also in Tikz there is another manner to draw angles.
– Hafid Boukhoulda
3 hours ago
it would be great if you can share the other way because precision is always better.
– subham soni
3 hours ago
|
show 4 more comments
Since in cos(30)
and tan(30)
there are parentheses you must put these functions inside curly brackets {}
documentclass{article}
usepackage{tikz}
usetikzlibrary{angles,quotes}
tikzset{help lines/.style=very thin}
tikzset{My Grid/.style={help lines,color=blue!50}}
begin{document}
begin{tikzpicture}
draw[My Grid] (-4,-4) grid (4,4);
draw (-5,0) node[left] {$(-5,0)$} -- (5,0) node[right] {$(5,0)$};
draw (0,-5) node[below] {$(0,-5)$} -- (0,5) node[above] {$(0,5)$};
draw (0,0) circle [radius=3cm];
% shadedraw[left color=gray, right color=green, draw=green!50!black]
% (0,0) -- (0.75,0) arc [start angle=0, end angle=30, radius=0.75cm] -- cycle;
coordinate(O)at(0,0);
draw[red, very thick] (30:3cm)coordinate(A)
--({3*cos(30)},0)coordinate(B);
draw [very thick,orange] (3,0) -- (3,{3*tan(30)})coordinate(C);
pic[fill=green!50!black,
angle radius=0.75cm,
angle eccentricity=1.2,
"(alpha)"] {angle=B--O--A};
draw (O)--(C);
end{tikzpicture}
end{document}
Will this ensure that the length is actual value when computed as well or plotted manually with pencil and graph?
– subham soni
4 hours ago
@subhamsoni I notice that the green angle is greeter than 30° I suppose you needed to be 30°
– Hafid Boukhoulda
4 hours ago
I have mentioned end angle as 30. Is there anything I am missing
– subham soni
4 hours ago
@subhamsoni Yes you need the specify the correct radius 0.75 cm and not 1cm since the start point is (0.75,0). Also in Tikz there is another manner to draw angles.
– Hafid Boukhoulda
3 hours ago
it would be great if you can share the other way because precision is always better.
– subham soni
3 hours ago
|
show 4 more comments
Since in cos(30)
and tan(30)
there are parentheses you must put these functions inside curly brackets {}
documentclass{article}
usepackage{tikz}
usetikzlibrary{angles,quotes}
tikzset{help lines/.style=very thin}
tikzset{My Grid/.style={help lines,color=blue!50}}
begin{document}
begin{tikzpicture}
draw[My Grid] (-4,-4) grid (4,4);
draw (-5,0) node[left] {$(-5,0)$} -- (5,0) node[right] {$(5,0)$};
draw (0,-5) node[below] {$(0,-5)$} -- (0,5) node[above] {$(0,5)$};
draw (0,0) circle [radius=3cm];
% shadedraw[left color=gray, right color=green, draw=green!50!black]
% (0,0) -- (0.75,0) arc [start angle=0, end angle=30, radius=0.75cm] -- cycle;
coordinate(O)at(0,0);
draw[red, very thick] (30:3cm)coordinate(A)
--({3*cos(30)},0)coordinate(B);
draw [very thick,orange] (3,0) -- (3,{3*tan(30)})coordinate(C);
pic[fill=green!50!black,
angle radius=0.75cm,
angle eccentricity=1.2,
"(alpha)"] {angle=B--O--A};
draw (O)--(C);
end{tikzpicture}
end{document}
Since in cos(30)
and tan(30)
there are parentheses you must put these functions inside curly brackets {}
documentclass{article}
usepackage{tikz}
usetikzlibrary{angles,quotes}
tikzset{help lines/.style=very thin}
tikzset{My Grid/.style={help lines,color=blue!50}}
begin{document}
begin{tikzpicture}
draw[My Grid] (-4,-4) grid (4,4);
draw (-5,0) node[left] {$(-5,0)$} -- (5,0) node[right] {$(5,0)$};
draw (0,-5) node[below] {$(0,-5)$} -- (0,5) node[above] {$(0,5)$};
draw (0,0) circle [radius=3cm];
% shadedraw[left color=gray, right color=green, draw=green!50!black]
% (0,0) -- (0.75,0) arc [start angle=0, end angle=30, radius=0.75cm] -- cycle;
coordinate(O)at(0,0);
draw[red, very thick] (30:3cm)coordinate(A)
--({3*cos(30)},0)coordinate(B);
draw [very thick,orange] (3,0) -- (3,{3*tan(30)})coordinate(C);
pic[fill=green!50!black,
angle radius=0.75cm,
angle eccentricity=1.2,
"(alpha)"] {angle=B--O--A};
draw (O)--(C);
end{tikzpicture}
end{document}
edited 1 hour ago
answered 4 hours ago
Hafid BoukhouldaHafid Boukhoulda
3,9021622
3,9021622
Will this ensure that the length is actual value when computed as well or plotted manually with pencil and graph?
– subham soni
4 hours ago
@subhamsoni I notice that the green angle is greeter than 30° I suppose you needed to be 30°
– Hafid Boukhoulda
4 hours ago
I have mentioned end angle as 30. Is there anything I am missing
– subham soni
4 hours ago
@subhamsoni Yes you need the specify the correct radius 0.75 cm and not 1cm since the start point is (0.75,0). Also in Tikz there is another manner to draw angles.
– Hafid Boukhoulda
3 hours ago
it would be great if you can share the other way because precision is always better.
– subham soni
3 hours ago
|
show 4 more comments
Will this ensure that the length is actual value when computed as well or plotted manually with pencil and graph?
– subham soni
4 hours ago
@subhamsoni I notice that the green angle is greeter than 30° I suppose you needed to be 30°
– Hafid Boukhoulda
4 hours ago
I have mentioned end angle as 30. Is there anything I am missing
– subham soni
4 hours ago
@subhamsoni Yes you need the specify the correct radius 0.75 cm and not 1cm since the start point is (0.75,0). Also in Tikz there is another manner to draw angles.
– Hafid Boukhoulda
3 hours ago
it would be great if you can share the other way because precision is always better.
– subham soni
3 hours ago
Will this ensure that the length is actual value when computed as well or plotted manually with pencil and graph?
– subham soni
4 hours ago
Will this ensure that the length is actual value when computed as well or plotted manually with pencil and graph?
– subham soni
4 hours ago
@subhamsoni I notice that the green angle is greeter than 30° I suppose you needed to be 30°
– Hafid Boukhoulda
4 hours ago
@subhamsoni I notice that the green angle is greeter than 30° I suppose you needed to be 30°
– Hafid Boukhoulda
4 hours ago
I have mentioned end angle as 30. Is there anything I am missing
– subham soni
4 hours ago
I have mentioned end angle as 30. Is there anything I am missing
– subham soni
4 hours ago
@subhamsoni Yes you need the specify the correct radius 0.75 cm and not 1cm since the start point is (0.75,0). Also in Tikz there is another manner to draw angles.
– Hafid Boukhoulda
3 hours ago
@subhamsoni Yes you need the specify the correct radius 0.75 cm and not 1cm since the start point is (0.75,0). Also in Tikz there is another manner to draw angles.
– Hafid Boukhoulda
3 hours ago
it would be great if you can share the other way because precision is always better.
– subham soni
3 hours ago
it would be great if you can share the other way because precision is always better.
– subham soni
3 hours ago
|
show 4 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%2f476287%2fusing-functions-like-sine-cosine-and-tangent-to-calculate-coordinates-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
May be If you specify exactly what is hard for you to understand someone will try to explain it to you
– Hafid Boukhoulda
4 hours ago
@hafid The slope lines and connecting the tangent for the time being
– subham soni
4 hours ago
Do you need to use
cos(30)
andtan(30)
to indicate point coordinates instead of(2.6,0)
and(3,1.7)
– Hafid Boukhoulda
4 hours ago
Yes @hafid. That is exactly the requirement.
– subham soni
4 hours ago