On this page:
6.1.1 (Fake) classes
manifold-spec%
specify-manifold
manifold-spec%_  _  ’new-patch
manifold-spec%_  _  ’patch-setup
manifold-spec%_  _  ’generator
manifold%
manifold%_  _  ’name
manifold%_  _  ’the-manifold
manifold%_  _  ’type
manifold%_  _  ’dimension
manifold%_  _  ’manifold-dimension
manifold%_  _  ’embedding-dimension
manifold%_  _  ’patch-names
manifold%_  _  ’get-patch
manifold%_  _  ’distinguished-points
manifold%_  _  ’add-distinguished-point!
patch%
patch%_  _  ’name
patch%_  _  ’the-patch
patch%_  _  ’coordinate-system-names
patch%_  _  ’get-coordinate-system
coord-sys%
coord-sys%_  _  ’name
coord-sys%_  _  ’patch
coord-sys%_  _  ’->point
coord-sys%_  _  ’check-coords
coord-sys%_  _  ’->coords
coord-sys%_  _  ’check-point
coord-transformer%
6.1.2 Functions
manifold-point%
temp
patch
attach-patch
make-manifold
coordinate-system
coordinate-system-at
attach-coordinate-system
transfer-point
6.1.3 Predefined elements
R^n
R1
R1-rect
the-real-line
R2
R2-rect
R2-polar
R3
R3-rect
R3-cyl
R3-spherical
R4
R4-rect
R4-cyl
spacetime
spacetime-rect
spacetime-sphere
S^n
S1
S1-circular
S1-tilted
S1-sloped
S1-gnomic
S2p
S2p-spherical
S2p-tilted
S2p-sloped
S2p-Riemann
S2p-gnomic
S3
S3-spherical
S3-tilted
S3-gnomic
S3-stereographic
S^2
S2
S2-spherical
S2-tilted
S2-stereographic
S2-Riemann
S2-gnomic
SO3-type
SO3
Euler-angles
alternate-angles
6.1.4 Examples
9.1.0.11

6.1 Manifolds🔗

This module provides objects to construct manifolds. Some important manifolds are predefined but it is possible to construct more.

Although the OO-like implementation is procedure/message based, for the purpose of this document the racket-class syntax has been used.

But there are (currently) no manifold% or other classes actualy defined, and there is no good way to check if something is-a? manifold%.

Methods, like ((manifold-spec%__’new-patch) rst ...) should be called as ((manifold-spec% 'new-patch) rst ...).

6.1.1 (Fake) classes🔗

class

manifold-spec% : class?

  superclass: procedure?

constructor

(specify-manifold spec [type])  manifold-spec%

  spec : symbol?
  type : symbol? = Real
The constructor function for a new manifold-spec%. Predefined manifold-spec%s include R^n for n-dimensional space, S^n for surface of an n-dimensional sphere. an "^n" within the spec will be used to attach the dimension to a manifold% generated by this manifold-spec%

method

((manifold-spec%__’new-patch patch-name    
  generator    
  setup)  void?
  patch-name : symbol?
  generator : any
  setup : any
Attaches a new patch to the manifold. Don’t use directly but use attach-patch.

method

((manifold-spec%__’patch-setup) patch-name)  any

  patch-name : symbol?
Get the patch-generator for a patch linked to the manifold-spec%. It should not be necessary to call this directly.

method

((manifold-spec%__’generator dimension    
  [embedding-dimension])  manifold%
  dimension : positive-integer?
  embedding-dimension : positive-integer? = dimension
Set up a new manifold%. Don’t use directly but use make-manifold.

class

manifold% : class?

  superclass: procedure?

A manifold is ...???.

field

(manifold%__’name)  symbol?

field

(manifold%__’the-manifold)  patch%

Returns itself

field

(manifold%__’type)  symbol?

field

(manifold%__’dimension)  positive-integer?

field

(manifold%__’manifold-dimension)  positive-integer?

field

(manifold%__’embedding-dimension)  positive-integer?

field

(manifold%__’patch-names)  (listof symbol?)

method

((manifold%__’get-patch) name)  patch%

  name : symbol?
Get the patch from a manifold. Don’t use directly but use patch

field

(manifold%__’distinguished-points)  (listof ???)

¿leftovers?

method

((manifold%__’add-distinguished-point! sspec    
  m)  void?
  sspec : symbol?
  m : ???
¿leftovers?

class

patch% : class?

  superclass: procedure?

A patch is ...???. ... linked to a manifold ... and one or more coordinate systems. Messages not handled by the patch will be passed to the manifold. A new patch should be added via attach-patch.

field

(patch%__’name)  symbol?

The name of the patch.

field

(patch%__’the-patch)  patch%

Returns itself

field

(patch%__’coordinate-system-names)  (listof symbol?)

All the defined coordinate systems for a patch.

method

((patch%__’get-coordinate-system) name)  coord-sys%

  name : symbol?
Get the coordinate system on a patch. Don’t use directly but use coordinate-system-at

class

coord-sys% : class?

  superclass: procedure?

A coordinate-system is ...???. ... linked to a manifold and a patch. Messages not handled by the coordinate-system will be passed to the manifold. A new coordinate-system should be added via attach-coordinate-system.

field

(coord-sys%__’name)  symbol?

The name of the coordinate-system.

field

(coord-sys%__’patch)  patch%

The patch the coordinate-system belongs to.

method

((coord-sys%__’->point) coord)  manifold-point%

  coord : structure?

method

((coord-sys%__’check-coords) coord)  boolean?

  coord : structure?

method

((coord-sys%__’->coords) point)  manifold-point%

  point : manifold-point%

method

((coord-sys%__’check-point) point)  boolean?

  point : manifold-point%

class

coord-transformer% : class?

  superclass: procedure?

6.1.2 Functions🔗

class

manifold-point% : class?

  superclass: procedure?

procedure

(temp)  number?

procedure

(patch name manifold)  patch%

  name : symbol?
  manifold : manifold%
Get the patch from a manifold.

procedure

(attach-patch patch-name manifold-spec)  void?

  patch-name : symbol?
  manifold-spec : manifold-spec%
Attaches a new patch to the manifold. For example (attach-patch 'north-pole S^n) or (attach-patch 'origin R^n)

procedure

(make-manifold manifold-spec    
  dimension    
  [embedding-dimension])  manifold%
  manifold-spec : manifold-spec%
  dimension : positive-integer?
  embedding-dimension : positive-integer? = dimension
Create a new manifold% within manifold-spec%.

procedure

(coordinate-system name patch)  coord-sys%

  name : symbol?
  patch : patch%
Get the coordinate system on a patch.

procedure

(coordinate-system-at coord-name    
  patch-name    
  manifold)  coord-sys%
  coord-name : symbol?
  patch-name : symbol?
  manifold : manifold%

procedure

(attach-coordinate-system name    
  patch-name    
  spec    
  transformations    
  [prototype])  void?
  name : symbol?
  patch-name : symbol?
  spec : manifold-spec%
  transformations : (-> manifold% coord-transformer%)
  prototype : structure? = (up 'x0 'x1 ...)
Sets up and a coord-sys% to a patch% on a manifold-spec% so it can be used on it’s manifolds. If a prototype is supplied only manifolds with the same dimension as the prototype can be used with this coordinate system.

procedure

(transfer-point embedded embedding)

  (-> manifold-point% manifold-point%)
  embedded : manifold%
  embedding : manifold%
Creates a function that will copy points from one manifold% to another. For this to work the (embedded) dimensions of the manifold%s must be the same. See also the examples at the end of this section.

6.1.3 Predefined elements🔗

value

R^n : manifold-spec%

Pre-installed patch%es:

'origin

Pre-installed coordinate-system generators:
'rectangular
'polar/cylindrical
'spherical/cylindrical
'spacetime-spherical

With names for folowing manifold%s and coord-sys%tems:

value

R1 : manifold%

value

R1-rect : coord-sys%

value

the-real-line : coord-sys%

value

R2 : manifold%

value

R2-rect : coord-sys%

value

R2-polar : coord-sys%

value

R3 : manifold%

value

R3-rect : coord-sys%

value

R3-cyl : coord-sys%

value

R3-spherical : coord-sys%

value

R4 : manifold%

value

R4-rect : coord-sys%

value

R4-cyl : coord-sys%

value

spacetime : manifold%

value

spacetime-rect : coord-sys%

value

spacetime-sphere : coord-sys%

value

S^n : manifold-spec%

Pre-installed patch%es:
'north-pole
'tilted
'south-pole
Pre-installed coordinate-system generators:
'spherical
'stereographic
'gnomic

With names for folowing manifold%s and coord-sys%tems:

value

S1 : manifold%

value

S1-circular : (coord-sys% 'spherical 'north-pole)

value

S1-tilted : (coord-sys% 'spherical 'tilted)

value

S1-sloped : (coord-sys% 'stereographic 'north-pole)

value

S1-gnomic : (coord-sys% 'gnomic 'north-pole)

value

S2p : manifold%

value

S2p-spherical : (coord-sys% 'spherical 'north-pole)

value

S2p-tilted : (coord-sys% 'spherical 'tilted)

value

S2p-sloped : (coord-sys% 'stereographic 'north-pole)

value

S2p-Riemann : (coord-sys% 'stereographic 'north-pole)

value

S2p-gnomic : (coord-sys% 'gnomic 'north-pole)

value

S3 : manifold%

value

S3-spherical : (coord-sys% 'spherical 'north-pole)

value

S3-tilted : (coord-sys% 'spherical 'tilted)

value

S3-gnomic : (coord-sys% 'gnomic 'north-pole)

value

S3-stereographic : (coord-sys% 'stereographic 'south-pole)

value

S^2 : manifold-spec%

Pre-installed patch%es:
'north-pole
'tilted
'south-pole
Pre-installed coordinate-system generators:
'spherical
'stereographic
'gnomic

With names for folowing manifold%s and coord-sys%tems:

value

S2 : manifold%

value

S2-spherical : (coord-sys% 'spherical 'north-pole)

value

S2-tilted : (coord-sys% 'spherical 'tilted)

value

S2-stereographic : (coord-sys% 'stereographic 'north-pole)

value

S2-Riemann : (coord-sys% 'stereographic 'north-pole)

value

S2-gnomic : (coord-sys% 'gnomic 'north-pole)

value

SO3-type : manifold-spec%

Pre-installed patch%es:
'Euler-patch
'alternate-patch
Pre-installed coordinate-system generators:
'Euler
'alternate

With names for folowing manifold%s and coord-sys%tems:

value

SO3 : manifold%

value

Euler-angles : (coord-sys% 'Euler 'Euler-patch)

value

alternate-angles : (coord-sys% 'alternate 'alternate-patch)

6.1.4 Examples🔗

With all this in place you can define a point using spherical coordinates, and extracts its rectangular coordinates:

Examples:
> (define P ((R3-spherical '->point) (up 'r 'θ 'ϕ)))
> (expression ((R3-rect '->coords) P))

'(up (* r (cos ϕ) (sin θ)) (* r (sin θ) (sin ϕ)) (* r (cos θ)))

For this to work points need to be defined on the same manifold. If the embedding dimension is the same, you can also transfer points from one manifold to another:

Examples:
> (define P ((R3-rect '->point) (up 'x 'y 'z)))
> (expression
   ((S2-spherical '->coords)
    ((transfer-point R3-rect S2-spherical) P)))

'(up (acos z) (atan y x))