Function Repository Resource:

Geodesic

Compute the geodesics for a parametrized surface

Contributed by: Wolfram Staff (original content by Alfred Gray)
 ResourceFunction["Geodesic"][s,{u,v},t,{u0,v0},θ0] computes the geodesics for surface s with parameters u and v, emanating from the point parametrized by u0,v0 and proceeding in the direction θ0.

Details and Options

A geodesic is a curve that locally minimizes length traversed.
The result returned by ResourceFunction["Geodesic"] is a set of differential equations of u and v in the variable t.
The system of equations generated by ResourceFunction["Geodesic"] has the form , where are the Christoffel symbols of the second kind that can be effectively computed by the resource function ChristoffelSymbol.
Initial conditions are of the form u(0)=u0, v(0)=v0 and u'(0)=cos(θ0), v'(0)=sin(θ0).

Examples

Basic Examples (7)

A sphere:

 In[1]:=

Equations for geodesics on a sphere:

 In[2]:=
 Out[2]=

A set of numerical solutions of equations for geodesics of a sphere:

 In[3]:=

Evaluate the geodesic at a definite point:

 In[4]:=
 Out[4]=

Plot solutions in a plane:

 In[5]:=
 Out[5]=

Plot geodesics on a sphere:

 In[6]:=
 Out[6]=

Plot the geodesic circles (locus surface points located at a given geodesic radius):

 In[7]:=
 Out[7]=

Scope (3)

A torus:

 In[8]:=

The equations for geodesics:

 In[9]:=
 Out[9]=

Solve a geodesic for large t:

 In[10]:=
 Out[10]=

Solve for geodesics:

 In[11]:=

Plot solutions in a plane:

 In[12]:=
 Out[12]=

Solve for a set of geodesics:

 In[13]:=
 Out[13]=

Plot the geodesic circles:

 In[14]:=
 Out[14]=

Plot the geodesic circles over the torus:

 In[15]:=
 In[16]:=
 Out[17]=

 In[18]:=
 Out[18]=

Get the equations for geodesics:

 In[19]:=
 Out[19]=

Solve the equations for geodesics:

 In[20]:=

Plot solutions for geodesics:

 In[21]:=
 Out[21]=

Plot the geodesics over the surface:

 In[22]:=
 Out[22]=

Plot the geodesic circles:

 In[23]:=
 Out[23]=

Plot the geodesics circles over the surface:

 In[24]:=
 Out[24]=

A pseudosphere:

 In[25]:=

The geodesic equations:

 In[26]:=
 In[27]:=

Plot the geodesic equations in 3D varying θ:

 In[28]:=
 In[29]:=
 Out[29]=

A top view of a solution:

 In[30]:=
 Out[30]=

Enrique Zeleny

Version History

• 1.0.0 – 08 April 2020