y=mx+2
=>mx-y+2=0
Khoảng cách từ O đến (d) là:
\(d\left(O;\left(d\right)\right)=\dfrac{\left|0\cdot m+0\cdot\left(-1\right)+2\right|}{\sqrt{m^2+\left(-1\right)^2}}=\dfrac{2}{\sqrt{m^2+1}}\)
Để \(d\left(O;\left(d\right)\right)=\dfrac{2\sqrt{5}}{5}=\dfrac{2}{\sqrt{5}}\) thì \(\dfrac{2}{\sqrt{m^2+1}}=\dfrac{2}{\sqrt{5}}\)
=>\(m^2+1=5\)
=>\(m^2=4\)
=>\(\left[{}\begin{matrix}m=2\\m=-2\end{matrix}\right.\)