Why is it ATAN2(x,y) in LO, when it's ATAN2(y,x) everywhere else?

LibreOffice Calc offers the function atan2 (or arctan2) as all other spreadsheet and mathematical programs do.
But the LO implementation is ATAN2(x,y), where the standard everywhere else is ATAN2(y,x).

Why? Is it a bug? A misunderstanding of the function from the developers?
ATAN2 or arctan2 are designed to behave like atan/arctan, where y/x is the classic argument through centuries.

The implementation of atan2 creates massive interoperability issues to say the least.

See the standard:

Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula (OpenFormula) Formula - 6.16.10 ATAN2

hence I’d assume the developers implemented the standard.


> where the standard everywhere else is ATAN2(y,x).

Hmm …

[1] ATAN2 function - Office Support

[2] Documentation/How Tos/Calc: ATAN2 function - Apache OpenOffice Wiki

[3] https://developer.apple.com/documentation/simd/atan2

Thanks, you’re right. Perhaps I’m too deep in the classic arctan use.

Dear Opaque,
your links seems broken…

MS Excel

@Zizi64 - had been on reworking the links, while a simultaneous edit (comment) prevented my changes from being saved:

ATAN2 function - Office Support - why there is a need to type ENTER is not clear to me)

https://wiki.openoffice.org/wiki/Documentation/How_Tos/Calc:_ATAN2_function

https://developer.apple.com/documentation/simd/atan2

There is no formal standard saying that every implementation of this function must have a particular sequence of parameters/operands. Each formalised language implementation must define its own syntax.

The de facto standard for procedural languages seems to be ATAN2(y,x).

The de facto standard for spreadsheets (from first appearing in Lotus 123 I believe) is ATAN2(X;Y)

Not sure about other functional languages (of which spreadsheets is a subset). Someone else may investigate. I don’t see the point.

Interoperability between spreadsheet functions and functions in procedural languages is rarely required. If you are transitioning between contexts on a regular basis, you will learn to live with it. If you don’t, there is no problem.

If you still, for some reason, require consistency between the contexts, you can sometimes overload the function syntax (same function name). In other cases you need to define a new function (different name) with the operands swapped.

“… massive interoperability issues, to say the least.” is, in my view, a massive exaggeration. Not “saying the least”. Just saying.