Ejemplo n.º 1
0
  public float angle(Velocity l2) {
    float scalar = (this.getX() * l2.getX()) + (this.getZ() * l2.getZ());
    float distance1 = (float) Velocity.getDistance(new Velocity(0, 0), this);
    float distance2 = (float) Velocity.getDistance(new Velocity(0, 0), l2);
    float distance = distance1 * distance2;
    //		Szstem.out.println(distance1+","+distance2+","+Math.acos(scalar/distance));
    return (float) Math.toDegrees(Math.acos(scalar / distance));

    // |1|	* |2|
    // |1|	* |2|
  }