Package javax.vecmath

Examples of javax.vecmath.Point2d


    }
    return isRingBond;
  }
 
  private void reflectAtom(IAtom a, IAtom refAtom1, IAtom refAtom2) {
    Point2d refCoords = Reflection.reflect(a.getPoint2d(), refAtom1.getPoint2d(), refAtom2.getPoint2d());
    a.setPoint2d(refCoords);
  }
View Full Code Here


  }

  public static Point2d getScaledVectorPoint(Vector2d vector, Point2d p, double size) {
    double x = p.getX() + size * vector.getX();
    double y = p.getY() + size * vector.getY();
    return new Point2d(x, y);
  }
View Full Code Here

        // Check if adjusted position needs to be computed
        Point3d adjPos = new Point3d();    // Position of the Raster after adjusting for dstOffset
        adjPos.set(position);

        Point2d winCoord = new Point2d()// Position of Raster in window coordinates
        Transform3D localToImagePlate = new Transform3D()// Local to Image plate transform

        Point3d clipCoord = computeWinCoord(cv, ra, winCoord, adjPos, localToImagePlate);

        // Test raster for out of bounds in Z.
View Full Code Here

    boolean pointIntersectPolygon2D(Vector3d normal, Point3d[] coord,
            Point3d point)
  {

      double  absNrmX, absNrmY, absNrmZ;
      Point2d coord2D[] = new Point2d[coord.length];
      Point2d pnt = new Point2d();

      int i, j, axis;

      // Project 3d points onto 2d plane.
      // Note : Area of polygon is not preserve in this projection, but
      // it doesn't matter here.

      // Find the axis of projection.
      absNrmX = Math.abs(normal.x);
      absNrmY = Math.abs(normal.y);
      absNrmZ = Math.abs(normal.z);

      if(absNrmX > absNrmY)
    axis = 0;
      else
    axis = 1;

      if(axis == 0) {
    if(absNrmX < absNrmZ)
        axis = 2;
      }
      else if(axis == 1) {
    if(absNrmY < absNrmZ)
        axis = 2;
      }

      // System.err.println("Normal " + normal + " axis " + axis );

      for(i=0; i<coord.length; i++) {
    coord2D[i] = new Point2d();

    switch (axis) {
    case 0:
        coord2D[i].x = coord[i].y;
        coord2D[i].y = coord[i].z;
View Full Code Here

    boolean edgeIntersectPolygon2D(Vector3d normal, Point3d[] coord,
           Point3d[] seg)
  {

      double  absNrmX, absNrmY, absNrmZ;
      Point2d coord2D[] = new Point2d[coord.length];
      Point2d seg2D[] = new Point2d[2];

      int i, j, axis;

      // Project 3d points onto 2d plane.
      // Note : Area of polygon is not preserve in this projection, but
      // it doesn't matter here.

      // Find the axis of projection.
      absNrmX = Math.abs(normal.x);
      absNrmY = Math.abs(normal.y);
      absNrmZ = Math.abs(normal.z);

      if(absNrmX > absNrmY)
    axis = 0;
      else
    axis = 1;

      if(axis == 0) {
    if(absNrmX < absNrmZ)
        axis = 2;
      }
      else if(axis == 1) {
    if(absNrmY < absNrmZ)
        axis = 2;
      }

      // System.err.println("Normal " + normal + " axis " + axis );

      for(i=0; i<coord.length; i++) {
    coord2D[i] = new Point2d();

    switch (axis) {
    case 0:
        coord2D[i].x = coord[i].y;
        coord2D[i].y = coord[i].z;
        break;

    case 1:
        coord2D[i].x = coord[i].x;
        coord2D[i].y = coord[i].z;
        break;

    case 2:
        coord2D[i].x = coord[i].x;
        coord2D[i].y = coord[i].y;
        break;
    }

    // System.err.println("i " + i + " u " + uCoor[i] + " v " + vCoor[i]);
      }

      for(i=0; i<2; i++) {
    seg2D[i] = new Point2d();
    switch (axis) {
    case 0:
        seg2D[i].x = seg[i].y;
        seg2D[i].y = seg[i].z;
        break;
View Full Code Here

       
//        updateAreaSet();
    }

    public PrintObject(AreaSet areaSet, double[] densities, double height) {
        this(areaSet, densities, new Point2d(), height);
    }
View Full Code Here

    public PrintObject(AreaSet areaSet, double[] densities, double height) {
        this(areaSet, densities, new Point2d(), height);
    }
   
    public PrintObject(AreaSet areaSet, double height){
        this(areaSet, new double[areaSet.getResolution()], new Point2d(), height);
    }
View Full Code Here

    public double getY(){
        return this.position.y;
    }
   
    public void setPosition(double x, double y) {
        setPosition(new Point2d(x, y));
    }
View Full Code Here

        double maxX = bsp.bed_size[0] - minX;
       
        ArrayList<Point2d> centers = new ArrayList<>();
       
        double curX = minX + env0.getWidth()/2;
        centers.add(new Point2d(curX, py[0]));
        for (int i = 1; true; i++) {
            curX += dx[i%2];
            if(curX > maxX)
                break;
            centers.add(new Point2d(curX, py[i%2]));
        }
       
        int xCount = centers.size();
        double dy = lineHeight + bsp.gap;
        for (int i = 1; i < lines; i++) {
            for (int j = 0; j < xCount; j++) {
                Point2d pj = centers.get(j);
                centers.add(new Point2d(pj.x, pj.y + i*dy));
            }
        }
       
        return centers.toArray(new Point2d[centers.size()]);
    }
View Full Code Here

        double disty = bb.getHeight() + bsp.gap;
       
        Point2d[] positions = new Point2d[x*y];
        for (int ix = 0; ix < x; ix++) {
            for (int iy = 0; iy < y; iy++) {
                positions[ix*y + iy] = new Point2d(t1x + ix*distx, t1y + iy*disty);
            }
        }
       
        return positions;
    }
View Full Code Here

TOP

Related Classes of javax.vecmath.Point2d

Copyright © 2018 www.massapicom. 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.