arcTangent without a calculator, power series is not fully capable Right now I'm using Java code to have a turret rotate to track a target. In order to get the angle of rotation I'm using a power series from n = 0 to 100 to get a close estimate ($\sum_{n=0}^{100} \frac{(-1)^n(x)^{2n+1}}{2n+1}$). But for an x of 9/4 or -9/4 it blows up (which I'm assuming it is due to radius of convergence)
So what ways could I implement an arcTangent(x) without using a calculator?
 A: Using the inbuilt math functions in Java would be a thousand times faster than almost anything you could come up with yourself. Since you clearly don't need more than 32-bit precision, that's the way to go.
That said, it's very good that you're exploring how to compute arctangent yourself! One standard way to compute such functions is to use Newton-Raphson to invert the tangent function (if you do it correctly it would have the same time complexity). $\tan(t)$ is in turn easily computed by computing $\exp(it)$ and taking the ratio of imaginary to real. $\exp(z)$ can be computed by Taylor series and the identity $\exp(z) = \exp(z 2^{-k})^{2^k}$ can be used to speed up the process by choosing $k \sim \sqrt{d}$ where $d$ is the desired number of digits of precision.
There is an even faster method than the above to compute $\exp$, but I don't know the underlying mathematics so you'd have to read up on your own. It's called the AGM (Arithmetic-Geometric Mean) method and can be used to compute $\ln(z)$ very fast. Newton-Raphson inversion then gives $\exp$ and hence all the trigonometric functions with the same time complexity.
A: If you are not requiring too much accuracy and you want to avoid long summations, you can also use Padé approximants of $\tan^{-1}(x)$.
For example, for the range $-2\leq x \leq 2$ $$\tan^{-1}(x)\approx x\frac{1+\frac{7 }{9}x^2+\frac{64 }{945}x^4}{1+\frac{10 x^2}{9}x^2+\frac{5 }{21}x^4}$$ $$\tan^{-1}(x)\approx x\frac{1+\frac{50 }{39}x^2+\frac{283 }{715}x^4+\frac{256 }{15015}x^6}{1+\frac{21 }{13}x^2+\frac{105 }{143}x^4+\frac{35 }{429}x^6}$$ seem to be quite good.
Otherwise, as Oussama Boussif commented, using $\arctan(x)+\arctan(\frac{1}{x})= \frac{\pi}{2}$ and series expansion is the way to go.
