Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to Draw a Circle in Minecraft Blocks: the Math Behind a Pixel Circle Generator

A circle in Minecraft is a grid problem: every block is either placed or not. We build PixelCircles , a browser tool that draws Minecraft circles, spheres and domes block by block, and this post walks through the four decisions that shape every circle it draws. The code excerpts are simplified from the site's source; every number below came from running it. 1. Which cells are inside? Take a…

Minecraft circles are built by deciding which cells are inside the circle's boundaries. A function called insideEllipse determines if a cell's center lies within the ellipse, calculated using w and h values. The code places the circle on a d × d grid and asks if the center of each cell is inside the circle. Adding 0.5 to the cell's coordinates moves from the cell's corner to its center, and 1e-9 prevents floating-point noise from dropping cells on the edge.

Odd and even widths create different circle shapes. Odd widths have a single center block, whereas even widths have a 2 × 2 center, leading to no single middle block. For thin outlines, only the four side neighbors are checked to see if they are empty. For thick outlines, diagonal neighbors are also considered. The outline function checks if a cell should be included in the outline based on its neighbors and the chosen mode.

For large circles, testing each cell individually is slow. Instead, we start at the middle column of each row and walk outwards until the next cell falls outside the circle. This approach is efficient and suitable for creating large circles in Minecraft.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Project = Supported Woman

❤️ Supported Woman ❤️ Supported Woman is a free and ad-free project, developed by a 15-year-old teenager, with support from ChatGPT and without professional training in the field of programming.

Building an Engineer, One Connection at a Time

Why I started SolderFlow and the journey I'm choosing to document Like many students in India, I didn’t enter engineering with a clear path.

  • SolderFlow aims to document engineering journey through real experiences
  • Openly sharing projects, mistakes, and growth to connect engineering dots
  • Goal is to guide lost students, not provide shortcuts or perfect paths

A CRO Experiment Brief Template That Stops False Wins

Most failed A/B tests fail before they launch: the hypothesis was vague, the metric was chosen afterwards, or the test was stopped the moment the dashboard turned green.

  • Observation section includes evidence sources like analytics funnels and surveys
  • Hypothesis follows specific structure with observed observation and expected outcome
  • Primary metric is defined before test launch to prevent false wins

More from Tuesday 29 September →