2. In the Cartesian coordinate system $x O y$, for the ellipse $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1(a>b>0)$, the focal distance is $2 c$. A circle $M$ is drawn with $O$ as the center and $a$ as the radius. If two tangents are drawn from $P\left(\frac{a^{2}}{c}, 0\right)$ to circle $M$ and they are perpendicular to each other, find the eccentricity of the ellipse.
(The line equation of chord $AB$ is $x=c$. It is easy to know that $\triangle OAP$ is an isosceles right triangle. Therefore, $e=\frac{c}{a}=$ $\left.\cos 45^{\circ}=\frac{\sqrt{2}}{2}.\right)$