### Non-Euclidean geometry

The conventional geometry derived from Euclid's axioms is that of flat space (what you learnt about at school). In the more general form of non-Euclidean geometry, the fifth axiom is dropped, and curved spaces are allowed. Spherical geometry is the simplest example; it is the geometry of a space of constant positive curvature. In such geometries the objects we need identify are some space containing the points (verticies) in question, and some way of measuring distance between them. From this, you can define straight lines as being paths of minimal distance between points (geodesics). Given this, you can form polygons and measure angles.

### Spherical geometry

The space in question will be the unit sphere S2 considered as a two dimensional subset of three dimensional space (formally, S2 = {(x,y,z) | x2+y2+z2=1}). On it, straight lines will be considered as intersections of planes that pass through the origin with the sphere - ie. they are great circles. Between any two distinct points, we can define a unique geodesic between then as being the shorter of the two arcs of the great circle which joins them. (Unique because the two points plus the origin define a unique plane in R3. It can be shown to be of the shortest distance either by elementary analytic means, or by using the Euler-Lagrange equations.). Note that if two vectors a and b point to two points on the sphere, and l is their spherical distance of separation, then a·b = cos(l).
Then, the angle between two such lines is just the angle between the two planes that define them. Note that because of this, the sum of the angles at a point is still 2π.

# Sum of the interior angles of a triangle

Suppose we have some triangle on the sphere with angles α,β,γ. Is there any interesting expression for their sum, like in the Euclidean case?
To answer this, first consider the notion of a double lune: this is the area enclosed by two great circles at some (interior) angle θ to each other).
```

-x######;,
X###########
######-   .#####
;;###,.      -;###=
-+##x        . ###=
;=##+          x##=
;=##+-=+++xx=x+###=
..,,                  ;=################=
+################               ;=##=  ,,;,,.;;X##=
;###################X=.            ;=##+          X##=
######=-,,.......,;=X####x+.         -=##x        x-###;
.=###++,.,,,;;;;;;,,,.;-X#####+=       -=###        #x#x#
#####x.,,;-------------;..,,######,.      #####.    ,### ;
,;###xx;,-------------------;,,,-#####+.    .-###########x
;;======+++=-;xx#X# -,;---------------------;;,==######      =x######X=
+=x####################x+ . ..,,;-------------------;;,,++#####+
xx#########XXXXXXXXxXX######xX+==-..    ....,,;;;;;------;,;.-+x####X.
,x######x=-;........   ;-################Xxx+=-;,,.......,,,;;;;,,.-+x###,.
,#####x,;..,,;;------;-;###X#=+=++X####################XX--;,,....,,.;.X####;
####X;,,.;;-----------;=+#####  .;,,,,;--=++X###################++=;;.. ;-X###=,
,-###X=-.;;--------------;-=###+x                 ,-####---+X###########+=;...+X###
. XX###;;;;---------------;;-x###-;                   -###X+  ....--x#########x;,;X###+;
---###x+.;-----------------,++###-                        ###x=;.;,,... ,--x#####X+.-+###
++X###--;------------------.Xx###                          x####.-;----;;,....-+####x-###;=
, Xx###=;;-------------------.XX#XX                          ,,###-+;---------;;,;-X####xX##x,
-.###x+,;--------------------.Xx#+x                            #X#++;;-----------;,;;+X####### .
-.#X#++,--------------------- Xx#+x                            =+##X=;-------------;,,==###### .
==,#X#=+,--------------------- xx#xX                             -x##x,---------------;;,X##### =
+=.###=+,-------------------;-.#X#xX                             .-##X,-----------------,-+#### ;
++;###==,-------------------;=-###-=                             ,-##X.-----------------;,==#X#
++-#X#,-;-------------------;++### .                             ;-##X.------------------,==###
+x=#xX.-;------------------;-+X###                               ,-##X.------------------,==###
=+=#xx ;;------------------;-+X###                               ;-##X.------------------,==###
+x+###-=;------------------;-+X###                               ;-##X.------------------,+=### .
xXx###+x,------------------;-+X###                               ;=##X.------------------,+=### ;
xXx###++,------------------;-+X###                               ;-##X.------------------,=-### -
+Xx###++,------------------;;++###                               ,-##X.------------------;=-### -
,XX###++,-------------------,==###.,                             .=##X,------------------;=-### -
=;###Xx--------------------,=-###==                             -###X,------------------;=-### ;
, ####X=;------------------;==###=+                            x+###x,------------------;=-### -
#x###+;-;----------------;==###=+                            ####X-;------------------;=-### -
=+####--;----------------;=;###+x,                         --###-+,;------------------;=-### -
-+###++.----------------;-,#X#++-                         =X###.=;-------------------;=-### -
###xx.------------------,XX#XX-,;                      X###x+.---------------------;=-### ;
xx###;-;----------------,+x###+-=                    ..###--,;---------------------;=-### -
.,###x-;;---------------;;-x###=+                    -=###,-;----------------------;=-### -
=###==.----------------;-;###xx,.                  ###xx.------------------------;=-### ;
####x ,;----------------,xx###==+                +##X-;;-----------------------;,--### .
;-###+=;,---------------,;;x###XX-=            =+###=-;----------------------;;,;=x###
-####x.;,;-------------;,,+x###;=,           #X#xx.;------------------;;,,..,,x####+
,-###x+-,;;;------------,-,###++;           ###++,------------------,,,;--x#####;-
X#####==,.;;------------,+X###x ,       -x###--;----------------;;,xX#######+=
######--.,,;---------;;+x###-+.   , +x###+;;---------------;.-=X######x=
-#####x-; .,,;------;-,#####=., . #x#x+,;-------------;,.;.#####x-;
X######x+,;,;;;---; ++###X .   ###++,;----------;;,;,=#####==.
X######x-;,.,,,;,,;=###-- ;.###;-;--;;;;;,,,.,,;+x####xx
########+=-,,, . ++###x###+- ..---,....;-=######X#..
;##########X==;--x#####=-;;-;-=##############+,,
.=X###################################XX-
.;-xxx##########################x,

```
The area of such a shape is 4θ (since the area must be proportional to θ, and is equal to 4π when θ = π).
So imagine placing three lunes at the corners of the triangle, such that their angles match with those of the triangle. Now try and visualise the area they cover: it is the area of the sphere plus four times the area of the triangle. By adding area, we then get the result:
Propostition: For a spherical triangle of area A and with angles α,β and γ, α+β+γ = A + π
Quite neat. Note that when we look at small regions of the sphere, which are approximately planar, A is small for some triangle in the region, and so the Euclidean formula becomes more and more accurate. The result can easily be generalised to (convex) polygons, since an n-gon can be subdivied into n-2 triangles (draw lines from one vertex to all the others). By counting the angles and adding areas, we get:
Proposition: For a spherical convex polygon of area A and angles α12,...,αn, A = ( (sum over i) αi) - (n-2)π

# Euler characteristic

From this, you can prove that the Euler characteristic of a sphere is 2, independent of its polygonal decomposition: let the polygons be called Pi, each having ni edges and interior angles summing to βi. Then
• 2πV (verticies) = (sum over i) βi
• 2E (edges) = (sum over i) ni
• F (faces) = # of polygons
Then by summing the previous formula over all faces,
Area of sphere = 4π = (sum over i) βi -(ni-2)π = 2πV - 2πE + 2πF
So V-E+F=2

# Cosine rule and Pythagoras's Theorem

To produce some kind of equivalent of the cosine rule, we'll need some way of relating the angles of the triangle to the lengths of its edges. A good starting point is to take three vectors a,b,c in R3 which point to the three verticies of the triangle. Say that the side side opposite to a has length x (similar definitions follow for y and z), then from the result stated above we obtain the three side lengths by:
x = b·c
y = a·b
z = c·a
Now, find a way to express the angles of the triangle in terms of a,b and c: do this by defining normals to the planes defining the three side of the triangle:
n1 = b×c/sin(x)
n2 = c×a/sin(y)
n3 = a×b/sin(z)
They should all be outward point normals, if not, then interchange the labels a,b and c such that they are. Now to relate these to the angles. Using simple three dimensional geometry,
n1·n2 = -cos(γ)
n2·n3 = -cos(α)
n3·n1 = -cos(β)
where α,β and γ are the respective angles at points a,b and c.
```

;+##
.+###,. #####-
.=###,##########
-x####-;     .-X##=####.+-### .
.+##########     .=X##### , , #X# .
.                                                                                            -=############# -    =###### . - #X# , =-######--
x####=.XX#-++##++    -X###X#   ; ###.= ########## .
,  ;;### .;####-     #XX..   , ###=x;###+ =-#X# ,
#####   #####.              -,X   ,.   --#x# .
+##x;      +,                         ;x###-x
;-###,.                              , ###### ;
#X###                                  ######x#
. ###x#                                     ;;#X# ,
....                              ,;-;;,------------------------,,        =-# .                             +X##X   =-#x# ,
.                                    ..##########+##-;                 ;=+=-,.   -=+===============+++++++++++;,                                     ############# .
=###############+-              -=x=-     ,;-=--------------------------==+xxx+;.                                  =#######x
###+=      #X###x;          .-=+=-.   .;--==----------------------------------==++==.
###         .####;      ,;-==+==.. ,,--==-----------------------------------------==+==
###,;       .####=  .-==+====-;,  ,--=-----------------------------------------------=+--
########+Xx######x=-====----=;;...-----------------------------------------------------=+=,.
+X##########X###Xx;---------.. ..=------------------------------------------------------=--..
.--==-,. xx#Xx,-------;- . ;,=-------------------------------------------------------.,...
,-####X;-------;- . -;------------------------==============------------------,, ,=
,;,.=-X==---=-===;- . -;---------------------=-========---;-;-------------------,, ,=;-
;.;         ....;--;,   ,.;;;;------------------..               -----------------,, .;=+
+-=;;...               .;,,.. ...,;------------,         .       -----------------,. .;-==,
,.+=======------;;.  -;######Xx===;;..,;;---------,.,;-+xx+=   . +-=----------------...,---=--
--=---------======--,=,#############+=; ..,;------==+++=+.     -=x====--------------,..,;----+
..-==-----------------=-- #x#;-.--=x#######x-.,.,;;-------     ;;++===-=-=------------,. .,-----+;-
=-=--------------------,, #x#-=      ..x#####Xx;,,.,;;--;,               -;-----------;. ,,------==
,,+----------------------,- #X#-x.----;.  .,X#######--...,;-               ;,-----------;. ,,-------=;
--=----------------------,=,###-+.--------;.,,-xX#####x--.,,,-;-==========-=-----------=;. ;,--------=..
;-------------------------.=.#X#;+,----------;,.,.-=+######X=--,;;-========--------------.. -,=-------=,-
--------------------------.+;#X#,=,------------;;,,..--x########+-.,,;----------------=,; . -;--------=;+
=-------------------------.+;#X#,=,----------------;,,. . ==######==..,,;-------------=., ,.=-----------+ .
=------------------------- +;#X#,=;--------------------;;,.. ,,X#####+= ,,;------------ . ;;=----------;+.,
+------------------------- +;#X#,=,-------------------------;,..;;#####==,,;;--------;,  ,------------;,= .
- .             +------------====------===.+-#X#,=,----------------------------;,.-;X####x,,.;;----=,. ..-----------;;--X.;
-=#####             +------------;..--==--;, . =,#X#;=,------------------------------;,.,++###Xx,;,;---=.. ;,=----------;;+##=+
.x#####-=             +-----------,    .-+=-.    -.#X#-+,--------------------------------;,;.=+####x=.;-;- . ------------;-;###+x
#####=,                =-=----------;     =-     ,=,#X#;+.----------------------------------;,,,,#####..    .,=-----------,+=###=+
+####x                    ,-=----------+;-        =;;=.###-+.-------------------------------------;.;.####X=   --=-----------.+-#X#.-
x=###=.                      -=------------+;.    . x--; #X#=x.--------------------------------------;;.=x####+x -==-----------.x=#X# ,
.###x+ ..;--==#####X+.        ,;=-----------+=-    . +--, #X#+x.----------------------------------------,.,.X##X# ;;=-----------.x+#X#;-
.####################+        . +---------=-=..   .--=--. Xx#+x ;;--------------------------------------,., XX#+X . ;;=---------.x=#X#######-.
. =+=;;;-+x#####XX+++=-         . +---------=,-   ;,+=----, +X###-;;;-----------------------------------;,.-+####-= . ..----------.x=#x#+#######
X#####=.                        . +---------=..   =-=-----;,.+####--.---------------------------------;, --####x;,--;,  .;-=------.x+#x#    .### .
-########+=                   ,.+--------;;    ,=--------- . ###xX.-;-----------------------------;.,,+#####.,.;-=-=,, . =-=----.x+###=x;x=### .
.-=########;;              ;,=---------=-=-===---------,, #x###.=;---------------------------;., xX###+=;.;-----=--.  ,;-----,==###########
,+#######-.            ;-=-----------===------------; +-###,=,-------------------------,..-xX###XX.;,;--------=;,. .,----;;,-=x=++++-
-+#=-                 ,=##,.            --=---------------------------.-;###-+.----------------------;,. -=####X=,;.;------------;- . ;;=---;- .
+####.-;x++;;                           ;;=---------------------------;;,###-+.;-------------------,. .-+#####.;.,;;--------------=., ..-----+..
;x############X                        ;,+----------------------------..x##+x,;--------------;,.   -=#####+;;.;;-----------------=;; . ---==-
;+#####x#######==                      . +----------------------------,,-####=;------;;,,...  ..=+######--.,;;----------------------.. -;===
.;###,-     #X#;-                        +-=--------------------------;;.xx##=;;--;;,.,.--;=+########-,..;-------------------------;.  ;-x.,
,;###       #X#,;   . ,,..               ,.====-------------------------.x+##=,;;;.,;=###########X+,,.,;;-;=-===-===-=--------------;..,,=
;-###-,   , #X#,- ########--               ;;;--========----------------,x-##x.. ,;X#########+--.,,,;;;-     =-+==.. ;;--------------.,. .
#+-     ; ###-x;########+#               ..  ..,;------=--============.=.###=-+#####Xx.......,,;;-----..     -.,   -;------------=+;-..,
=-# . x+   =-#+#                ,.,       . ......,,,,,,,,,, , #X#######x=.. ,,;;;;--------=-=-        .,+------------===
Xx#x#                  =--;,..                      ;;####x=...,;-----------------=+=x..    ,;x==--------=x-;
X#####                    .-=+++==--------;--------;;..       .,;;--------------------=-+ .      ;,-------=+--
..########x#==                  .==========================..   ;;-------------------------     .,    .-----===,
.-############+                  ,,-===-------------;;;,;,-,,   ;;-=---------------------;     ;=+-; ;,---==+
.     -=X+.     .               ;;+===-------;,..,,,,,;,,.    .-----------------------.  --==========+-,
.,;+=+==-;,,.=+######xxx-=   ,;=-------------------===-==-----===+--
-===;;xx##############x; .-----------------------------==+==,
.,######x++xxxX#####+ .,--=-------------------===+++==-
-,###;.   ......;-==+==,;,===+++=+===++++++++++==-..                     =x#,=
X=#x#                 ......,;;;;;,,.,,,,,..                 +X###,,     ###+#
#=#+#                                                        -=#####     ###-X
#+###                                                          ;;####x -,### -   ;.#
;-###+;        - .                                               .X####X=#x#     #####,+####;;
;#######x+=##### ,                                                ######+#     #=###########-.
..###########xX                                                    ;##### .   #=####X=;=+###x;
--xxx+=;                                          ;.######+;   =+###.=   #+###;     XX###
+=################     #x###      #x###
=;-;-=########=,     #####      x+##x.;#X# .
#x#+X      . #; --###,=
. ###,=
,.###,=
. ### ;

```
Now to put this all together using a result of three dimensional vector algebra:
(c×b)·(a×c) = (a·c)(b·c) - (c·c)(b·a)
it looks horrible, but it is easy to prove if you write it out using the summation convention. So:
n1·n2 = -cos(γ)
= (c×b)·(a×c)/sin(x)sin(y)
= ((a·c)(b·c) - (b·a))sin(x)sin(y)
Remebering that c·c = 1. Multiply through by -sin(x)sin(y) and get:
Propostition: For this triangle, cos(γ)sin(x)sin(y) = cos(z) - cos(a)cos(b)
which is the cosine formula on a sphere. If the triangle is right angled, then cos(γ)=0 and the spherical form of Pythagoras's Theorem is
cos(x)cos(y) = cos(z)
Note that when the triangle is small, x,y and z are small, and using a Taylor expansion to second order, this implies the conventional form of the theorem.