Understanding a transform of 3d plane coordinates to xy plane

831 Views Asked by At

I have a series of random movements that can either go +x, +y, +z. 1/3 chance each. After 1000 steps, the average ending point is 333,333,333. Here is many trials for an average. 500 trials This also forms a plane where each line ends. I wanted to plot these ending points on a xy plane equivalent, where the xy plane origin is 333,333,333. If the x,y ending points are taken directly, I feel it is almost the shadow of the lines ending points projected onto the xy plane. It creates an oval shape if plotted. 2d pic of ending points I found these transforms online that work. x' = x - (y + z)/2 , y' = y - (x + z)/2 , z' = z - (x + y)/2 , x'' = sqrt(3) * (y' - x')/2 , y'' = z' - (x' + y')/2 , Here is a picture of the transformed points 3d histogram What is the general math that explains the transformation of x,y,z points to x,y? I have only taken a "engineer" linear algebra course where I learned nothing, so maybe explain in layman terms. Thank you

1

There are 1 best solutions below

9
On BEST ANSWER

Since the number of steps is the same for all trajectories, endpoints lie on the plane $x+y+z=1000$:

enter image description here

Due to the initial symmetry, the distribution of endpoints on this plane is symmetric with regard of 120° rotations around vector $\vec e=(1,1,1)$ (permutation of axes $x,y,z$).

If you consider only $x,y$ coordinates of the endpoints, you will get a projections of this plane (and the distribution) onto $xy$ plane. In other words, you will get a shadow indeed.

You other transformation can be written as: $$ \begin{pmatrix}x''\\y'' \end{pmatrix} = \begin{pmatrix} -\frac{\sqrt{3}}{2} & \frac{\sqrt{3}}{2} & 0 \\ -\frac{1}{2} & -\frac{1}{2} & 1 \\ \end{pmatrix} \begin{pmatrix} 1 & -\frac{1}{2} & -\frac{1}{2} \\ -\frac{1}{2} & 1 & -\frac{1}{2} \\ -\frac{1}{2} & -\frac{1}{2} & 1 \\ \end{pmatrix} \begin{pmatrix}x\\y\\z \end{pmatrix} = \begin{pmatrix} -\frac{3 \sqrt{3}}{4} & \frac{3 \sqrt{3}}{4} & 0 \\ -\frac{3}{4} & -\frac{3}{4} & \frac{3}{2} \\ \end{pmatrix} \begin{pmatrix}x\\y\\z \end{pmatrix} $$

If you consider two rows of the transformation matrix as vectors: $\vec u=\left(\frac{3 \sqrt{3}}{4}, \frac{3 \sqrt{3}}{4}, 0\right)$, $\vec v=\left(-\frac{3}{4}, -\frac{3}{4}, \frac{3}{2}\right)$, you can notice that both of them are orthogonal to the normal of the plane $\vec e$: $$\vec u\cdot\vec e = 0\qquad \text{and} \qquad\vec v\cdot\vec e = 0.$$ That means both of them lie on the plane. Moreover, they are orthogonal to each other: $\vec u\cdot\vec v=0$ and they lengths are equal $|\vec u|=|\vec v|$. That means this transformation doesn't skew the distribution unlike $xy$ projection.

However, this transformation scales the distribution, since $k=|\vec u|=|\vec v| = \sqrt{\frac{27}8}\approx 1.84$. So the distribution on your 3d histogram appear $k$ times wider that it would look like if we just took points on the plane. In order to fix this, you need to divide all the numbers in your final matrix by $k$: $$ \begin{pmatrix}x'''\\y''' \end{pmatrix} = \begin{pmatrix} -\frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0 \\ -\frac{1}{\sqrt{6}} & -\frac{1}{\sqrt{6}} & \sqrt{\frac{2}{3}} \\ \end{pmatrix} \begin{pmatrix}x\\y\\z \end{pmatrix} $$

And the distribution looks like this:

enter image description here