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 Point2DcalculateIntersectionPoint(Line2D lineA, Line2D lineB) Calculates the intersection point oflineAwithlineB, possiblynullif 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 segmentsbuilding 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
lineAandlines. - See Also:
-
calculateIntersectionPoint
Calculates the intersection point oflineAwithlineB, possiblynullif 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
lineAwithlineB, possiblynullif no intersection point exists
-
getLines
Returns allline segmentsbuilding up ashape.- Parameters:
shape- a shape that is built up ofPathIterator.SEG_LINETOelements.at- an optionalAffineTransformto be applied to the coordinates as they are returned in the iteration, ornullif untransformed coordinates are desired- Returns:
- all
line segmentsbuilding up theshape - Throws:
IllegalArgumentException- ifshapecontains non-straight line segments (i.e.PathIterator.SEG_CUBICTOorPathIterator.SEG_QUADTO)
-