Is there a formula for coefficients of a given vector written in terms of the basis? Given that $\vec{u}_1,.., \vec{u}_N$ are a basis of $\mathbb{R}^N$, such that we can write any vector $\vec{v}\in\mathbb{R}^n$ as $$\vec{v} = \sum_{n=1}^Nc_n\vec{u}_n$$
Is there a formula to find the coefficients? In an old pdf I found the following $$c_n = \frac{1}{|\vec{u}_n|^2}\vec{v}\cdot\vec{u_n}$$
However it is very confusing and I don't understanding whether it is a typo, if it is talking about something else, or if this is correct but I just never saw this formula in Linear Algebra. 
And if this is true, how can I derive it?
My Try
Writing $\vec{v} = (v_1,..,v_n)^T$ and $\vec{c}=  (c_1,.., c_n)^T$, and $U = (\vec{u}_1,..,\vec{u}_n)^T$ then  we have $$\vec{v} = \vec{c}^T U$$ and therefore $\vec{v}^T = U^T\vec{c}$ so that the coefficients can be found as $$\vec{c} = (U^T)^{-1}\vec{v}^T$$
So once we have the inverse of that matrix, we can calculate them. However I wouldn't know how to proceeed.
Solution 
Thanks to all those who answered. This formula only holds if the basis are orthogonal. This is because we start with $$\vec{v} = c_1\vec{u}_1+..+c_n\vec{u}_n$$
Then, say we want to find coefficient $c_1$, then we can multiply both sides by the corresponding basis vector: $$\vec{u}_1^T \cdot \vec{v} = c_1\vec{u}_1^T\vec{u}_1 + 0+..+0$$ and therefore $$c_1 = \frac{\vec{u}_1^T\cdot \vec{v}}{||\vec{u}_1||_2^2}$$

That formula holds only if the $u_n$'s are orthogonal. In that case, the coefficients of $v$ are given by the scalar product of $v$ with the normalized basis. This is a basic theorem of Linear algebra. In the general case the formula is not true.
