Examples of normalize()


Examples of javax.vecmath.GVector.normalize()

      for (int count=0;count<interiorReflexVertices.size();count++)
      {
        Vertex v=(Vertex)interiorReflexVertices.get(count);
        GVector n=new GVector(new double[] {v.getPosition().x,v.getPosition().y});
        n.sub(new GVector(new double[] {rightMostHoleVertex.getPosition().x,rightMostHoleVertex.getPosition().y}));
        n.normalize();
        GVector m=new GVector(new double[] {1.0,0.0});
        float dot=(float)m.dot(n);
       

        //if this line is the closest we've found
View Full Code Here

Examples of javax.vecmath.Quat4f.normalize()

    dorn.set(axis.x, axis.y, axis.z, (float) Math.cos(fAngle * timeStep * 0.5f));
    Quat4f orn0 = curTrans.getRotation(Stack.alloc(Quat4f.class));

    Quat4f predictedOrn = Stack.alloc(Quat4f.class);
    predictedOrn.mul(dorn, orn0);
    predictedOrn.normalize();
//  #endif
    predictedTransform.setRotation(predictedOrn);
  }

  public static void calculateVelocity(Transform transform0, Transform transform1, float timeStep, Vector3f linVel, Vector3f angVel) {
View Full Code Here

Examples of javax.vecmath.Vector2d.normalize()

  }

  private void redirectRobotToPoint(RoboterComponent rc, Point2d mouseClickedPointPosition) {
    Roboter roboter = rc.getModelObject();
    Vector2d vec = new Vector2d(mouseClickedPointPosition.getX() - roboter.getX(), mouseClickedPointPosition.getY() - roboter.getY());
    vec.normalize();
    roboter.setDirection(vec);
  }

  private void redirectRobotsToPoint(Point2d mouseClickedPointPosition) {
    Iterator<RoboterComponent> it = this.roboterComponents.iterator();
View Full Code Here

Examples of javax.vecmath.Vector3d.normalize()

            v1.sub(b, a);
            v2.sub(c, a);
            faceNormal.cross(v1, v2);
            if (faceNormal.length()==0) continue;
            faceNormal.normalize();

            // suppose the faces are nearly flat, with small deflection
            // check the scalar product is >0, so each face is the same orientation
            // otherwise, reverse the normal
            double scalara = normal[ja] * faceNormal.x + normal[ja+1] * faceNormal.y + normal[ja+2] * faceNormal.z;
 
View Full Code Here

Examples of javax.vecmath.Vector3f.normalize()

            v1.sub(b, a);
            v2.sub(c, a);
            faceNormal.cross(v1, v2);
            if (faceNormal.length()==0) continue;
            faceNormal.normalize();

            // suppose the faces are nearly flat, with small deflection
            // check the scalar product is >0, so each face is the same orientation
            // otherwise, reverse the normal
            float scalara = normal[ja] * faceNormal.x + normal[ja+1] * faceNormal.y + normal[ja+2] * faceNormal.z;
 
View Full Code Here

Examples of javax.vecmath.Vector4d.normalize()

/*  607 */     for (int i = 0; i < 6; i++)
/*  608 */       if ((enableMask & 1 << i) != 0)
/*      */       {
/*  610 */         Vector4d vec = new Vector4d(this.xformPlanes[i].x, this.xformPlanes[i].y, this.xformPlanes[i].z, this.xformPlanes[i].w);
/*      */
/*  612 */         vec.normalize();
/*  613 */         invtrans.transform(vec);
/*  614 */         update(ctx, i, true, vec.x, vec.y, vec.z, vec.w);
/*      */       }
/*      */       else {
/*  617 */         update(ctx, i, false, 0.0D, 0.0D, 0.0D, 0.0D);
View Full Code Here

Examples of javax.xml.datatype.XMLGregorianCalendar.normalize()

            int diffInMinutes = offsetInMinutes - origTimeZoneInMinutes;
            long diffInMills = diffInMinutes * 60000;
            cal.add(XsDatatypeFactory.createDuration(diffInMills));
            cal.setMillisecond(origMillis); // workaround           
            cal.setTimezone(offsetInMinutes);
            cal.normalize();
        }
        return arg;
    }

    /**
 
View Full Code Here

Examples of jinngine.math.Vector3.normalize()

    final Vector3 p4 = poly.get(1);
    final Vector3 p5 = poly.get(2);
    // counter clock-wise normal
    final Vector3 poly1normal = p5.sub(p3).cross(p3.sub(p4));
    // return
    normal.assign(poly1normal.normalize());
  }
 
  /**
   * Return true if p is contained inside poly. Poly is required to contain at least 3 affine independent points
   * @param p
View Full Code Here

Examples of jray.common.Vect3.normalize()

    Vect.crossProduct(mab, normal, dab);
    Vect.crossProduct(mac, normal, dac);
    Vect.addMultiple(a, mab, 0.5, mab);
    Vect.addMultiple(a, mac, 0.5, mac);
    dab.normalize();
    dac.normalize();
   
    if(Math.abs(dac.data[0])>1e-9&&Math.abs(dac.data[1])>1e-9&&Math.abs(dab.data[0]/dac.data[0] - dab.data[1]/dac.data[1])>1e-9){
      double x = ((mab.data[1]-mac.data[1])/dac.data[1] - (mab.data[0]-mac.data[0])/dac.data[0])/(dab.data[0]/dac.data[0] - dab.data[1]/dac.data[1]);

      Vect.addMultiple(mab, dab, x);
View Full Code Here

Examples of maui.util.Candidate.normalize()

        }
      }
    }

    for (Candidate candidate : candidatesTable.values()) {
      candidate.normalize(totalFrequency, pos);
    }

    if (vocabularyName.equals("wikipedia")) {
      candidatesTable = disambiguateCandidates(candidatesTable.values());
    }
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.