Drawing angles on a diagram in Tikz using the angles library
up vote
1
down vote
favorite
I've recently been trying to learn Tikz, and I've constructed a diagram to use for my dissertation, to help show a vector being split into components that are parallel (v_b) and perpendicular (v_g) to another vector (B). A vector normal to the plane is also shown (n).
Where I am struggling is including arcs to show angles between the vectors. I want the angle from n to v_i to be labelled theta_vn, the angle between n and v_b to be labelled theta_bn and the angle between v_b and v_i to be labelled psi.
I have looked at how other people have managed this and attempted to copy, but it is throwing an error message: "Package pgf Error: No shape named origin is known." where "origin" is one of the coordinates I've specified. Any help is appreciated or just any comments on improving my code in general.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles}
begin{document}
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (v_i) at (2,-14,3);
coordinate (v_b) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (v_i);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (v_b);
draw[->,thick] (v_b) -- node[below]{$vec{v_g}$} (v_i);
%Drawing other lines
draw (v_b) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (v_i);
draw (normal) -- (v_b);
%Drawing angles - throwing error
pic ["$theta_{vn}$", angle eccentricity = 1.2, angle radius = 3cm] {angle = normal -- origin -- v_i};
pic ["$theta_{bn}$", angle eccentricity = 1.2, angle radius = 3cm] {angle = normal -- origin -- v_b};
pic ["$psi$", angle eccentricity = 1.2, angle radius = 3cm] {angle = v_i -- origin -- v_b};
end{tikzpicture}
end{document}
tikz-pgf tikz-angles
New contributor
add a comment |
up vote
1
down vote
favorite
I've recently been trying to learn Tikz, and I've constructed a diagram to use for my dissertation, to help show a vector being split into components that are parallel (v_b) and perpendicular (v_g) to another vector (B). A vector normal to the plane is also shown (n).
Where I am struggling is including arcs to show angles between the vectors. I want the angle from n to v_i to be labelled theta_vn, the angle between n and v_b to be labelled theta_bn and the angle between v_b and v_i to be labelled psi.
I have looked at how other people have managed this and attempted to copy, but it is throwing an error message: "Package pgf Error: No shape named origin is known." where "origin" is one of the coordinates I've specified. Any help is appreciated or just any comments on improving my code in general.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles}
begin{document}
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (v_i) at (2,-14,3);
coordinate (v_b) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (v_i);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (v_b);
draw[->,thick] (v_b) -- node[below]{$vec{v_g}$} (v_i);
%Drawing other lines
draw (v_b) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (v_i);
draw (normal) -- (v_b);
%Drawing angles - throwing error
pic ["$theta_{vn}$", angle eccentricity = 1.2, angle radius = 3cm] {angle = normal -- origin -- v_i};
pic ["$theta_{bn}$", angle eccentricity = 1.2, angle radius = 3cm] {angle = normal -- origin -- v_b};
pic ["$psi$", angle eccentricity = 1.2, angle radius = 3cm] {angle = v_i -- origin -- v_b};
end{tikzpicture}
end{document}
tikz-pgf tikz-angles
New contributor
1
Could you probably add a fully compilableMWE
instead of a snippet.
– Raaja
yesterday
1
@Raaja there we go, sorry.
– Jasper Salisbury
yesterday
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I've recently been trying to learn Tikz, and I've constructed a diagram to use for my dissertation, to help show a vector being split into components that are parallel (v_b) and perpendicular (v_g) to another vector (B). A vector normal to the plane is also shown (n).
Where I am struggling is including arcs to show angles between the vectors. I want the angle from n to v_i to be labelled theta_vn, the angle between n and v_b to be labelled theta_bn and the angle between v_b and v_i to be labelled psi.
I have looked at how other people have managed this and attempted to copy, but it is throwing an error message: "Package pgf Error: No shape named origin is known." where "origin" is one of the coordinates I've specified. Any help is appreciated or just any comments on improving my code in general.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles}
begin{document}
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (v_i) at (2,-14,3);
coordinate (v_b) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (v_i);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (v_b);
draw[->,thick] (v_b) -- node[below]{$vec{v_g}$} (v_i);
%Drawing other lines
draw (v_b) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (v_i);
draw (normal) -- (v_b);
%Drawing angles - throwing error
pic ["$theta_{vn}$", angle eccentricity = 1.2, angle radius = 3cm] {angle = normal -- origin -- v_i};
pic ["$theta_{bn}$", angle eccentricity = 1.2, angle radius = 3cm] {angle = normal -- origin -- v_b};
pic ["$psi$", angle eccentricity = 1.2, angle radius = 3cm] {angle = v_i -- origin -- v_b};
end{tikzpicture}
end{document}
tikz-pgf tikz-angles
New contributor
I've recently been trying to learn Tikz, and I've constructed a diagram to use for my dissertation, to help show a vector being split into components that are parallel (v_b) and perpendicular (v_g) to another vector (B). A vector normal to the plane is also shown (n).
Where I am struggling is including arcs to show angles between the vectors. I want the angle from n to v_i to be labelled theta_vn, the angle between n and v_b to be labelled theta_bn and the angle between v_b and v_i to be labelled psi.
I have looked at how other people have managed this and attempted to copy, but it is throwing an error message: "Package pgf Error: No shape named origin is known." where "origin" is one of the coordinates I've specified. Any help is appreciated or just any comments on improving my code in general.
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles}
begin{document}
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (v_i) at (2,-14,3);
coordinate (v_b) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (v_i);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (v_b);
draw[->,thick] (v_b) -- node[below]{$vec{v_g}$} (v_i);
%Drawing other lines
draw (v_b) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (v_i);
draw (normal) -- (v_b);
%Drawing angles - throwing error
pic ["$theta_{vn}$", angle eccentricity = 1.2, angle radius = 3cm] {angle = normal -- origin -- v_i};
pic ["$theta_{bn}$", angle eccentricity = 1.2, angle radius = 3cm] {angle = normal -- origin -- v_b};
pic ["$psi$", angle eccentricity = 1.2, angle radius = 3cm] {angle = v_i -- origin -- v_b};
end{tikzpicture}
end{document}
tikz-pgf tikz-angles
tikz-pgf tikz-angles
New contributor
New contributor
edited yesterday
New contributor
asked yesterday
Jasper Salisbury
62
62
New contributor
New contributor
1
Could you probably add a fully compilableMWE
instead of a snippet.
– Raaja
yesterday
1
@Raaja there we go, sorry.
– Jasper Salisbury
yesterday
add a comment |
1
Could you probably add a fully compilableMWE
instead of a snippet.
– Raaja
yesterday
1
@Raaja there we go, sorry.
– Jasper Salisbury
yesterday
1
1
Could you probably add a fully compilable
MWE
instead of a snippet.– Raaja
yesterday
Could you probably add a fully compilable
MWE
instead of a snippet.– Raaja
yesterday
1
1
@Raaja there we go, sorry.
– Jasper Salisbury
yesterday
@Raaja there we go, sorry.
– Jasper Salisbury
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
Partial answer: by removing the inter-word spacing in the angle's nodal definition and letting the tex
engine know that it has to draw
whatever we desire:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles}
begin{document}
% a bit of a help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
with which you can get:
Complete answer: Now by including the additional package usepackage{quote}
(I think):
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles,quotes}
begin{document}
% a bit of help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, "a", angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
you will end up with
I took the liberty to rename your variables.
Update 1: To make the interior angles, just make angle = vb--origin--vi
. That should do.
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = vb--origin--vi};
This would give you
that's amazing thank you, one final point, I wanted the arc on the interior angle not the exterior, do you know how I would achieve that?
– Jasper Salisbury
yesterday
@JasperSalisbury Just made an update to the answer, let me know whether that is okay.
– Raaja
22 hours ago
That's perfect, thank you so much.
– Jasper Salisbury
16 hours ago
@JasperSalisbury If you find it useful, consider accepting it.
– Raaja
16 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Partial answer: by removing the inter-word spacing in the angle's nodal definition and letting the tex
engine know that it has to draw
whatever we desire:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles}
begin{document}
% a bit of a help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
with which you can get:
Complete answer: Now by including the additional package usepackage{quote}
(I think):
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles,quotes}
begin{document}
% a bit of help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, "a", angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
you will end up with
I took the liberty to rename your variables.
Update 1: To make the interior angles, just make angle = vb--origin--vi
. That should do.
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = vb--origin--vi};
This would give you
that's amazing thank you, one final point, I wanted the arc on the interior angle not the exterior, do you know how I would achieve that?
– Jasper Salisbury
yesterday
@JasperSalisbury Just made an update to the answer, let me know whether that is okay.
– Raaja
22 hours ago
That's perfect, thank you so much.
– Jasper Salisbury
16 hours ago
@JasperSalisbury If you find it useful, consider accepting it.
– Raaja
16 hours ago
add a comment |
up vote
2
down vote
Partial answer: by removing the inter-word spacing in the angle's nodal definition and letting the tex
engine know that it has to draw
whatever we desire:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles}
begin{document}
% a bit of a help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
with which you can get:
Complete answer: Now by including the additional package usepackage{quote}
(I think):
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles,quotes}
begin{document}
% a bit of help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, "a", angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
you will end up with
I took the liberty to rename your variables.
Update 1: To make the interior angles, just make angle = vb--origin--vi
. That should do.
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = vb--origin--vi};
This would give you
that's amazing thank you, one final point, I wanted the arc on the interior angle not the exterior, do you know how I would achieve that?
– Jasper Salisbury
yesterday
@JasperSalisbury Just made an update to the answer, let me know whether that is okay.
– Raaja
22 hours ago
That's perfect, thank you so much.
– Jasper Salisbury
16 hours ago
@JasperSalisbury If you find it useful, consider accepting it.
– Raaja
16 hours ago
add a comment |
up vote
2
down vote
up vote
2
down vote
Partial answer: by removing the inter-word spacing in the angle's nodal definition and letting the tex
engine know that it has to draw
whatever we desire:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles}
begin{document}
% a bit of a help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
with which you can get:
Complete answer: Now by including the additional package usepackage{quote}
(I think):
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles,quotes}
begin{document}
% a bit of help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, "a", angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
you will end up with
I took the liberty to rename your variables.
Update 1: To make the interior angles, just make angle = vb--origin--vi
. That should do.
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = vb--origin--vi};
This would give you
Partial answer: by removing the inter-word spacing in the angle's nodal definition and letting the tex
engine know that it has to draw
whatever we desire:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles}
begin{document}
% a bit of a help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
with which you can get:
Complete answer: Now by including the additional package usepackage{quote}
(I think):
documentclass{article}
usepackage[utf8]{inputenc}
usepackage{tikz}
usetikzlibrary{angles,quotes}
begin{document}
% a bit of help from: https://tex.stackexchange.com/questions/267201/tikz-angle-between-two-vectors-and-a-projection
begin{tikzpicture}[x=0.5cm,y=0.5cm,z=0.3cm,>=stealth]
%Defining coordinates
coordinate (origin) at (0,0,0);
coordinate (vi) at (2,-14,3);
coordinate (vb) at (0,-4,-14);
coordinate (normal) at (0,-10,0);
%Drawing vectors
draw[->,thick] (normal) -- node[left]{$vec{n}$} (origin);
draw[->,thick] (origin) -- node[right]{$vec{v_i}$} (vi);
draw[->,thick] (origin) -- node[left]{$vec{v_b}$} (vb);
draw[->,thick] (vb) -- node[below]{$vec{v_g}$} (vi);
%Drawing other lines
draw (vb) -- (0,1,3.5) node[above]{$vec{B}$};
draw (normal) -- (vi);
draw (normal) -- (vb);
pic [draw, angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vi};
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = normal--origin--vb};
pic [draw, "a", angle eccentricity=1.2, angle radius = 3cm] {angle = vi--origin--vb};
end{tikzpicture}
end{document}
you will end up with
I took the liberty to rename your variables.
Update 1: To make the interior angles, just make angle = vb--origin--vi
. That should do.
pic [draw, "$theta$", angle eccentricity=1.2, angle radius = 3cm] {angle = vb--origin--vi};
This would give you
edited 22 hours ago
answered yesterday
Raaja
1,6312523
1,6312523
that's amazing thank you, one final point, I wanted the arc on the interior angle not the exterior, do you know how I would achieve that?
– Jasper Salisbury
yesterday
@JasperSalisbury Just made an update to the answer, let me know whether that is okay.
– Raaja
22 hours ago
That's perfect, thank you so much.
– Jasper Salisbury
16 hours ago
@JasperSalisbury If you find it useful, consider accepting it.
– Raaja
16 hours ago
add a comment |
that's amazing thank you, one final point, I wanted the arc on the interior angle not the exterior, do you know how I would achieve that?
– Jasper Salisbury
yesterday
@JasperSalisbury Just made an update to the answer, let me know whether that is okay.
– Raaja
22 hours ago
That's perfect, thank you so much.
– Jasper Salisbury
16 hours ago
@JasperSalisbury If you find it useful, consider accepting it.
– Raaja
16 hours ago
that's amazing thank you, one final point, I wanted the arc on the interior angle not the exterior, do you know how I would achieve that?
– Jasper Salisbury
yesterday
that's amazing thank you, one final point, I wanted the arc on the interior angle not the exterior, do you know how I would achieve that?
– Jasper Salisbury
yesterday
@JasperSalisbury Just made an update to the answer, let me know whether that is okay.
– Raaja
22 hours ago
@JasperSalisbury Just made an update to the answer, let me know whether that is okay.
– Raaja
22 hours ago
That's perfect, thank you so much.
– Jasper Salisbury
16 hours ago
That's perfect, thank you so much.
– Jasper Salisbury
16 hours ago
@JasperSalisbury If you find it useful, consider accepting it.
– Raaja
16 hours ago
@JasperSalisbury If you find it useful, consider accepting it.
– Raaja
16 hours ago
add a comment |
Jasper Salisbury is a new contributor. Be nice, and check out our Code of Conduct.
Jasper Salisbury is a new contributor. Be nice, and check out our Code of Conduct.
Jasper Salisbury is a new contributor. Be nice, and check out our Code of Conduct.
Jasper Salisbury is a new contributor. Be nice, and check out our Code of Conduct.
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%2f461113%2fdrawing-angles-on-a-diagram-in-tikz-using-the-angles-library%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
1
Could you probably add a fully compilable
MWE
instead of a snippet.– Raaja
yesterday
1
@Raaja there we go, sorry.
– Jasper Salisbury
yesterday