Package javax.vecmath

Examples of javax.vecmath.Point3f.distance()


      // but if periodic, then the navigationCenter may have to be moved back a
      // notch
      Point3f pt = new Point3f(navigationCenter);
      viewer.toUnitCell(navigationCenter, null);
      // presuming here that pointT is still a molecular point??
      if (pt.distance(navigationCenter) > 0.01) {
        matrixTransform.transform(navigationCenter, pt);
        float dz = navigationShiftXY.z - pt.z;
        // the new navigation center determines the navigationZOffset
        modelCenterOffset += dz;
        calcCameraFactors();
View Full Code Here


      atom2 = b.getAtom2();
      undoAction(atom1.index, AtomCollection.TAINT_COORD, true);
      Point3f pt = new Point3f(x, y, (atom1.screenZ + atom2.screenZ) / 2);
      transformManager.unTransformPoint(pt, pt);
      if (atom2.getCovalentBondCount() == 1
          || pt.distance(atom1) < pt.distance(atom2)
          && atom1.getCovalentBondCount() != 1) {
        Atom a = atom1;
        atom1 = atom2;
        atom2 = a;
      }
View Full Code Here

      atom2 = b.getAtom2();
      undoAction(atom1.index, AtomCollection.TAINT_COORD, true);
      Point3f pt = new Point3f(x, y, (atom1.screenZ + atom2.screenZ) / 2);
      transformManager.unTransformPoint(pt, pt);
      if (atom2.getCovalentBondCount() == 1
          || pt.distance(atom1) < pt.distance(atom2)
          && atom1.getCovalentBondCount() != 1) {
        Atom a = atom1;
        atom1 = atom2;
        atom2 = a;
      }
View Full Code Here

    // for x = plane({atomno=1}, {atomno=2}, {atomno=3}, {atomno=4})
    float nd = getNormalThroughPoints(pointA, pointB, pointC, vNorm, vAB, vAC);
    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

      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;
      }
    }
    return nd;
View Full Code Here

    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;
    }
    return (float) Math.sqrt((sum2 - sum * sum / n) / (n - 1));
  }
View Full Code Here

          //true ==> only atom index > this atom accepted
          while (iter.hasNext()) {
            int iatomB = iter.next();
            Point3f ptB = atomXyz[myIndex[iatomB]];
            rB = atomData.atomRadius[iatomB] + solventRadius;
            if (isWithin && ptB.distance(point) > distance + rB + 0.5)
              continue;
            if (params.thePlane != null
                && Math.abs(volumeData.distancePointToPlane(ptB)) > 2 * rB)
              continue;

View Full Code Here

    // Eval getZoomFactor
    Point3f center = getAtomSetCenter(bs);
    float maxRadius = 0;
    for (int i = bs.nextSetBit(0); i >= 0; i = bs.nextSetBit(i + 1)) {
      Atom atom = atoms[i];
      float distAtom = center.distance(atom);
      float outerVdw = distAtom + getRadiusVdwJmol(atom);
      if (outerVdw > maxRadius)
        maxRadius = outerVdw;
    }
    return (maxRadius == 0 ? 10 : maxRadius);
View Full Code Here

      i = iToken + 1;
    }
    float rotationRadius = Float.NaN;
    float zoom0 = viewer.getZoomSetting();
    if (center != null) {
      if (!isChange && center.distance(viewer.getRotationCenter()) >= 0.1)
        isChange = true;
      // optional {center} rotationRadius
      if (isFloatParameter(i))
        rotationRadius = floatParameter(i++);
      if (!isCenterParameter(i)) {
View Full Code Here

        // component.
        pt0 = new Point3f();
        pt0.set(pt00);
        pt0.add(d);
        pa1.scaleAdd(0.5f, d, pt00);
        if (pt0.distance(p0) > 0.1f) {
          trans = new Vector3f(p0);
          trans.sub(pt0);
          ptemp.set(trans);
          uc.toFractional(ptemp, false);
          ftrans.set(ptemp);
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.