java.lang.Object
org.jhotdraw8.geom.biarc.ArcToCubicCurve
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidarcTo(double lastX, double lastY, double radiusX, double radiusY, double xAxisRotation, double x, double y, boolean largeArcFlag, boolean sweepFlag, @NonNull DoubleConsumer2 lineTo, @NonNull DoubleConsumer6 curveTo) Converts an arcTo into a sequence of curveTo, or - if the arcTo is degenerate - to a lineTo or to nothing.
-
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, @NonNull DoubleConsumer2 lineTo, @NonNull 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 coordinatelastY- the last y coordinateradiusX- the x radius of the arcradiusY- the y radius of the arcxAxisRotation- the x-axis rotation of the arc in degreesx- the x to coordinatey- the y to coordinatelargeArcFlag- the large-arc flagsweepFlag- the sweep-arc flaglineTo- the consumer for lineTo (can be called 0 to 1 timescurveTo- the consumer for curveTo (can be called 0 to 4 times)
-