| Constructor and Description |
|---|
XyArc(XyPoint center,
double radius,
XyDeflection deflection)
Creates a new XyArc from the given center, radius, and deflection.
|
XyArc(XyPoint center,
double radius,
XyDirection start,
XyDirection end,
boolean clockwise)
Creates a new XyArc starting at the given start angle and ending at the
given end angle.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsDirection(XyDirection direction)
Returns true if the given angle is part of this arc.
|
boolean |
equals(java.lang.Object nother) |
XyAngle |
getAngle()
Returns the angular width (the angular difference between the start and
end directions positions).
|
XyBounds |
getBounds()
Returns an XyBounds object representing the rectangular extents of this
shape.
|
XyPoint |
getCenter()
Geometric center of circle.
|
XyDirection |
getEnd()
Ending direction for arc.
|
XyPoint |
getEndPoint()
Returns the last point in the shape.
|
double |
getLength()
Returns the length of the path.
|
double |
getRadius()
Returns the radius of the circle containing this arc.
|
XyDirection |
getStart()
Starting direction for arc.
|
XyPoint |
getStartPoint()
Returns the first point in the shape.
|
boolean |
isClockwise()
If true, arc proceeds clockwise from start to end.
|
java.util.Iterator<XyPoint> |
iterator() |
XyArc |
reversed()
Returns a modified version of this arc with the start and end swapped and
the clockwise flag reversed.
|
XyArc |
scaledBy(double scale)
Return a scaled version of the shape by multiplying all coordinates by
the given factor in both dimensions.
|
XyArc |
scaledBy(double scaleX,
double scaleY) |
XyPolyline |
toPolyline()
Same as
XyPath.toPolyline(XyAngle) with a default angle granularity of
1/60 circle (6 degrees, pi/30 radians). |
XyPolyline |
toPolyline(XyAngle granularity)
Converts this area to a polyline which approximates it in some fashion.
|
java.lang.String |
toString() |
XyShape |
transformedBy(XyTransform transform)
Transform the shape using the given transform.
|
XyArc |
translatedBy(double offsetX,
double offsetY)
Translate the shape by adding all coordinates to the given x and y
offsets.
|
XyArc |
withCenter(XyPoint newCenter)
Returns a modified version of this arc with the given center.
|
XyArc |
withClockwise(boolean newClockwise)
Returns a modified version of this arc with the given clockwise flag.
|
XyArc |
withEnd(XyDirection newEnd)
Returns a modified version of this arc with the given end direction.
|
XyArc |
withRadius(double newRadius)
Returns a modified version of this arc with the given radius.
|
XyArc |
withStart(XyDirection newStart)
Returns a modified version of this arc with the given start direction.
|
public XyArc(XyPoint center, double radius, XyDirection start, XyDirection end, boolean clockwise)
public XyArc(XyPoint center, double radius, XyDeflection deflection)
public XyArc withStart(XyDirection newStart)
public XyArc withEnd(XyDirection newEnd)
public XyArc withCenter(XyPoint newCenter)
public XyArc withRadius(double newRadius)
public XyArc withClockwise(boolean newClockwise)
public XyArc reversed()
public boolean containsDirection(XyDirection direction)
public XyPolyline toPolyline(XyAngle granularity)
XyPathThe angle parameter allows a certain level of control of the output. Essentially it dictates the minimum angular granularity used to approximate curved paths. For example, an arc would be turned into a polyline by placing points around the arc's slice of a circle, separated by the given angle.
toPolyline in interface XyPath<XyArc>public XyPolyline toPolyline()
XyPathXyPath.toPolyline(XyAngle) with a default angle granularity of
1/60 circle (6 degrees, pi/30 radians).toPolyline in interface XyPath<XyArc>public double getLength()
XyPathpublic XyPoint getStartPoint()
XyPathgetStartPoint in interface XyPath<XyArc>public XyPoint getEndPoint()
XyPathgetEndPoint in interface XyPath<XyArc>public XyArc scaledBy(double scale)
XyShapepublic XyArc scaledBy(double scaleX, double scaleY)
public XyArc translatedBy(double offsetX, double offsetY)
XyShapetranslatedBy in interface XyShape<XyArc>offsetX - offset for the x dimensionoffsetY - offset for the y dimensionpublic XyShape transformedBy(XyTransform transform)
XyShapetransformedBy in interface XyShape<XyArc>transform - affine transform to apply.public XyBounds getBounds()
XyShapepublic java.util.Iterator<XyPoint> iterator()
iterator in interface java.lang.Iterable<XyPoint>public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object nother)
equals in class java.lang.Objectpublic XyPoint getCenter()
public double getRadius()
public boolean isClockwise()
public XyDirection getStart()
public XyDirection getEnd()
public XyAngle getAngle()