6

I want to draw this picture, can anyone help me complete it?

My picture

\documentclass[a4paper,11pt]{article}
                 
\usepackage{tikz} 

\begin{document}
    \begin{tikzpicture}
        \shade[ball color = brown, opacity=0.7] (0,0) circle (2cm);
        \draw (0,0) circle (2cm);
        \draw[thick, -latex] (-130:1cm) -- (-130:3.5cm) node [below] {$ x $}; % x axis
        \draw[thick, -latex] (-20:1cm) -- (-20:3.5cm) node [right] {$ y $}; % y axis
        \draw[thick, -latex] (90:1cm) -- (90:3.5cm) node [above] {$ z $}; % z axis
        \draw (60:1.5cm) -- (60:3.5cm) node [anchor=south west, xshift=-2em]
        {$ x^2 + y^2 + z^2 - a^2 = 0 $};
    \end{tikzpicture}
\end{document}

enter image description here

1
9

I'g go for a 3d approach here. I think that it is almost as simple but it looks a little better. I left the labels for you.

\documentclass[border=2mm]{standalone}
\usepackage    {tikz}
\usetikzlibrary{3d}

\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,x={(-0.3590cm,-0.4278cm)},y={(0.9333cm,-0.1646cm)},z={(0cm,0.8887cm)}]
  % coordinates
  \coordinate (A1) at ({-3+2*cos(60)}, 1.75,{ 2*sin(60)});
  \coordinate (C1) at ({-3+2*cos(60)},-1.75,{-2*sin(60)});
  \coordinate (A2) at ({ 3-2*cos(60)}, 1.75,{ 2*sin(60)});
  \coordinate (C2) at ({ 3-2*cos(60)},-1.75,{-2*sin(60)});
  % cylinder behind
  \begin{scope}[canvas is xz plane at y=-1.75]
    \shade [opacity=0.5,left color=blue!10,right color=blue!70,shading angle=0]
      (A1) arc (60:-60:2) -- (C1) arc (-60:60:2) -- cycle;
  \end{scope}
  % sphere
  \shade[draw,ball color=brown!70] (0,0,0) circle (1cm);
  % y,z axis
  \draw [-latex] (0,1,0) -- (0,3,0) node [right] {$y$};
  \draw [-latex] (0,0,1) -- (0,0,3) node [above] {$z$};
  % front cylinder 
  \begin{scope}[canvas is xz plane at y=-1.75]
    \shade [opacity=0.5,left color=green!10,right color=green!70,shading angle=0]
      (A2) arc (120:240:2) -- (C2) arc (240:120:2) -- cycle;
  \end{scope}
  % little dot and x axis
  \draw [fill=red] (1,0,0) circle (0.025 cm);
  \draw [-latex]   (1.025,0,0) -- (3,0,0) node [left]  {$x$};
\end{tikzpicture}
\end{document}

This is the result: enter image description here

0

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.