Velocity v is positive (to the right) while displacement x is negative when the particle in SHM is moving from the left extreme towards the mean position. Velocity v is negative (to the left) while displacement x is positive when the particle in SHM is moving from the right extreme towards the mean position.