6. Let real numbers $x, y$ satisfy
$$
17\left(x^{2}+y^{2}\right)-30 x y-16=0 \text {. }
$$

Then the maximum value of $\sqrt{16 x^{2}+4 y^{2}-16 x y-12 x+6 y+9}$ is ( ).
(A) 7
(B) $\sqrt{29}$
(C) $\sqrt{19}$
(D) 3
6. A.
$$
\begin{array}{l}
\text { Given } 17\left(x^{2}+y^{2}\right)-30 x y-16=0 \\
\Rightarrow(x+y)^{2}+16(x-y)^{2}=16 \\
\Rightarrow\left(\frac{x+y}{4}\right)^{2}+(x-y)^{2}=1 \text {. } \\
\text { Let }\left\{\begin{array}{l}
x+y=4 \cos \theta, \\
x-y=\sin \theta
\end{array}(\theta \in \mathbf{R})\right. \text {. Then } \\
\begin{array}{l} 
f(x, y)=\sqrt{16 x^{2}+4 y^{2}-16 x y-12 x+6 y+9} \\
= \sqrt{(4 x-2 y)^{2}-3(4 x-2 y)+9} \\
=\sqrt{[3(x-y)+(x+y)]^{2}-3[3(x-y)+(x+y)]+9} \\
\quad=\sqrt{(3 \sin \theta+4 \cos \theta)^{2}-3(3 \sin \theta+4 \cos \theta)+9} \\
= \sqrt{[5 \sin (\theta+\alpha)]^{2}-3[5 \sin (\theta+\alpha)]+9},
\end{array}
\end{array}
$$

where, $\alpha=\arcsin \frac{4}{5}$.
When $\theta=\frac{3 \pi}{2}-\alpha$, $\sin (\theta+\alpha)=-1$, $f(x, y)$ achieves its maximum value of 7.