We measure a projected signal $y\in\mathbb R$ with an analogue antenna at three different angles $x=0,\ y=1$; $x=\pi/4,\ y=0$; $x=\pi/2,\ y=1$; find $a$ and $b$ such that the function $$p(x) = a \cos(x) + b \sin(x)$$ best approximates the data points $(x, y)$, using the method of least squares.
I don't understand how to go about this question. i tried the matrix transformation a bunch of different ways but just kept getting stuck.