Package java.awt.geom

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


  {
    Line2D line1 = new Line2D.Double(0.0, 0.0, 1.0, 0.0);
    harness.check(2500.0, line1.ptSegDistSq(-50.0, 0.0));
    harness.check(0.0, line1.ptSegDistSq(0.0, 0.0));
    harness.check(0.0, line1.ptSegDistSq(1.0, 0.0));
    harness.check(49.0*49.0, line1.ptSegDistSq(50.0, 0.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(0.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(1.0, 1.0));
    harness.check(49.0*49.0+1.0, line1.ptSegDistSq(50.0, 1.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, -1.0));
View Full Code Here


    Line2D line1 = new Line2D.Double(0.0, 0.0, 1.0, 0.0);
    harness.check(2500.0, line1.ptSegDistSq(-50.0, 0.0));
    harness.check(0.0, line1.ptSegDistSq(0.0, 0.0));
    harness.check(0.0, line1.ptSegDistSq(1.0, 0.0));
    harness.check(49.0*49.0, line1.ptSegDistSq(50.0, 0.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(0.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(1.0, 1.0));
    harness.check(49.0*49.0+1.0, line1.ptSegDistSq(50.0, 1.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, -1.0));
    harness.check(1.0, line1.ptSegDistSq(0.0, -1.0));
View Full Code Here

    harness.check(2500.0, line1.ptSegDistSq(-50.0, 0.0));
    harness.check(0.0, line1.ptSegDistSq(0.0, 0.0));
    harness.check(0.0, line1.ptSegDistSq(1.0, 0.0));
    harness.check(49.0*49.0, line1.ptSegDistSq(50.0, 0.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(0.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(1.0, 1.0));
    harness.check(49.0*49.0+1.0, line1.ptSegDistSq(50.0, 1.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, -1.0));
    harness.check(1.0, line1.ptSegDistSq(0.0, -1.0));
    harness.check(1.0, line1.ptSegDistSq(1.0, -1.0));
View Full Code Here

    harness.check(0.0, line1.ptSegDistSq(0.0, 0.0));
    harness.check(0.0, line1.ptSegDistSq(1.0, 0.0));
    harness.check(49.0*49.0, line1.ptSegDistSq(50.0, 0.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(0.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(1.0, 1.0));
    harness.check(49.0*49.0+1.0, line1.ptSegDistSq(50.0, 1.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, -1.0));
    harness.check(1.0, line1.ptSegDistSq(0.0, -1.0));
    harness.check(1.0, line1.ptSegDistSq(1.0, -1.0));
    harness.check(49.0*49.0+1.0, line1.ptSegDistSq(50.0, -1.0));
View Full Code Here

    harness.check(0.0, line1.ptSegDistSq(1.0, 0.0));
    harness.check(49.0*49.0, line1.ptSegDistSq(50.0, 0.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(0.0, 1.0));
    harness.check(1.0, line1.ptSegDistSq(1.0, 1.0));
    harness.check(49.0*49.0+1.0, line1.ptSegDistSq(50.0, 1.0));
    harness.check(2501.0, line1.ptSegDistSq(-50.0, -1.0));
    harness.check(1.0, line1.ptSegDistSq(0.0, -1.0));
    harness.check(1.0, line1.ptSegDistSq(1.0, -1.0));
    harness.check(49.0*49.0+1.0, line1.ptSegDistSq(50.0, -1.0));

View Full Code Here

        // Works which line segment the point of the label is closest to
        mxPoint p0 = edgeState.getAbsolutePoint(0);
        mxPoint pe = edgeState.getAbsolutePoint(1);
        Line2D line = new Line2D.Double(p0.getPoint(), pe.getPoint());
        double minDist = line.ptSegDistSq(x, y);

        int index = 0;
        double tmp = 0;
        double length = 0;
View Full Code Here

        {
          tmp += segments[i - 2];
          pe = edgeState.getAbsolutePoint(i);

          line = new Line2D.Double(p0.getPoint(), pe.getPoint());
          double dist = line.ptSegDistSq(x, y);

          if (dist < minDist)
          {
            minDist = dist;
            index = i - 1;
View Full Code Here

      }
     
      // Work which line segment the point of the label is closest to
      Point2D last = edge.getPoint(1);
      Line2D line = new Line2D.Double(p0, last);
      double minDist = line.ptSegDistSq(p);
     
      int index = 0;
      double tmp = 0;
      double length = 0;
     
View Full Code Here

      for (int i = 2; i < pointCount; i++)
      {
        tmp += segments[i-2];
       
        line = new Line2D.Double(edge.getPoint(i), last);
        double dist = line.ptSegDistSq(p);
       
        if (dist < minDist) {
          minDist = dist;
          index = i-1;
          length = tmp;
View Full Code Here

        // Works which line segment the point of the label is closest to
        mxPoint p0 = edgeState.getAbsolutePoint(0);
        mxPoint pe = edgeState.getAbsolutePoint(1);
        Line2D line = new Line2D.Double(p0.getPoint(), pe.getPoint());
        double minDist = line.ptSegDistSq(x, y);

        int index = 0;
        double tmp = 0;
        double length = 0;
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.