# 3D to 2D projections, a generalization

Given some data points in 3D, $X\in\mathbb{R}^{n\times 3}$, could one say that $$Y=XP,$$ for some $P\in\mathbb{R}^{3\times 2}$ actually corresponds to a particular viewpoint on a 3D data? Basically, does any $P$ correspond to a viewpoint, which is a 2D projection?

I'm trying to understand the relation, and I'm interested in whether one is left with more degrees of freedom by choosing $P$, or simply by choosing a viewpoint. What is the relation between the two?

In order to answer your question, I need to clarify a few things, especially because I've noticed that in at least three of your previous questions, the word "projection" tends to be used very loosely. Projection is a technical term, and as such, it's vitally important that it have a precise meaning, so here it is:

Definition: A projection matrix $P$ is a matrix $\mathbb{R}^{n \times n}$ for some $n$ such that $P^2 = P$. (cf. Wikipedia, projection (linear algebra) and also Generalized Inverses: Theory and Applications, Second Edition, p.58-64; Strang's books on linear algebra supposedly have a nice discussion of projection matrices also.)

The usage of "projection" in the sense of mapping from $\mathbb{R}^{n}$ to $\mathbb{R}^{m}$ also occurs in the literature, but its use is confusing, at best, especially since that notion is strongly related to (and thus conflated with) the definition above. (See Wikipedia, projection (mathematics).)

If you have a projection matrix $P$, then its range $\mathcal{R}(P)$ and nullspace $\mathcal{N}(P)$ are complementary subspaces, which is to say that $\mathcal{R}(P) \cap \mathcal{N}(P) = \{0\}$, and any vector in $\mathbb{R}^{n}$ can be decomposed uniquely into the sum of a component in $\mathcal{R}(P)$ and a component in $\mathcal{N}(P)$. This relationship is denoted notationally as a direct sum: $\mathcal{R}(P) \oplus \mathcal{N}(P) = \mathbb{R}^{n}$.

When you take a vector $x$ and project it onto $\mathcal{R}(P)$ along $\mathcal{N}(P)$, you are calculating $y = Px$. Let $\mathcal{R}(P)$ have dimension $m \leq n$. If we change coordinate systems, points in the subspace $\mathcal{R}(P)$ can be represented such that only $m$ coordinates have nonzero values; that is, we could represent them as a point in $\mathbb{R}^{m}$ instead, leading to the irritatingly confusing abuse of terminology "projecting from $n$-D to $m$-D".

The matrix $P$ can be decomposed as $P = XY^{*}$ (see G. W. Stewart's paper "On the Numerical Analysis of Oblique Projectors", SIAM Journal of Matrix Analysis and Applications, Vol. 32, pp. 309-342)), such that:

• $X \in \mathbb{R}^{n \times m}$
• $\mathcal{R}(X) = \mathcal{R}(P)$
• $Y \in \mathbb{R}^{n \times m}$
• $Y \in \mathcal{R}(P^{*})$
• $Y^{*} \in \mathcal{N}(P)$.

Such a decomposition is not unique; for given values of $X$ and $Y$ satisfying the relationships above, $Y^{*}$ is the mapping from $\mathbb{R}^{n}$ to $\mathbb{R}^{m}$ loosely referred to as a "projection from $n$-D to $m$-D".

The specific relationship you're talking about would be where $n = 3$ and $m = 2$; depending on how you pick the range and nullspace, you'll get a different mapping of your 3D points onto 2D.

However, the range and nullspace only refer to perspective (the direction from where you're viewing) and not the viewpoint (the exact location you're viewing from, along that direction). The viewpoint is more like a shift of origin (if you can shift your coordinate system however you want, then this shift doesn't matter, but in a lot of concrete applications, it does). For a given $x \in \mathbb{R}^{n}$, the map you want would look something like

\begin{align} \tilde{x} = Y^{*}(x - x_{0}), \end{align}

where $\tilde{x} \in \mathbb{R}^{m}$, and $x_{0} \in \mathbb{R}^{n}$ corresponds to the shift in origin from $0$ to $x_{0}$.

• Thanks for the answer and the suggestion from the beginning. I have to admit that the term "projection" is used in an unusual way. So, your answer implies that the actual viewpoint change $Y=(X-X_0)Z$ (X_0 should be understood as a matrix responsible for the origin shift) offers more choices on the resulting 2D configuration than the direction change $Y=XZ$ (I suppose my interpretation is right). However, with my application the origin is fixed, and I only perform $Y=XZ$, thereby only changing the direction? – usero May 10 '12 at 12:49