Examples of Point2d


Examples of Makelangelo.Point2D

    numPoints=0;
    for(y=0;y<image_height;++y) {
      for(x=0;x<image_width;++x) {
        i=decode(img.getRGB(x,y));
        if(i==0) {
          points[numPoints++]=new Point2D(TX(x),TY(y));
        }
      }
    }
  }
View Full Code Here

Examples of ae.java.awt.geom.Point2D

    {
        boolean linear =
            (paint.getColorSpace() == ColorSpaceType.LINEAR_RGB);
        Color[] colors = paint.getColors();
        int numStops = colors.length;
        Point2D pt1 = paint.getStartPoint();
        Point2D pt2 = paint.getEndPoint();
        AffineTransform at = paint.getTransform();
        at.preConcatenate(sg2d.transform);

        if (!linear && numStops == 2 &&
            paint.getCycleMethod() != CycleMethod.REPEAT)
        {
            // delegate to the optimized two-color gradient codepath
            boolean isCyclic =
                (paint.getCycleMethod() != CycleMethod.NO_CYCLE);
            setGradientPaint(rq, at,
                             colors[0], colors[1],
                             pt1, pt2,
                             isCyclic, useMask);
            return;
        }

        int cycleMethod = paint.getCycleMethod().ordinal();
        float[] fractions = paint.getFractions();
        int[] pixels = convertToIntArgbPrePixels(colors, linear);

        // calculate plane equation constants
        double x = pt1.getX();
        double y = pt1.getY();
        at.translate(x, y);
        // now gradient point 1 is at the origin
        x = pt2.getX() - x;
        y = pt2.getY() - y;
        double len = Math.sqrt(x * x + y * y);
        at.rotate(x, y);
        // now gradient point 2 is on the positive x-axis
        at.scale(len, 1);
        // now gradient point 1 is at (0.0, 0), point 2 is at (1.0, 0)
View Full Code Here

Examples of aima.core.util.datastructure.Point2D

  /**
   * Defines the position of a location as with respect to an orthogonal
   * coordinate system.
   */
  public void setPosition(String loc, double x, double y) {
    locationPositions.put(loc, new Point2D(x, y));
  }
View Full Code Here

Examples of co.ideago.AdvancedPoint.Point2D

import co.ideago.AdvancedPoint.TooFewPointsException;

public class Test {
  public static void main(String[] args) {
    // Are two points equal?
    Point2D p1 = new Point2D(2.0, 2.0);
    Point2D p2 = new Point2D(2.0, 2.0);
   
    System.out.println(p1 + " is equal to " + p2 + "? " + p1.equals(p2));
   
    // Create an ArrayList of awt Points
    ArrayList<java.awt.Point> awtPoints = new ArrayList<java.awt.Point>();
    awtPoints.add(new java.awt.Point(4,4));
    awtPoints.add(new java.awt.Point(2,4));
    awtPoints.add(new java.awt.Point(3,5));
    awtPoints.add(new java.awt.Point(5,6));
    awtPoints.add(new java.awt.Point(5,5));
    awtPoints.add(new java.awt.Point(4,5));
   
    ArrayList<Point2D> points = null;
    try {
      points = PointUtil.pointConverter(awtPoints);
     
      for (Point2D p : points) {
        System.out.println(p.getX() + " " + p.getY());
      }
    } catch (InstantiationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (IllegalAccessException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
   
    System.out.println("----------- Testing Convex Hull ----------");
   
    List<Point2D> convexHull = null;
    try {
      convexHull = ConvexHull.giftWrap2D(points);
      for (Point2D p : convexHull) {
        System.out.println(p.getX() + " " + p.getY());
      }
     
    } catch (TooFewPointsException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
   
   
    System.out.println("--------- Test Outliers --------");
    List<Point2D> outliers = new ArrayList<Point2D>();
    outliers.add(new Point2D(-1.0, 1.0));
    outliers.add(new Point2D(10.0, 1.0));
    outliers.add(new Point2D(9.0, 4.0));
    outliers.add(new Point2D(4.0, 5.0));
   
    List<Point2D> result = ConvexHull.outliers(outliers, convexHull);
    for (Point2D p : result) {
      System.out.println(p);
    }
View Full Code Here

Examples of com.cedarsoftware.ncube.proximity.Point2D

            LatLon l = (LatLon)o;
            builder.append(String.format("\"%f,%f\"", l.getLat(), l.getLon()));
        }
        else if (o instanceof Point2D)
        {
            Point2D l = (Point2D)o;
            String twoDoubleFormat = "\"%f,%f\"";
            builder.append(String.format(twoDoubleFormat, l.getX(), l.getY()));
        }
        else if (o instanceof Point3D)
        {
            Point3D p = (Point3D)o;
            builder.append(String.format("\"%f,%f,%f\"", p.getX(), p.getY(), p.getZ()));
View Full Code Here

Examples of com.eagerlogic.cubee.client.utils.Point2D

        int bx = (int) (0 - ((bw - mw) * tcx));
        int by = (int) (0 - ((bh - mh) * tcy));
        double rot = rotate.get();
        if (rot != 0.0) {
            rot = rot * 360;
            Point2D tr = rotatePoint(bw, 0, rot);
            Point2D br = rotatePoint(bw, bh, rot);
            Point2D bl = rotatePoint(0, bh, rot);
            int minX = Math.min(Math.min(0, tr.getX()), Math.min(br.getX(), bl.getX()));
            int minY = Math.min(Math.min(0, tr.getY()), Math.min(br.getY(), bl.getY()));
            int maxX = Math.max(Math.max(0, tr.getX()), Math.max(br.getX(), bl.getX()));
            int maxY = Math.max(Math.max(0, tr.getY()), Math.max(br.getY(), bl.getY()));
            bw = maxX - minX;
            bh = maxY - minY;
            bx = minX;
            by = minY;
        }
View Full Code Here

Examples of com.emitrom.lienzo.client.core.types.Point2D

     */
    public Line(double x1, double y1, double x2, double y2)
    {
        super(ShapeType.LINE);

        setPoints(new Point2DArray(new Point2D(x1, y1), new Point2D(x2, y2)));
    }
View Full Code Here

Examples of com.esri.core.geometry.Point2D

    }
  }

  void fillMultiPath(SimpleRasterizer rasterizer, Transformation2D trans, MultiPathImpl polygon, boolean isWinding) {
    SegmentIteratorImpl segIter = polygon.querySegmentIterator();
    Point2D p1 = new Point2D();
    Point2D p2 = new Point2D();
    while (segIter.nextPath()) {
      while (segIter.hasNextSegment()) {
        Segment seg = segIter.nextSegment();
        if (seg.getType() != Geometry.Type.Line)
          throw GeometryException.GeometryInternalError(); // TODO:
View Full Code Here

Examples of com.google.code.appengine.awt.geom.Point2D

        return dst;
    }

    public void transform(Point2D[] src, int srcOff, Point2D[] dst, int dstOff, int length) {
        while (--length >= 0) {
            Point2D srcPoint = src[srcOff++];
            double x = srcPoint.getX();
            double y = srcPoint.getY();
            Point2D dstPoint = dst[dstOff];
            if (dstPoint == null) {
                if (srcPoint instanceof Point2D.Double) {
                    dstPoint = new Point2D.Double();
                } else {
                    dstPoint = new Point2D.Float();
                }
            }
            dstPoint.setLocation(x * m00 + y * m01 + m02, x * m10 + y * m11 + m12);
            dst[dstOff++] = dstPoint;
        }
    }
View Full Code Here

Examples of com.jgraph.gaeawt.java.awt.geom.Point2D

        if ((glyphIndex > vector.length) || (glyphIndex < 0)) {
            // awt.43=glyphIndex is out of vector's limits
            throw new IndexOutOfBoundsException(Messages.getString("awt.43")); //$NON-NLS-1$
        }
        int index = glyphIndex << 1;
        Point2D pos = new Point2D.Float(visualPositions[index], visualPositions[index+1]);

        // For last position we don't have to transform !!
        if(glyphIndex==vector.length){
            return pos;
        }

        AffineTransform at = getGlyphTransform(glyphIndex);
        if ((at == null) || (at.isIdentity())){
            return pos;
        }

        pos.setLocation(pos.getX() + at.getTranslateX(), pos.getY() + at.getTranslateY());

        return pos;
    }
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.