Back to project page PharmaApp.
The source code is released under:
MIT License
If you think the Android project PharmaApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package mobi.pharmaapp.util; /* w w w. ja v a 2 s. c om*/ import mobi.pharmaapp.models.UserModel; /** * * @author see /AUTHORS */ public class Location { private float lat; private float lon; public Location(float lat, float lon) { this.lat = lat; this.lon = lon; } @Override public String toString() { return "[" + lat + "," + lon + "]"; } public float getLat() { return lat; } public float getLon() { return lon; } public float distanceTo(Location l) { return (float) (Math.sqrt(Math.pow(2, getLat() - UserModel.getInstance().getCurrentLocation().getLat()) + Math.pow(2, getLon() - UserModel.getInstance().getCurrentLocation().getLon()))); } }