Question: We know the centripetal force $F\_c$ had magnitude $m\omega^2r$. But let's try to write it in vector form.

First of all,since it is directed along the radius,the unit vector in radial direction in this case is $-\hat{\boldsymbol{r}}$. And since the magnitude is $m\omega^2r$,we finally get $$\vec{\mathrm{F\_c}}=-\mathrm{m}\mathrm{\omega}^2\mathrm{r}\hat{\boldsymbol{r}}=-\mathrm{m}\frac{v^2}{r^2}\vec{\mathrm{r}}.$$

But this is not how it us done in the books. According to them,$$\vec{\mathrm{F\_c}}=-\mathrm{m}\frac{v^2}{r^3}\vec{\mathrm{r}}.$$

I don't understand how they got it,the one i did seems to be completely fine to me. Could anyone tell me the mistake i made?

Answer: 
Your shm equation I will write as the displacement $y(t) = A \cos (-\omega t+\Psi)$.  

Thus at some position you have a particle executing shm with amplitude $A$, frequency $\omega$, and phase $\Psi$.

Now suppose that the phase $\Psi$ is a function of position $x$.  

$\Psi (x) = \psi(x) + \phi\,\Rightarrow \, y(x,t) = A \cos (-\omega t+\Psi(x)) = A \cos (-\omega t +\psi (x) + \phi$).

Nearly there.

Now make the displacement $y(x,t)$ periodic with respect to $x$ by making $\phi(x) = \frac{2\pi}{\lambda}\,x = kx$ where $\lambda$ is a characteristic length which we call *wavelength* amd $k$ is the *wave number*.

You now have the equation of a wave travelling in the positive $x$ direction,

$y(x,t) = A \cos (kx-\omega t +\phi)$
The first one gives for every $t$ the displacement of the observed body in simple harmonic motion.
[![SHM](https://i.stack.imgur.com/WKOpW.gif)](https://i.stack.imgur.com/WKOpW.gif)

The second one gives you some quantity in space and time for every $t$ and $x$, let it be the change in pressure (sound), height (string), electric field strenght (light), or something else.
[![EM wave](https://i.stack.imgur.com/dk1xp.gif)](https://i.stack.imgur.com/dk1xp.gif)

Note, that the two equations represent entirely different phenomena. The first one represents only the position of some discrete object in simple harmonic motion, but the second one is for waves in fields (pressure, height, electric field strength, ...).

On the other hand, the change in some quantity at some point in space is a simple harmonic motion. For this perspective, I advise you to take a look at [Farcher](https://physics.stackexchange.com/users/104696/farcher)'s answer to this question.