# Conversion from Cartesian to non-orthogonal skewed coordinate system

I have the coordinates of a point in a right-handed Cartesian coordinate system that has an angle of 90° between the two axes. I want to convert these coordinates to those in a new system that has the same origin, but whose axes are skewed and the internal angle between them is 120°. See the link below for a graphic (the graphic is not perfectly drawn, but conveys the idea. The red lines are the new coordinate system). The X and Y axes in the new system are tilted, with the internal angle being 120°.

How do I do this? If anyone can point to the formula, would be great.

Conversion from Cartesian to skewed coordinate system

Call your new basis $(e_1', e_2')$. We have $$(e_1', e_2') = (e_1, e_2) \cdot \left( \begin{matrix}\frac{1}{2} & \frac{1}{2} \\ -\frac{\sqrt{3}}{2} & \frac{\sqrt{3}}{2}\end{matrix} \right)$$

Let $\left( \begin{matrix} x \\ y \end{matrix}\right)$ the coordinates of a vector $v$ in base $(e_1, e_2)$, and $\left( \begin{matrix} x' \\ y' \end{matrix}\right)$ the coordinates of the same vector in base $(e_1', e_2')$. Then we have $$v = (e_1, e_2) \cdot \left( \begin{matrix} x \\ y \end{matrix}\right)= (e_1', e_2') \cdot \left( \begin{matrix} x' \\ y' \end{matrix}\right)$$

From the two equalities above it follows that we have $$\left( \begin{matrix} x' \\ y' \end{matrix}\right)= \left( \begin{matrix}\frac{1}{2} & \frac{1}{2} \\ -\frac{\sqrt{3}}{2} & \frac{\sqrt{3}}{2}\end{matrix} \right )^{-1} \cdot \left( \begin{matrix} x \\ y \end{matrix}\right)=\left( \begin{matrix}1 & -\frac{1}{\sqrt{3}} \\ 1 & \frac{1}{\sqrt{3}}\end{matrix} \right ) \cdot \left( \begin{matrix} x \\ y \end{matrix}\right)=\left( \begin{matrix} x-\frac{1}{\sqrt{3}}y \\ x + \frac{1}{\sqrt{3}}y\end{matrix}\right)$$

Moral: if you multiply a basis by a matrix to get another basis, the component vector in the other basis are obtained by multiplying the component vector for the first basis with the inverse matrix -- with the note that bases get multiplied on the right and component vectors on the left.

For two linear coordinate systems that share the same origin, in order to get the general conversion from system A into system B it is sufficient to take just the points $(1,0)$ and $(0,1)$ in system A and find the coordinates of those points in system B.

Suppose the coordinates of these points in system B turn out to be $(a,b)$ (for the point called $(1,0)$ in system A) and $(c,d)$ (for the point called $(0,1)$ in system A). Then just as any point $(x,y)$ in system A is really just $x$ times the coordinates of $(1,0)$ and $y$ times the coordinates of $(0,1),$ when we translate the coordinates into system B we get $x$ times the coordinates of $(a,b)$ and $y$ times the coordinates of $(c,d),$ that is, $$(x,y) \text{ in system A} \mapsto (ax + cy, bx + dy) \text{ in system B}.$$

I assume you meant to rotate the axes but not to change the scale, that is, one unit along an axis in the skewed system is equal to one unit along the axis in the Cartesian system. Then in your particular systems of coordinates, the Cartesian coordinates $(1,0)$ occur at the coordinates $(1,1)$ in the skewed system, which can be seen by constructing two equilateral triangles using the Cartesian point $(1,1)$ and the two skewed axes.

A line through the Cartesian point $(0,1)$ parallel to the $x$ axis intersects the skewed $x$ axis at $x=-2/\sqrt3$ and the skewed $y$ axis at $y=2/\sqrt3$; since the Cartesian point $(0,1)$ is at the midpoint between those two intersection points, its coordinates in the skewed system are $(-1/\sqrt3, 1/\sqrt3).$

So if you have a point with coordinates $(x,y)$ in the Cartesian system, its coordinates in the skewed system are $$\left(x - \frac1{\sqrt3} y, x + \frac1{\sqrt3} y\right).$$