TITLE: Convert coordinates from Cartesian system to non-orthogonal axes
QUESTION [7 upvotes]: I have a 2D coordinate system defined by two non-perpendicular axes. I wish to convert from a standard Cartesian (rectangular) coordinate system into mine. Any tips on how to go about it?

REPLY [7 votes]: Let us denote by "old" the usual cartesian system with orthogonal axes and by "new" the system with the skew axes $(\alpha_1, \alpha_2)^T,  (\beta_1, \beta_2)^T$ (expressed in the old system). An old vector $(x,y)^T$ can be expressed as a linear combination of the skew vectors:
$$
\left( \begin{array}{c} x \\ y \end{array}\right) = 
a \left( \begin{array}{c} \alpha_1 \\ \alpha_2\end{array}\right) +
b \left( \begin{array}{c} \beta_1 \\ \beta_2\end{array}\right) =
\left( \begin{array}{cc} \alpha_1 & \beta_1 \\ \alpha_2 & \beta_2 \end{array} \right) \left( \begin{array}{c} a \\ b \end{array}\right) = 
A \left( \begin{array}{c} a \\ b \end{array}\right) 
$$
Using this equation we can transform vectors from the new skew system to the old orthogonal system. Note that the columns of the matrix A are built from the coordinates of the skew basis vectors.
In order to transform from the  the old orthogonal system to new skew system we need to invert the above equation and we get:
\begin{equation}
\left( \begin{array}{c} a \\ b \end{array}\right) = 
A^{-1} \left( \begin{array}{c} x \\ y \end{array}\right) =
\frac{1}{\alpha_1 \beta_2 - \alpha_2 \beta_1}
\left( \begin{array}{cc} \beta_2 & -\beta_1 \\ -\alpha_2 & \alpha_1 \end{array}\right)
\left( \begin{array}{c} x \\ y \end{array}\right) 
\end{equation}
The above invverse matrix $A^{-1}$ should be computed once and then used for the transformation of all needed points. The inversion is possible when the respective denominator is not zero, i.e. when the new skew axes are not parallel.