Electromagnetic Theory · Coordinate Transformations and Scale Factors

#06 Unit-vector transformations among Cartesian, cylindrical, and spherical systems

Interpret scale factors, derive transformation matrices, and move reliably among all three coordinate systems.

Question

Lesson frame showing coordinate-system scale factors and unit-vector transformation matrices.
Scale factors determine differential distance, while orthogonal transformation matrices connect unit-vector bases.

Explain scale factors geometrically, derive the Cartesian, cylindrical, and spherical unit-vector transformation matrices, and combine vectors written in different coordinate systems using a common basis.

Written solution and narration transcript(shows the full solution)

Below are all the lines written in the notebook together with the full narration transcript.

  1. 1. Bring the three coordinate systems together

    Lesson frame showing coordinate-system scale factors and unit-vector transformation matrices.
    Scale factors determine differential distance, while orthogonal transformation matrices connect unit-vector bases.
    In the previous lessons, we defined three coordinate systems: Cartesian, cylindrical, and spherical.
    We wrote the position vector and the differential elements in each system.
    In this lesson, we bring these systems together.
    We will discuss scale factors and how to remember them easily.
    Then we derive the transformation matrices that convert unit vectors from one system to another.
    Finally, we work through examples, including cases where unit vectors from different coordinate systems appear in the same expression.

    Narration transcript

    In the previous lessons, we defined three coordinate systems: Cartesian, cylindrical, and spherical. We wrote the position vector and the differential elements in each system. In this lesson, we bring these systems together. We will discuss scale factors and how to remember them easily. Then we derive the transformation matrices that convert unit vectors from one system to another. Finally, we work through examples, including cases where unit vectors from different coordinate systems appear in the same expression.

  2. 2. Derive scale factors from geometry

    Lesson frame showing coordinate-system scale factors and unit-vector transformation matrices.
    Scale factors determine differential distance, while orthogonal transformation matrices connect unit-vector bases.
    Scale factors, or metric coefficients, tell us how much actual distance changes per unit change in a coordinate.
    In Cartesian coordinates:
    hx=hy=hz=1.\displaystyle h_{x} = h_{y} = h_{z} = 1.
    This is because x, y, z directly measure distance.
    In cylindrical coordinates:
    hρ=hz=1,hφ=ρ.\displaystyle h_{\rho } = h_{z} = 1, h_{\varphi } = \rho .
    In spherical coordinates:
    hr=1,hθ=r,hφ=rsinθ.\displaystyle h_{r} = 1, h_{\theta } = r, h_{\varphi } = r \sin \theta .
    Here is a useful mnemonic to remember these.
    When we move from one coordinate system to the next, the new length coordinate that did not exist in the previous system gives the scale factor for the corresponding new angle.
    Going from Cartesian to cylindrical: ρ is the new length coordinate.
    So hφ, the scale factor of the new angle φ, equals ρ.
    Going from cylindrical to spherical: r is the new length coordinate.
    So hθ, the scale factor of the new angle θ, equals r.
    The spherical right triangle gives ρ = r sin θ, hence hφ = r sin θ.
    Since hφ was ρ in cylindrical, in spherical it becomes r sin θ.
    This mnemonic is not blind memorization.
    It comes from understanding the geometric relationships between the systems.

    Narration transcript

    Scale factors, or metric coefficients, tell us how much actual distance changes per unit change in a coordinate. In Cartesian coordinates, all three scale factors are one: h x equals one, h y equals one, h z equals one. This is because x, y, z directly measure distance. In cylindrical coordinates, h rho equals one and h z equals one, but h phi equals rho. In spherical coordinates, h r equals one, h theta equals r, and h phi equals r sine theta. Here is a useful mnemonic to remember these. When we move from one coordinate system to the next, the new length coordinate that did not exist in the previous system gives the scale factor for the corresponding new angle. Going from Cartesian to cylindrical: rho is the new length coordinate. So h phi, the scale factor of the new angle phi, equals rho. Going from cylindrical to spherical: r is the new length coordinate. So h theta, the scale factor of the new angle theta, equals r. For h phi in spherical, recall the right triangle relating r, rho, and theta: rho equals r sine theta. Since h phi was rho in cylindrical, in spherical it becomes r sine theta. This mnemonic is not blind memorization. It comes from understanding the geometric relationships between the systems.

  3. 3. Derive the cylindrical transformation matrix

    Lesson frame showing coordinate-system scale factors and unit-vector transformation matrices.
    Scale factors determine differential distance, while orthogonal transformation matrices connect unit-vector bases.
    Now let us derive the transformation matrix between Cartesian and cylindrical coordinates.
    The general unit-vector formula is ei = (1/hi)(∂r/∂qi).
    Here r is the position vector and qi is the i-th coordinate.
    The cylindrical position vector is r = ρ cos φ ex + ρ sin φ ey + z ez.
    To find eρ, we take the partial derivative of r with respect to ρ, and divide by hρ which is one.
    This gives eρ = cos φ ex + sin φ ey.
    To find eφ, we take the partial derivative of r with respect to φ, and divide by hφ which is ρ.
    The ρ terms cancel, giving eφ = −sin φ ex + cos φ ey.
    And ez remains ez.
    We can write this as a matrix equation.
    The first row is cos φ, sin φ, zero.
    The second row is minus sin φ, cos φ, zero.
    The third row is zero, zero, one.
    The key insight: do not memorize this matrix.
    Instead, remember the derivation formula and you can reconstruct it anytime.

    Narration transcript

    Now let us derive the transformation matrix between Cartesian and cylindrical coordinates. The general formula for a unit vector is: e hat i equals one over h i, partial r over partial q i. Here r is the position vector and q i is the i-th coordinate. We start by writing the position vector in cylindrical terms: r equals rho cosine phi, e hat x, plus rho sine phi, e hat y, plus z, e hat z. To find e hat rho, we take the partial derivative of r with respect to rho, and divide by h rho which is one. This gives: e hat rho equals cosine phi, e hat x, plus sine phi, e hat y. To find e hat phi, we take the partial derivative of r with respect to phi, and divide by h phi which is rho. The rho terms cancel, giving: e hat phi equals minus sine phi, e hat x, plus cosine phi, e hat y. And e hat z remains e hat z. We can write this as a matrix equation. The first row is cosine phi, sine phi, zero. The second row is minus sine phi, cosine phi, zero. The third row is zero, zero, one. The key insight: do not memorize this matrix. Instead, remember the derivation formula and you can reconstruct it anytime.

  4. 4. Derive the spherical transformation matrix

    Lesson frame showing coordinate-system scale factors and unit-vector transformation matrices.
    Scale factors determine differential distance, while orthogonal transformation matrices connect unit-vector bases.
    The spherical position vector is r = r sin θ cos φ ex + r sin θ sin φ ey + r cos θ ez.
    Applying the same formula:
    er=sinθcosφex+sinθsinφey+cosθez.\displaystyle e_{r} = \sin \theta \cos \varphi e_{x} + \sin \theta \sin \varphi e_{y} + \cos \theta e_{z}.
    eθ=cosθcosφex+cosθsinφeysinθez.\displaystyle e_{\theta } = \cos \theta \cos \varphi e_{x} + \cos \theta \sin \varphi e_{y} - \sin \theta e_{z}.
    eφ=sinφex+cosφey.\displaystyle e_{\varphi } = -\sin \varphi e_{x} + \cos \varphi e_{y}.
    This gives the spherical to Cartesian transformation matrix.
    Now here is a powerful trick.
    These transformation matrices are orthogonal.
    This means the inverse is simply the transpose.
    To go from Cartesian back to cylindrical or spherical, just transpose the matrix: swap rows and columns.
    And to convert between cylindrical and spherical?
    Go through Cartesian as an intermediate step.
    First convert to Cartesian, then convert to the target system.
    With just these two matrices and their transposes, you can transform between any pair of coordinate systems.

    Narration transcript

    For spherical coordinates, we write the position vector as: r equals r sine theta cosine phi, e hat x, plus r sine theta sine phi, e hat y, plus r cosine theta, e hat z. Applying the same formula: e hat r equals sine theta cosine phi, e hat x, plus sine theta sine phi, e hat y, plus cosine theta, e hat z. e hat theta equals cosine theta cosine phi, e hat x, plus cosine theta sine phi, e hat y, minus sine theta, e hat z. e hat phi equals minus sine phi, e hat x, plus cosine phi, e hat y. This gives the spherical to Cartesian transformation matrix. Now here is a powerful trick. These transformation matrices are orthogonal. This means the inverse is simply the transpose. To go from Cartesian back to cylindrical or spherical, just transpose the matrix: swap rows and columns. And to convert between cylindrical and spherical? Go through Cartesian as an intermediate step. First convert to Cartesian, then convert to the target system. With just these two matrices and their transposes, you can transform between any pair of coordinate systems.

  5. 5. Solve mixed-unit-vector examples

    Lesson frame showing coordinate-system scale factors and unit-vector transformation matrices.
    Scale factors determine differential distance, while orthogonal transformation matrices connect unit-vector bases.
    Let us work through two examples.
    Example one: express ex + ey in cylindrical coordinates.
    We need the inverse transformation, so we use the transpose.
    From the transpose, ex = cos φ eρ − sin φ eφ.
    And ey = sin φ eρ + cos φ eφ.
    Adding them:
    ex+ey=(cosφ+sinφ)eρ+(cosφsinφ)eφ.\displaystyle e_{x} + e_{y} = \left(\cos \varphi + \sin \varphi \right)e_{\rho } + \left(\cos \varphi - \sin \varphi \right)e_{\varphi }.
    Example two: express eρ + eθ in Cartesian coordinates.
    This is interesting because eρ is cylindrical and eθ is spherical.
    They come from different systems!
    The approach: convert each to Cartesian separately.
    eρ=cosφex+sinφey.\displaystyle e_{\rho } = \cos \varphi e_{x} + \sin \varphi e_{y}.
    eθ=cosθcosφex+cosθsinφeysinθez.\displaystyle e_{\theta } = \cos \theta \cos \varphi e_{x} + \cos \theta \sin \varphi e_{y} - \sin \theta e_{z}.
    The result is (1 + cos θ)cos φ ex + (1 + cos θ)sin φ ey − sin θ ez.
    The key lesson: when you have unit vectors from different systems in the same expression, convert each one to Cartesian first, then combine.

    Narration transcript

    Let us work through two examples. Example one: express e hat x plus e hat y in cylindrical coordinates. We need the inverse transformation, so we use the transpose. From the transpose, e hat x equals cosine phi, e hat rho, minus sine phi, e hat phi. And e hat y equals sine phi, e hat rho, plus cosine phi, e hat phi. Adding them: e hat x plus e hat y equals, cosine phi plus sine phi, times e hat rho, plus cosine phi minus sine phi, times e hat phi. Example two: express e hat rho plus e hat theta in Cartesian coordinates. This is interesting because e hat rho is cylindrical and e hat theta is spherical. They come from different systems! The approach: convert each to Cartesian separately. e hat rho equals cosine phi, e hat x, plus sine phi, e hat y. e hat theta equals cosine theta cosine phi, e hat x, plus cosine theta sine phi, e hat y, minus sine theta, e hat z. Adding these: the result is one plus cosine theta, times cosine phi, e hat x, plus one plus cosine theta, times sine phi, e hat y, minus sine theta, e hat z. The key lesson: when you have unit vectors from different systems in the same expression, convert each one to Cartesian first, then combine.

  6. 6. Review the transformation method

    Lesson frame showing coordinate-system scale factors and unit-vector transformation matrices.
    Scale factors determine differential distance, while orthogonal transformation matrices connect unit-vector bases.
    Let us review.
    Scale factors tell us the actual distance per unit coordinate change.
    Remember: the new length coordinate in each system gives the scale factor for the corresponding new angle.
    The formula ei = (1/hi)(∂r/∂qi) lets you derive any transformation matrix from scratch.
    The inverse transformation is simply the transpose.
    To convert between cylindrical and spherical, go through Cartesian.
    With these tools, you can freely move between all three coordinate systems, which is essential for electromagnetic theory.

    Narration transcript

    Let us review. Scale factors tell us the actual distance per unit coordinate change. Remember: the new length coordinate in each system gives the scale factor for the corresponding new angle. The transformation formula, e hat i equals one over h i, partial r over partial q i, lets you derive any transformation matrix from scratch. The inverse transformation is simply the transpose. To convert between cylindrical and spherical, go through Cartesian. With these tools, you can freely move between all three coordinate systems, which is essential for electromagnetic theory.

Source video: Electromagnetic Theory (v2) #06 Coordinate Transformations & Scale Factors (7:45)