Class GeomUtil

java.lang.Object
org.jfree.chart.util.GeomUtil

public final class GeomUtil extends Object
Some utility methods for working with geometry in Java2D.
  • Constructor Details

    • GeomUtil

      private GeomUtil()
  • Method Details

    • calculateIntersectionPoints

      public static Point2D[] calculateIntersectionPoints(Line2D lineA, Line2D... lines)
      For each line in lines, calculates its intersection point with lineA, 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 and lines.
      See Also:
    • calculateIntersectionPoint

      public static Point2D calculateIntersectionPoint(Line2D lineA, Line2D lineB)
      Calculates the intersection point of lineA with lineB, possibly null if no intersection point exists (i.e. parallel lines).
      Parameters:
      lineA - the first line for the calculation
      lineB - the second line for the calculation
      Returns:
      the intersection point of lineA with lineB, possibly null if no intersection point exists
    • getLines

      public static Line2D[] getLines(Shape shape, AffineTransform at) throws IllegalArgumentException
      Returns all line segments building up a shape.
      Parameters:
      shape - a shape that is built up of PathIterator.SEG_LINETO elements.
      at - an optional AffineTransform to be applied to the coordinates as they are returned in the iteration, or null if untransformed coordinates are desired
      Returns:
      all line segments building up the shape
      Throws:
      IllegalArgumentException - if shape contains non-straight line segments (i.e. PathIterator.SEG_CUBICTO or PathIterator.SEG_QUADTO)