# Projecting a surface on another surface

I would like to know if there is a method, and what is called the area of mathematics that studies this kind of things, for projecting surfaces on other surfaces.

Example: suppose to have a half-sphere (3d) centered in $(1,1,1)$. I want to find its projection on the plane $z=0$ as seen from the direction defined by the vector $(1,0,1)$ (the line $z=x$ on the $y=0$). How is then given the parametric formula of the surface "projected"? Basically this is how to find the shape of the shadow of an umbrella, and I would like to generalize it.

• If you want a parameterisation of the projection, find a parameterisation of the surface, and a formula for the projection, and compose them. – Theo Bendit Jun 30 '18 at 15:09
• Thank you, that's exactly what I was thinking for. The problem is the formula of the projection, is there a general method for projecting on a direction? – Lenz Jun 30 '18 at 15:16

If your surface is represented as $$S = S(u,v)$$ given a direction $$\vec n$$

the projection is given as

$$S_{\vec n}(u,v) = S(u,v)-\langle S(u,v), \vec n \rangle \frac{\vec n}{||\vec n||^2}$$

Here $$<\cdot,\cdot>$$ represents the scalar product of two vectors.

Here

$$S(u,v) = \{\cos (v) (\cos (u)+3),\sin (v) (\cos (u)+3),\sin (u)\}\\ \vec n = (1,1,1)$$

NOTE

Regarding the slanted projection with direction $$\vec n$$ in a plane $$\Pi\to \langle p-p_0,\vec a \rangle = 0$$

this projection is generated by the intersection of each line associated to the point $$S(u^*,v^*)$$

$$L\to p = S(u^*,v^*)+\lambda \vec n$$

with the plane $$\Pi$$ so the determination of

$$\lambda^* = -\frac{\langle S_*-p_0,\vec a\rangle}{\langle \vec a, \vec n\rangle}$$

gives the projection image over $$\Pi$$ hence

$$S_{\Pi} = S(u,v)-\left(\frac{\langle S(u,v)-p_0,\vec a\rangle}{\langle \vec a, \vec n\rangle}\right)\vec n$$

so choosing a projection plane as

$$\Pi\to\langle p-p_0,\vec a \rangle = 0$$

with

$$p_0 = -(5,5,5)\\ \vec a = (0,0,1)\\ \vec n = (1,1,1)$$

we have

• The asker wanted to know about non-orthogonal projections though. – Theo Bendit Jun 30 '18 at 15:51
• Thanks, I was exactly thinking about scalar products. I only have a doubt: isn't the definition written by you the definition of projection orthogonal to that vector? – Lenz Jun 30 '18 at 15:52
• @TheoBendit In this case the procedure is analogous. – Cesareo Jun 30 '18 at 15:53
• @Lenz Yes. It is the orthogonal projection but we can use instead any other convenient scalar product. – Cesareo Jun 30 '18 at 15:55
• @TheoBendit Included the slanted projection as required. – Cesareo Jun 30 '18 at 23:00

This is to answer specifically the problem in your comment, about how to find a formula for general (not necessarily orthogonal) projections onto a (hyper)plane. Note: this answer will assume some familiarity with linear algebra.

Let's assume that the plane goes through the origin, as this will make things simpler. If it doesn't, it's not difficult to translate the problem so that the plane does go through the origin. In this case, this is not an issue.

Because the plane goes through the origin, it is a vector subspace. Find a basis for this subspace. Since (hyper)planes are of co-dimension $1$, if you add on any vector not in the plane, it will complete a basis for the entire space. In our case, the list of vectors $((1, 0, 0), (0, 1, 0))$ form a perfectly acceptable basis for the plane.

Next, add on the vector along which you wish to project to the basis to form a basis for the entire space. In our case, our basis for $\mathbb{R}^3$ shall be $$B = ((1, 0, 0), (0, 1, 0), (1, 0, 1))$$ We can define our projection operator $T$ in terms of the basis vectors. $T$ will not change any of the basis vectors in the plane, but it will map the final added vector to $0$. In our case, \begin{align*} T(1, 0, 0) &= (1, 0, 0), \\ T(0, 1, 0) &= (0, 1, 0), \\ T(1, 0, 1) &= (0, 0, 0). \end{align*} We can therefore easily compute the matrix $M(T, B, B)$ of $T$ with respect to the basis $B$. Since we've chosen a basis of eigenvectors, the matrix will be diagonal. In fact, there will be $1$s down the diagonal, except at the bottom-right entry, which will be a $0$. In our case, $$M(T, B, B) = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{pmatrix}.$$ (The above will hold true whenever you work in $3$ dimensions. Changing the dimension will just adjust the number of $1$s.)

Let $S$ be the standard basis. In order to help us find the formula for $T$, we compute the standard matrix $M(T, S, S)$. In order to do this, we use the change-of-basis formula $$M(T, S, S) = M(I, B, S)M(T, B, B)M(I, S, B) = M(I, B, S)M(T, B, B)M(I, B, S)^{-1}.$$ To find $M(I, B, S)$, we put the standard basis vectors as columns. In our case, $$M(I, B, S) = \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}.$$ Compute the inverse, by whatever means you wish. In our case, we get $$M(I, B, S)^{-1} = \begin{pmatrix} 1 & 0 & -1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}.$$ Therefore, $$M(T, S, S) = \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{pmatrix} \begin{pmatrix} 1 & 0 & -1 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & 0 & -1 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{pmatrix}$$ To compute what the projection does to a vector (in our case, in $3$ dimensions, $(x, y, z)$), multiply the transpose of this vector to $M(T, S, S)$. We get $$M(T, S, S)\begin{pmatrix}x & y & z\end{pmatrix}^T = \begin{pmatrix} 1 & 0 & -1 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{pmatrix}\begin{pmatrix}x \\ y \\ z\end{pmatrix} = \begin{pmatrix}x - z & y & 0\end{pmatrix}^T.$$ That is, $T(x, y, z) = (x - z, y, 0)$.

Forgive the complicated steps, but this is how you can do this in full generality.

• Many thanks, a very complete answer! Then the final question: is it possible to generalize this, to be able to project on general surfaces? Example: a sphere next to a torus, i want to see the "shadow" of the sphere on the torus from a fixed direction. I think it may enter the metric of the manifold which i consider? – Lenz Jun 30 '18 at 17:28
• @Lenz I'm not the person to ask about it, but I don't think it's going to have an elegant solution in general. Essentially, it comes down to whether you can compute the points where a line intersects the surface on which you're projecting. It's easy enough to find the line, parallel to the particular direction vector, going through a point. It's not so easy to find the nearest point along that line to a surface in general. If you at least assume finite intersections, it may not be too bad... – Theo Bendit Jun 30 '18 at 17:46