1. In the unit cube $A B C D-A_{1} B_{1} C_{1} D_{1}$, $M$ is the midpoint of edge $B B_{1}$, point $P$ is on edge $C D$, and $D P$ $=m(0<m<1)$, let the distance from $M$ to line $A P$ be $d$. Then $d=$ $\qquad$ .
ニ、1. $\sqrt{\frac{1}{4}+\frac{1}{m^{2}+1}}$.
Draw $B Q \perp A P$, intersecting $A P$ at point $Q$.
By the theorem of three perpendiculars, we know $M Q \perp A P$.
Clearly, $A P=\sqrt{m^{2}+1}$.
From $A P \cdot B Q=2 S_{\triangle A B P}=1$, we get $B Q=\frac{1}{\sqrt{m^{2}+1}}$.
Thus, $d=M Q=\sqrt{B M^{2}+B Q^{2}}=\sqrt{\frac{1}{4}+\frac{1}{m^{2}+1}}$.