Package javax.vecmath

Examples of javax.vecmath.Vector3d.sub()


  diff.sub(s0start, s1start);

  Vector3d seg0dir = new Vector3d();
  seg0dir.sub(s0end, s0start);
  Vector3d seg1dir = new Vector3d();
  seg1dir.sub(s1end, s1start);

  double A = seg0dir.dot(seg0dir); // Dot(seg0dir,seg0dir);
  double B = -seg0dir.dot(seg1dir); // -Dot(seg0dir,seg1dir);
  double C = seg1dir.dot(seg1dir); // Dot(seg1dir,seg1dir);
  double D = seg0dir.dot(diff); // Dot(seg0dir,diff);
View Full Code Here


      getVertexData(i++, pnt1);
      getVertexData(i++, pnt2);
      getVertexData(i++, pnt3);

      // Determine the normal
      tmpvec.sub(pnt0, pnt1);
      vec.sub(pnt1, pnt2);

      // Do the cross product
      normal.cross(tmpvec, vec);
      normal.normalize();
View Full Code Here

   * Returns the current distance between the two atoms, in Angstroms
   */
    double getCurrentDistance() {

    Vector3d dist = new Vector3d();
    dist.sub(i.getPosition(), j.getPosition());

    return dist.length();

  }
 
View Full Code Here

   */
  public void evaluateForce() {

    Vector3d temp3d = new Vector3d();

    temp3d.sub(i.getPosition(), j.getPosition());

    double forceVectorSum = getAnalyticalGradient();
   
    double unitForce = forceVectorSum / temp3d.length();

View Full Code Here

   * Returns the current distances between the two atoms in Angstroms
   */
  private double getCurrentDistance() {

    Vector3d dist = new Vector3d();
    dist.sub(i.getPosition(), j.getPosition());

    return dist.length();

  }

View Full Code Here

   */
  public void evaluateForce() {

    Vector3d temp3d = new Vector3d();

    temp3d.sub(i.getPosition(), j.getPosition());

    double forceVectorSum = getAnalyticalGradient();

    double unitForce = forceVectorSum / temp3d.length();

View Full Code Here

   * Returns the current length of the bond in Angstroms
   */
  public double getCurrentLength() {

    Vector3d dist = new Vector3d();
    dist.sub(i.getPosition(), j.getPosition());

    return dist.length();
  }

  /**
 
View Full Code Here

   * Calculates and imparts the vector force of the bond to its member atoms
   */
  public void evaluateForce() {
    Vector3d temp3d = new Vector3d();

    temp3d.sub(i.getPosition(), j.getPosition());

    double unitForce = this.getAnalyticalGradient() / temp3d.length();

    temp3d.scale(unitForce);

View Full Code Here

    rkj.sub(k, j);
    rkj.normalize();

    // Equ 5.3c
    rkj.scale(rlk.dot(rkj));
    S.sub(rlk, rkj);

    LOG.debug("S is " + S);

    // Normalise both these vectors
    // Equ. 5.3a
View Full Code Here

  /** Returns the distance of the atom from the atom (Angstroms). */
  public double DistanceFrom(Atom atom) {

    Vector3d dist = new Vector3d();
    dist.sub(this.getPosition(), atom.getPosition());

    return dist.length();
  }

  /** Gets the atom's van der Waals radius in the 6-12 VDW equation (Angstroms). */
 
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.