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

Projeto = Mulher Amparada

❤️ Mulher Amparada ❤️ O Mulher Amparada é um projeto gratuito e livre de anúncios, desenvolvido por um adolescente de 15 anos, com apoio do ChatGPT e sem formação profissional na área de programação.

Why Chat History Failed Our Agents and Hindsight Fixed It

Every time an engineer started a new session with our project assistant, the agent suffered from total amnesia. It could analyze architecture, propose deployment manifests, and draft pull requests…

  • Agents exhibited "total amnesia" in chat history sessions
  • Vast chat transcripts inflated token consumption, reduced focus
  • ProjectRecall workflow with Hindsight fixed session-dependent context

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

More from Tuesday 29 September →