Examples of ptSegDist()


Examples of java.awt.geom.Line2D.ptSegDist()

    harness.check(49.0, line1.ptSegDist(new Point2D.Double(50.0, 0.0)));
    harness.check(Math.sqrt(2501.0), line1.ptSegDist(new Point2D.Double(-50.0, 1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(0.0, 1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(1.0, 1.0)));
    harness.check(Math.sqrt(49.0*49.0+1.0), line1.ptSegDist(new Point2D.Double(50.0, 1.0)));
    harness.check(Math.sqrt(2501.0), line1.ptSegDist(new Point2D.Double(-50.0, -1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(0.0, -1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(1.0, -1.0)));
    harness.check(Math.sqrt(49.0*49.0+1.0), line1.ptSegDist(new Point2D.Double(50.0, -1.0)));
 
    boolean pass = false;
View Full Code Here

Examples of java.awt.geom.Line2D.ptSegDist()

    harness.check(Math.sqrt(2501.0), line1.ptSegDist(new Point2D.Double(-50.0, 1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(0.0, 1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(1.0, 1.0)));
    harness.check(Math.sqrt(49.0*49.0+1.0), line1.ptSegDist(new Point2D.Double(50.0, 1.0)));
    harness.check(Math.sqrt(2501.0), line1.ptSegDist(new Point2D.Double(-50.0, -1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(0.0, -1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(1.0, -1.0)));
    harness.check(Math.sqrt(49.0*49.0+1.0), line1.ptSegDist(new Point2D.Double(50.0, -1.0)));
 
    boolean pass = false;
    try {
View Full Code Here

Examples of java.awt.geom.Line2D.ptSegDist()

    harness.check(1.0, line1.ptSegDist(new Point2D.Double(0.0, 1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(1.0, 1.0)));
    harness.check(Math.sqrt(49.0*49.0+1.0), line1.ptSegDist(new Point2D.Double(50.0, 1.0)));
    harness.check(Math.sqrt(2501.0), line1.ptSegDist(new Point2D.Double(-50.0, -1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(0.0, -1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(1.0, -1.0)));
    harness.check(Math.sqrt(49.0*49.0+1.0), line1.ptSegDist(new Point2D.Double(50.0, -1.0)));
 
    boolean pass = false;
    try {
      line1.ptSegDist(null);
View Full Code Here

Examples of java.awt.geom.Line2D.ptSegDist()

    harness.check(1.0, line1.ptSegDist(new Point2D.Double(1.0, 1.0)));
    harness.check(Math.sqrt(49.0*49.0+1.0), line1.ptSegDist(new Point2D.Double(50.0, 1.0)));
    harness.check(Math.sqrt(2501.0), line1.ptSegDist(new Point2D.Double(-50.0, -1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(0.0, -1.0)));
    harness.check(1.0, line1.ptSegDist(new Point2D.Double(1.0, -1.0)));
    harness.check(Math.sqrt(49.0*49.0+1.0), line1.ptSegDist(new Point2D.Double(50.0, -1.0)));
 
    boolean pass = false;
    try {
      line1.ptSegDist(null);
    }
View Full Code Here

Examples of java.awt.geom.Line2D.ptSegDist()

    harness.check(1.0, line1.ptSegDist(new Point2D.Double(1.0, -1.0)));
    harness.check(Math.sqrt(49.0*49.0+1.0), line1.ptSegDist(new Point2D.Double(50.0, -1.0)));
 
    boolean pass = false;
    try {
      line1.ptSegDist(null);
    }
    catch (NullPointerException e) {
      pass = true;
    }
    harness.check(pass)
View Full Code Here

Examples of java.awt.geom.Line2D.ptSegDist()

  public boolean contains(Point2D point) {
    Line2D line = new Line2D.Double(
        this.getP1().getX(), this.getP1().getY(),
        this.getP2().getX(), this.getP2().getY());
    return line.ptSegDist(point.getX(), point.getY()) == 0;
  }

  public boolean contains(double xP1, double yP1, double xP2, double yP2) {
//    double thisxP1 = MathUtils.round(this.getP1().getX());
//    double thisyP1 = MathUtils.round(this.getP1().getY());
View Full Code Here

Examples of java.awt.geom.Line2D.ptSegDist()

          pt1 = new Point2D.Double(coordinates[0], coordinates[1]);
        } else if (type == PathIterator.SEG_LINETO) {
          ln = new Line2D.Double(pt1, new Point2D.Double(coordinates[0], coordinates[1]));
          pt1 = (Point2D) ln.getP1().clone();
         
          if (distance > ln.ptSegDist(pt)) {
            distance = ln.ptSegDist(pt);
          }
         
        }     
        pi.next();
View Full Code Here

Examples of java.awt.geom.Line2D.ptSegDist()

        } else if (type == PathIterator.SEG_LINETO) {
          ln = new Line2D.Double(pt1, new Point2D.Double(coordinates[0], coordinates[1]));
          pt1 = (Point2D) ln.getP1().clone();
         
          if (distance > ln.ptSegDist(pt)) {
            distance = ln.ptSegDist(pt);
          }
         
        }     
        pi.next();
      }
View Full Code Here

Examples of java.awt.geom.Line2D.ptSegDist()

    Point2D firstpoint = points.get(0);
    Point2D nextpoint;
    for (int i = 1; i < points.size(); i++) {
      nextpoint = points.get(i);
      line.setLine(firstpoint, nextpoint);
      if (line.ptSegDist(xcoord, ycoord) < DELTA) return true;
      firstpoint = nextpoint;
    }
    return false;
  }
View Full Code Here

Examples of java.awt.geom.Line2D.ptSegDist()

    Point2D firstpoint = points.get(0);
    Point2D nextpoint;
    for (int i = 1; i < points.size(); i++) {
      nextpoint = points.get(i);
      line.setLine(firstpoint, nextpoint);
      if (line.ptSegDist(xcoord, ycoord) < DELTA) return true;
      firstpoint = nextpoint;
    }
    return false;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.