Package javax.vecmath

Examples of javax.vecmath.Point2d


    public PointComparator() {
    }

    public int compare(Object o1, Object o2) {
        Point2d p1 = (Point2d)o1;
        Point2d p2 = (Point2d)o2;

        if (p1.x<p2.x) return -1;
        if (p1.x>p2.x) return 1;
        if (p1.y<p2.y) return -1;
        if (p1.y>p2.y) return 1;
View Full Code Here


    // static calls to do some stuff, almost never on real triangles
    private static Point2d[] sorted = new Point2d[3];

    public static double signedArea(Point2d vertex0,Point2d vertex1,Point2d vertex2) {
        Point2d temp;

        sorted[0] = vertex0;
        sorted[1] = vertex1;
        sorted[2] = vertex2;
View Full Code Here

    public DistanceComparator(Point2d point) {
        start = point;
    }

    public int compare(Object o1, Object o2) throws ClassCastException {
        Point2d p1,p2;

        if (o1 instanceof Point2d)
            p1 = (Point2d)o1;
        else if (o1 instanceof PointNode)
            p1 = ((PointNode)o1).data;
View Full Code Here

/*      */   }
/*      */
/*      */   static boolean pointIntersectPolygon2D(Vector3d normal, Point3d[] coord, Point3d point)
/*      */   {
/* 2153 */     Point2d[] coord2D = new Point2d[coord.length];
/* 2154 */     Point2d pnt = new Point2d();
/*      */
/* 2163 */     double absNrmX = Math.abs(normal.x);
/* 2164 */     double absNrmY = Math.abs(normal.y);
/* 2165 */     double absNrmZ = Math.abs(normal.z);
/*      */     int axis;
/*      */     int axis;
/* 2167 */     if (absNrmX > absNrmY)
/* 2168 */       axis = 0;
/*      */     else {
/* 2170 */       axis = 1;
/*      */     }
/* 2172 */     if (axis == 0) {
/* 2173 */       if (absNrmX < absNrmZ)
/* 2174 */         axis = 2;
/*      */     }
/* 2176 */     else if ((axis == 1) &&
/* 2177 */       (absNrmY < absNrmZ)) {
/* 2178 */       axis = 2;
/*      */     }
/*      */
/* 2183 */     for (int i = 0; i < coord.length; i++) {
/* 2184 */       coord2D[i] = new Point2d();
/*      */
/* 2186 */       switch (axis) {
/*      */       case 0:
/* 2188 */         coord2D[i].x = coord[i].y;
/* 2189 */         coord2D[i].y = coord[i].z;
View Full Code Here

/* 2309 */       (absNrmY < absNrmZ)) {
/* 2310 */       axis = 2;
/*      */     }
/*      */
/* 2315 */     for (int i = 0; i < coord.length; i++) {
/* 2316 */       coord2D[i] = new Point2d();
/*      */
/* 2318 */       switch (axis) {
/*      */       case 0:
/* 2320 */         coord2D[i].x = coord[i].y;
/* 2321 */         coord2D[i].y = coord[i].z;
/* 2322 */         break;
/*      */       case 1:
/* 2325 */         coord2D[i].x = coord[i].x;
/* 2326 */         coord2D[i].y = coord[i].z;
/* 2327 */         break;
/*      */       case 2:
/* 2330 */         coord2D[i].x = coord[i].x;
/* 2331 */         coord2D[i].y = coord[i].y;
/*      */       }
/*      */
/*      */     }
/*      */
/* 2337 */     for (i = 0; i < 2; i++) {
/* 2338 */       seg2D[i] = new Point2d();
/* 2339 */       switch (axis) {
/*      */       case 0:
/* 2341 */         seg2D[i].x = seg[i].y;
/* 2342 */         seg2D[i].y = seg[i].z;
/* 2343 */         break;
View Full Code Here

/*     */
/* 202 */       if (this.elements.size() == 2) {
/* 203 */         if (!(this.elements.get(1) instanceof Double)) {
/* 204 */           syntaxError(st, file, "Both elements must be numbers");
/*     */         }
/* 206 */         return new Point2d(((Double)this.elements.get(0)).doubleValue(), ((Double)this.elements.get(1)).doubleValue());
/*     */       }
/*     */
/* 211 */       if (this.elements.size() == 3) {
/* 212 */         if ((!(this.elements.get(1) instanceof Double)) || (!(this.elements.get(2) instanceof Double)))
/*     */         {
View Full Code Here

/*     */     }
/* 238 */     else if (attr.equals("WindowPosition")) {
/* 239 */       if (!(val instanceof Point2d)) {
/* 240 */         syntaxError("WindowPosition must be a Point2d");
/*     */       }
/* 242 */       Point2d p2d = (Point2d)val;
/* 243 */       this.windowX = ((int)p2d.x);
/* 244 */       this.windowY = ((int)p2d.y);
/*     */     }
/* 246 */     else if (attr.equals("WindowSize")) {
/* 247 */       if ((val instanceof Point2d)) {
/* 248 */         this.fullScreen = false;
/* 249 */         this.noBorderFullScreen = false;
/*     */
/* 251 */         Point2d p2d = (Point2d)val;
/* 252 */         this.windowWidthInPixels = ((int)p2d.x);
/* 253 */         this.windowHeightInPixels = ((int)p2d.y);
/*     */       }
/* 255 */       else if ((val instanceof String)) {
/* 256 */         String s = (String)val;
View Full Code Here

/*     */   {
/*  60 */     this.geoType = 15;
/*     */
/*  62 */     this.vwip = new Transform3D();
/*  63 */     this.adjPos = new Point3d();
/*  64 */     this.winCoord = new Point2d();
/*     */   }
View Full Code Here

/*       */   }
/*       */
/*       */   boolean pointIntersectPolygon2D(Vector3d normal, Point3d[] coord, Point3d point)
/*       */   {
/*  6252 */     Point2d[] coord2D = new Point2d[coord.length];
/*  6253 */     Point2d pnt = new Point2d();
/*       */
/*  6262 */     double absNrmX = Math.abs(normal.x);
/*  6263 */     double absNrmY = Math.abs(normal.y);
/*  6264 */     double absNrmZ = Math.abs(normal.z);
/*       */     int axis;
/*       */     int axis;
/*  6266 */     if (absNrmX > absNrmY)
/*  6267 */       axis = 0;
/*       */     else {
/*  6269 */       axis = 1;
/*       */     }
/*  6271 */     if (axis == 0) {
/*  6272 */       if (absNrmX < absNrmZ)
/*  6273 */         axis = 2;
/*       */     }
/*  6275 */     else if ((axis == 1) &&
/*  6276 */       (absNrmY < absNrmZ)) {
/*  6277 */       axis = 2;
/*       */     }
/*       */
/*  6282 */     for (int i = 0; i < coord.length; i++) {
/*  6283 */       coord2D[i] = new Point2d();
/*       */
/*  6285 */       switch (axis) {
/*       */       case 0:
/*  6287 */         coord2D[i].x = coord[i].y;
/*  6288 */         coord2D[i].y = coord[i].z;
View Full Code Here

/*  6421 */       (absNrmY < absNrmZ)) {
/*  6422 */       axis = 2;
/*       */     }
/*       */
/*  6427 */     for (int i = 0; i < coord.length; i++) {
/*  6428 */       coord2D[i] = new Point2d();
/*       */
/*  6430 */       switch (axis) {
/*       */       case 0:
/*  6432 */         coord2D[i].x = coord[i].y;
/*  6433 */         coord2D[i].y = coord[i].z;
/*  6434 */         break;
/*       */       case 1:
/*  6437 */         coord2D[i].x = coord[i].x;
/*  6438 */         coord2D[i].y = coord[i].z;
/*  6439 */         break;
/*       */       case 2:
/*  6442 */         coord2D[i].x = coord[i].x;
/*  6443 */         coord2D[i].y = coord[i].y;
/*       */       }
/*       */
/*       */     }
/*       */
/*  6450 */     for (i = 0; i < 2; i++) {
/*  6451 */       seg2D[i] = new Point2d();
/*  6452 */       switch (axis) {
/*       */       case 0:
/*  6454 */         seg2D[i].x = seg[i].y;
/*  6455 */         seg2D[i].y = seg[i].z;
/*  6456 */         break;
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.