# Find s in terms of p and c for certain equations

$s$, $p$ and $c$ are vectors; I need to find $s$ in terms of the other two for:

(1) $| s - c | = 1$

(2) $s = \lambda p$ ( $\lambda$ is a constant )

How can I use the constant $\alpha = (p \cdot c)^2 - p^2 * (c^2 - 1)$?

There may be no solution.

-
This is the second problem of the same kind posted within the last hour or so: math.stackexchange.com/questions/33183/… ; are these part of some more general problem, an assignment? What is the context for these problems? – Arturo Magidin Apr 15 '11 at 19:51
The problems are part of some past papers I'm working on for a Maths Methods exam. – Sorin Cioban Apr 15 '11 at 20:23

The question is not entirely clear. I will try to make a clear question from it, using more or less your notation. It may not be the question you intended to ask!

Let the vectors $p$ and $c$ be given. Find a constant $\lambda$ such that if $s=\lambda p$, then $|s-c|=1$.

Solution: For any vector $v$, $|v|=\sqrt{v\cdot v}$. Since $s=\lambda p$, we want $$(\lambda p -c)\cdot(\lambda p -c)=1$$ Expanding the dot product according to the usual rules, we obtain $$\lambda^2 (p\cdot p) -2\lambda (p\cdot c) +c\cdot c-1=0$$ The above equation is a quadratic equation in $\lambda$ (unless $p$ is the zero-vector).

Solve for $\lambda$ using the Quadratic Formula. Note that there may not be a (real) solution.

-
@user6312: "quadratic equation in $\lambda$ (unless $c$ is the zero-vector)" should be "(unless $p$ is the zero vector)". – Arturo Magidin Apr 15 '11 at 20:33
@Arturo Magidin: Thank you! I have made the correction. – André Nicolas Apr 15 '11 at 20:48

Just as in the other problem you posted, since $s=\lambda\cdot p$, if you know $\lambda$ then you know $s$. If $p=0$, then there is a solution if and only if $|c|=1$, in which case the solution is $s=0$.

Assume $p\neq 0$.

Plugging $s=\lambda p$ into the first equation, you know that $$|\lambda p - c| = 1.$$ Since $|v|^2 = v\cdot v$ for any vector $v$, this gives $$1 = (\lambda p - c)\cdot (\lambda p - c) = \lambda^2 (p\cdot p) - 2\lambda(p\cdot c) + (c\cdot c),$$ or equivalently, that $$(p\cdot p)\lambda^2 - 2(p\cdot c)\lambda + \bigl( (c\cdot c)-1\bigr) = 0.$$ This is a quadratic equation in $\lambda$; if the discriminant $$4(p\cdot c)^2 - 4(p\cdot p)\bigl((c\cdot c)-1\bigr) = 4\alpha$$ (with $\alpha$ the correct version of what you write above; see note at the end) is negative, there are no solutions. If $4\alpha$ is nonnegative, then solving for $\lambda$ gives that $$\lambda = \frac{2(p\cdot c) + \sqrt{4(p\cdot c)^2 - 4(p\cdot p)\bigl((c\cdot c)-1\bigr)}}{2(p\cdot p)}$$ or $$\lambda = \frac{2(p\cdot c) - \sqrt{4(p\cdot c)^2 - 4(p\cdot p)\bigl((c\cdot c) - 1\bigr)}}{2(p\cdot p)}.$$ which yields (up to) two possible solutions for $\lambda$, hence up to two values for $s$.

The constant $\alpha$ in your statement is a rather bad attempt at describing (one fourth of) the discriminant. $p^2$ should be $p\cdot p$ and $c^2$ should be $c\cdot c$. Using $$\alpha = (p\cdot c)^2 - (p\cdot p)\bigl((c\cdot c) - 1\bigr)$$ and simplifying, we can write it as:

• If $p=0$, then no solutions if $|c|\neq 1$, and $s=0$ is the unique solution if $|c|=1$.
• If $p\neq 0$ and $\alpha\lt 0$, then no solutions;
• If $p\neq 0$ and $\alpha\geq 0$, then the solutions are given by $$\lambda = \frac{(p\cdot c) + \sqrt{\alpha}}{p\cdot p},\qquad\text{and}\qquad \lambda = \frac{(p\cdot c) - \sqrt{\alpha}}{p\cdot p}.$$
-
I'm beginning to recognize your posts before I see your name under them -- I saw the question and saw the beginning of your answer and thought, this must be another one of those admirable thorough and patient explanations by Arturo :-) You're really making quite an extraordinary contribution to this site. – joriki Apr 15 '11 at 23:09
@joriki: Thank you kindly! – Arturo Magidin Apr 15 '11 at 23:47