# Coordinate systems/Derivation of formulas/Coordinate variable transformations
## Can these formulas be derived without without sketches or visualizing three-dimensional geometry?

The answer is yes, and students who can do will quickly grasp the Riemannian calculus of general relativity.
In the three dimensional universe that contains the identities of this resource, the "vector" and "unit vector" are like Euclid's common notions in that there is little point in defining them. But vectors and basis vectors exist within any set of variables that obey Riemannian calculus[citation needed].

#### First think about unit vectors in Cartesian coordinates as a "step" of unit length in the direction of a coordinate

Following ideas found in textbooks on general relativity, we can define the unit vector in Cartesian coordinates as the the displacement vector associated with increasing the variable x by 1:
    ${\hat {x}}={\vec {r}}(x+1,y,z)-{\vec {r}}(x,y,z)\;,$
where ${\vec {r}}=x{\hat {x}}+y{\hat {y}}+z{\hat {z}}$. The leads to the obvious and expected result:
    ${\hat {x}}=\left[(x+1){\hat {x}}+y{\hat {y}}+z{\hat {z}}\right]-\left[x{\hat {x}}+y{\hat {y}}+z{\hat {z}}\right]={\hat {x}}$

#### Modify this definition of unit vector if the coordinates are "curvey" (non-technical term) in some way

A pretty obvious statement. The problem arises in other coordinate systems, where a step will turn the unit vectors around if the step is too large. We have this primitive notion that ${\hat {\theta }}$ is supposed to point in the "direction of increasing $\theta$, but since this direction changes, we must therefore make a very small step. Then we "normalize" by dividing by the size of that step.
Let's try this out in polar coordinates (which are cylindrical coordinates if we ignore z):
    ${\hat {\theta }}=\lim _{\epsilon \rightarrow 0}{\frac {{\vec {r}}(\theta +\epsilon )-{\vec {r}}(\theta )}{\|{\vec {r}}(\theta +\epsilon )-{\vec {r}}(\theta )\|}}={\frac {upstairs}{downstairs}}$

#### "Upstairs" is easy to calculate

Upstairs is easily related to the derivative of the two components of the position vector. We use partial derivatives because two variables are present (in polar coordinates):
    ${\frac {\partial {\vec {r}}}{\partial \theta }}={\hat {x}}{\frac {\partial x}{\partial \theta }}+{\hat {y}}{\frac {\partial y}{\partial \theta }}=-r\sin \theta {\hat {x}}+r\cos \theta {\hat {y}}\;,$
where we have used x=x(r,θ)=rsinθ and y=y(r,θ)=rsinθ. Hence,
    ${\frac {upstairs}{\epsilon }}=-r\sin \theta {\hat {x}}+r\cos \theta {\hat {y}}\;,$.

#### "Downstairs" is hard to do if you are not allowed to "see" it

For downstairs, we could the rule for line differential in polar coordinates, namely $d\ell ^{2}=dr^{2}+r^{2}d\theta ^{2}$, but that requires visualization, which we wish to eschew in order to better grasp Riemannian calculus. Hence we seek what is called "the metric". Begin with our transformation:
    $x=r\cos \theta$ $y=r\sin \theta$
An extremely useful rule in mathematical physics is:
    $dx={\frac {\partial x}{\partial \theta }}d\theta +{\frac {\partial x}{\partial r}}dr$
    $dy={\frac {\partial y}{\partial \theta }}d\theta +{\frac {\partial y}{\partial r}}dr$
Hence,
    $dx^{2}=\left({\frac {\partial x}{\partial \theta }}\right)^{2}d\theta ^{2}+2\left({\frac {\partial x}{\partial \theta }}\right)\left({\frac {\partial x}{\partial r}}\right)drd\theta +\left({\frac {\partial x}{\partial r}}\right)^{2}dr^{2}$
    $dy^{2}=\left({\frac {\partial y}{\partial \theta }}\right)^{2}d\theta ^{2}+2\left({\frac {\partial y}{\partial \theta }}\right)\left({\frac {\partial y}{\partial r}}\right)drd\theta +\left({\frac {\partial y}{\partial r}}\right)^{2}dr^{2}$

#### And the metric for polar coordinates is...

It is a simple but tedious matter to work out the partial derivatives and conclude that the metric in polar coordinates can be written:
    $dx^{2}+dy^{2}=dr^{2}+r^{2}d\theta ^{2}$
The equation is obvious if you just look at this picture, but we did it without a picture in a way that could easily be generalized to more than three dimensions. And without using any mental images, we conclude that if dr=0, then ${\sqrt {dx^{2}+dy^{2}}}=rd\theta$. In other words, two points separated in angle by ε will be spearated in space by rε.
$downstairs\ =\left|{\vec {r}}(\theta +\epsilon )-{\vec {r}}(\theta \right|)=r\epsilon$
And therefore the unit vector in the $\theta$ direction is,

#### (unfinished)

... don't forget, what ever get's calculated here might be wrong.

#### See Tensors for application to the mathematics of general relativity

* See also Tensors
In a curvilinear coordinate system, the coordinates are ...