Example for spherical coordinates

One possible transformation from spherical coordinates (r,φ,ϑ) to cartesian coordinates (x,y,z) is:

x:=r⋅(\sin ϑ)⋅(\cos φ)
y:=r⋅(\sin ϑ)⋅(\sin φ)
z:=r⋅(\cos ϑ)


\sin x:=÷{exp(i⋅x)-\exp(-i⋅x)}{2⋅i}
\cos x:=÷{exp(i⋅x)+\exp(-i⋅x)}{2}

where: i²=-1

Geodetic distance

My current try is:

Length l is defined to be:


So if r⃗(t), then:


The usual definition of "distance" is "minimum length", so try to find the minimum:

l=∫|r⃗'(t)|⋅dt -> min



And x, y, z as above, but with (r,φ,ϑ) being functions of t.

So the extremum is determined by:

÷{d}{dt} ÷{∂L}{∂ṙ}=÷{∂L}{∂r}
÷{d}{dt} ÷{∂L}{∂φ̇}=÷{∂L}{∂φ}
÷{d}{dt} ÷{∂L}{∂ϑ̇}=÷{∂L}{∂ϑ}

I'm not sure how to stay ON the sphere with the curve.

ẋ=ṙ⋅(\sin ϑ)⋅(\cos φ)+r⋅(\cos ϑ)⋅ϑ̇⋅(\cos φ)-r⋅(\sin ϑ)⋅φ̇⋅(\sin φ)
ẏ=ṙ⋅(\sin ϑ)⋅(\sin φ)+r⋅(\cos ϑ)⋅ϑ̇⋅(\sin φ)+r⋅(\sin ϑ)⋅φ̇⋅(\cos φ)
ż=ṙ⋅(\cos ϑ)-r⋅(\sin ϑ)⋅ϑ̇

And so:

ẋ²+ẏ²+ż²=ṙ²+r²⋅ϑ̇²+r²⋅(\sin ϑ)²⋅φ̇²

After dropping the square root (is that safe?), one gets:

r̈=r⋅ϑ̇²+r⋅(\sin ϑ)²⋅φ̇²
2⋅r⋅ṙ⋅(\sin ϑ)²⋅φ̇+2⋅r²⋅(\sin ϑ)⋅(\cos ϑ)⋅ϑ̇⋅φ̇+(\sin ϑ)²⋅φ̈=0
2⋅r⋅ṙ⋅ϑ̇+r²⋅ϑ̈=r²⋅φ̇²⋅(\sin ϑ)⋅(\cos ϑ)

How to stay on the surface of the sphere?

Spherical Angles

The Spatial Angle Ω on a sphere with radius R is defined to be:


Where A is the area on the surface of the sphere enclosed by beams from the center to the object.

This is so that:

Ω[A=4⋅π⋅R², R]=4⋅π
Ω[A=0, R]=0