Skip to content

Instantly share code, notes, and snippets.

@jchernandez
Created July 23, 2016 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jchernandez/d3226ba016a835f9a510775325baa7a4 to your computer and use it in GitHub Desktop.
Save jchernandez/d3226ba016a835f9a510775325baa7a4 to your computer and use it in GitHub Desktop.
spiral
double t = 0;
Location temp = new Location("");
do {
double newLat = (uLocation.getLatitude() + (t * Math.cos(3 * t)));
double newLong = -(-uLocation.getLongitude() + (t * Math.sin(3 * t)));
LatLng latLng = new LatLng(newLat, newLong);
temp.setLatitude(newLat);
temp.setLongitude(newLong);
locations.add(latLng);
t = t + 0.00009;
}while (temp.distanceTo(uLocation)<800);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment