# Calculate most parallel vector

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}$).

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"?

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.