Android Open Source - WATisRain Waypoint






From Project

Back to project page WATisRain.

License

The source code is released under:

MIT License

If you think the Android project WATisRain listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.lucky.watisrain.backend.data;
/*from   w ww.  j  a  v a  2 s .  co  m*/
/**
 * A waypoint is a primitive point without a name.
 */
public class Waypoint {
  
  private int x;
  private int y;
  
  /**
   * Default constructor
   */
  public Waypoint(int x, int y){
    this.x = x;
    this.y = y;
  }
  
  public int getX(){
    return x;
  }
  
  public int getY(){
    return y;
  }
  
  
  /**
   * Calculate Euclidean distance
   */
  public double distanceTo(Waypoint other){
    double xx = this.x - other.x;
    double yy = this.y - other.y;
    return Math.sqrt(xx*xx + yy*yy);
  }
  
  @Override
  public String toString(){
    return "(" + x + "," + y + ")";
  }
  
  @Override
  public boolean equals(Object o){
    Waypoint other = (Waypoint)o;
    return this.x == other.x && this.y == other.y;
  }

}




Java Source Code List

com.lucky.watisrain.Global.java
com.lucky.watisrain.MainActivity.java
com.lucky.watisrain.backend.Main.java
com.lucky.watisrain.backend.MapFactory.java
com.lucky.watisrain.backend.RouteFinder.java
com.lucky.watisrain.backend.Util.java
com.lucky.watisrain.backend.data.Building.java
com.lucky.watisrain.backend.data.Location.java
com.lucky.watisrain.backend.data.Map.java
com.lucky.watisrain.backend.data.Path.java
com.lucky.watisrain.backend.data.RouteStep.java
com.lucky.watisrain.backend.data.Route.java
com.lucky.watisrain.backend.data.Waypoint.java
com.lucky.watisrain.map.DirectionsView.java
com.lucky.watisrain.map.MapDraw.java
com.lucky.watisrain.map.MapView.java