Examples of sub()


Examples of de.psi.telco.sumoplayer.util.PointImpl.sub()

        PointImpl endPos = new PointImpl(points.get(idx+1).getX(),points.get(idx+1).getY());
        double partialLen = startPos.distance(endPos);
        double rest = pos-len;
        double fact = rest/partialLen;
       
        Vector out = startPos.add((endPos.sub(startPos).scale(fact)));
        return new PointImpl(out.getX(),out.getY());
      }else{
        return points.get(points.size()-1);    // just return last point
      }
   
View Full Code Here

Examples of eas.math.geometry.Vector2D.sub()

        pos.scale(Vector2D.NULL_VECTOR, new Vector2D(scale, scale));
        Vector2D midTranslation = new Vector2D(
                env.getScreenWidth() / 2,
                env.getScreenHeight() / 2);
        midTranslation.sub(b.centerPoint());
        pos.translate(midTranslation);

        return pos;
    }
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.math.Vector2f.sub()

    Vector2f p1 = new Vector2f(body1.getPosition());
    p1.add(r1);
    Vector2f p2 = new Vector2f(body2.getPosition());
    p2.add(r2);
    Vector2f dp = new Vector2f(p2);
    dp.sub(p1);
    float length = dp.length();
    // dp.scale(1.0f/length);
    Vector2f V = new Vector2f((float) Math.cos(originalAngle
        + body1.getRotation()), (float) Math.sin(originalAngle
        + body1.getRotation()));
View Full Code Here

Examples of fmg.fmg8.umgebung2D.Vektor2D.sub()

        normArr.add(aktV);
        aktAbst = 0;
        while (i < this.nPoints()) {
            if (i + 1 < this.nPoints()) {
                aktRicht = new Vektor2D(this.get(i + 1));
                aktRicht.sub(this.get(i));
               
                if (this.get(i).distanz(this.get(i + 1)) >= durchAbst) {
                    aktRicht.laengeFestlegen(durchAbst);
                   
                    while (aktAbst < abstaende.get(i + 1)) {
View Full Code Here

Examples of javax.vecmath.GVector.sub()

        GVector x = new GVector( initialGuess );
        GVector tempv = new GVector( initialGuess );
        tempv.mul( matrix, initialGuess );
        GVector bb = new GVector( b );
        bb.sub( tempv );
        GVector r = new GVector( bb );
        GVector p = new GVector( r );
        GVector xnew = new GVector( p );
        GVector rnew = new GVector( p );
        GVector pnew = new GVector( p );
View Full Code Here

Examples of javax.vecmath.Matrix3f.sub()

        switch (x2.tok) {
        default:
          return addX(ScriptVariable.fValue(x1) - ScriptVariable.fValue(x2));
        case Token.matrix3f:
          m = new Matrix3f((Matrix3f) x1.value);
          m.sub((Matrix3f) x2.value);
          return addX(m);
        }
      case Token.matrix4f:
        switch (x2.tok) {
        default:
View Full Code Here

Examples of javax.vecmath.Matrix4f.sub()

    Matrix4f unscaled = new Matrix4f();
    unscaled.setIdentity();
    vectorTemp.set(fixedRotationCenter);
    matrixTemp.setZero();
    matrixTemp.setTranslation(vectorTemp);
    unscaled.sub(matrixTemp);
    matrixTemp.set(matrixRotate);
    unscaled.mul(matrixTemp, unscaled);
    return unscaled;
  }
View Full Code Here

Examples of javax.vecmath.Point2d.sub()

        // make the triangle corners
        Point2d vertexA = new Point2d(wedge.firstPointX, wedge.firstPointY);
        Point2d vertexB = new Point2d(wedge.secondPointX, wedge.secondPointY);
        Point2d vertexC = new Point2d(vertexB);
        vertexB.add(normal);
        vertexC.sub(normal);
        this.g.setColor(wedge.color);
        if (wedge.type == WedgeLineElement.TYPE.DASHED) {
            this.drawDashedWedge(vertexA, vertexB, vertexC);
        } else if(wedge.type == WedgeLineElement.TYPE.WEDGED){
            this.drawFilledWedge(vertexA, vertexB, vertexC);
View Full Code Here

Examples of javax.vecmath.Point2f.sub()

            Point2f v0 = el.getNode(0).getPoint2f();
            Point2f v1 = el.getNode(1).getPoint2f();
            Point2f v2 = el.getNode(2).getPoint2f();
           
            v1.sub(v0); // from node 0 to 1
            v2.sub(v0); // from node 0 to 2
           
            float cross = v1.x*v2.y - v1.y*v2.x;
           
            if(cross < 0){
                el.reorient();
View Full Code Here

Examples of javax.vecmath.Point3d.sub()

           
            penProjectionOntoDeskNormal.set(deskSurfaceNormal);
            penProjectionOntoDeskNormal.scale(penToDeskDistance.getDoubleValue());
           
            penProjectionOntoDesk.set(penPosition);
            penProjectionOntoDesk.sub(penProjectionOntoDeskNormal);
           
            penProjectionInDeskFrame.set(penProjectionOntoDesk);
            transformFromWorldToDesk.transform(penProjectionInDeskFrame);
           
            // Only apply a force on the pen, not the desk. Doesn't follow Newton's third law, but the force is probably pretty small anyway.
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.