Package com.confluenity.jaylen.entity.math

Examples of com.confluenity.jaylen.entity.math.Decimal


  private long trackId;
  private long id;

  public Particle(int id, String x, String y, String z) {
    this.id = id;
    this.r.set(X, new Decimal(x));
    this.r.set(Y, new Decimal(y));
    this.r.set(Z, new Decimal(z));
    this.v.set(X, new Decimal());
    this.v.set(Y, new Decimal());
    this.v.set(Z, new Decimal());
    this.snapshotId = VOID_SNAPSHOT_ID;
    this.trackId = VOID_TRACK_ID;
  }
View Full Code Here


  public boolean isAssignedToSnapshot() {
    return snapshotId >= 0 && snapshotId != VOID_SNAPSHOT_ID;
  }

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

    }
    return squareDistance.sqrt();
  }

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

TOP

Related Classes of com.confluenity.jaylen.entity.math.Decimal

Copyright © 2018 www.massapicom. 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.