Package javax.vecmath

Examples of javax.vecmath.Vector3d.lengthSquared()


  // We projected 'before' the start point, just return the dSquared between
  // the point and the start
  if (proj <= 0.0d) {
    if (closest != null) closest.set(start);
    return dt.lengthSquared();
  }

  // Project the segment onto itself
  double segSquared = dir.lengthSquared();
View Full Code Here


  // If our point projected off the end of the segment, return the dSquared between
  // the point and the end
  if (proj >= segSquared) {
    if (closest != null) closest.set(end);
    dt.sub(pt, end);
    return dt.lengthSquared();
  }

  // We projected somewhere along the segment, calculate the closest point
  dt.scaleAdd(proj / segSquared, dir, start);
  if (closest != null) closest.set(dt);
View Full Code Here

  dt.scaleAdd(proj / segSquared, dir, start);
  if (closest != null) closest.set(dt);

  // return the distance from the point to the closest point on the segment
  dt.sub(pt, dt);
  return dt.lengthSquared();
}

/**
* Returns the square of the minimum distance from the given point to the ray
* defined by start, dir.
View Full Code Here

  // We projected 'before' the start point, just return the dSquared between
  // the point and the start
  if (proj <= 0.0d) {
    if (closest != null) closest.set(start);
    return dt.lengthSquared();
  }

  // Project the ray onto itself
  double raySquared = dir.lengthSquared();
View Full Code Here

  dt.scaleAdd(proj / raySquared, dir, start);
  if (closest != null) closest.set(dt);

  // return the distance from the point to the closest point on the ray
  dt.sub(pt, dt);
  return dt.lengthSquared();
}

private static final double ZERO_TOL = 1e-5d;

/**
 
View Full Code Here

      if(acLenSq < abLenSq) {
    return false; // C doesn't lies between end points of edge.
      }

      radiusSq = sphere.radius * sphere.radius;
      apLenSq = ap.lengthSquared();

      if((apLenSq - acLenSq) <= radiusSq) {
    return true;
      }

View Full Code Here

/* 1263 */     delta0.sub(coords[index1], coords[index0]);
/* 1264 */     delta1.sub(coords[index2], coords[index0]);
/* 1265 */     delta2.sub(coords[index2], coords[index1]);
/* 1266 */     double len0 = delta0.lengthSquared();
/* 1267 */     double len1 = delta1.lengthSquared();
/* 1268 */     double len2 = delta2.lengthSquared();
/* 1269 */     Vector3d longest = delta0;
/* 1270 */     double maxLen = len0;
/* 1271 */     if (len1 > maxLen) {
/* 1272 */       longest = delta1;
/* 1273 */       maxLen = len1;
View Full Code Here

/*      */
/* 2130 */     if (acLenSq < abLenSq) {
/* 2131 */       return false;
/*      */     }
/* 2133 */     double radiusSq = radius * radius;
/* 2134 */     double apLenSq = ap.lengthSquared();
/*      */
/* 2136 */     if (apLenSq - acLenSq <= radiusSq) {
/* 2137 */       return true;
/*      */     }
/* 2139 */     return false;
View Full Code Here

/*  6220 */       freeVector3d(ap);
/*  6221 */       return false;
/*       */     }
/*       */
/*  6224 */     double radiusSq = sphere.radius * sphere.radius;
/*  6225 */     double apLenSq = ap.lengthSquared();
/*       */
/*  6227 */     if (apLenSq - acLenSq <= radiusSq) {
/*  6228 */       freeVector3d(ab);
/*  6229 */       freeVector3d(ap);
/*  6230 */       return true;
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.