17. (1) Let the normal vector of plane $SND$ be $\vec{n}=\lambda \overrightarrow{BA}+\mu \overrightarrow{BC}+\overrightarrow{AS}$, since $\vec{n} \perp \overrightarrow{ND}, \vec{n} \perp \overrightarrow{NS}$,

then $\vec{n} \cdot \overrightarrow{ND}=0, \vec{n} \cdot \overrightarrow{NS}=0$.
Also, $\vec{n} \cdot \overrightarrow{ND}=(\lambda \overrightarrow{BA}+\mu \overrightarrow{BC}+\overrightarrow{AS}) \cdot(\overrightarrow{NB}+\overrightarrow{BD})=\lambda \overrightarrow{BA} \cdot \overrightarrow{NB}+\mu \overrightarrow{BC} \cdot \overrightarrow{BD}=-8 \lambda+2 \mu=0$,
$\vec{n} \cdot \overrightarrow{NS}=(\lambda \overrightarrow{BA}+\mu \overrightarrow{BC}+\overrightarrow{AS}) \cdot(\overrightarrow{NA}+\overrightarrow{AS})=8 \lambda+4=0$, hence $\lambda=-\frac{1}{2}, \mu=-2$.
Thus, $\vec{n}=-\frac{1}{2} \overrightarrow{BA}-2 \overrightarrow{BC}+\overrightarrow{AS},|\vec{n}|^{2}=\left(-\frac{1}{2} \overrightarrow{BA}-2 \overrightarrow{BC}+\overrightarrow{AS}\right)^{2}=4+16+4=24,|\vec{n}|=2 \sqrt{6}$, $|\overrightarrow{AS}|=2$,
$\overrightarrow{AS} \cdot \vec{n}=\overrightarrow{AS} \cdot\left(-\frac{1}{2} \overrightarrow{BA}-2 \overrightarrow{BC}+\overrightarrow{AS}\right)=4$.
Let the dihedral angle $S-ND-A$ be $\theta$, then
$$
\cos \theta=\frac{\overrightarrow{SA} \cdot \vec{n}}{|\overrightarrow{SA}| \cdot|\vec{n}|}=\frac{4}{2 \cdot 2 \sqrt{6}}=\frac{\sqrt{6}}{6} \text {. }
$$
(2) The distance from $A$ to plane $SND$ is
$$
d=\frac{|\overrightarrow{SA} \cdot \vec{n}|}{|\vec{n}|}=\frac{4}{2 \sqrt{6}}=\frac{\sqrt{6}}{3} .
$$
17. As shown in Figure $8-15, \triangle A B C$ is a right-angled triangle with $\angle C$ as the right angle, $S A \perp$ plane $A B C, S A=B C=2, A B=4, N$ and $D$ are the midpoints of $A B$ and $B C$ respectively.
(1) Find the cosine value of the dihedral angle $S-N D-A$;
(2) Find the distance from point $A$ to the plane $S N D$.