For the transformation to be canonical, the Poisson bracket of \( Q \) and \( P \) must satisfy:
\[
\{ Q, P \} = 1.
\]
The Poisson bracket is given by:
\[
\{ Q, P \} = \frac{\partial Q}{\partial r} \frac{\partial P}{\partial p} - \frac{\partial Q}{\partial p} \frac{\partial P}{\partial r}.
\]
Substituting the given forms of \( Q \) and \( P \):
\[
Q = \vec{a} \cdot \vec{r}, P = \vec{b} \cdot \vec{r}.
\]
The Poisson bracket simplifies to:
\[
\{ Q, P \} = \vec{a} \cdot \vec{b}.
\]
For the transformation to be canonical, we require:
\[
\vec{a} \cdot \vec{b} = 1.
\]
Thus, the value of \( \vec{a} \cdot \vec{b} \) is \( -1 \).