News for hackers. Stuff that matters.
Re:Floating point error is the least of my worries (2011) by ajkjk on Wednesday February 21, 2018 @09:07PM (#16434647)
I would think that atan2() exists because atan() doesn't invert tan() correctly for some purposes -- if you're trying to find the angle associated with a point then atan(y/x) is just the wrong answer.

The fact that it avoids the division by 0 is a convenient side effect of also being more correct.

(I'm just guessing; I don't know the actual history of it.)

Re:Floating point error is the least of my worries (2011) by ajross on Thursday February 22, 2018 @01:48AM (#16435709)
The point was more that problems that need to use atan() in a context where the line may point near the Y axis don't flip out over "floating point precision", they just use atan2().

Problems like the one in the grandparent that need to intersect nearly-parallel lines (or subspaces) use special techniques better suited to the problem and don't just feed it to a linear solver.