I am trying to reproduce below image using tikz-3dplot.
Immediately I stumbled upon a problem where I cannot draw the cartesian x-y-z axis with the z-axis to the right because \tdplotsetmaincoords{xrotation}{zrotation} does not support rotation around y-axis.
I can trick it by swapping y with z axis and mirror it, but then I get problem later on when defining the polar coordinate.
\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{110}
\begin{tikzpicture}[tdplot_main_coords]
\draw[thick,->] (-3,0,0) -- (3,0,0) node[anchor=north east]{x};
%% \draw[thick,->] (0,0,0) -- (0,3,0) node[anchor=north west]{y};
%% \draw[thick,->] (0,0,0) -- (0,0,3) node[anchor=south]{z};
\draw[thick,->] (0,3,0) -- (0,-3,0) node[anchor=north west]{z};
\draw[thick,->] (0,0,-3) -- (0,0,3) node[anchor=south]{y};
\end{tikzpicture}
\end{document}
I hope the experts here can help me with this. Thanks!
Update
Now I used tdplotsetrotatedcoords to rotate so that the z-axis is pointing to right as I want it. But I am still struggling to draw the theta and phi angle to the red vector.
\tdplotsetmaincoords{0}{0}
\tdplotsetrotatedcoords{0}{-110}{-10}
\begin{tikzpicture}[tdplot_rotated_coords]
\draw[thick,->] (-3,0,0) -- (5,0,0) node[anchor=north east]{x};
\draw[thick,->] (0,-3,0) -- (0,3,0) node[anchor=north west]{y};
\draw[thick,->] (0,0,-3) -- (0,0,3) node[anchor=south]{z};
\draw[red,->] (0,0,0) -- (3,2.5,-3.5);
\end{tikzpicture}
\tdplotsetrotatedcoords
performs three rotations, where the first and last can be used to cancel each other. In other words, try\tdplotsetrotatedcoords{90}{45}{-90}
and\tdplotsetrotatedcoords{-90}{45}{90}
.