# Relationship between Coefficients of Orthogonal Polynomial and Normal regression

So this is more a question to help me understand what is going on rather than application:

So in normal regression we have

$$\mathbf{Y=X} \mathbf{\beta} + \varepsilon$$

Now the part that really confuses me:

A regression with orthogonal polynomial regression is just:

$$\mathbf{Y= \phi(X)} \mathbf{W}+ \varepsilon$$

where $\mathbf{\phi(X) = P^{T} X}$ and $W= \mathbf{P\beta}$

Where P is the orthonormal change of basis matrix that you can obtain in R using contri.poly()?These P transformations chosen usually appear to also centre the data? Also if I am correct, how exactly are these change of basis matrix determined?