Package org.jfree.chart.util
Class GeomUtil
java.lang.Object
org.jfree.chart.util.GeomUtil
Some utility methods for working with geometry in Java2D.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Point2D
calculateIntersectionPoint
(Line2D lineA, Line2D lineB) Calculates the intersection point oflineA
withlineB
, possiblynull
if no intersection point exists (i.e.static Point2D[]
calculateIntersectionPoints
(Line2D lineA, Line2D... lines) For each line inlines
, calculates its intersection point withlineA
, possibly no intersection point exists (i.e.static Line2D[]
getLines
(Shape shape, AffineTransform at) Returns allline segments
building up ashape
.
-
Method Details
-
calculateIntersectionPoints
For each line inlines
, calculates its intersection point withlineA
, possibly no intersection point exists (i.e. parallel lines).- Parameters:
lineA
- line to calculate the intersection point for.lines
- lines to calculate the intersection points with.- Returns:
- all intersections points between
lineA
andlines
. - See Also:
-
calculateIntersectionPoint
Calculates the intersection point oflineA
withlineB
, possiblynull
if no intersection point exists (i.e. parallel lines).- Parameters:
lineA
- the first line for the calculationlineB
- the second line for the calculation- Returns:
- the intersection point of
lineA
withlineB
, possiblynull
if no intersection point exists
-
getLines
Returns allline segments
building up ashape
.- Parameters:
shape
- a shape that is built up ofPathIterator.SEG_LINETO
elements.at
- an optionalAffineTransform
to be applied to the coordinates as they are returned in the iteration, ornull
if untransformed coordinates are desired- Returns:
- all
line segments
building up theshape
- Throws:
IllegalArgumentException
- ifshape
contains non-straight line segments (i.e.PathIterator.SEG_CUBICTO
orPathIterator.SEG_QUADTO
)
-