Confusion when converting between reference frames

50 Views Asked by At

I am currently working on a problem where I am trying to convert a 2-D coordinate system into a 3-D coordinate space that shares a common origin. Say in 3-D space, I have two known vectors, r1 and r2 that branch from the origin. These vectors form a plane that contains some point "P". Looking at all of these points along the 2-D plane, I have the 2-D position coordinates of the known vectors, and the 2-D position of point "P". Using this information, and assuming that these points do in fact line up, how can I find the 3-D coordinates of point "P"?

I know this is kind of a strange question, so here is an example I made (I intentionally made the vectors perpendicular since it is easier to work with, but they wont be for my problem)

3-D: Visual Representation of 3-D space

r1 = <1, 2, 1>

r2 = <2, 1, -4>

P = <?, ?, ?

2-D:Visual Representation of points in 2-D Plane

r1 = <2, sqrt(2)>

r2 = <sqrt(7), -sqrt(14)>

P = <1, 3>

2

There are 2 best solutions below

0
On BEST ANSWER

I ended up figuring it out, it was actually fairly simple once I broke it down into a series of variables. I am going to post the answer here in case anyone else runs across a problem like this.

Essentially, the problem becomes a simple rotation matrix problem, where

R = [a, b, c ; d, e, f]

X = <x,y> (2-D)

V=<u,v,w> (3-D)

where RX=V.

This simply solves to be

a=(u1y2 - u2y1)/(x1y2-x2y1)

b=(u2x1 - u1x2)/(x1y2-x2y1)

c=(v1y2 - v2y1)/(x1y2-x2y1)

d=(v2x1 - v1x2)/(x1y2-x2y1)

e=(w1y2 - w2y1)/(x1y2-x2y1)

f=(w2x1 - w1x2)/(x1y2-x2y1)

0
On

If $r_1, r_2$ have the same lengths and angle between them in both your 2D plane and in 3D space, then the general process is:

  1. Express $P$ as a linear combination of $r_1, r_2$ in the plane: $P = ar_1 + br_2$ for some real numbers $a, b$.
  2. Locate $P$ in 3D space as the same linear combination of the 3D versions of $r_1, r_2$ (for convenience, let me call the 3D versions $r_1', r_2'$): $P' = ar_1' + br_2'$.

The hard part is finding the $a,b$ with $P = ar_1 + br_2$. But if you can rewrite it as $$P = R\begin{bmatrix}a\\b\end{bmatrix}$$ where $$R=\begin{bmatrix}r_{1x}&r_{2x}\\r_{1y}&r_{2y}\end{bmatrix}$$ Because $r_1$ and $r_2$ are linearly independent, $R$ is invertible, so $$\begin{bmatrix}a\\b\end{bmatrix} = R^{-1}P$$

Per your example, $$R = \begin{bmatrix}2&\sqrt 7\\\sqrt 2&-\sqrt{14}\end{bmatrix}$$ whose determinant is $-3\sqrt{14}$ and so $$R^{-1} =\frac{-1}{3\sqrt{14}}\begin{bmatrix}-\sqrt{14}&-\sqrt 2\\-\sqrt 7&2\end{bmatrix}$$ and $$\begin{bmatrix}a\\b\end{bmatrix} = R^{-1}\begin{bmatrix}1\\3\end{bmatrix} = \begin{bmatrix}\frac13 + \frac 1{\sqrt 7}\\\frac 1{3\sqrt2} - \frac 2{\sqrt{14}}\end{bmatrix}$$ and in $\Bbb R^3$ we get $$P = \left(\frac13 + \frac 1{\sqrt 7}\right)\begin{bmatrix}1\\2\\1\end{bmatrix} + \left(\frac 1{3\sqrt2} - \frac 2{\sqrt{14}}\right)\begin{bmatrix}2\\1\\-4\end{bmatrix}$$