Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I draw the three intersection circles/ellipse with that shading paradigm (not necessarily the same colors) effectively? It appears that the original image doesn't have overlapping colors whereas I do.

  1. Is there a better way to construct the drawing of the circles/ellipse than what I have done?
  2. How can I make this a precise rotation for alignment with the equatorial
    and ecliptic plane with the x axis ray?
  3. How can I clip the circle at the origin out the all the filldraws so the blue sphere isn't over come by the background colors in it?
  4. Also, how can I create the curve arrows to the point? I know I can use controls, but my control curves never look close to that.

enter image description here

When adding in the axis, I had to fiddle with the angle of ecliptic plane in order for the equatorial and the ecliptic plane to intersect at the x axis. However, this cant be precise just close.

Here is what I have now. The clips are really sloppy but I couldn't figure out a way to clip the area concisely.

\documentclass[convert = false, tikz]{standalone}
\usepackage[utf8]{inputenc}
\renewcommand{\rmdefault}{ppl}
\linespread{1.05}
\usepackage[scaled]{helvet}
\usepackage{courier}
\usepackage{eulervm}
\normalfont
\usepackage[T1]{fontenc}
\usepackage{textcomp}

\usepackage{amsmath}
\usepackage{tikz-3dplot}
\usetikzlibrary{intersections}
\tikzset{
  partial ellipse/.style args = {#1:#2:#3}{
    insert path = {+ (#1:#2) arc (#1:#2:#3)}
  }
}
\begin{document}
\tdplotsetmaincoords{60}{130}
\begin{tikzpicture}[tdplot_main_coords,
  every lable/.append style = {font = \tiny},
  dot/.style = {outer sep = 0, inner sep = 0,
    shape = circle, label = {#1}},
  dot/.default =,
  small dot/.style = {minimum size = .1cm, dot = {#1}},
  small dot/.default =, 
  big dot/.style = {minimum size = .15cm, dot = {#1}},
  big dot/.default =
  ]
  \coordinate (O) at (0, 0);

  \def\rad{5cm}
  \def\moonangle{45}
  \def\sunangle{13.7}

  \draw[-latex] (O) -- (6.5, 0, 0) node[font = \scriptsize, pos = 1.1]
  {\(x(\gamma)\)};
  \draw[-latex] (O) -- (0, 6, 0) node[font = \scriptsize, pos = 1.05] {\(y\)};
  \draw[-latex] (O) -- (0, 0, 6.5) node[font = \scriptsize, above] {\(z\)};

  \draw (O) circle[radius = \rad];
  \draw[name path = arc] (90:\rad) arc[x radius = 3cm, y radius = \rad,
  start angle = 90, end angle = 270];
  \draw[name path = equa] (O) ellipse[x radius = \rad, y radius = 1.675cm];
  \draw[rotate = {\moonangle}, name path = moon] (O) ellipse[x radius = \rad,
  y radius = 2.25cm];
  \draw[rotate = {\sunangle}, name path = eclip] (O) ellipse[x radius = \rad,
  y radius = 1cm];

  \node[coordinate, name intersections = {of = moon and equa}] (P1) at
  ($(intersection-1)$) {};
  \node[coordinate, name intersections = {of = moon and equa}] (P2) at
  ($(intersection-4)$) {};
  \node[coordinate, name intersections = {of = moon and eclip}] (P3) at
  ($(intersection-4)$) {};
  \node[coordinate, name intersections = {of = equa and eclip}] (P4) at
  ($(intersection-4)$) {};

  \draw (P1) -- (P2);
  \draw (O) -- (P3);

  \begin{scope}
    \begin{pgfinterruptboundingbox}
      \clip (P1) -- ($(P1) + (3, -8)$) -- ($(P1) + (50, 20)$) --
      (P2) -- cycle;
    \end{pgfinterruptboundingbox}

    \filldraw[green, opacity = .3, rotate = {\moonangle}] (O)
    ellipse[x radius = \rad, y radius = 2.25cm];
    \filldraw[yellow, opacity = .3, rotate = {\sunangle}] (O)
    ellipse[x radius = \rad, y radius = 1cm];
    \filldraw[blue, opacity = .3] (O) ellipse[x radius = \rad,
    y radius = 1.675cm];
  \end{scope}

  \begin{scope}
    \begin{pgfinterruptboundingbox}
      \clip (P1) -- ($(P1) + (-20, -5)$) -- ($(P1) + (20, 40)$) -- (P2) --
      cycle;
    \end{pgfinterruptboundingbox}

    \filldraw[blue, opacity = .3] (O) ellipse[x radius = \rad,
    y radius = 1.675cm];
    \filldraw[yellow, opacity = .3, rotate = {\sunangle}] (O)
    ellipse[x radius = \rad, y radius = 1cm];
    \filldraw[green, opacity = .3, rotate = {\moonangle}] (O)
    ellipse[x radius = \rad, y radius = 2.25cm];
  \end{scope}

  \begin{scope}
    \begin{pgfinterruptboundingbox}
      \clip (O) -- (P4) -- +(1, 1) -- (P3) -- cycle;
    \end{pgfinterruptboundingbox}

    \filldraw[yellow, opacity = .3, rotate = {\sunangle}] (O)
    ellipse[x radius = \rad, y radius = 1cm];
  \end{scope}

  \filldraw[blue, opacity = .3] (O) circle[radius = .5cm];

  \draw (180:.5cm) arc[x radius = .5cm, y radius = .25cm, start angle = 180,
  end angle = 360];

  \path[name path = greenwhich] (O) -- (128.5212:\rad);
  \path[name path = moonrot] (O) -- (35:\rad);
  \path[name path = sun] (O) -- (9:\rad);
  \path[name intersections = {of = arc and greenwhich, by = P5}];
  \path[name intersections = {of = moon and moonrot, by = P6}];
  \path[name intersections = {of = sun and eclip, by = P7}];

  \draw[-latex, blue, shorten <= .3cm, shorten >= .05cm] (O) -- (P5);

  \node[fill = black, small dot = {right: }] at (P5) {};

  \draw[-latex, purple, shorten <= .3cm, shorten >= .05cm] (O) -- (P6);

  \node[fill = black, small dot = {right: }] at (P6) {};

  \draw[-latex, red, shorten <= .3cm, shorten >= .05cm] (O) -- (P7);

  \node[fill = orange, draw = orange, small dot = {right: }] at (P7) {};
  \node[coordinate, name intersections = {of = arc and equa}, fill = black,
  small dot = {left: }] (P8) at ($(intersection-2)$) {};

  \draw[-latex] (226:4.75cm and 1.55cm) arc[x radius = 4.75cm,
  y radius = 1.55cm, start angle = 226, end angle = 242];
  \draw[rotate = {\moonangle}, -latex] (332:4.75cm and 2cm)
  arc[x radius = 4.75cm, y radius = 2cm, start angle = 332, end angle = 348];
  \draw[rotate = {\sunangle}, -latex] (327:5.25cm and 1.25cm)
  arc[x radius = 5.25cm, y radius = 1.25cm, start angle = 327, end angle = 345];
\end{tikzpicture}
\end{document}

enter image description here


We can see the intersection looks good, but unless I am extremely luckily, it isn't precise.

enter image description here

share|improve this question
9  
\begin{UnproductiveComment} Your drawing looks great anyways. \end{UnproductiveComment} –  Henri Menke Aug 6 '13 at 15:29
    
@HenriMenke there is still room for improvement and some of the stuff I can't do so well like the curve arrows from the nodes to the key points or ellipses. I know controls should make them but mine never turn out so natural. –  dustin Aug 6 '13 at 15:35
    
Nice work! :-) I've been trying to figure out answers to some of your questions. Somehow I feel that it should be possible to use the TikZ 3D library to produce the ellipsoids, such that you don't have to do the y width calculations manually. I've also noticed that your sun orbit aren't on top of the moon orbit and equator ellipsoid in the small sector just right of the prime meridian. I also think you should have a slightly denser opacity (0.5?) to yield a more "3D effect" in the ellipsoids. The prime meridian should also be in a front layer. –  Holene Nov 26 '13 at 19:56
add comment

1 Answer 1

An alternative way to make complex 3D representations is to use TeXgraph.

TexGraph is a software assisting in the creation of mathematical graphs in the form of orders, and to export as text files in various formats: LaTeX (eepic macros), or pstricks or Pgf / Tikz (pgf macros), or Eps or PSF (eps + pSfrag) or pdf (eps conversion -> pdf) or svg ... There are also specific export to 3D.

share|improve this answer
add comment

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.