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.

enter image description here

I am trying to construct this sphere above. What I have so far is below:

\documentclass[tikz, convert = false]{standalone}

\newcommand\pgfmathsinandcos[3]{%                                                   
  \pgfmathsetmacro#1{sin(#3)}%                                                      
  \pgfmathsetmacro#2{cos(#3)}%                                                      
}
\newcommand\LongitudePlane[3][current plane]{%                                      
  \pgfmathsinandcos\sinEl\cosEl{#2} % elevation                                     
  \pgfmathsinandcos\sint\cost{#3} % azimuth                                         
  \tikzset{#1/.estyle = {cm = {\cost, \sint * \sinEl, 0, \cosEl, (0, 0)}}}          
}
\newcommand\LatitudePlane[3][current plane]{%                                       
  \pgfmathsinandcos\sinEl\cosEl{#2} % elevation                                     
  \pgfmathsinandcos\sint\cost{#3} % latitude                                        
  \pgfmathsetmacro\yshift{\cosEl * \sint}                                           
  \tikzset{#1/.estyle = {cm = {\cost, 0, 0, \cost*\sinEl, (0, \yshift)}}} %         
}
\newcommand\DrawLongitudeCircle[2][2]{                                              
  \LongitudePlane{\angEl}{#2}                                                       
  \tikzset{current plane/.prefix style = {scale = #1}}                              
  % angle of "visibility"                                                           
  \pgfmathsetmacro\angVis{atan(sin(#2) * cos(\angEl) / sin(\angEl))} %              
  \draw[current plane] (\angVis:1) arc (\angVis:\angVis + 180:1);                   
  \draw[current plane, dashed] (\angVis - 180:1) arc (\angVis - 180:\angVis:1);     
}
\newcommand\DrawLatitudeCircle[2][3]{                                               
  \LatitudePlane{\angEl}{#2}                                                        
  \tikzset{current plane/.prefix style = {scale = #1}}                              
  \pgfmathsetmacro\sinVis{sin(#2) / cos(#2) * sin(\angEl) / cos(\angEl)}            
  % angle of "visibility"                                                           
  \pgfmathsetmacro\angVis{asin(min(1, max(\sinVis, -1)))}                           
  \draw[current plane] (\angVis:1) arc (\angVis:-\angVis - 180:1);                  
  \draw[current plane, dashed] (180 - \angVis:1) arc (180 - \angVis:\angVis:1);     
}
\newcommand\DrawLongitudeCirclered[2][4]{                                           
  \LongitudePlane{\angEl}{#2}                                                       
  \tikzset{current plane/.prefix style = {scale = #1}}                              
  % angle of "visibility"                                                           
  \pgfmathsetmacro\angVis{atan(sin(#2) * cos(\angEl) / sin(\angEl))} %              
  \draw[current plane, blue, thick] (150:1) arc (150:180:1);                        
  % \draw[current plane,dashed] (-50:1) arc (-50:-35:1);  
  }%for drawing the grid                                                              
\newcommand\DLongredd[2][5]{                                                        
  \LongitudePlane{\angEl}{#2}                                                       
  \tikzset{current plane/.prefix style = {scale = #1}}                              
  % angle of "visibility"                                                           
  \pgfmathsetmacro\angVis{atan(sin(#2) * cos(\angEl) / sin(\angEl))} %              
  \draw[current plane, black, dashed, ultra thick] (150:1) arc (150:180:1);         
}
\newcommand\DLatred[2][6]{                                                          
  \LatitudePlane{\angEl}{#2}                                                        
  \tikzset{current plane/.prefix style = {scale = #1}}                              
  \pgfmathsetmacro\sinVis{sin(#2) / cos(#2) * sin(\angEl) / cos(\angEl)}            
  % angle of "visibility"                                                           
  \pgfmathsetmacro\angVis{asin(min(1, max(\sinVis, -1)))}                           
  \draw[current plane, dashed, black, ultra thick] (-50:1) arc (-50:-35:1);         
}
\newcommand\fillred[2][7]{                                                          
  \LongitudePlane{\angEl}{#2}                                                       
  \tikzset{current plane/.prefix style = {scale = #1}}                              
  % angle of "visibility"                                                           
  \pgfmathsetmacro\angVis{atan(sin(#2) * cos(\angEl) / sin(\angEl))} %              
  \draw[current plane, blue, thin] (\angVis:1) arc (\angVis:\angVis + 180:1);       
}
\newcommand\DrawLatitudeCirclered[2][8]{                                            
  \LatitudePlane{\angEl}{#2}                                                        
  \tikzset{current plane/.prefix style = {scale = #1}}                              
  \pgfmathsetmacro\sinVis{sin(#2) / cos(#2) * sin(\angEl) / cos(\angEl)}            
  % angle of "visibility"                                                           
  \pgfmathsetmacro\angVis{asin(min(1, max(\sinVis, -1)))}                           
  % \draw[current plane,red,thick] (-\angVis-50:1) arc                              
  (-\angVis-50:-\angVis-20:1);                                                      
  \draw[current plane, blue, thick] (-50:1) arc (-50:-35:1);                        
}
  \newcommand\fillred[2][9]{                                                          
  \LongitudePlane{\angEl}{#2}                                                       
  \tikzset{current plane/.prefix style = {scale = #1}}                              
  % angle of "visibility"                                                           
  \pgfmathsetmacro\angVis{atan(sin(#2) * cos(\angEl) / sin(\angEl))} %              
  \draw[current plane, blue, thin] (\angVis:1) arc (\angVis:\angVis + 180:1);       
}
\newcommand\DrawLatitudeCirclered[2][10]{                                            
  \LatitudePlane{\angEl}{#2}                                                        
  \tikzset{current plane/.prefix style = {scale = #1}}                              
  \pgfmathsetmacro\sinVis{sin(#2) / cos(#2) * sin(\angEl) / cos(\angEl)}            
  % angle of "visibility"                                                           
  \pgfmathsetmacro\angVis{asin(min(1, max(\sinVis, -1)))}                           
  % \draw[current plane,red,thick] (-\angVis-50:1) arc                              
  (-\angVis-50:-\angVis-20:1);                                                      
  \draw[current plane, blue, thick] (-50:1) arc (-50:-35:1);                        
}
\begin{document}
\begin{tikzpicture}
  \def\R{1.75} % sphere radius                                                      
  \def\angEl{10} % elevation angle                                                  
  \def\angPhi{-170} % longitude of point P                                          
  \def\angBeta{45} % latitude of point P                                            

  \filldraw[ball color = green!50, opacity = .4] (0, 0) circle (\R);
  \foreach \t in {20, 0} { \DrawLatitudeCircle[\R]{\t} }
  \foreach \t in {70} { \DrawLongitudeCircle[\R]{\t} }

  \pgfmathsetmacro\H{\R * cos(\angEl)} % distance to north pole                     
  \LongitudePlane[pzplane]{\angEl}{\angPhi}
\end{tikzpicture}
\end{document}

What I need help constructing is imax and imin circles on the sphere and the departure trajectories hyperbolas along those circles.

enter image description here

share|improve this question

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.