What's that? Arcus tangent? Or, what's the 2 there? Anyhow, you only need arcus cosine for calculating the angles. That'd obviously mean that you have to write that part on your own. Which, I'm guessing, you're reluctant to, you math-hating person, you.
Anyhow, just tell me what you need that math function to do, I'll look it up. It'd be handy to note the language, too.