org.apache.poi.sl.draw.geom

## Class ArcToCommand

- java.lang.Object
- - org.apache.poi.sl.draw.geom.ArcToCommand

- All Implemented Interfaces:
    PathCommand

      public class ArcToCommand
      extends java.lang.Object
      implements PathCommand

  ArcTo command within a shape path in DrawingML: `&lt;arcTo wR="wr" hR="hr" stAng="stAng" swAng="swAng"/&gt;`

  Where `wr` and `wh` are the height and width radiuses of the supposed circle being used to draw the arc. This gives the circle a total height of (2 * hR) and a total width of (2 * wR) stAng is the `start` angle and `swAng` is the swing angle

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double` | `convertOoxml2AwtAngle(double ooAngle, double width, double height)` Arc2D angles are skewed, OOXML aren't ...
    `void` | `execute(java.awt.geom.Path2D.Double path, Context ctx)` Execute the command an append a segment to the specified path

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### execute

          public void execute(java.awt.geom.Path2D.Double path,
                              Context ctx)

      Description copied from interface: `PathCommand`
      Execute the command an append a segment to the specified path
      Specified by:
        `execute` in interface `PathCommand`
      Parameters:
        `path` - the path to append the result to
        `ctx` - the context to lookup variables

    - #### convertOoxml2AwtAngle

          @Internal
          public static double convertOoxml2AwtAngle(double ooAngle,
                                                               double width,
                                                               double height)

      Arc2D angles are skewed, OOXML aren't ... so we need to unskew them

      Furthermore ooxml angle starts at the X-axis and increases clock-wise, where as Arc2D api states "45 degrees always falls on the line from the center of the ellipse to the upper right corner of the framing rectangle" so we need to reverse it

           AWT:                      OOXML:
                      |90/-270                     |270/-90 (16200000)
                      |                            |
           +/-180-----------0           +/-180-----------0
                      |               (10800000)   |
                      |270/-90                     |90/-270 (5400000)

      Parameters:
        `ooAngle` - the angle in OOXML units divided by 60000
        `width` - the width of the bounding box
        `height` - the height of the bounding box
      Returns:
        the angle in degrees
      See Also:
        unskew angle

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.