Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static List<Location> getCircle(Location location, double radius, int points) {
- List<Location> locations = new ArrayList<>();
- double increment = (Math.PI * 2) / points;
- for (int i = 0; i < points; i++) {
- double angle = i * increment;
- double x = location.getX() + (Math.cos(angle) * radius);
- double z = location.getZ() + (Math.sin(angle) * radius);
- locations.add(new Location(location.getWorld(), x, location.getY(), z));
- }
- return locations;
- }
Advertisement
Add Comment
Please, Sign In to add comment