3. Let $\vec{a}, \vec{b}, \vec{c}$ be three unit vectors in the same plane, and $\vec{a} \perp \vec{b}$, then the maximum value of $(\vec{c}-\vec{a}) \cdot(\vec{c}-\vec{b})$ is $(\quad)$
A. $1+\sqrt{2}$
B. $1-\sqrt{2}$
C. $\sqrt{2}-1$
D. 1
Solution: A.
[Method 1] Since $a \perp b, |a|=|b|=|c|=1$, we have $a \cdot b=0, |a+b|=\sqrt{2}$. Let the angle between vector $c$ and $a+b$ be $\theta$, then
$$
\begin{array}{l}
(c-a) \cdot(c-b)=c^{2}-c \cdot(a+b)+a \cdot b \\
=|c|^{2}-|c| \cdot|a+b| \cos \theta=1-\sqrt{2} \cos \theta \leqslant 1+\sqrt{2},
\end{array}
$$

with equality holding if and only if $\cos \theta=-1$, i.e., $\theta=\pi$.
Therefore, the maximum value of $(c-a) \cdot(c-b)$ is $1+\sqrt{2}$.
$$
\begin{aligned}
& (c-a) \cdot(c-b)=(\cos \theta-1) \cos \theta+\sin \theta(\sin \theta-1) \\
= & \cos ^{2} \theta+\sin ^{2} \theta-(\cos \theta+\sin \theta)=1-\sqrt{2} \sin \left(\theta+\frac{\pi}{4}\right) .
\end{aligned}
$$

Thus, when $\sin \left(\theta+\frac{\pi}{4}\right)=-1$, $(c-a) \cdot(c-b)$ achieves its maximum value, which is $1+\sqrt{2}$.