Uploaded image for project: 'OASIS Open Document Format for Office Applications (OpenDocument) TC'
  1. OASIS Open Document Format for Office Applications (OpenDocument) TC
  2. OFFICE-3822

atan2 in attribute draw:formula (19.171, part 1 ODF1.2) has wrong order of arguments

    Details

    • Proposal:
      Hide

      Current text:
      atan2(x,y)
      returns the angle <...> of the vector (x,y) with the x-axis

      Proposed text:
      atan2(y,x)
      returns the angle <..> of the vector (x,y) with the x-axis

      I have skipped the part "in degrees" here, because that is an additional problem, for which I will write another issue.

      Show
      Current text: atan2(x,y) returns the angle <...> of the vector (x,y) with the x-axis Proposed text: atan2(y,x) returns the angle <..> of the vector (x,y) with the x-axis I have skipped the part "in degrees" here, because that is an additional problem, for which I will write another issue.

      Description

      The arguments of atan2 are specified in the order x,y. But the applications Apache OpenOffice, Symphony, LibreOffice, Calligra Stage, PowerPoint Preview 2013 use it in the order atan2(y,x).
      The order (y,x) is common for programming languages too.

      Does anyone know an application, that has implemented it in the order (x,y)?
      If not, I suggest to change it in ODF1.2 Errata.

        Attachments

          Activity

          Hide
          orcmid Dennis Hamilton (Inactive) added a comment -

          Funny, I automatically thought it was ATAN2(x,y) where it is the arctangent of y/x (or complex(x,y) if you prefer).

          But I see that has not been the case in programming languages for as long as ATAN2(y,x) has been defined (starting in FORTRAN, continuing through C, etc.). I must have been aware of the FORTRAN parameter order (having been on the ANSI TC) but it fell out of my brain.

          It is interesting that the programming language definition for atan2(y,x) is the common implementation, but the description in ODF 1.2 contradicts that. I also note that although atan2 is defined in the syntax for draw:formula in ODF 1.0/1.1, there is no definition for the function whatsoever in those versions of the specification.

          It would seem that this is a specification error in the addition of details that was made from ODF 1.0 to ODF 1.2.

          • Dennis

          For further amusement: In ODF 1.2 OpenFormula and OOXML, the definition is for ATAN2(x,y) and that is how implementations work, in LibreOffice, Apache OpenOffice, Excel, except that the ODF spreadsheet implementations have ATAN2(0,0) = 0 where Excel produces #DIV/0!

          Show
          orcmid Dennis Hamilton (Inactive) added a comment - Funny, I automatically thought it was ATAN2(x,y) where it is the arctangent of y/x (or complex(x,y) if you prefer). But I see that has not been the case in programming languages for as long as ATAN2(y,x) has been defined (starting in FORTRAN, continuing through C, etc.). I must have been aware of the FORTRAN parameter order (having been on the ANSI TC) but it fell out of my brain. It is interesting that the programming language definition for atan2(y,x) is the common implementation, but the description in ODF 1.2 contradicts that. I also note that although atan2 is defined in the syntax for draw:formula in ODF 1.0/1.1, there is no definition for the function whatsoever in those versions of the specification. It would seem that this is a specification error in the addition of details that was made from ODF 1.0 to ODF 1.2. Dennis For further amusement: In ODF 1.2 OpenFormula and OOXML, the definition is for ATAN2(x,y) and that is how implementations work, in LibreOffice, Apache OpenOffice, Excel, except that the ODF spreadsheet implementations have ATAN2(0,0) = 0 where Excel produces #DIV/0!
          Hide
          aguelzow Andreas Guelzow (Inactive) added a comment -

          The openformula definition of ATAN2 is:
          --------------------------------
          Summary: Returns the principal value of the arc tangent given a coordinate of two numbers.
          The angle is returned in radians.
          Syntax: ATAN2( Number x ; Number y )
          Returns: Number
          Constraints: x<>0 or y<>0
          Semantics: Computes the arc tangent of two numbers (the x and y coordinates of a point), in
          radians. This is similar to ATAN(y/x), but the signs of the two numbers are taken into account so
          that the result covers the full range from -PI() to +PI(). ATAN2(0;0) is implementation-defined,
          evaluators may return 0 or an Error.
          Returns a principal value -PI < result ≤ PI.
          --------------------------------

          It seems to me that the
          draw:formula (19.171, part 1 ODF1.2) matches this definition, except that atan2 in that case is supposed to return the result in degrees

          So the current definition in 19.171 is consistent with openformula (except that consistently 19.171 works with degrees while OpenFormula uses radians).

          I thin kit is more important to be consistent within ODF parts 1,2,3 than with some common programming languages.

          Show
          aguelzow Andreas Guelzow (Inactive) added a comment - The openformula definition of ATAN2 is: -------------------------------- Summary: Returns the principal value of the arc tangent given a coordinate of two numbers. The angle is returned in radians. Syntax: ATAN2( Number x ; Number y ) Returns: Number Constraints: x<>0 or y<>0 Semantics: Computes the arc tangent of two numbers (the x and y coordinates of a point), in radians. This is similar to ATAN(y/x), but the signs of the two numbers are taken into account so that the result covers the full range from -PI() to +PI(). ATAN2(0;0) is implementation-defined, evaluators may return 0 or an Error. Returns a principal value -PI < result ≤ PI. -------------------------------- It seems to me that the draw:formula (19.171, part 1 ODF1.2) matches this definition, except that atan2 in that case is supposed to return the result in degrees So the current definition in 19.171 is consistent with openformula (except that consistently 19.171 works with degrees while OpenFormula uses radians). I thin kit is more important to be consistent within ODF parts 1,2,3 than with some common programming languages.
          Hide
          rcweir Robert Weir (Inactive) added a comment -

          Reviewed on TC call of 2013-04-15

          No implementation appears to depend on this error.

          Show
          rcweir Robert Weir (Inactive) added a comment - Reviewed on TC call of 2013-04-15 No implementation appears to depend on this error.
          Hide
          patrick Patrick Durusau added a comment -

          Applied OpenDocument-v1.3-wd08-part3-documents.odt

          Show
          patrick Patrick Durusau added a comment - Applied OpenDocument-v1.3-wd08-part3-documents.odt
          Hide
          regina.henschel Regina Henschel added a comment -

          Clone for ODF 1.2 Errata 01 is in https://issues.oasis-open.org/browse/OFFICE-3974

          Show
          regina.henschel Regina Henschel added a comment - Clone for ODF 1.2 Errata 01 is in https://issues.oasis-open.org/browse/OFFICE-3974

            People

            • Assignee:
              Unassigned
              Reporter:
              regina.henschel Regina Henschel
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: