2. Given that the three vertices $A, B, C$ of the right triangle $\triangle A B C$ are all on the parabola $y=x^{2}$, and the hypotenuse $A B$ is parallel to the $x$-axis, then the altitude $C D$ from $C$ to $A B$ equals $\qquad$ .
Let $A\left(-s, s^{2}\right), B\left(s, s^{2}\right), C\left(t, t^{2}\right)$, then $\overrightarrow{A C} \cdot \overrightarrow{B C}=(t+s)(t-s)+\left(t^{2}-s^{2}\right)\left(t^{2}-s^{2}\right)$ $=\left(t^{2}-s^{2}\right)\left(t^{2}-s^{2}+1\right)=0 \Rightarrow t^{2}=s^{2}-1 \Rightarrow y_{C}=y_{A}-1$.
Therefore, the altitude $C D$ from vertex $C$ to the hypotenuse $A B$ equals 1.