/** * Constructs a new Line2D.Iterator for given line and transformation * @param l - the source Line2D object * @param at - the AffineTransform object to apply rectangle path */ Iterator(Line2D l, AffineTransform at) { this.x1 = l.getX1(); this.y1 = l.getY1(); this.x2 = l.getX2(); this.y2 = l.getY2(); this.t = at; }
public static double getFlatness(double x1, double y1, double ctrlx, double ctrly, double x2, double y2) { return Line2D.ptSegDist(x1, y1, x2, y2, ctrlx, ctrly); }
public boolean intersectsLine(double x1, double y1, double x2, double y2) { double rx1 = getX(); double ry1 = getY(); double rx2 = rx1 + getWidth(); double ry2 = ry1 + getHeight(); return (rx1 <= x1 && x1 <= rx2 && ry1 <= y1 && y1 <= ry2) || (rx1 <= x2 && x2 <= rx2 && ry1 <= y2 && y2 <= ry2) || Line2D.linesIntersect(rx1, ry1, rx2, ry2, x1, y1, x2, y2) || Line2D.linesIntersect(rx2, ry1, rx1, ry2, x1, y1, x2, y2); }
public boolean intersects(double rx, double ry, double rw, double rh) { return intersects(new Rectangle2D.Double(rx, ry, rw, rh)); }
public Rectangle getBounds() { return getBounds2D().getBounds(); }
public static double ptLineDist(double x1, double y1, double x2, double y2, double px, double py) { return Math.sqrt(ptLineDistSq(x1, y1, x2, y2, px, py)); }
public boolean intersectsLine(double x1, double y1, double x2, double y2) { double rx1 = getX(); double ry1 = getY(); double rx2 = rx1 + getWidth(); double ry2 = ry1 + getHeight(); return (rx1 <= x1 && x1 <= rx2 && ry1 <= y1 && y1 <= ry2) || (rx1 <= x2 && x2 <= rx2 && ry1 <= y2 && y2 <= ry2) || Line2D.linesIntersect(rx1, ry1, rx2, ry2, x1, y1, x2, y2) || Line2D.linesIntersect(rx2, ry1, rx1, ry2, x1, y1, x2, y2); }
public boolean intersects(double rx, double ry, double rw, double rh) { return intersects(new Rectangle2D.Double(rx, ry, rw, rh)); }
public Rectangle getBounds() { return getBounds2D().getBounds(); }
public static double ptLineDist(double x1, double y1, double x2, double y2, double px, double py) { return Math.sqrt(ptLineDistSq(x1, y1, x2, y2, px, py)); }
/** * Constructs a new Line2D.Iterator for given line and transformation * @param l - the source Line2D object * @param at - the AffineTransform object to apply rectangle path */ Iterator(Line2D l, AffineTransform at) { this.x1 = l.getX1(); this.y1 = l.getY1(); this.x2 = l.getX2(); this.y2 = l.getY2(); this.t = at; }
public static double getFlatness(double coords[], int offset) { return Line2D.ptSegDist( coords[offset + 0], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); }
public double ptLineDistSq(double px, double py) { return ptLineDistSq(getX1(), getY1(), getX2(), getY2(), px, py); }
public static double getFlatness(double coords[], int offset) { return Line2D.ptSegDist( coords[offset + 0], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); }
public int relativeCCW(double px, double py) { return relativeCCW(getX1(), getY1(), getX2(), getY2(), px, py); }
public static double getFlatness(double x1, double y1, double ctrlx, double ctrly, double x2, double y2) { return Line2D.ptSegDist(x1, y1, x2, y2, ctrlx, ctrly); }
public double getFlatness() { return Line2D.ptSegDist(getX1(), getY1(), getX2(), getY2(), getCtrlX(), getCtrlY()); }
public boolean intersectsLine(double x1, double y1, double x2, double y2) { return linesIntersect(x1, y1, x2, y2, getX1(), getY1(), getX2(), getY2()); }
public double getFlatness() { return Line2D.ptSegDist(getX1(), getY1(), getX2(), getY2(), getCtrlX(), getCtrlY()); }