Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8894819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:36:17+00:00 2026-06-14T23:36:17+00:00

I need a method to get the points of the circle, I have one

  • 0

I need a method to get the points of the circle, I have one that I found online but unfortunately I’d like to add a boolean filled to it:

public static Location[] getCylinderAt(Location loc, int r, int height) {
    ArrayList<Location> list = new ArrayList<>();

    int cx = loc.getBlockX();
    int cy = loc.getBlockY();
    int cz = loc.getBlockZ();
    World w = loc.getWorld();
    int rSquared = r * r;

    for (int x = cx - r; x <= cx + r; x++) {
        for (int y = cy - height; y <= cy + height; y++) {
            for (int z = cz - r; z <= cz + r; z++) {
                if ((cx - x) * (cx - x) + (cz - z) * (cz - z) <= rSquared) {
                    list.add(new Location(w, x, y, z));
                }
            }
        }
    }
    return list.toArray(new Location[list.size()]);
}

I can’t really get my head around the maths involved in this and have been searching through non minecraft sources to create my own but to no avail.

Ideally I’d like to be able to change the method to this:

public static Location[] getCylinderAt(Location loc, boolean filled, int r, int height) 

Thanks guys! If you like I can remove all of the minecraft references, but I didn’t think it’d be necessary as a Location is basically a Vector with a few added minecraft only variables!

Thanks for reading 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:36:19+00:00Added an answer on June 14, 2026 at 11:36 pm

    Are you looking for a way to compute pixels on the rim of a circle, as opposed to those inside, for the case where filled is false? If so, have a look at the midpoint circle algorithm. It describes how a circle can be drawn in a raster image.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to get two points that have biggest distance between. The easiest method
I need a method to get the data from an external editor. def _get_content():
I need to be able to interrogate a function/method and get a list of
Is there a special method to get iPhones orientation? I don't need it in
I need to send GET Request method with the below headers . I am
i have this code: def some_method(): #i need to get some attrs :( return
I need to get in an action method the values from the selected checkboxes
I'm doing a Get and Post method for an android project and I need
I need a method that creates an empty clone of an object in a
Background: I have a function in my program that takes a set of points

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.