Package javax.vecmath

Examples of javax.vecmath.Vector3d.sub()


/*     */   }
/*     */
/*     */   public static double pointToSegment(Point3d pt, Point3d segstart, Point3d segend, Point3d segint, double[] param)
/*     */   {
/* 531 */     Vector3d segdir = new Vector3d();
/* 532 */     segdir.sub(segend, segstart);
/* 533 */     Vector3d diff = new Vector3d();
/* 534 */     diff.sub(pt, segstart);
/* 535 */     double t = segdir.dot(diff);
/*     */
/* 537 */     if (t <= 0.0D) {
View Full Code Here


/*     */   public static double pointToSegment(Point3d pt, Point3d segstart, Point3d segend, Point3d segint, double[] param)
/*     */   {
/* 531 */     Vector3d segdir = new Vector3d();
/* 532 */     segdir.sub(segend, segstart);
/* 533 */     Vector3d diff = new Vector3d();
/* 534 */     diff.sub(pt, segstart);
/* 535 */     double t = segdir.dot(diff);
/*     */
/* 537 */     if (t <= 0.0D) {
/* 538 */       t = 0.0D;
/* 539 */       if (segint != null) segint.set(segstart);
View Full Code Here

/*     */     else
/*     */     {
/* 543 */       double mDotm = segdir.dot(segdir);
/* 544 */       if (t >= mDotm) {
/* 545 */         t = 1.0D;
/* 546 */         diff.sub(segdir);
/* 547 */         if (segint != null) segint.set(segend);
/* 548 */         if (param != null) param[0] = t;
/*     */       }
/*     */       else
/*     */       {
View Full Code Here

/*     */   }
/*     */
/*     */   public static double segmentToSegment(Point3d seg0start, Point3d seg0end, Point3d seg1start, Point3d seg1end, Point3d seg0int, Point3d seg1int, double[] param)
/*     */   {
/* 595 */     Vector3d diff = new Vector3d();
/* 596 */     diff.sub(seg0start, seg1start);
/*     */
/* 598 */     Vector3d seg0dir = new Vector3d();
/* 599 */     seg0dir.sub(seg0end, seg0start);
/* 600 */     Vector3d seg1dir = new Vector3d();
/* 601 */     seg1dir.sub(seg1end, seg1start);
View Full Code Here

/*     */   {
/* 595 */     Vector3d diff = new Vector3d();
/* 596 */     diff.sub(seg0start, seg1start);
/*     */
/* 598 */     Vector3d seg0dir = new Vector3d();
/* 599 */     seg0dir.sub(seg0end, seg0start);
/* 600 */     Vector3d seg1dir = new Vector3d();
/* 601 */     seg1dir.sub(seg1end, seg1start);
/*     */
/* 603 */     double A = seg0dir.dot(seg0dir);
/* 604 */     double B = -seg0dir.dot(seg1dir);
View Full Code Here

/* 596 */     diff.sub(seg0start, seg1start);
/*     */
/* 598 */     Vector3d seg0dir = new Vector3d();
/* 599 */     seg0dir.sub(seg0end, seg0start);
/* 600 */     Vector3d seg1dir = new Vector3d();
/* 601 */     seg1dir.sub(seg1end, seg1start);
/*     */
/* 603 */     double A = seg0dir.dot(seg0dir);
/* 604 */     double B = -seg0dir.dot(seg1dir);
/* 605 */     double C = seg1dir.dot(seg1dir);
/* 606 */     double D = seg0dir.dot(diff);
View Full Code Here

/* 3090 */         sqDistToEdge = Distance.rayToSegment(origin, direction, coordinates[i], coordinates[(i + 1)], iPnt1, iPnt2, null);
/*      */       }
/*      */
/* 3095 */       if (sqDistToEdge <= radius * radius) {
/* 3096 */         pi.setPointCoordinatesVW(iPnt2);
/* 3097 */         originToIpnt.sub(iPnt1, origin);
/* 3098 */         pi.setDistance(originToIpnt.length());
/*      */
/* 3100 */         freePoint3d(origin);
/* 3101 */         freePoint3d(end);
/* 3102 */         freeVector3d(direction);
View Full Code Here

/*      */     else {
/* 3248 */       sqDist = Distance.pointToRay(pt, origin, direction, iPnt, null);
/*      */     }
/* 3250 */     if (sqDist <= radius * radius) {
/* 3251 */       pi.setPointCoordinatesVW(pt);
/* 3252 */       originToIpnt.sub(iPnt, origin);
/* 3253 */       pi.setDistance(originToIpnt.length());
/*      */
/* 3255 */       freePoint3d(origin);
/* 3256 */       freePoint3d(end);
/* 3257 */       freeVector3d(direction);
View Full Code Here

/* 3293 */       sqDist = Distance.pointToSegment(pt, origin, end, iPnt, null);
/*      */     }
/*      */     else {
/* 3296 */       sqDist = Distance.pointToRay(pt, origin, direction, iPnt, null);
/*      */     }
/* 3298 */     originToIpnt.sub(iPnt, origin);
/* 3299 */     double distance = originToIpnt.length();
/* 3300 */     double radius = Math.tan(cone.getSpreadAngle()) * distance;
/* 3301 */     if (sqDist <= radius * radius) {
/* 3302 */       pi.setPointCoordinatesVW(pt);
/* 3303 */       pi.setDistance(distance);
View Full Code Here

/* 168 */       eyePosn.y = mousePosn.y;
/* 169 */       isParallel = true;
/*     */     }
/*     */
/* 173 */     Vector3d eyeToCanvas = new Vector3d();
/* 174 */     eyeToCanvas.sub(mousePosn, eyePosn);
/* 175 */     double distanceEyeToCanvas = eyeToCanvas.length();
/*     */
/* 177 */     Point3d deltaImgPlate = new Point3d();
/* 178 */     this.canvas.getPixelLocationInImagePlate(xpos + 1, ypos, deltaImgPlate);
/*     */
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.