If a box with dimensions x, y, and z exists, an xyz axis is set with a camera having no rotation relative to it, and this box is rotated angle_x degrees, angle_y degrees, and angle_z degrees relative to this axis, how (if possible) can the surface area visible to that camera be found? (This question was difficult to word clearly, so I hope it is understandable).

Hopefully helpful diagram: 1


closed as off-topic by Ben McKay, abx, Jan-Christoph Schlage-Puchta, Pace Nielsen, Chris Godsil Jan 13 at 23:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about research level mathematics within the scope defined in the help center." – Ben McKay, abx, Pace Nielsen, Chris Godsil
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ Find the coordinates of the vertices as vectors. Normalising them gives points on the unit sphere which bound a region with the right surface area. $\endgroup$ – YiFan Jan 4 at 3:36
  • 1
    $\begingroup$ Do you mean the area of the projection to the plane, or just the area on the box's surface that you can see? In the second case, clearly it is either one side, two sides or three sides, depending on how many axes of the box are not perpendicular to the vector from the centre to the observer. $\endgroup$ – Ben McKay Jan 8 at 14:42

This question is perhaps a little too straightforward for this site, but there's a nice trick that might not be completely obvious, and some hidden depths below the surface.

You have two problems. The first is to specify the transformation in some form that's easy to compute with. That will be some matrix taking vectors in $\mathbb R^3$ to vectors in $\mathbb R^2$ (their images under rotation then projection onto the plane of the camera) and will have a form like $$ \begin{pmatrix}1&0&0\\0&1&0\end{pmatrix} \begin{pmatrix}\cos z&-\sin z&0\\\sin z&\cos z&0\\0&0&1\end{pmatrix} \begin{pmatrix}\cos y & 0& -\sin y\\0&1&0\\\sin y &0&\cos y\end{pmatrix} \begin{pmatrix}1&0&0\\0&\cos x&-\sin x\\0&\sin x&\cos x\end{pmatrix}. $$ Exactly what it is isn't important: it's just some projection $\pi$ of $\mathbb R^3$ onto $\mathbb R^2$. After projecting your cube you have a hexagon which is naturally composed of three parallelograms. The sides of these parallelograms are the projections $\pi(e_1), \pi(e_2), \pi(e_3)$ of the standard basis in $\mathbb R^3$, and you can compute their area by taking cross products: the area you're looking for is $$ |\pi(e_1)\times\pi(e_2)|+|\pi(e_1)\times\pi(e_3)|+|\pi(e_2)\times\pi(e_3)|. $$ This picture can be generalised significantly. Let $\pi$ be a projection from a cube $[0,1]^n$ to $\mathbb R^m$. The image $\pi([0,1]^n)$ is called a zonotope and again splits up into paralellepipeds generated by the projections of the standard basis. It might be possible to do this in multiple ways, but you will always need to use one of each type of parallepiped that you can make from $\pi(e_1), \ldots, \pi(e_n)$. This leads to a generalisation of the expression for the area of the symmetric hexagon presented above that is related to the basic properties of a geometric function called the mixed volume.

  • 2
    $\begingroup$ A generally good answer, but two nitpicks and one truly annoying issue. Nitpicks: (1) Parallelograms, not rhombi (2) Cross product, not dot product. Truly annoying issue: This formula is only correct if the camera is far enough away that the map can be approximated as a linear one. If the camera is close to the cube, you get a nonlinear formula involving camera matrices en.wikipedia.org/wiki/Camera_matrix $\endgroup$ – David E Speyer Jan 8 at 14:46
  • $\begingroup$ @DavidESpeyer (1) and (2) are very embarrassing: thank you for spotting them. $\endgroup$ – Ben Barber Jan 8 at 16:31

This question has a nice clean answer as long as the camera is far enough away that it can be treated as a "view from infinity", so that the map taking a point of $\mathbb{R}^3$ to its image on the film is linear. If you need to deal with cameras which are close to the cube (so that, for example, only one face might be visible) life is much harder; read up on camera matrices.

So, the nice answer. Let the camera point in direction $(u,v,w)$ with side lengths $(x,y,z)$. Let $\pi$ be the orthogonal projection of $\mathbb{R}^3$ onto $\mathbb{R}^2$ with kernel $(u,v,w)$; we want to find the area of $\pi(\mathrm{cube})$. As Ben Barber says, this is a hexagon which can be dissected into three parallelograms. The sides of these parallelograms are the three ways to chose two of the three vectors $\pi(x e_1)$, $\pi(y e_2)$, $\pi(z e_3)$; let $P_{ij}$ be the parallelogram with sides $\pi(x e_i)$ and $\pi(y e_j)$. So we need a formula for $\mathrm{Area}(P_{ij})$ in terms of $(u,v,w)$. We could slog this out with cross products, but there is a slicker way.

Consider two parallelepipeds in $\mathbb{R}^3$: Let $B$ have sides $(u,v,w)$, $x e_1$ and $y e_2$ and let $C$ have sides $(u,v,w)$, $\pi(x e_1)$ and $\pi(y e_2)$. Since $C$ is formed from $B$ by sliding the vectors $x e_1$ and $y e_2$ parallel to the common side $(u,v,w)$, they have the same volume. The volume of $B$ is $\left| \det(x e_1, y e_2, (u,v,w)) \right|= x y|w|$.

Since $(u,v,w)$ is perpendicular to $P_{12}$, the volume of $C$ is $|(u,v,w)| \ \mathrm{Area}(P_{12})$, and of course $|(u,v,w)| = \sqrt{u^2+v^2+w^2}$. Setting $\mathrm{Vol}(B) = \mathrm{Vol}(C)$, we have $$\mathrm{Area}(P_{12}) = \frac{x y |w|}{\sqrt{u^2+v^2+w^2}}.$$ The area of the image of the cube is $$ \frac{x y|w|+x z |v|+y z |u|}{\sqrt{u^2+v^2+w^2}}.$$


Not the answer you're looking for? Browse other questions tagged or ask your own question.