3. As shown in the figure, $A$ and $P$ are a fixed point and a moving point on the unit circle $O$, respectively. The initial side of angle $x$ is the ray $O A$, and the terminal side is the ray $O P$. Draw a perpendicular from point $P$ to the line $O A$, with the foot of the perpendicular being $M$. Express the distance from point $M$ to the line $O P$ as a function $f(x)$ of $x$, then $f(x)=$ $\qquad$ .
Rong Ying $|\sin x \cos x|$.
Analysis Classify the angle $x$ simply as $x \in\left[0, \frac{\pi}{2}\right),\left[\frac{\pi}{2}, \pi\right), \cdots$, then according to the definition of trigonometric functions,

Use the periodicity of the function to get $f(x)=|\sin x \cos x|$.