Circular regression when you already know the period

This Stack Exchange answer reminded&#xA;me of a useful data science trick. In short, if you try to model y y as a&#xA;sinusoidal function of x x , you obtain a regression formula that is nonlinear&#xA;in the parameters. However, if you know the period, you can use a trig identity&#xA;to linearize the formula and compute an exact least-squares fit.