Examples of sub()


Examples of net.phys2d.math.Vector2f.sub()

   */
  public void applyImpulse() {
    Vector2f dv = new Vector2f(body2.getVelocity());
    dv.add(MathUtil.cross(body2.getAngularVelocity(), r2));
    dv.sub(body1.getVelocity());
    dv.sub(MathUtil.cross(body1.getAngularVelocity(), r1));

    float ju = -dv.dot(dp) + bias;
    float p = ju / sc;

    Vector2f impulse = new Vector2f(dp);
View Full Code Here

Examples of net.sf.fysix.math.Vector2d.sub()

    return 0;
  }

  public Vector2d getGravity(Vector2d pos) {
    Vector2d dist = new Vector2d(centerPoint.getX(), centerPoint.getY());
    dist.sub(pos);
    if (dist.length() > 0 && dist.length() < 250) {
      dist.scale(100.0/dist.length());
      return dist;
    } else {
      return new Vector2d(0, 0);
View Full Code Here

Examples of net.sourceforge.fo3d.util.Vector3.sub()

                        // Fallback solution, we can compute the direction with
                        // a given target vector and the position.
                        dir = DOMUtil.get3DVectorAttribute(camera, "target");
                        if (dir != null) {
                            // compute direction
                            dir.sub(pos);
                            // set distance to center of orbit
                            view.setCameraDistanceFromCenterOfOrbit(dir
                                .length());
                        } else {
                            if (log.isErrorEnabled()) {
View Full Code Here

Examples of org.antlr.xjlib.appkit.gview.base.Vector2D.sub()

        path.add(p1);
        path.add(p2);
        path.add(end_);
        path.add(end);

        link.label.setPosition(p1.add(p2.sub(p1).stretch(0.5)).shift(LABEL_OFFSET, 0));
    }

}
View Full Code Here

Examples of org.apache.geronimo.samples.requirebundle.bean.CalculatorBean.sub()

      ExportBean eb = new ExportBean();
            String re = eb.hello_reexport();
            out.println("<h1>This sample presents features:require-bundle</h1>");
      out.println("<p>"+re+"</p>");
            out.println("<li>Bean_B [\"CalculatorBean\"] says, result of ADD operation [\"10.0 + 8.0 = ?\"] is: " + mydf.format(cb.add(10.0, 8.0))+"</li>");
            out.println("<li>Bean_B [\"CalculatorBean\"] says, result of SUB operation [\"10.0 - 8.0 = ?\"] is: " + mydf.format(cb.sub(10.0, 8.0))+"</li>");
            out.println("</body></html>");
        } catch ( Exception e ) {
            e.printStackTrace();
            throw new ServletException(e);
        } finally {
View Full Code Here

Examples of org.apache.solr.common.util.RTimer.sub()

      }
      else {
        // Process
        RTimer subt = timer.sub( "process" );
        for( SearchComponent c : components ) {
          rb.setTimer( subt.sub( c.getName() ) );
          c.process(rb);
          rb.getTimer().stop();
        }
        subt.stop();
        timer.stop();
View Full Code Here

Examples of org.apache.velocity.tools.generic.MathTool.sub()

        assertEquals(11,mathTool.mod(37,13));
        assertEquals(12,mathTool.mul(3,4));
        assertEquals(13,mathTool.round(12.8));
        assertEquals(14.2,mathTool.roundTo(1,14.18));
        assertEquals(-5.0,mathTool.roundTo(2,-4.999));
        assertEquals(15,mathTool.sub(30,15));
        assertEquals(16,mathTool.pow(4,2));
        assertEquals(17,mathTool.toInteger("17"));
        assertEquals(18.1,mathTool.toDouble("18.1"));
    }
View Full Code Here

Examples of org.bouncycastle.pqc.math.ntru.polynomial.BigIntPolynomial.sub()

            Cdec.halve();
            C = Cdec.round();
        }

        BigIntPolynomial F = (BigIntPolynomial)B.clone();
        F.sub(f.mult(C));
        BigIntPolynomial G = (BigIntPolynomial)A.clone();
        G.sub(g.mult(C));

        IntegerPolynomial FInt = new IntegerPolynomial(F);
        IntegerPolynomial GInt = new IntegerPolynomial(G);
View Full Code Here

Examples of org.bouncycastle.pqc.math.ntru.polynomial.IntegerPolynomial.sub()

            IntegerPolynomial x = fPrime.mult(i);
            x.div(q);
            x = f.mult(x);

            IntegerPolynomial si = y;
            si.sub(x);
            s.add(si);

            IntegerPolynomial hi = (IntegerPolynomial)kPriv.getBasis(iLoop).h.clone();
            if (iLoop > 1)
            {
View Full Code Here

Examples of org.datanucleus.store.rdbms.sql.expression.SQLExpression.sub()

            // Create a new StringExpression and manually update its SQL
            StringExpression strExpr = new StringExpression(stmt, null, null);
            SQLText sql = strExpr.toSQLText();
            sql.append("SUBSTRING(").append(expr).append(" FROM ").append(startExpr.add(one))
                .append(" FOR ").append(endExpr.sub(startExpr)).append(')');
            return strExpr;
        }
    }
}
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.