1
$\begingroup$

Let's suppose I have a vector $\vec{a}$ and arbitrary many vectors (in my example two: $\vec{b}$ and $\vec{c}$), which all have a common starting point P. Now I want to find out which of these vectors is most "aligned" to $\vec{a}$, so which vector is most parallel to it (On my image, it would be $\vec{b}$).

enter image description here

I know that I could use the dot product to calculate the angle between a and the other vectors and take the one with the smallest angle. But the challenge here is that I must not to use functions/operations which yield irrational output. So when I take for example the dot product, I need to calculate the unit vector, which requires the square root. But a square root produces an irrational number. So is it possible to solve this problem just with "rational operations"?

$\endgroup$

1 Answer 1

1
$\begingroup$

You want $\left( \dfrac{|\vec{a} \cdot \vec{b}|}{||\vec{a}||\, ||\vec{b}||} \right) \gt \left(\dfrac{|\vec{a} \cdot \vec{c}|}{||\vec{a}||\, ||\vec{c}||} \right)$, i.e. $\dfrac{|\vec{a} \cdot \vec{b}|}{ ||\vec{b}||} \gt \dfrac{|\vec{a} \cdot \vec{c}|}{ ||\vec{c}||} $

This is equivalent to $\dfrac{(\vec{a} \cdot \vec{b})^2}{\vec{b} \cdot \vec{b}} \gt \dfrac{(\vec{a} \cdot \vec{c})^2}{\vec{c} \cdot \vec{c}} $, which may count as just using rational operations.

Just find the equivalent for multiple vectors and choose the maximum.

$\endgroup$
1
  • $\begingroup$ Awsome! Thanks. $\endgroup$
    – NMO
    Commented Feb 9, 2016 at 23:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .