Skip to content

An implementation of an algorithm for generating circles in a raster grid

Notifications You must be signed in to change notification settings

cSquaerd/midpointCircleAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Charlie Cook's Midpoint Circle Algortihm Implementation

This python script works together with PIL to compute and render rasterized circles. It can also output ASCII-art representations of said circles.

Also included is a script that can make concentric circles that are colored relative to their radii. Here's what that looks like: Gay & Trans Rights!

Example code

import mpca
c = mpca.RasterCircle(7)
c.printASCII()

Output

Pixels generated for radius 7.
ASCII Art representation set.
            [][][]
        [][]      [][]
    [][]              [][]
    []                  []
  []                      []
  []                      []
[]                          []
[]                          []
[]                          []
  []                      []
  []                      []
    []                  []
    [][]              [][]
        [][]      [][]
            [][][]

About

An implementation of an algorithm for generating circles in a raster grid

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages