Package javax.vecmath

Examples of javax.vecmath.Vector3d.sub()


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

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

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

    Torsion gt = new Torsion();
View Full Code Here


    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();
View Full Code Here

  @Override
  public void evaluateForce() {

    Vector3d temp3d = new Vector3d();

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

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

    temp3d.scale(unitForce);
View Full Code Here

        Vector3d normal = new Vector3d();
        Vector3d vector1 = new Vector3d();
        Vector3d vector2 = new Vector3d();

        vector1.sub(p2, p1);
        vector2.sub(p3, p1);

        normal.cross(vector1, vector2);
        normal.normalize();
        return new Vector3f(normal);
    }
View Full Code Here

           
            yArmExternalForcePoint.getPosition(yArmPosition);
            yArmExternalForcePoint.getVelocity(yArmVelocity);
           
            Vector3d xArmToYArm = new Vector3d();
            xArmToYArm.sub(yArmPosition, xArmPosition);
           
            Vector3d xArmToYArmVelocity = new Vector3d();
            xArmToYArmVelocity.sub(yArmVelocity, xArmVelocity);
           
            Vector3d armForcesKp = new Vector3d();
View Full Code Here

           
            Vector3d xArmToYArm = new Vector3d();
            xArmToYArm.sub(yArmPosition, xArmPosition);
           
            Vector3d xArmToYArmVelocity = new Vector3d();
            xArmToYArmVelocity.sub(yArmVelocity, xArmVelocity);
           
            Vector3d armForcesKp = new Vector3d();
            Vector3d armForcesKd = new Vector3d();
           
            armForcesKp.set(xArmToYArm);
View Full Code Here

  //
  if (bounds instanceof BoundingSphere) {
      Point3d sphCenter = ((BoundingSphere)bounds).getCenter();
      double sphRadius = ((BoundingSphere)bounds).getRadius();
      double sqDist = Utils.ptToRaySquare(sphCenter, origin, direction, rayPt);
      vector.sub (rayPt, origin);
      distance = vector.length();
      radius = getRadius (distance);
      if (sqDist <= (sphRadius+radius)*(sphRadius+radius)) {
    return true;
      }
View Full Code Here

      Point3d center = ((BoundingBox)bounds).getCenter ();

      // First, see if cone is too far away from BoundingBox
      double sqDist = Utils.ptToRaySquare(center, origin, direction, rayPt);

      vector.sub (rayPt, origin);
      distance = vector.length();
      radius = getRadius (distance);

      double temp = (center.x - lower.x + radius);
      double boxRadiusSquared = temp*temp;
 
View Full Code Here

    // System.err.println ("Testing edge: "+edges[i][0]+" - "+edges[i][1]);
    double distToEdge =
        Utils.rayToSegment (origin, direction, edges[i][0], edges[i][1],
             rayPt, null, null);

    vector.sub (rayPt, origin);
    distance = vector.length();
    radius = getRadius (distance);
    // System.err.println ("PickConeRay: distance: "+distance+" radius:"+radius);
    if (distToEdge <= radius*radius) {
        //    System.err.println ("Intersects!");
View Full Code Here

      bsphere.getCenter (sphCenter);
      double sphRadius = bsphere.getRadius();

      double sqDist = Utils.ptToRaySquare(sphCenter, origin, direction, rayPt);
      vector.sub (rayPt, origin);
      distance = vector.length();
      radius = getRadius (distance);
      if (sqDist > (sphRadius+radius)*(sphRadius+radius)) {
    return false; // we are too far to intersect
      }
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.