Lesson 4 of 15

Coordinate Systems

Coordinate Systems

A manifold is a space that locally looks like Rn\mathbb{R}^n. To do calculus on a manifold, we need coordinate systems — smooth maps that identify regions of the manifold with regions of Rn\mathbb{R}^n.

A coordinate system consists of two inverse functions:

  • chart χ\chi: maps manifold points → coordinate tuples (e.g., (x,y)(x,y) or (r,θ)(r,\theta))
  • point χ1\chi^{-1}: maps coordinate tuples → manifold points

The book introduces these as (chart coordsys) and (point coordsys) in Scheme. In Python, we represent a coordinate system as a pair of functions.

Example: Polar Coordinates on R2\mathbb{R}^2

A point p=(x,y)p = (x, y) in rectangular coordinates has polar coordinates:

r=x2+y2,θ=atan2(y,x)r = \sqrt{x^2 + y^2}, \quad \theta = \text{atan2}(y, x)

Going back from polar to rectangular:

x=rcosθ,y=rsinθx = r\cos\theta, \quad y = r\sin\theta

Coordinate Independence

The key insight: a manifold point is a geometric object independent of coordinates. The point (3,4)(3, 4) in rectangular and the point (5,atan2(4,3))(5, \text{atan2}(4,3)) in polar refer to the same point on the manifold. Both coordinate systems describe the same reality.

Your Task

Implement the polar coordinate system:

  • polar_chart(p): convert rectangular point (x,y)(x, y) → polar coordinates (r,θ)(r, \theta)
  • polar_point(c): convert polar coordinates (r,θ)(r, \theta) → rectangular point (x,y)(x, y)
Python runtime loading...
Loading...
Click "Run" to execute your code.