xeRicker

Untitled

Aug 4th, 2016
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. public static List<Location> getCircle(Location location, double radius, int points) {
  2. List<Location> locations = new ArrayList<>();
  3. double increment = (Math.PI * 2) / points;
  4. for (int i = 0; i < points; i++) {
  5. double angle = i * increment;
  6. double x = location.getX() + (Math.cos(angle) * radius);
  7. double z = location.getZ() + (Math.sin(angle) * radius);
  8. locations.add(new Location(location.getWorld(), x, location.getY(), z));
  9. }
  10. return locations;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment