# Convert coordinates from Cartesian system to non-orthogonal axes

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?

-

1. What's the angle between your axes? 2. Does your system share an origin with the Cartesian one? – J. M. Sep 7 '11 at 16:00
The angle between the axes is arbitrary. If it helps, they could share an origin with the Cartesian one. – andygeers Sep 7 '11 at 16:07
– J. M. Sep 7 '11 at 16:11
In the standard Cartesian frame, the basis is $e_1,e_2$. Choose $I=(e_1,e_2)$. Now your basis is $a_1,a_2$, choose $A=(a_1,a_2)$. Then the relationship between the new coordinate $x'$ and old one $x$ is $Ix=Ax'$. So $x'=A^{-1}x$ – Shiyu Sep 8 '11 at 1:47

## 3 Answers

Sure. Let's approach this in a very elementary way: with matrix algebra.

Suppose that our two new 'basis vectors' are given by $(\alpha _1, \alpha _2)$ and $(\beta _1, \beta_2)$, e.g. $(1,1)$ and $(1,0)$.

Then our goal is to find a linear combination of them such that we can express some given vector, which we will imaginatively denote as $(x, y)$. In particular, this will allow us to find where a standard point is in our new, nonstandard coordinate system.

But this is nothing more than solving the system: $$\left( \begin{array}{cc} \alpha_1 & \beta_1 \\ \alpha_2 & \beta_2 \end{array} \right) \left( \begin{array}{c} a \\ b \end{array}\right)= \left( \begin{array}{c} x \\ y\end{array}\right)$$ for the unknown a and b values. In particular, this means that if the matrix is invertible (meaning that your axes are not parallel), then you can immediately find where any particular points are in your system.

Is that what you were looking for?

-

I'll make the assumption that the oblique coordinate system $(u,v)$ with angle $\varphi$ and the Cartesian system $(x,y)$ share an origin.

Consider the following diagram:

We have at once the relationship $x=u+h$. The acute angle formed by the $v$-axis and $h$ is $\varphi$, since alternate interior angles in a pair of parallel lines are congruent. We use trigonometry to deduce the relation $y=h\tan\,\varphi$. Eliminating $h$ gives the equation for $u$: $u=x-y\cot\,\varphi$.

To find an expression for $v$, we see that this length is equal to the length of the hypotenuse of the right triangle with legs $y$ and $h$. This leads to the equation $y=v\sin\,\varphi$. Solving for $v$ gives the equation $v=y\csc\,\varphi$.

Thus, the conversion formulae from Cartesian to oblique coordinates with angle $\varphi$ are

$$\begin{align*}u&=x-y\cot\,\varphi\\v&=y\csc\,\varphi\end{align*}$$

For completeness, the formulae for converting from oblique to Cartesian coordinates are

$$\begin{align*}x&=u+v\cos\,\varphi\\v&=v\sin\,\varphi\end{align*}$$

-

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:

$$\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)$$

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.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 34, "mathjax_display_tex": 5, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9133733510971069, "perplexity_flag": "head"}