TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to draw properly parallels of a sphere properly? The equator is ok:

\documentclass{article}    
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\fill[ball color=blue!20] (0,0) circle (1.5);
\draw [thick,dotted] plot [domain=0:pi] ({1.5*cos(\x r)},{0.2*sin(\x r)},0);
\draw [thick] plot [domain=pi:2*pi] ({1.5*cos(\x r)},{0.2*sin(\x r)},0);
\end{tikzpicture}
\end{document}

Yet the other parallels are tricky to put in place.

share|improve this question
    
What does "parallels of a sphere" mean? – Hans-Peter E. Kristiansen Apr 5 '14 at 5:15
1  
    
I mean circles of latitude, like on the Earth. – Papagon Apr 5 '14 at 5:18
up vote 7 down vote accepted

This is one way to do it:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\fill[ball color=blue!20] (0,0) circle (1.5 cm);
\newcommand\latitude[1]{%
  \draw (#1:1.5) arc (0:-180:{1.5*cos(#1)} and {0.2*cos(#1)});
  \draw[dashed] (#1:1.5) arc (0:180:{1.5*cos(#1)} and {0.2*cos(#1)});
}
\latitude{30};
\latitude{0};
\latitude{-30};
\end{tikzpicture}
\end{document}  

latitudes

It can be improved, by making the radius(1.5 and 0.2) variables.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.