Given a vector, how can I limit other vectors passing through its perpendicular?

242 Views Asked by At

I have an vector in space that I want to use to 'restrict' other vectors, but I've no idea how. Since I don't know how to explain this using math terms, here's a picture:

Question Example

The blue line represents the vector that will 'restrict' the other vectors.

Green lines represent other vectors that should be 'restricted'.

The red line is perpendicular to the 'restricting' vector (blue line) - green lines passing through this line should be 'restricted' to this line.

For more clarification: If the limiting vector was something like $(0, 5)$, all other vectors would have their $Y$ values limited to $(-\infty, 5]$, but it's not that simple when the blue vector is not axis-aligned.

2

There are 2 best solutions below

4
On BEST ANSWER

There are a couple of ways to interpret what you mean by “limiting” a vector, but based on your example of $(0,5)$ as the limiter, it looks like you want to trim the component that’s parallel to the limiting vector. This is easily done by projecting onto the limiter.

Let $\mathbf v$ be the “limit” vector. Given a vector $\mathbf x$ that is to be trimmed, first compute the scalar projection $p$ of $\mathbf x$ onto $\mathbf v$: $$p = {\mathbf x\cdot\mathbf v \over \|\mathbf v\|}.$$ If $p\le\|\mathbf v\|$ then there’s nothing to do. Otherwise, decompose $\mathbf x$ into its components $\mathbf x_\parallel$ and $\mathbf x_\perp$ parallel and orthogonal, respectively, to $\mathbf v$, and replace $\mathbf x_\parallel$ with $\mathbf v$. The orthogonal component is $$\mathbf x_\perp = \mathbf x - {p\over\|\mathbf v\|}\mathbf v,$$ the orthogonal rejection of $\mathbf x$ from $\mathbf v$ and so the trimmed vector is $$\mathbf x_\perp+\mathbf v = \mathbf x + \left(1 - {p\over\|\mathbf v\|}\right)\mathbf v = \mathbf x + \left(1-{\mathbf x\cdot\mathbf v \over \mathbf v\cdot\mathbf v}\right)\mathbf v.$$ You can even combine this expression with the test if you like: $$\mathbf x + \min\left(0,1-{\mathbf x\cdot\mathbf v \over \mathbf v\cdot\mathbf v}\right)\mathbf v$$

If instead you just want to shorten $\mathbf x$ without changing its direction, simply multiply the entire vector by ${\|\mathbf v\|\over p}$ without performing the above decomposition.

1
On

I think you are trying to describe the following:

Let $O$ denote the origin. Suppose you're given a (blue) point $P$. Let $\ell$ be the (red) line through P that is perpendicular to $\overline{OP}$.

If I'm given another (green) point $Q$, how do I tell whether $O$ and $Q$ are on the same side of $\ell$?

For the sake of arithmetic, I will treat points as vectors. I will assume further that $P \neq O$.

  • $Q$ lies on $\ell$ if and only if $(Q-P) \cdot P = 0$
  • Two points $Q$ and $R$ are on the same side of $\ell$ if and only if $(Q-P) \cdot P$ and $(R-P) \cdot P$ have the same sign.

In particular, $Q$ and $O$ are on the same side of $\ell$ if and only if $(Q-P) \cdot P$ is negative. Or equivalently, when $Q \cdot P < P \cdot P$

Here, $\cdot$ means the dot product of vectors. One way to prove these formulas are correct is:

  • Formulas involving dot products remain true if you rotate a diagram around the origin
  • These formulas are true in the case you understand: when $P$ lies on the $y$ axis.

As an aside, how I personally arrived at these formula is that I know these sorts of questions usually reduce to checking the results of a linear equation.

I determined the formula that gives zero if and only if a point lies on the given line. Then the points that give positive values for this formula all lie on one side of the line, and the points that give negative values for this formula lie on the other side.

To determine that formula, let $v$ be perpendicular to $P$. Then $Q$ lies on $\ell$ iff $Q = P + kv$ for some scalar $k$. Taking the dot product with $P$ eliminates the unknown constant; the equation reduces to $Q \cdot P = P \cdot P$. Since $Q \cdot P = P \cdot P$ is a single (scalar) linear equation in the variable $Q$, its solution space is one dimensional, and thus is exactly the line $\ell$.