I am trying to rotate a circle around two axes.
The circle should be placed perpendicular to the red vector.
Code:
\documentclass[a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
% xyz axes
\draw[thick,->] (0,0,0) -- (5,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,5,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,5) node[anchor=north west]{$z$};
% vector
\draw[->,red] (0,0,0) -- (4,4,4);
% center of circle
\fill (3,3,3) circle (1pt);
% circle
\draw (3,3,3) circle (3); % rotation?
\end{tikzpicture}
\end{document}
Output:
I would like to know how to rotate the circle in a way that the red vector and the circle are perpendicular to each other.
I think it's a 45° rotation around the y-axis and 45° around the z-axis but how is this realizable using tikz?
Best Answer
I'd suggest using
tikz-3dplot
if you really want to use TikZ since it will handle many of the calculations required to fake 3D with a package designed to draw in 2D.For example:
If we wanted to shade the circle to give more of a sense of depth, we could use the
backgrounds
library and some care about the drawing order. For example: