2

I want to draw a 3D (rotational) Cartesian coordinate system as shown in the attached figure. As a new user of TikZ, I stuck on the following points:

1) How to plot two arcs with same center and different radius (arrow head)

2) intersection points b/w arc and line

3) rotated co-ordinates (one of the case is shown in figure) on that intersection point

There is something I managed to do today with the help of examples and manual, but this is surely not an efficient and smart way to start this problem.

I would really appreciate your help.

\documentclass[tikz,border=12pt]{standalone}
\usetikzlibrary{intersections}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\tdplotsetmaincoords{60}{110}

\begin{document}
\begin{tikzpicture} 
% add: rotation option
\coordinate (O) at (0,0,0);
\draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};

\draw[red] [name path=A1] (3,0) arc(0:120:3);

\draw[red][name path=r1] (0,0) -- (3,3);
\draw [name intersections={of=A1 and r1, by=y}] (y) circle (1pt);

\draw[blue] (6,0) arc(0:120:6);

\end{tikzpicture}
\end{document}

enter image description here

  • 1
    The most immediate thing is that you have not yet installed the 3d coordinates. Please consider adding [tdplot_main_coords] to the options of the tikzpicture. – marmot Mar 9 at 15:37
2

In order to make use of tikz-3dplot, you need to install its coordinate system. And then the 3d library allows you to transform to various planes. In these planes, you can draw arcs as usual.

\documentclass[tikz,border=12pt]{standalone}
\usetikzlibrary{3d,calc}
\usepackage{tikz-3dplot}
\tdplotsetmaincoords{60}{-80}
\begin{document}
\begin{tikzpicture}[tdplot_main_coords,bullet/.style={fill,circle,inner sep=1.5pt,transform shape}] 
 \pgfmathsetmacro{\r}{3.5}
 \pgfmathsetmacro{\R}{5}
 \pgfmathsetmacro{\myangle}{60}
 \coordinate (O) at (0,0,0);
%  \draw[thick,-stealth] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
%  \draw[thick,-stealth] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
%  \draw[thick,-stealth] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};
 \begin{scope}[canvas is xy plane at z=0]
  \draw[blue,-latex] (120:\r) arc(120:-30:\r) node[above,black]{$s$};
  \path (\myangle:\r) node[bullet] (P1){};
  \draw[-stealth] ($(P1)+(\myangle+90:1)$) -- ($(P1)+(\myangle-90:2)$) node[above]{$\hat z$};
  \draw[-stealth] (O) -- (0:\r) node[midway,right]{$\rho$};
  \draw[-stealth] (O) -- (90:\r) node[midway,below]{$\rho$};
  \draw[-stealth] (O) -- (\myangle:\R+1) node[below left]{$\hat x$};
  \path (\myangle:\R) node[bullet](P2'){};
 \end{scope}
 \begin{scope}[canvas is xy plane at z=2]
  \draw[red,-latex] (120:\R) arc(120:-30:\R) ;
  \path (\myangle:\R)node[bullet] (P2){};
  \draw[-stealth,thick] (P2) -- ++ (\myangle-90:0.5) node[midway,above]{$\mathrm{d}\vec r$};
  \path (\myangle:\r) node[bullet](P1'){};
  \draw[thin] (P2'.center) -- (P2.center) -- (P1'.center);
 \end{scope}
 \path (P1.center) -- (P1'.center) coordinate[pos=-0.3] (aux1)
 coordinate[pos=1.5] (aux2); 
 \draw[-stealth] (aux1) -- (aux2) node[right]{$\hat y$};
\end{tikzpicture}
\end{document}

enter image description here

  • Thank you very much for your answer. It introduced and helped me to understand a lot of new stuff, for example, I was not aware of scoping also. – Lauren Mar 9 at 18:38
  • @Lauren You are welcome! – marmot Mar 9 at 18:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.