[Tex/LaTex] Ellipse with latitude and longitude circles in TikZ

tikz-pgf

Does anyone of you have a clever way of coding

ellipse with dashed longitude and latitude cricles

in Tikz? My own solution currently is to draw an ellipse, then to specify each dashed arc explicitly, a thoroughly plebeian technique.

Best Answer

I very much like Altermundus' solution, but if you want exactly what you drew, here's how I would do it:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\node[draw,ellipse,minimum width=4cm,minimum height=2cm] (ell) {};
\foreach \ang in {-70,-60,...,70} {
  \pgfmathtruncatemacro{\rang}{180 - \ang}
  \draw[dashed,shorten >=1pt,shorten <=1pt] (ell.\ang) -- (ell.\rang);
}
\foreach \ang in {-65,-45,...,65} {
  \pgfmathsetmacro{\xrad}{2*sin(\ang)}
  \draw[dashed] (0,1) arc [x radius=\xrad,y radius=1,start angle=90,end angle=-90];
}
\end{tikzpicture}
\end{document}

Result:

ellipse

I think that if given a little latitude in the design, then I would add a gentle curve to the lines of latitude.

Related Question