The three Pauli matrices are
\begin{align*}
X &= \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, & Y &= \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix}, & Z &= \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}
\end{align*}
Each is hermitian and square to the identity:
\begin{equation*}
X^{2} = Y^{2} = Z^{2} = I_{2}
\end{equation*}
Consider the following function:
\begin{align*}
U_{M}(\theta) &\equiv \exp{\left( \frac{i}{2} \theta M \right)}, & M^{2} &= I_{2}
\end{align*}
The exponential of a matrix is defined in terms of the infinite series
\begin{equation*}
U_{M}(\theta) = \sum_{n = 0}^{\infty} \frac{1}{\Gamma(n+1)} \left( \frac{i}{2} \theta M \right)^{n}
\end{equation*}
First, you split the sum into even and odd powers:
\begin{equation*}
U_{M}(\theta) = \sum_{n = 0}^{\infty} \frac{1}{\Gamma(2n+1)} \left( \frac{i}{2} \theta M \right)^{2n} + \sum_{n = 0}^{\infty} \frac{1}{\Gamma(2n+2)} \left( \frac{i}{2} \theta M \right)^{2n + 1}
\end{equation*}
Then you use the fact that
\begin{align*}
i^{2n} &= (-1)^{n}, & M^{2n} &= I_{2}
\end{align*}
to find
\begin{equation*}
U_{M}(\theta) = I_{2} \sum_{n = 0}^{\infty} \frac{(-1)^{n}}{\Gamma(2n+1)} \left( \frac{1}{2} \theta \right)^{2n} + i M \sum_{n = 0}^{\infty} \frac{(-1)^{n}}{\Gamma(2n+2)} \left( \frac{1}{2} \theta \right)^{2n + 1}
\end{equation*}
Finally, you recognize the sine and cosine infinite series:
\begin{equation*}
U_{M}(\theta) = I_{2} \cos{\left( \frac{\theta}{2} \right)} + i M \sin{\left( \frac{\theta}{2} \right)}
\end{equation*}
Here \(M\) can be any of the three Pauli matrices.
Recall also that the three Pauli matrices anti-commute:
\begin{equation*}
XY + YX = YZ + ZY = ZX + XZ = 0
\end{equation*}
Now consider the following matrix
\begin{align*}
\hat{r} \cdot R &\equiv x X + y Y + z Z, & x^{2} + y^{2} + z^{2} &= 1
\end{align*}
Then it follows that
\begin{equation*}
(\hat{r} \cdot R)^{2} = I_{2}
\end{equation*}
Thus, in general
\begin{equation*}
\exp{\left[ \frac{i}{2} \theta (\hat{r} \cdot R) \right]} = I_{2} \cos{\left( \frac{\theta}{2} \right)} + i (\hat{r} \cdot R) \sin{\left( \frac{\theta}{2} \right)}
\end{equation*}
If you relax the unit 2-sphere condition, then
\begin{align*}
r \cdot R &= x X + y Y + z Z, & x^{2} + y^{2} + z^{2} &\neq 1
\end{align*}
and thus
\begin{equation*}
(r \cdot R)^{2} = \left(\sqrt{x^{2} + y^{2} + z^{2}}\right)^{2} I_{2}
\end{equation*}
The net effect is to scale the angle parameter:
\begin{align*}
\exp{\left[ \frac{i}{2} \theta (r \cdot R) \right]} &= \exp{\left[ \frac{i}{2} \tilde{\theta} (\hat{r} \cdot R) \right]}, & \tilde{\theta} &= \theta \sqrt{x^{2} + y^{2} + z^{2}}
\end{align*}
Thus:
\begin{equation*}
\exp{\left[ \frac{i}{2} \theta (r \cdot R) \right]} = I_{2} \cos{\left( \frac{\theta \sqrt{x^{2} + y^{2} + z^{2}}}{2} \right)} + i \left( \frac{r \cdot R}{\sqrt{x^{2} + y^{2} + z^{2}}} \right) \sin{\left( \frac{\theta \sqrt{x^{2} + y^{2} + z^{2}}}{2} \right)}
\end{equation*}
In any case, the length of the \(r\) vector can always be absorbed into the angle \(\theta\).