Examples of ptSegDist()


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()

    assertEquals(p2, segment1.getP2());
   
    Line2D segment2 = connection.getSegmentAtPoint(26.0, 5.0);
    assertEquals(p2, segment2.getP1());
    assertEquals(p3, segment2.getP2());
    System.out.println("dist: " + segment2.ptSegDist(26, 5));
   
    // contains
    assertFalse(connection.contains(100, 6));
    assertTrue(connection.contains(26, 5));
  }
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.