# What is distance between two points in a parallel coordinate system?

We know the distance between two points in a cartesian coordinate system.
$$d=\sqrt{(x_{2}-x_{1})^2+(y_{2}-y_{1})^2}$$

So how can we find the formula for the distance between points $$A(x_{1},y_{1}), B(x_{2},y_{2})$$ in a parallel coordinate system?

(Parallel Coordinate system : Let's take two lines intersecting each other at any angle in the plane. Let's orient these lines by thinking of them as number lines and consider these number lines as coordinate axes.From any point P in the plane to a pair consisting of numbers corresponding to the marked distances of the parallels drawn to these axes; They are called parallel coordinates of P or Descartes coordinates.)

• Do you mean something of this sort? – Tavish Dec 21 '20 at 12:30

Just use the cosine rule: $$d=\sqrt{(x_{2}-x_{1})^2+(y_{2}-y_{1})^2-2(x_{2}-x_{1})(y_{2}-y_{1})\cos(\pi-\theta)}$$ or $$d=\sqrt{(x_{2}-x_{1})^2+(y_{2}-y_{1})^2+2(x_{2}-x_{1})(y_{2}-y_{1})\cos(\theta)}$$ where $$\theta$$ is the angle between the axes.

Assume that you have two lines $$L_1, L_2$$, passing through the origin, which you wish to be your new axes. By themselves the lines are not enough, we also need to specify where the marked points are. Let $$P_1, P_2$$ be the points with new coordinates $$(1,0)$$ and $$(0,1)$$ respectively. Let $$(a,b)$$ and $$(c,d)$$ be their Cartesian coordinates.

Let $$A = \pmatrix{a & c \\ b & d}$$. Then we have

\begin{align*} A\pmatrix{0 \\ 0} &= \pmatrix{0 \\ 0} \\ A\pmatrix{1 \\ 0} &= \pmatrix{a \\ b} \\ A\pmatrix{0 \\ 1} &= \pmatrix{c \\ d} \end{align*}

So that $$A: \mathbb{R}^2 \to \mathbb{R}^2$$ maps your parallel coordinates to Cartesian coordinates. Therefore, let $$(x_1,y_1)$$, $$(x_2, y_2)$$ be the parallel coordinates of two points. Then the distance is

$$d^2 = \left|A\pmatrix{x_1 \\ y_1} - A\pmatrix{x_2 \\ y_2}\right|^{2} = \left|A\pmatrix{x_1-x_2 \\ y_1-y_2} \right|^{2} = \pmatrix{x_1 - x_2 & y_1-y_2}A^TA\pmatrix{x_1-x_2 \\ y_1 - y_2}.$$

Notice that if $$A$$ is a rotation matrix (for example), then the distance is unchanged. More generally, the distance is unchanged whenever $$A^TA = I$$, in other words when $$A$$ is an isometry.

In general, $$A^TA = \pmatrix{a^2+b^2 & ac+bd \\ ac+bd & c^2+d^2}.$$

Therefore, writing $$\Delta x = x_1-x_2$$, $$\Delta y = y_1 - y_2$$, we have

$$d^2 = (a^2+b^2)\Delta x^2 + 2(ac+bd)\Delta x \Delta y + (c^2 + d^2) \Delta y^2.$$