Nice work, one thing (which you'll see everywhere once you've fixed it yourself) though: in TeX you want to escape functions like cos, i.e. use "\cos" not "cos", which will get rendered as a product of 3 variables c, o and s.
Just pushed a fix changing "cos" to "\cos", looks much better. Thank you!