Solution (source code)

= Solution

Choose the transverse axis so that the <photon> travels in the $xy$ plane. Its energy-momentum <four-vector> is $p^\mu=(E/c,E\cos\theta/c,E\sin\theta/c,0)$. A <Lorentz boost> of speed $v$ along $x$, with $\beta=v/c$ and $\gamma=(1-\beta^2)^{-1/2}$, gives
$$
E'/c=\gamma(E/c-\beta p_x),\qquad p_x'=\gamma(p_x-\beta E/c).
$$
Because a <photon> has zero invariant mass, $|\mathbf p'|=E'/c$. Therefore
$$
\boxed{E'=\frac{E(1-\beta\cos\theta)}{\sqrt{1-\beta^2}},\qquad\cos\theta'=\frac{cp_x'}{E'}=\frac{\cos\theta-\beta}{1-\beta\cos\theta}.}
$$
The first is the <relativistic Doppler effect> in angular form, and the second is <relativistic aberration>.