A problem of simple harmonic motion in high school physics A. B is a spring ballast composed of two objects. In the process of vibration, a and B always keep relatively static. A is placed on B, and the spring is connected to B. why is the image of the relationship between the friction force F on a and the displacement X of the ballast y = - x? Here I know that the friction force is the restoring force of a, but don't the displacement and restoring force change in the same direction? Why isn't their relationship image y = x?

A problem of simple harmonic motion in high school physics A. B is a spring ballast composed of two objects. In the process of vibration, a and B always keep relatively static. A is placed on B, and the spring is connected to B. why is the image of the relationship between the friction force F on a and the displacement X of the ballast y = - x? Here I know that the friction force is the restoring force of a, but don't the displacement and restoring force change in the same direction? Why isn't their relationship image y = x?

"Friction is the restoring force of A." that's right!
If you think about it carefully, its direction is opposite to the displacement direction! Naturally, y = - X