User:Regina/ODF AngleProblems

From The Document Foundation Wiki
Jump to: navigation, search

Dashboard for collecting, where ODF and LibeOffice differ in regard to angles.

Angles in ODF

Datatype Angle

It is in 18.3.1 angle.

An angle, as defined in §4.1 of [SVG]. An angle is a double value that may be followed immediately by one of the following angle unit identifiers: deg (degrees), grad (gradiants) or rad (radians). If no unit identifier is specified, the value is assumed to be in degrees.

Note: OpenDocument v1.1 did not support angle specifications that contain an angle unit identifier. Angle unit identifiers should be omitted for compatibility with OpenDocument v1.1.

Problems

  • angle is defined as reference to SVG. The default degrees is a problem for LibreOffice, because it uses radians in most cases. Idea: Introduce a datatype "draw-angle" with default radians.
  • The Note is misleading. Better: If compatibility to OpenDocument v1.1 is desired, then unit identifiers should be omitted.
  • Only referencing SVG hides the problem of orientation of angles.
  • The attribute 20.77 dr3d:end-angle refers to 18.3.1 for its angle. But in LibreOffice this angle is neither degrees nor radians, but it is 1/10 degree in content, but without unit.
  • The attributes draw:start-angle and draw:end-angle (from circle sector) refer to 18.3.1. and they are used in degree without unit.
  • draw:transform="rotate(0.523598775598299)" is interpreted as counterclockwise in regard to UI in LibreOffice and as clockwise in regard to UI in Powerpoint. The users sees 30° for rotation in PowerPoint and in LibreOffice as well.

Trigonometric Functions

In 19.171 draw:formula

sin(n) returns the trigonometric sine of n, where n is an angle specified in degrees
cos(n) returns the trigonometric cosine of n, where n is an angle specified in degrees
tan(n) returns the trigonometric tangent of n, where n is an angle specified in degrees
atan(n) returns the arc tangent of n in degrees
atan2(x,y) returns the angle in degrees of the vector (x,y) with the x-axis

LibreOffice uses radians in all cases.