File:Concentric circles drawn with Bresenham's circle algorithm.png

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Concentric_circles_drawn_with_Bresenham's_circle_algorithm.png (301 × 301 pixels, file size: 5 KB, MIME type: image/png)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: The midpoint circle algorithm, also known as Bresenham's circle algorithm, run 150 times, each time with one pixel bigger to create the final image of "concentric" circles. In this case different colors were used to more obviously show the concentricity of the circles.

Source code:

Date
Source Own work
Author Psiĥedelisto

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Source code

[edit]

The below source code is GFDL 1.2-licensed. Repository by User:Psiĥedelisto.

from rcbitmap import Bitmap
from rcbitmap import BLACK, WHITE, RED, GREEN, BLUE, TRANSPARENT

WIDTH = HEIGHT = 301

bitmap = Bitmap(WIDTH, HEIGHT, background=TRANSPARENT)

colours = list()

for i in range(0,25):
    colours.append(BLACK if i%2 else RED)

for i in range(0,25):
    colours.append(BLACK if math.ceil(i/2)%2 else RED)

for i in range(0,5):
    colours.append(RED)

for i in range(0,5):
    colours.append(BLACK)

for i in range(0,150-len(colours)):
    colours.append(BLUE if math.floor(i/18)%2 else RED)

assert len(colours) == 150, "Not enough colours"

for i in range(1, 151):
    bitmap.circle(x0=(WIDTH//2), y0=(HEIGHT//2), radius=i, colour=colours[i-1])

bitmap.xpm()

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current17:52, 13 December 2020Thumbnail for version as of 17:52, 13 December 2020301 × 301 (5 KB)Psiĥedelisto (talk | contribs)New version after email complaint. Source code: https://github.com/ctrlcctrlv/Midpoint-circle-algorithm-Wikipedia-images/blob/main/multicolor_circle.py
09:49, 25 November 2018Thumbnail for version as of 09:49, 25 November 2018295 × 295 (13 KB)Psiĥedelisto (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata