Formula (20) in the link states that, if ```mp(x)``` is the minimal polynomial of ```sin(2*pi / q)```, then the minimal polynomial of ```cos(2*pi / q)``` is given by ```mp(sqrt((1-x) / 2))```.
The cases for ```cos(pi/7)``` and ```cos(pi/9)``` can be hardcoded.