I want to draw the arc in the yellow circle
- 48,848
-
3Please provide MWE for your work what you have tried so far. – mmr Nov 14 '22 at 05:18
-
1Related Question: Symbol for "rotate around axis" – Peter Grill Nov 14 '22 at 08:56
1 Answers
Welcome to TeX.SX! If you use TikZ (which I assume in view of the tag), cou can define a pic, or rather two, one for the front and one for the back:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\tikzset{
revolving arrow back/.pic = {
\draw[fill=white, pic actions]
(-90:1 and 2) ++(0.5,0)
arc[start angle=-90, end angle=90, x radius=1, y radius=2]
-- ++(-1,0)
arc[start angle=90, end angle=-90, x radius=1, y radius=2] -- cycle;
},
revolving arrow front/.pic = {
\draw[fill=white, pic actions]
(90:1 and 2) ++(0.5,0)
arc[start angle=90, end angle=150, x radius=1, y radius=2]
-- ++(0.5,0) -- ++(-1,-1.5) -- ++(-1,1.5) -- ++(0.5,0)
arc[start angle=150, end angle=90, x radius=1, y radius=2]
-- cycle
(210:1 and 2) ++(0.5,0)
arc[start angle=210, end angle=270, x radius=1, y radius=2]
-- ++ (-1,0)
arc[start angle=270, end angle=210, x radius=1, y radius=2]
-- cycle;
}
}
\begin{document}
\begin{tikzpicture}
\pic[magenta, scale=0.5] at (0,0) {revolving arrow back};
\draw[-stealth] (-2,0) -- (2,0);
\pic[magenta, scale=0.5] at (0,0) {revolving arrow front};
\end{tikzpicture}
\end{document}
If you wish to also get the gaps, you could do this using some preaction:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\tikzset{
revolving arrow back/.pic = {
\draw[fill=white, pic actions]
(-90:1 and 2) ++(0.5,0)
arc[start angle=-90, end angle=90, x radius=1, y radius=2]
-- ++(-1,0)
arc[start angle=90, end angle=-90, x radius=1, y radius=2] -- cycle;
},
revolving arrow front/.pic = {
\draw[fill=white, white border, pic actions]
(90:1 and 2) ++(0.5,0)
arc[start angle=90, end angle=150, x radius=1, y radius=2]
-- ++(0.5,0) -- ++(-1,-1.5) -- ++(-1,1.5) -- ++(0.5,0)
arc[start angle=150, end angle=90, x radius=1, y radius=2]
-- cycle
(210:1 and 2) ++(0.5,0)
arc[start angle=210, end angle=270, x radius=1, y radius=2]
-- ++ (-1,0)
arc[start angle=270, end angle=210, x radius=1, y radius=2]
-- cycle;
},
white border/.default = 3pt,
white border/.style = {
preaction = {
draw,
white,
line join = bevel,
line width = #1,
},
}
}
\begin{document}
\begin{tikzpicture}
\pic[magenta, scale=0.25] at (0,0) {revolving arrow back};
\draw[-stealth, white border] (-1,0) -- (1,0);
\pic[magenta, scale=0.25] at (0,0) {revolving arrow front};
\end{tikzpicture}
\end{document}
Making use of the backgrounds library, it is possible to create a to-path that automatically attaches the pic to its center:
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, backgrounds}
\tikzset{
revolving arrow/.style = {
preaction = {
draw,
white,
line join = bevel,
line width = 3pt,
},
to path = {
-- (\tikztotarget)
pic at ($(\tikztostart)!0.5!(\tikztotarget)$) {revolving arrow back}
pic at ($(\tikztostart)!0.5!(\tikztotarget)$) {revolving arrow front}
\tikztonodes
}
},
revolving arrow pic/.style = {
scale=0.25,
draw,
fill=white,
},
revolving arrow pic front/.style = {
revolving arrow pic,
preaction = {
draw,
white,
line join = bevel,
line width = 3pt,
}
},
revolving arrow pic back/.style = {
revolving arrow pic,
},
revolving arrow back/.pic = {
\begin{scope}[on background layer]
\path[revolving arrow pic back]
(-90:1 and 2) ++(0.5,0)
arc[start angle=-90, end angle=90, x radius=1, y radius=2]
-- ++(-1,0)
arc[start angle=90, end angle=-90, x radius=1, y radius=2] -- cycle;
\end{scope}
},
revolving arrow front/.pic = {
\path[revolving arrow pic front]
(90:1 and 2) ++(0.5,0)
arc[start angle=90, end angle=150, x radius=1, y radius=2]
-- ++(0.5,0) to[bend right=2.5] ++(-1,-1.5) to[bend left=2.5] ++(-1,1.5) -- ++(0.5,0)
arc[start angle=150, end angle=90, x radius=1, y radius=2]
-- cycle
(210:1 and 2) ++(0.5,0)
arc[start angle=210, end angle=270, x radius=1, y radius=2]
-- ++ (-1,0)
arc[start angle=270, end angle=210, x radius=1, y radius=2]
-- cycle;
}
}
\begin{document}
\begin{tikzpicture}
\draw[-stealth, revolving arrow] (-1,1.5) to (1,1.5);
\draw[-stealth, revolving arrow] (10:-1) to[revolving arrow pic/.append style={draw=magenta, rotate=10}] (10:1);
\end{tikzpicture}
\end{document}
- 48,848
-
1
-
Well, this is not an exact copy of the original arrow. In order to get the gaps, it would be necessary to re-draw both, the upper part of the revolving arrow as well as the black arrow. – Jasper Habicht Nov 14 '22 at 09:39
-
1In order to get a slight bending to the arrow tip, one could maybe replace
-- ++(0.5,0) -- ++(-1,-1.5) -- ++(-1,1.5) -- ++(0.5,0)by-- ++(0.5,0) to[bend right=2.5] ++(-1,-1.5) to[bend left=2.5] ++(-1,1.5) -- ++(0.5,0). – Jasper Habicht Nov 14 '22 at 13:27



