3
$\begingroup$

I need to find the angle between a vector: $$(2,2,1,1)$$ and a linear subspace spanned by vectors: $$(3,4,-4,-1)$$ and $$(0,1,-1,2)$$

I know how to find the angle between two vectors using scalar product. But not a linear subspace.

I tried this:

I found a basis of that linear subspace: $$(3,4)$$ $$(0,1)$$

And then tried to find angle between vector x and any vector constructed with that basis, but it didn't work out

Its from task book, so i know the answer, its 60

$\endgroup$
4
  • 1
    $\begingroup$ I don't think that angle between a vector and vector space is defined. What is the angle between front wall and the line which separates front wall from side wall? Not defined. Could it be that you are referring to angle between projection of a vector on a vector space and the vector? $\endgroup$ Commented May 11, 2020 at 23:31
  • $\begingroup$ @Koro It's defined as the minimum angle between the given vector and any vector in the subspace, or equivalently, as the angle between the given vector and that vector's projection onto the subspace. $\endgroup$ Commented May 11, 2020 at 23:35
  • $\begingroup$ I think the angle between a vector $x\in H$ and a closed linear subspace $V\subset H$ of a Hilbert space $H$ is the angle between $x$ and $p(x)$, where $p\colon H\to H$ is the orthogonal projection onto $V$. $\endgroup$ Commented May 11, 2020 at 23:39
  • 1
    $\begingroup$ The vectors $(3,4)$ and $(0,1)$ have the wrong dimension to interact with anything else in this problem. You don't need to find a basis; it's given to you as $(3,4,-4,-1)$ and $(0,1,-1,2)$. ("Vectors span a space" and "a space has a basis" are just reverse ways around of saying the same thing.) $\endgroup$ Commented May 11, 2020 at 23:39

2 Answers 2

2
$\begingroup$

Call the vectors that span your subspace $a$ and $b$. Call $X$ the matrix whose columns are those vectors.Then, the projection of the given vector $y=(2,2,1,1)$ onto the subspace is given by $$ w=X(X^TX)^{-1}X^Ty $$ Finally, just find the angle between $y$ and $w$ using the dot product.

$\endgroup$
7
  • $\begingroup$ and where this formula is from? $\endgroup$ Commented May 11, 2020 at 23:46
  • $\begingroup$ This must be missing an inverse operation somewhere. It should be independent of multiplying $a$ or $b$ or $X$ by a scalar. $\endgroup$ Commented May 11, 2020 at 23:48
  • $\begingroup$ This is the formula for the projection matrix onto a subspace. There are several ways to prove it. One way is to minimize the distance to the subspace, as you do in least squares minimization (linear regression). Observe that if the subspace is one-dimensional, it reduces to the projection of one vector in the direction of another. $\endgroup$ Commented May 11, 2020 at 23:48
  • $\begingroup$ Check this google.com/… $\endgroup$ Commented May 11, 2020 at 23:50
  • $\begingroup$ @aschepler you are right. I had a typo in the formula, forgot the inverse. I corrected it. $\endgroup$ Commented May 11, 2020 at 23:51
1
$\begingroup$

Here is a quite computationally heavy approach:

  1. Let $V$ be the linear span of the vectors $\vec{v}_{1}:=(3,4,−4,−1)$ and $\vec{v}_{2}:=(0,1,−1,2)$. Let $\vec{v}$ be the vector $(2,2,1,1)$.
    1. Compute an orthonormal basis $(\vec{e}_{1},\vec{e}_{2})$ of $V$ using Gram-Schmidt: $$\vec{e}_{1}:=\frac{\vec{v}_{1}}{\|\vec{v}_{1}\|},\qquad\vec{e}_{2}:=\frac{\vec{v}_{2}-\frac{\langle\vec{v}_{1},\vec{v}_{2}\rangle}{\langle\vec{v}_{1},\vec{v}_{1}\rangle}\vec{v}_{1}}{\left\|\vec{v}_{2}-\frac{\langle\vec{v}_{1},\vec{v}_{2}\rangle}{\langle\vec{v}_{1},\vec{v}_{1}\rangle}\vec{v}_{1}\right\|}.$$
    2. Then $p\colon\mathbb{R}^{4}\to\mathbb{R}^{4}$ defined by $$p(\vec{x}):=\langle\vec{x},\vec{e}_{1}\rangle\vec{e}_{1}+\langle\vec{x},\vec{e}_{2}\rangle\vec{e}_{2}$$ is the orthogonal projection onto $V$.
    3. The angle $\theta$ between $\vec{v}$ and $V$ is then given by the angle $\theta$ between $\vec{v}$ and $p(\vec{v})$, i.e. $$\theta=\arccos\left(\frac{\langle\vec{v},p(\vec{v})\rangle}{\|\vec{v}\|\|p(\vec{v})\|}\right).$$
$\endgroup$
3
  • $\begingroup$ step 3 is very unclear to me. could you explain please? what does <> brackets mean? $\endgroup$ Commented May 16, 2020 at 20:57
  • $\begingroup$ it seems like its wrong formula for projection $\endgroup$ Commented May 16, 2020 at 21:24
  • $\begingroup$ @manabou11 The brackets $\langle\cdot,\cdot\rangle$ are the dot-product on $\mathbb{R}^{4}$. It is the conventional notation for an inner-product. Without an inner-product, we cannot (as far as I know) determine the angle between vectors in a vector space. Also, take a look at this. It shows that the formula in step 3 is in fact correct. $\endgroup$ Commented May 16, 2020 at 21:44

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.