Package com.confluenity.jaylen.entity.math

Examples of com.confluenity.jaylen.entity.math.Decimal.sqrt()


  public Decimal getDistance(final Particle other) {
    Decimal squareDistance = new Decimal();
    for (int j = 0; j < DIMENSIONS; j++) {
      squareDistance.add(getX().sub(other.getX()).sqr());
    }
    return squareDistance.sqrt();
  }

  public Decimal getVelocity() {
    Decimal velocityModule = new Decimal();
    for (int j = 0; j < DIMENSIONS; j++) {
View Full Code Here


  public Decimal getVelocity() {
    Decimal velocityModule = new Decimal();
    for (int j = 0; j < DIMENSIONS; j++) {
      velocityModule.add(getVx().sqr());
    }
    return velocityModule.sqrt();
  }

  public Decimal getX() {
    return r.elementAt(X);
  }
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.