Package javax.vecmath

Examples of javax.vecmath.Point3f.sub()


    if (ptRef != null) {
      Point3f pt0 = new Point3f(pointA);
      pt0.add(vNorm);
      float d = pt0.distance(ptRef);
      pt0.set(pointA);
      pt0.sub(vNorm);
      if (d > pt0.distance(ptRef)) {
        vNorm.scale(-1);
        nd = -nd;
      }
    }
View Full Code Here


    double Sxx = 0, Sxy = 0, Sxz = 0, Syx = 0, Syy = 0, Syz = 0, Szx = 0, Szy = 0, Szz = 0;
    for (int i = n + 1; --i >= 1;) {
      Point3f aij = centerAndPoints[0][i];
      Point3f bij = centerAndPoints[1][i];
      Point3f ptA = new Point3f(aij);
      ptA.sub(centerAndPoints[0][0]);
      Point3f ptB = new Point3f(bij);
      ptB.sub(centerAndPoints[0][1]);
      Sxx += (double) ptA.x * (double) ptB.x;
      Sxy += (double) ptA.x * (double) ptB.y;
      Sxz += (double) ptA.x * (double) ptB.z;
View Full Code Here

      Point3f aij = centerAndPoints[0][i];
      Point3f bij = centerAndPoints[1][i];
      Point3f ptA = new Point3f(aij);
      ptA.sub(centerAndPoints[0][0]);
      Point3f ptB = new Point3f(bij);
      ptB.sub(centerAndPoints[0][1]);
      Sxx += (double) ptA.x * (double) ptB.x;
      Sxy += (double) ptA.x * (double) ptB.y;
      Sxz += (double) ptA.x * (double) ptB.z;
      Syx += (double) ptA.y * (double) ptB.x;
      Syy += (double) ptA.y * (double) ptB.y;
View Full Code Here

    double sum2 = 0;
    int n = centerAndPoints[0].length - 1;
    Point3f ptAnew = new Point3f();
    for (int i = n + 1; --i >= 1;) {
      ptAnew.set(centerAndPoints[0][i]);
      ptAnew.sub(centerAndPoints[0][0]);
      q.transform(ptAnew, ptAnew);
      ptAnew.add(centerAndPoints[1][0]);
      double d = ptAnew.distance(centerAndPoints[1][i]);
      sum += d;
      sum2 += d * d;
 
View Full Code Here

  public static List transformPoints(List vPts, Matrix4f m4, Point3f center) {
    List v = new ArrayList();
    for (int i = 0; i < vPts.size(); i++) {
      Point3f pt = new Point3f((Point3f)vPts.get(i));
      pt.sub(center);
      m4.transform(pt, pt);
      pt.add(center);
      v.add(pt);
    }
    return v;
View Full Code Here

    Point3f a = new Point3f(bbVertices[1]);
    Point3f b = new Point3f(bbVertices[2]);
    Point3f c = new Point3f(bbVertices[4]);
    a.sub(center);
    b.sub(center);
    c.sub(center);
    if (offset != null)
      center.add(offset);
    return new Point3f[] { center, a, b, c };
  }
 
View Full Code Here

  }

  private static Point3f getContourPoint(Point3f[] vertices, int i, int j, float f) {
    Point3f pt = new Point3f();
    pt.set(vertices[j]);
    pt.sub(vertices[i]);
    pt.scale(f);
    pt.add(vertices[i]);
    return pt;
  }
View Full Code Here

  }

  private static Point3f getContourPoint(Point3f[] vertices, int i, int j, float f) {
    Point3f pt = new Point3f();
    pt.set(vertices[j]);
    pt.sub(vertices[i]);
    pt.scale(f);
    pt.add(vertices[i]);
    return pt;
  }
View Full Code Here

      int v2 = edgeVertexes[i + 1];
      // (P - P1) / (P2 - P1) = (0 - v1) / (v2 - v1)
      // or
      // P = P1 + (P2 - P1) * (0 - v1) / (v2 - v1)
      Point3f result = new Point3f(vertices[v2]);
      result.sub(vertices[v1]);
      result.scale(values[v1] / (values[v1] - values[v2]));
      result.add(vertices[v1]);
      edgePoints[i >> 1] = result;
    }
    if (flags == 0) {
View Full Code Here

          if (isCollapsed && !isFlat) {
            points[nPoints] = new Point3f(points[ptCenter]);
            points[nPoints].add(normal);
            otherAtoms[nPoints] = points[nPoints];
          } else if (isFlat) {
            ptRef.sub(normal);
            nRef = ptCenter;
          }
          String facet;
          facet = faceId(i, j, -1);
          if (isCollapsed || isFlat && facetCatalog.indexOf(facet) < 0) {
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.