Sphere
Sphere
BERNDT E. SCHWERDTFEGER
For Thomas
P REFACE
When reading R OEGEL [4] I wondered how the drawings were designed. Working at my implemen-
tation I realized that quite effective METAPOST-code is achieved by a conceptual mathematical
approach. Application to Astronomy completes this paper.
This work is licensed under the Creative Commons Attribution 4.0 International License. To
view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter
to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
1. S PHERE DRAWINGS
D ENIS R OEGEL [4] explains how to draw correctly orthogonal projections of circles on
spheres to some tangential plane. By systematic use of Euclidean geometry auxiliary
constructions like the orientation of ellipses in [4, 4.7] are avoided and projections of
arbitrarily positioned curves of second order are achieved.
1.1. Orthogonal projection. Let a 3-dimensional real vector space V be given with Eu-
clidean scalar product v · w ∈ R and vector cross product v × w ∈ V for two vectors
v, w ∈ V . We make frequent use of the formulas:
(1)                         u × (v × w) = (u · w)v − (u · v)w           G RASSMANN
                                               ¯                    ¯
                                               ¯v 1 · w 1 v 1 · w 2 ¯
(2)             (v 1 × v 2 ) · (w 1 × w 2 ) = ¯¯                    ¯    L AGRANGE
                                                 v2 · w1 v2 · w2¯
The relation v · w = 0 says that v and w are orthogonal, short v ⊥ w.
Proof. From u, w ⊥ u×w follows Ru+Rw ⊂ Tu×w hence equality of the planes. Similarly
we get R(u × w) ⊂ Tu ∩ T w and the latter is a line since Tu 6= T w .            
Proof. From (3) follows Tu ∩ T w = R(u × w), Tu ∩ Tu×w = R(u × (u × w)), and as u × w ⊥
u × (u × w) the decomposition is even orthogonal.                                     
this factor is u ·w. Identifying Tu ' R2 , T w ' R2 the projection reads p : R2 → R2 , p(ξ, η) =
(x, y), x = ξ, y = (u · w)η. The image of a circle ξ2 + η2 = a 2 in Tu is an ellipse in T w with
equation
            x2 y 2                                                       p
(5)           +    =1                with b = |u · w|a,             ε=       1 − (u · w)2
            a2 b2
in which the excentricity also equals ε = |u × w| = |p w (u)|, as by (2) we have
                                         ¯             ¯
                 2
                                         ¯u ·u u · w ¯
          |u × w| = (u × w) · (u × w) = ¯¯             ¯ = 1 − (u · w)2 = |p w (u)|2
                                           u · w w · w¯
Some different view may assist our imagination. Let us tilt the Earth from the previous
image to the left by π/6 (30◦ ) and look at this configuration both from the direction of
vector z 1 as well as its projection to the tangential plane T z from the direction of vector
z:
                  N
                                                                                      N
    z + Tz
                                                       E
View
         z
In the next sections we will first look at great circles and then generalize to arbitrary
circles on spheres and determine their elliptical images in the tangential plane T z .
1.3. Great circles. A great circle is an intersection of a plane with the sphere, hence of
the form K (u) = Tu ∩ S for a suitable vector u ∈ S. If u · z < 0 we replace u by −u, the
circle K (u) and the ellipse p z (K (u)) do not change since Tu = T−u . So, we may assume
u · z ≥ 0.
As is well-known the invariants of the ellipse can be calculated from the coefficients of
this equation (see appendix A); this calculation is performed in section §A.2. Its simple
result let me develop the conceptual approach I am presenting here.
In particular, we obtain for the image of the unit circle the equation (5) of an ellipse with
a = 1 and b = t · u. In case b < 1 the major axis of the ellipse has the line equation
(8)                                     (z 1 · u)x + (z 2 · u)y = 0
The two intersection points of the ellipse on the circumference x 2 + y 2 = 1 lie on the
major axis. We need not calculate them as the equation (8) gives us the angle of the
major axis and we can draw both half ellipses on the front and back side of the sphere.
As example serves a drawing of the sphere viewed
from the direction t = g (ϕ, λ) with coordinates
ϕ = 30◦ , λ = 25◦ and for vectors u = e 1 , u = e 2 and
u = e 3 (North pole) with the corresponding great
circles Tu ∩ S.
In this drawing I made the sphere transparent to
show the complete ellipses including the hidden
traces on the back side. The METAPOST code is
listed in the appendix §C.1, the employed macro
circle is explained in appendix §C.2.
points where it crosses the border ∂S≥          z = T z ∩ S, that is we want to determine the in-
tersection of the ellipse p z (K (s, u)) with the circumference. The adjacent figure is a
cross section through the sphere with the plane
Rz ⊕ Ru and we can read off the condition from                            u    z
it: the ellipse p z (K (s, u)) intersects the unit cir-                                     Tu
cle x 2 + y 2 = 1 in T z if and only if |z · u| ≤ c                              c
or equivalently |s| ≤ ε. The intersection points                          u
                                                                       z·                     Tz
p z (K (s, u)) ∩ S = {z 3 , z 4 } are osculation points of
the ellipse with the surrounding circle. We can
calculate z 3 , z 4 from the circle and ellipse equa-
tions, but a conceptual approach is available.
For that purpose a parameter d with −1 < d < +1 is introduced and the following ques-
tion asked:
                                      Which ellipse of excentricity ε can be inscribed into the
                  z2                  unit circle
                                                p such that it touches the circle at the points
                                      z 3,4 = (± 1 − d 2 , d ) ?
z4                              z3    The ellipse with center C = (0, y 0 ) (where y 0 = sε) and
                 d
                                      excentricity ε has the equation
                               z1                          (y − y 0 )2
                                                        x2 +           = a2
                                                             1 − ε2
                                      and at an osculation point its tangent has to equal the
                                      tangent of the circle, thus
                                                               d − y0
                                                                      =d
                                                               1 − ε2
hence y 0 = ε2 d and consequently the connection to the parameter s = εd , d = s/ε.
Moreover its semi-major axis results to
                               (d − ε2 d )2
              a2 = 1 − d 2 +                = 1 − d 2 + d 2 (1 − ε2 ) = 1 − d 2 ε2 = 1 − s 2 = c 2
                                 1 − ε2
Now we interpret the drawing above invariantly under movement. To this end we view
the METAPOST-plane as complex line T z ' C and the rotations as multiplications by
complex numbers ζ of absolute value |ζ| = 1, i.e. z 1 = 1 und z 2 = i . The osculation
points z 3 , z 4 are symmetric to the unit vector ζ = p z (u)/ε.    p In the drawing above          p we had
ζ = z 2 = i , hence
                p      the general formula is z 3,4 = ζ/i · (± 1 − d , d ) or z 4 = ζ · (d , 1 − d 2 ),
                                                                             2
     p z (K (sin ψ, u)) are drawn accounting for their visibility. We then have s = sin ψ, c =
     cos ψ and the condition for intersection |z · u| ≤ c is equivalent to | sin ψ| ≤ ε.
2. A PPLICATION TO A STRONOMY
     The examples in section §1 visualised the globe with its geographical coordinate grid.
     Now we are going to devise and comprehend drawings common in astronomy. In this
     context the sphere S ⊂ V plays the role of the celestial sphere above us.
     We explicate customary coordinate systems and orbital elements of celestial bodies like
     satellite orbits in the planetary system.
     2.1. Celestial coordinate systems. To determine the position of a celestial body a sys-
     tem of coordinates is necessary. To this end spherical coordinates are useful besides
     rectangular Cartesian coordinates. They are introduced as follows.
                       Let ϕ = ∠(p e (v), v) be the angle between p e (v) ∈ E and v, hence p e (v) · v =
                       x 2 + y 2 = |p e (v)||v| cos ϕ, thus r e = r cos ϕ, therefore
ze  v
    ϕ                          x = r cos ϕ cos λ            y = r cos ϕ sin λ           z = r sin ϕ
 O pe (v)
                                            v = xe 1 + ye 2 + ze = r g (ϕ, λ)
     Astronomical coordinate systems are thus constructed like the geographical coordinate
     system. In astronomy different reference planes and axes are used, for instance
           System        O          E          e         e1        e2            ϕ              λ
         horizontal       ♁      horizon     zenith    South     West      elevation h      azimuth A
         equatorial     ♁, ¯     equator     North              e × e1   declination δ    right asc. α
          ecliptical      ¯      ecliptic     ENP               e × e1     latitude β     longitude λ
2.2. Orbital elements. We handle the task to describe the orbits of celestial bodies by
orbital elements and draw the orbit on the celestial sphere with METAPOST. The ref-
erence system is chosen as the orthogonal pair (E , e) consisting of the ecliptical plane E
and the ecliptical north pole (ENP) e. In addition we take e 1 as above pointing to the
vernal equinox  and e 2 = e × e 1 . The rectangular coordinates refer to this base. By
choice we take as origin O = ¯ the sun, or in case of terrestrial satellites O = ♁ the Earth.
The considered heavenly body moves in a plane Tu with u as unit vector of the orbital
angular momentum. Let the inclination angle of E and Tu be i , i.e. e · u = cos i . We
have e · u ≥ 0 for 0 ≤ i ≤ π/2 and e · u < 0 (retrograde revolution) for π/2 < i < π. As by
definition i is the pole distance of u we have β(u) = π/2 − i .
The line E ∩Tu is called line of nodes, the two points E ∩Tu ∩S = {, } are the ascending
and descending node of the orbit. The ecliptical longitude Ω = λ() is the longitude of
the ascending node. From this it follows that λ(u) = Ω − π/2 and hence the ecliptical
coordinates of u are
           u = g (β(u), λ(u)) = g (π/2 − i , Ω − π/2) = (sin Ω sin i , − cos Ω sin i , cos i )
In the orbit plane Tu we choose u 1 , u 2 such that u 1 points to the periapsis. Let ω be the
longitude of the periapsis from the ascending node measured in the orbital plane.
By appendix §B.1 we have for the base change
                               (u 1 , u 2 , u) = (e 1 , e 2 , e)ρ 3 (Ω)ρ 1 (i )ρ 3 (ω),
hence for a vector v = xe 1 + ye 2 + ze = x 0 u 1 + y 0 u 2 + z 0 u the coordinate transformation
rule is
                           (x 0 , y 0 , z 0 ) = (x, y, z)ρ 3 (Ω)ρ 1 (i )ρ 3 (ω).
Therefore the ecliptical coordinates are (x, y, z) = (x 0 , y 0 , z 0 )ρ 3 (−ω)ρ 1 (−i )ρ 3 (−Ω) and we
have
     u 1 = (cos ω cos Ω − sin ω cos i sin Ω, cos ω sin Ω + sin ω cos i cos Ω, sin ω sin i )
     u 2 = (− sin ω cos Ω − cos ω cos i sin Ω, − sin ω sin Ω + cos ω cos i cos Ω, cos ω sin i )
      u = (sin i sin Ω, − sin i cos Ω, cos i )
u 1 , u 2 are the G AUSS vectors of [3, 1.3.1]: u 1 = P , u 2 = Q.
When writing u 1 = G(ω, i , Ω) as function of ω, i , Ω, then we have
          u 2 = G(ω + π/2, i , Ω)                u = G(π/2, i + π/2, Ω) = g (π/2 − i , Ω − π/2)
and G(ν + ω, i , Ω) = cos(ν)u 1 + sin(ν)u 2 .
   2the excentricity ε will not occur in section §2.1
8                                       BERNDT E. SCHWERDTFEGER
Here is a drawing with the values i = 30◦ , Ω = 35◦ , ω = 43◦ viewed from the perspective
of z = g (ϕ, λ) with ϕ = 25◦ , λ = 28◦ . Of course these values are arbitrary, in the appendix
§C.3 the METAPOST-code is documented.
                                                         e
                                                                               u2
                                   u
u1
Ω i
2.3. Orbit projection. After having explained the orbit elements we want to draw the
orbits of celestial bodies themselves by orthogonal projections. In general, these orbits
are not circular, but according to the gravitational law planar curves of second order (at
least approximately, up to perturbations). The difference to the previous section §2.2 is
thus, that we are looking for a drawing with METAPOST of p z (K ) where K ⊂ Tu is the
real orbit in space.
                                                 R2
                                                         ∼   / Tu
such that for all (ξ, η), (x, y) ∈ R2 with p z (ξu 1 +ηu 2 ) = xz 1 + y z 2 the relation (x, y) = (ξ, η)·
m(p z |Tu ) is satisfied.
We apply the calculation of the transition matrix in §B.2 to E = Tu , E 0 = T z and the trans-
formation t = p z |Tu . For w ⊥ z we have p z (v) · w = v · w, hence by (15) the transition
matrix is                                   µ                ¶
                                             u1 · z1 u1 · z2
                              m(p z |Tu ) =                    .
                                             u2 · z1 u2 · z2
Its determinant is det m(p z |Tu ) = (u 1 × u 2 ) · (z 1 × z 2 ) = u · z by (2).
                                 SPHERICAL DESIGN WITH METAPOST                                      9
Let us look at an orbit in its orbit plane Tu . Let E be the ecliptic and e the unit vector to
the ecliptical north pole. The focus F is in the origin, the vector u 1 points at the periapsis
P (A is the apoapsis). The ascending node  has the angle ω with u 1 and the descending
node  the angle π − ω. Recall by (8) that the line of nodes Te ∩ Tu is given in Tu by the
equation (u 1 · e)ξ + (u 2 · e)η = 0. The yellow part is above the ecliptic, the grey one below.
                                                                                u2
                                                                                     u1
               A                  a                              εa                       P
                                                     C                       F
                                                                                 P
                                                                 F
The invariants of plane curves of second order (like ellipses) follow readily from the coefficients of
the equation of the curve. This applies in particular to major and minor semi-axes a and b, as well
as to the line equations of major and minor axis. The knowledge of these invariants immensely
facilitates the METAPOST-drawing. The relevant formulas are collected here, for details see the
article [5].
A.1. Invariants of curves of second order. A plane curve of second order ist given by an equation
(10)                    a 11 x 2 + 2a 12 x y + a 22 y 2 + 2a 13 x + 2a 23 y + a 33 = 0
10                                               BERNDT E. SCHWERDTFEGER
where the coefficients a i k are subject to a common factor. The characteristic polynomial of the
curve is            ¯                     ¯
                    ¯a 11 − X       a 12 ¯¯
                    ¯
                    ¯ a                     = X 2 − t 33 X + A 33 = (X − λ1 )(X − λ2 )
                         12      a 22 − X ¯
                                              2 . Its roots are the eigenvalues λ , λ . They are determined
where t 33 = a 11 +a 22 , A 33 = a 11 a 22 −a 12                                 1 2
up to an arbitrary factor: if you multiply (10) by q the new eigenvalues become q · λ1 , q · λ2 . The
sign of the coefficients will be chosen such that t 33 ≤ 0 and the eigenvalues will be numerated
such that λ1 ≥ λ2 . We are concerned with the elliptic case A 33 > 0 only. We quote the formulas
for the semi-axes
                              s                       s
                            1     D                1     D
(11)               a =−                , b=−                                   [5, (2.14-15)]
                           λ1 −λ2                 λ2 −λ1
Here D = det(a i k ) is the determinant of the coefficients and C = (x 0 , y 0 ) is the center of the curve:
                           A 13            A 23
(13)                x0 =        ,   y0 =                                                   [5, (2.32)]
                           A 33            A 33
A.2. Calculation of invariants of ellipse equation. We apply the theory above to the ellipse equa-
tion (7) in section §1.3. With the conventions of §A.1 its coefficients are
           a 11 = −(z 2 · u 1 )2 − (z 2 · u 2 )2          a 12 = (z 1 · u 1 )(z 2 · u 1 ) + (z 1 · u 2 )(z 2 · u 2 )
                               2              2
           a 22 = −(z 1 · u 1 ) − (z 1 · u 2 )            a 33 = ((z 1 · u 1 )(z 2 · u 2 ) − (z 1 · u 2 )(z 2 · u 1 ))2
           a 13 = 0                                       a 23 = 0
This implies already A 13 = A 23 = 0 and the center of the ellipse by (13) is the origin C = (0, 0).
We will simplify the other coefficients by exploiting the fact that z, z 1 , z 2 and u, u 1 , u 2 are or-
thonormal bases. For example we have v = (v ·u)u +(v ·u 1 )u 1 +(v ·u 2 )u 2 for any v ∈ V. This yields
for v = z 1 , z 2 because of z 1 · z 2 = 0 the relation (z 1 ·u)(z 2 ·u)+(z 1 ·u 1 )(z 2 ·u 1 )+(z 1 ·u 2 )(z 2 ·u 2 ) = 0,
hence a 12 = −(z 1 ·u)(z 2 ·u). Similarly ensues the relation z 1 ·z 1 = (z 1 ·u)2 +(z 1 ·u 1 )2 +(z 1 ·u 2 )2 = 1,
hence a 22 = (z 1 ·u)2 −1, and in the same manner we obtain a¯ 11 = (z 2 ·u)2 −1.¯ By using z = ±z 1 ×z 2 ,
                                                                        ¯z · u      z 1 · u 2 ¯¯
u = ±u 1 × u 2 we have by (2) z · u = ±(z 1 × z 2 ) · (u 1 × u 2 ) = ± ¯¯ 1 1                   , hence a 33 = (z · u)2 .
                                                                         z ·u   2   z ·u ¯
                                                                                     1       2    2
We have a 11 − λ1 = (z 2 · u)2 − 1 + (z · u)2 = −(z 1 · u)2 . The equation of the major axis by (12) is
−(z 1 · u)2 x − (z 1 · u)(z 2 · u)y = 0, which for z 1 · u 6= 0 can be simplified to (z 1 · u)x + (z 2 · u)y = 0.
Remark: this line equation is also valid for z 1 · u = 0.
A.3. Equation and invariants in general position. We do not need the equation for the ellipse
p z (K (s, u)) ⊂ T z , but it is easy enough to write down.
which can be treated as in the previous section §A.2. This yields an equation (10) with the coeffi-
cient matrix
               a 11 a 12 a 13         (z 2 · u)2 − 1  −(z 1 · u)(z 2 · u)   s(z 1 · u)
                                                                                      
             a 12 a 22 a 23  = −(z 1 · u)(z 2 · u)  (z 1 · u)2 − 1       s(z 2 · u) 
               a 13 a 23 a 33           s(z 1 · u)        s(z 2 · u)      (z · u)2 − s 2
which has the same eigenvalues as in §A.2, in particular A 33 = (z · u)2 . The cofactors A 13 and A 23
are
            ¯−(z 1 · u)(z 2 · u) (z 1 · u)2 − 1¯                                    2
            ¯                                  ¯              ¯                        ¯
                                               ¯ = s(z 1 · u) ¯−(z 2 · u) (z 1 · u) − 1¯ = s(z 1 · u)(z · u)2
                                                              ¯                        ¯
    A 13 = ¯¯
                 s(z 1 · u)        s(z 2 · u) ¯               ¯   1          (z 2 · u) ¯
            ¯−(z 1 · u)(z 2 · u) (z 2 · u)2 − 1¯                                    2
            ¯                                  ¯              ¯                        ¯
                                               ¯ = s(z 2 · u) ¯−(z 1 · u) (z 2 · u) − 1¯ = s(z 2 · u)(z · u)2
                                                              ¯                        ¯
    A 23 = ¯¯
                 s(z 2 · u)        s(z 1 · u) ¯               ¯   1          (z 1 · u) ¯
The determinant D is
           D = a 13 A 13 + a 23 A 23 + a 33 A 33 = (z · u)2 s 2 (z 1 · u)2 + s 2 (z 2 · u)2 + (z · u)2 − s 2 =
                                                           ¡                                                ¢
= (z · u)4 (1 − s 2 ) = (z · u)4 c 2 .
y 0 = −x sin ϕ + y cos ϕ
                                                              cos ϕ        − sin ϕ
                                                             µ                       ¶
                                                 ρ(ϕ) =
                                                               sin ϕ       cos ϕ
                                               (x 0 , y 0 ) = (x, y) · ρ(ϕ)
                                              (e 10 , e 20 ) = (e 1 , e 2 ) · ρ(ϕ)
B.2. Transition matrix. We consider two planes E , E 0 with given base vectors e 1 , e 2 resp. e 10 , e 20 . A
linear transformation t : E → E 0 is determined by the images t (e 1 ) and t (e 2 )
                                                       t (e 1 ) = ae 10 + be 20
                                                       t (e 2 ) = ce 10 + d e 20
12                                               BERNDT E. SCHWERDTFEGER
In the diagram
                                      R2
                                                ∼   /E               (x, y) 7→ xe 1 + ye 2
(14)                              m(t )                   t
                                                     
                                      R2
                                                ∼   / E0         (x 0 , y 0 ) 7→ x 0 e 10 + y 0 e 20
My first calculations that led to this article have been done in April 2010, after acquiring in Febru-
ary the new edition of The LATEX Graphics Companion [1] and admiring in particular the drawings
by R OEGEL ([1, lunar orbit, page xx], [4]). These calculations aimed at making the rather smart
METAPOST constructions by ROEGEL unnecessary and replace them by mathematical concepts.
C.1. Transparent sphere with great circles. The definition of halfell(a, b, θ) describes half an
ellipse with center (0, 0) and semi-axes a, b, which has been rotated by θ. By the line equation (8)
of the major axis (z 1 · u)x + (z 2 · u)y = 0 the angle results to θ = angle(−(z 2 · u), (z 1 · u)).
In section 1.2 we introduced spherical coordinates
                                      z = g (ϕ, λ) = (cos ϕ cos λ, cos ϕ sin λ, sin ϕ)
                              z 1 = g (0, λ + π/2) = (− sin λ, cos λ, 0)
                             z 2 = g (ϕ + π/2, λ) = (− sin ϕ cos λ, − sin ϕ sin λ, cos ϕ)
These are used in the METAPOST code in the macro circle as function g(phi,lambda). circle
is explained in §C.2. The essential part here is
% -------------------------------
% Figure 5 -- great circles, parametrized
% -------------------------------
beginfig(5);
phi:=30;                               % latitude
lambda:=25;                            % longitude
vector e[];
e1=(1,0,0);
e2=(0,1,0);
e3=(0,0,1);
draw fullcircle scaled 2a;
circle(e1,0,a,3);
circle(e2,0,a,3);
circle(e3,0,a,3);
endfig;
                                  SPHERICAL DESIGN WITH METAPOST                                       13
C.2. Circles in general position. The METAPOST code is in fact very simple:
% -------------------------------
% Figure 8 -- circles of latitude
% -------------------------------
beginfig(8);
phi:=15;                                %                 latitude
lambda:=50;                             %                 longitude
vector e[];
e1=(1,0,0);                             %                 vector e1, pointing to vernal equinox
e2=(0,cosd(del),-sind(del));            %                 vector e2, axial tilt
e3=(0,sind(del),cosd(del));              %                vector e3 as North pole, axial tilt
draw fullcircle scaled 2a;
circle(e1,0,a,3);
circle(e2,0,a,3);
circle(e3,0,a,3);
for psi:= 23.5,45,66.5, -23.5,-45,-66.5:
    circle(e3,psi,a,2);                 %                 circles of latitude psi
endfor;
endfig;
The parameter s is chosen now as s = sin ψ with −π/2 < ψ < +π/2, c = cos ψ. A circle in general po-
sition K (sin ψ, u) is projected by p z into an ellipse, which is drawn by the macro circle(u, ψ, a, f )
in the METAPOST-plane T z .
In the case of great circles (ψ = 0) we use the simplification from section C.1. In case of intersec-
tion points of p z (K (s, u)) with x 2 + y 2 = 1 we use the formulas (9) for the definition of the vectors
z 3 , z 4 . We form the intersection of the lines from the center of the ellipse to the intersection
points z 3 , z 4 , take their time parameters (intersectiontimes) c 3 , c 4 and draw continuously the
visible part of the ellipse corresponding to the arc K (s, u) ∩ S≥  z on the visible hemisphere (path
p 1 ) and draw the invisible part which matches the invisible arc K (s, u) ∩ S<   z in dashed line (path
p 2 ). You will notice some fine points in the code concerning the visibility of the ellipses in case of
non-intersection.
The parameter a serves for scaling (size unit). The parameter f serves as flag: f = 0 draws only
the visible path p 1 , f = 1 draws also the vector p z (u) (path p 0 ), f = 2 draws the invisible path p 2
(dashed evenly) and f = 3 draws both.
% --------------------------------------------------------------------
%   circle parms
%   u: input vector u, to be projected via z=g(phi,lambda)
%   psi: latitude relative to vector u in range -90 < psi < + 90
%   a: size, scale unit
%   f: flag f=0,1,2,3
%           f=0 draws only the visible path p1
%           f=2, 3 draws the invisible path p2
%           f=1, 3 draws vector path p0 to p_z(u)
% --------------------------------------------------------------------
def circle(expr u,psi,a,f)=
    numeric s, c, e, c[]; path p[]; pair q[];
     c0=dot(u,g(phi,lambda));
     c1=dot(u,g(0,lambda+90));
     c2=dot(u,g(phi+90,lambda));
          if (c0>0):
              p1=p3; p2=p4;
          else:                                   % if (z.u)<0 we interchange visible and invisible
              p1=p4; p2=p3;
          fi
     fi
     draw p1;
     if (f>1):
         draw p2 dashed evenly;
     fi
     if (f=1) or (f=3):
         drawarrow p0 dashed evenly;
     fi
enddef;
C.3. Orbital elements. To be able to mark the vectors p z (u) with labels the coordinates (in the
METAPOST-plane) that have been calculated inside the macro circle are stored in the global
variable w$. The G AUSS vector u 1 = G(ω, i , Ω) is denoted by the function G(omega,incl,Omega).
In other respects the code is straightforward.
% -------------------------------
% Figure 12 -- orbital elements
% -------------------------------
beginfig(12);
phi:=25;                                          % latitude
lambda:=28;                                       % longitude
                                 SPHERICAL DESIGN WITH METAPOST                                        15
endfig;
                                            R EFERENCES
[1] Michel Goossens, Frank Mittelbach, Sebastian Rahtz, Denis Roegel, and Herbert Voß, The LATEX Graphics
    Companion, 2nd ed., Tools and Techniques for Computer Typesetting, Addison–Wesley, 2008.
[2] Donald E. Knuth, The METAFONTbook, Addison–Wesley, 1992.
[3] Oliver Montenbruck, Grundlagen der Ephemeridenrechnung, Spektrum Akademischer Verlag, 2005.
[4] Denis Roegel, Spheres, great circles and parallels, TUGboat 30 (2009), no. 1, 80–87.
[5] Berndt E. Schwerdtfeger, Invariants of Curves of second order (2013), available at http:
    //berndt-schwerdtfeger.de/wp-content/uploads/pdf/c2.pdf.
                                                                                                    I NDEX
               A                                                                                             longitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
astronomical coordinates . . . . . . . . . . . . . . . . . . . . . . . 6                                       ascending node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
automnal equinox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7                               periapsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
axial tilt of ecliptic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
                                                                                                                          M
           B                                                                                                 major axis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4, 10
base change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
                                                                                                                                N
                  C                                                                                          node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7, 9
canonical decomposition . . . . . . . . . . . . . . . . . . . . . . . 2
                                                                                                                          O
celestial mechanic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
                                                                                                             obliquity of the ecliptic . . . . . . . . . . . . . . . . . . . . . . . . . . 7
celestial sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
                                                                                                             orbit element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
center . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4, 10
                                                                                                             orbit of celestial bodies . . . . . . . . . . . . . . . . . . . . . . . 7, 8
center of ellipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
                                                                                                             orbit plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7, 8
characteristic polynomial . . . . . . . . . . . . . . . . . . . . . . 10
                                                                                                             orbit projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 12
C RAMER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
                                                                                                             orbital angular momentum . . . . . . . . . . . . . . . . . . . . . 7
          D                                                                                                  orbital elelments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
determinant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10                       orbital elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
                                                                                                             orthogonal complement . . . . . . . . . . . . . . . . . . . . . . . . 2
                  E                                                                                          orthogonal decomposition . . . . . . . . . . . . . . . . . . . . . . 2
ecliptic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9             orthogonal pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
ecliptical north pole ENP . . . . . . . . . . . . . . . . . . . . . . . . 7                                  orthogonal projection . . . . . . . . . . . . . . . . . . . . . . 1–3, 8
ecliptical noth pole ENP . . . . . . . . . . . . . . . . . . . . . . . . . 9                                 orthogonal vectors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
eigenvalues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10                     orthonormal basis . . . . . . . . . . . . . . . . . . . . . . . . . 2, 3, 10
ellipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2, 9
   p z (K (s, u)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4, 5, 10                                   P
   p z (K (u)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3               parallels of latitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
elliptic case A 33 > 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10                            partly visible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
                                                                                                             periapsis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7, 9
equation of ellipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
                                                                                                             planar curve of second order . . . . . . . . . . . . . . . . . . . . 8
   p z (K (u)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
                                                                                                             pole distance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
equatorial plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
example                                                                                                                  R
   general circles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5                       reference system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
   orbit with orbit elements . . . . . . . . . . . . . . . . . . . . . . 8                                   rotation matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
   transparent sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
excentricity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2                                    S
                                                                                                             satellite orbits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6
                   F                                                                                         sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2, 6
focus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9            spherical coordinates . . . . . . . . . . . . . . . . . . . . . 2, 6, 12
                                                                                                             spherical transformation formula . . . . . . . . . . . . . . . 7
              G
G AUSS vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7                                        T
geographical coordinates . . . . . . . . . . . . . . . . . . . . . 2, 6                                      tangential plane . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–3
G RASSMANN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1                       transformation
great circle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3                   METAPOST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
grid of parallels and meridians . . . . . . . . . . . . . . . . . . 3                                          linear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
                                                                                                             transformation rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
            H                                                                                                transition matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8, 12
hidden trace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
horizon system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6                                      U
                                                                                                             unit vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
                 I
inclination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7                                     V
invariants of ellipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4                          vernal equinox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
invariants of planar curves of 2. order. . . . . . . . . . .9                                                visible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
invisible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
                 L
L AGRANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
latitude . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
left-system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
line of nodes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7, 9
                                                                                                      16