0

I would like to replicate the following image in Tikz. Would anybody be able to help me? I've heard that drawing spheres and lines with good coordinate systems are hard...enter image description here

  • 2
    Your picture can easily be reproduced in TikZ. What have you tried so far? – Marian G. Apr 18 '19 at 19:41
  • Your picture is unfortunately not an orthogonal projection. If I was you I would probably just take e.g. this code and minimally modify it to get a more realistic projection. – user121799 Apr 18 '19 at 20:21
4

Welcome to TeX-SE! This produces something of that sort. It employs tikz-3dplot for the orthonormal projections of the view and the 3d library for projections on appropriate planes.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\begin{document}
\tdplotsetmaincoords{105}{-10}
\begin{tikzpicture}[tdplot_main_coords,bullet/.style={circle,fill,inner sep=1.2pt}]
 % parameters
 \pgfmathsetmacro{\Radius}{2.5}
 \pgfmathsetmacro{\Angle}{20}
 % axes
 \draw[-stealth] (0,0,0) coordinate (O) -- (0,0,1.2*\Radius);
 \draw[-stealth]  (O) -- (1.2*\Radius,0,0);
 \draw[-stealth]  (O) -- (0,1.2*\Radius,0);
 % sphere
 \draw[ball color=gray,fill opacity=0.3,tdplot_screen_coords] (0,0)
 circle[radius=\Radius];
 % equator
 \begin{scope}[canvas is xy plane at z=0]
  \draw[dashed,thick](\tdplotmainphi:\Radius)
  arc(\tdplotmainphi:\tdplotmainphi-180:\Radius);
  \draw[thick](\tdplotmainphi:\Radius)
  arc(\tdplotmainphi:\tdplotmainphi+180:\Radius);
 \end{scope} 
 % plane that runs through the poles
 \tdplotsetrotatedcoords{-130}{0}{0}
 \begin{scope}[tdplot_rotated_coords,canvas is xz plane at y=0]
  \draw[dashed,thick](-\tdplotmaintheta:\Radius)
   arc(-\tdplotmaintheta:-\tdplotmaintheta+180:\Radius);
  \draw[thick](-\tdplotmaintheta:\Radius)
   arc(-\tdplotmaintheta:-\tdplotmaintheta-180:\Radius);
  \draw[dashed,thick]  (\Angle:\Radius) node[bullet]{} 
    -- (\Angle+180:\Radius) node[bullet]{};
 \end{scope} 
\end{tikzpicture} 
\end{document} 

enter image description here

  • That will for sure work. Thank you for bearing with me and my not so clear question, it was late at night and i had spent the whole day trying to draw this, so I was pretty fed up... I tried various things, I as not able to do much with most of them. I am a beginner to Tikz, so that is probably why :) – Shurik Apr 19 '19 at 13:17

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.