Class ArcToCubicCurve

java.lang.Object
org.jhotdraw8.geom.biarc.ArcToCubicCurve

public class ArcToCubicCurve extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    arcTo(double lastX, double lastY, double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag, DoubleConsumer2 lineTo, DoubleConsumer6 curveTo)
    Converts an arcTo into a sequence of curveTo, or - if the arcTo is degenerate - to a lineTo or to nothing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • arcTo

      public static void arcTo(double lastX, double lastY, double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag, DoubleConsumer2 lineTo, DoubleConsumer6 curveTo)
      Converts an arcTo into a sequence of curveTo, or - if the arcTo is degenerate - to a lineTo or to nothing.

      As specified in w3.org

      This code has been derived from svgpath library [1].

      See math.stackexchange.com for a discussion on how to calculate control points of cubic bezier curve approximating a part of a circle.

      References:

      [1] svgpath library
      svgpath. Copyright (C) 2013-2015 by Vitaly Puzrin, MIT License. github.com
      Parameters:
      lastX - the last x coordinate
      lastY - the last y coordinate
      radiusX - the x radius of the arc
      radiusY - the y radius of the arc
      xAxisRotation - the x-axis rotation of the arc in degrees
      x - the x to coordinate
      y - the y to coordinate
      largeArcFlag - the large-arc flag
      sweepFlag - the sweep-arc flag
      lineTo - the consumer for lineTo (can be called 0 to 1 times
      curveTo - the consumer for curveTo (can be called 0 to 4 times)