Quiero usar tikz para hacer el dibujo que subí. No puedo indicar ángulos y crear algo similar a la imagen.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\fill[black!50] (2.5,1) ellipse (1 and 0.5);
%\fill[black!50][rotate=-30] (-2.5,1) ellipse (1.5 and 0.5);
\fill[black!50] (-2.5,1) ellipse (1 and 0.5);
\fill[black!50] (2.5,-1) ellipse (1 and 0.5);
\fill[black!50] (-2.5,-1) ellipse (1 and 0.5);
\fill[black!50] (-0,-0) ellipse (1.5 and 0.5);
\draw[black, ultra thick] (1.,.4) -- (2.5,1);
\draw[black, ultra thick] (-1.,.4) -- (-2.5,1);
\draw[black, ultra thick] (1.,-.4) -- (2.5,-1);
\draw[black, ultra thick] (-1.,-.4) -- (-2.5,-1);
\end{tikzpicture}
\end{document}
Respuesta1
Puede que TikZ no sea la mejor herramienta para diagramas en 3D, pero tiene soporte en forma de 3d
biblioteca perspective
.
Además, haytikz-3dplot
ytikz-3dtools
.
No estoy seguro de cómo funciona su sistema de coordenadas azul y cómo se encuentra en el mundo. El azulyEl eje se define en relación con el principal de guiones rojos, lo que facilita dibujar un arco entre ellos. La angles
biblioteca sólo funciona en ellienzosistema de coordenadas (el que tiene unidades) que siempre es 2d.
Código
\documentclass[tikz]{standalone}
%\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{3d, arrows.meta, calc, quotes}
\begin{document}
\begin{tikzpicture}[
x = ( 20:-2cm), y = (-30: 2cm), z = ( 80: 1.6cm),
> = Triangle]
\draw coordinate (O) (0,0,-.05) ellipse [radius=.2];
\foreach \xy/\yx in {x/y, y/x} {
\fill[white] (xyz cs: \xy = -1, \yx = -.05) -- (xyz cs: \xy = 1, \yx=-.05)
-- (xyz cs: \xy = 1, \yx = .05) -- (xyz cs: \xy = -1, \yx= .05) -- cycle;
\foreach \lmr in {-.05, 0, .05}
\draw[gray] (xyz cs: \xy=-1, \yx = \lmr) -- (xyz cs: \xy=1, \yx=\lmr);
\draw[fill=white, radius=.15] (xyz cs: \xy = -1) ellipse[]
(xyz cs: \xy = 1) ellipse[];
}
\draw[fill=white] (O) ellipse [radius=.2];
\foreach \xyz/\Label/\Ang in {% \Ang needs to start with a ,
x/left/ {, longitude = 70},
y/right/{, longitude =-20},
z/above/{, longitude = 70, latitude=70}%
} {
\draw[->, densely dashed, red] (0, 0, 0) -- ++(xyz cs: \xyz= 1.5)
coordinate (ax-\xyz) node[\Label] {$\xyz$};
\draw[blue, ->]
(0, 0, 0) -- (xyz spherical cs: radius = 1.5,/tikz/style/.expanded=\Ang)
coordinate (ax-\xyz') node[\Label] {$\xyz$};
}
\draw[canvas is xy plane at z=0]
(0, 1) arc[start angle=90, delta angle=20, radius=1]
node[midway, below right] {$\varphi$};
\end{tikzpicture}
\end{document}