Package javax.vecmath

Examples of javax.vecmath.Vector3d


  @Test
  public void testEvaluateForce() {

    myAngle.evaluateForce();

    Vector3d myAtom1Force = new Vector3d(0.0, -0.4448548635246797, 0.0);
    Vector3d myAtom2Force = new Vector3d(0.0, 0.0, 0.0);
    Vector3d myAtom3Force = new Vector3d(0.0, 0.4448548635246797, 0.0);

    assertEquals(myAtom1Force, myAtom1.getForce());
    assertEquals(myAtom2Force, myAtom2.getForce());
    assertEquals(myAtom3Force, myAtom3.getForce());
View Full Code Here


  public void testEvaluateForce() {

    myVdw.evaluateForce();

    // Express the result as a Vector3d object
    Vector3d myAtom1Force = new Vector3d(0.026170725626711078, 0.0, 0.0);
    Vector3d myAtom2Force = new Vector3d(-0.026170725626711078, 0.0, 0.0);

    assertEquals(myAtom1Force, myAtom1.getForce());
    assertEquals(myAtom2Force, myAtom2.getForce());

    LOG.debug("Force on myAtom1 is " + myAtom1.getForce().toString() + " kcal / (A mol)");
View Full Code Here

  public void testEvaluateForce() {

    myElectroStatic.evaluateForce();

    // Express the result as a Vector3d object
    Vector3d myAtom1Force = new Vector3d(25.621313063271604, 0.0, 0.0);
    Vector3d myAtom2Force = new Vector3d(-25.621313063271604, 0.0, 0.0);

    assertEquals(myAtom1Force, myAtom1.getForce());
    assertEquals(myAtom2Force, myAtom2.getForce());

    LOG.debug("Force on myAtom1 is " + myAtom1.getForce().toString()
View Full Code Here

   * @param position
   *            is cartesian space.
   */
  public Atom(Point3d position) {
    this.position = position;
    this.velocity = new Vector3d();
    this.force = new Vector3d();
  }
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();
  }
View Full Code Here

  }

  @Override
  public void evaluateForce() {
    Vector3d temp3d = new Vector3d();

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

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

    Torsion gt = new Torsion();

    TorsionGradients grad = gt.getGradients(i.getPosition(), j.getPosition(),
        k.getPosition(), l.getPosition());

    Vector3d tempI = grad.getI();
    tempI.scale(unitForce);

    Vector3d tempJ = grad.getJ();
    tempJ.scale(unitForce);

    Vector3d tempK = grad.getK();
    tempK.scale(unitForce);

    Vector3d tempL = grad.getL();
    tempL.scale(unitForce);

    i.subForce(tempI);
    j.subForce(tempJ);
    k.subForce(tempK);
    l.subForce(tempL);
View Full Code Here

   * (4)</a>.
   *
   */
  public double getCurrentAngle() {

    Vector3d Rij = new Vector3d(i.getPosition());
    Vector3d Rj = new Vector3d(j.getPosition());
    Vector3d Rkj = new Vector3d(k.getPosition());

    // Both bond vectors must be defined towards
    // the atom that they share (here atom j).
    Rij.sub(Rj);
    Rkj.sub(Rj);

    // Normalise both vectors.
    Rij.normalize();
    Rkj.normalize();

    // Dot product; angle between two vectors
    return Math.toDegrees(Math.acos(Rij.dot(Rkj)));

  }
View Full Code Here

   * Calculates and imparts the force of the angle to its member atoms
   */
  @Override
  public void evaluateForce() {

    Vector3d temp3d = new Vector3d();

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

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

    temp3d.scale(unitForce);

    i.addForce(temp3d);
    k.subForce(temp3d);

  }
View Full Code Here

            branchGroup.addChild(branchBG);
        }
    }

    private BranchGroup createBranch(TreeBranch3D branch3D) {
        Vector3d translationVector = new Vector3d(branch3D.getState().getTranslationVector().toPointValue());
        BranchGroup branchBG = new BranchGroup();
        TransformGroup transformGroup = TransformerHelper.getTranslationTransformGroup(translationVector);
        branchBG.addChild(transformGroup);

        transformGroup.addChild(branch3D.getGroup());
View Full Code Here

        leafBranchGroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND);
        TransformGroup transformGroup = new TransformGroup();
        transformGroup.setCapability(Group.ALLOW_CHILDREN_WRITE);
        transformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
        TreeLeaf3DState leaf3DState = leaf.getState();
        Transform3D translation = TransformerHelper.getTranslationTransform3D(new Vector3d(leaf3DState
                .getLeafAttachPoint().toPointValue()));
        Transform3D rotation = TransformerHelper.getRotationTransform3D(leaf3DState.getRotation(), Axis.Y);
        translation.mul(rotation);
        transformGroup.setTransform(translation);
        transformGroup.addChild(leaf.getBranchGroup());
View Full Code Here

TOP

Related Classes of javax.vecmath.Vector3d

Copyright © 2018 www.massapicom. 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.