This is two slightly different ways of approximating sine and cosine. The second one gets much more accurate much faster than the first, but it's probably slower and uses cheeky cheatery. This whole thing relies on rotation matrices and approximating circles with lines. The first solution is a lot more elegant.