Project

bresenham

0.0
No commit activity in last 3 years
No release in over 3 years
Implementation of Bresenham's algorithm for lines and circles. Functions return sets of coordinates that can be used for plotting.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Bresenham

A set of functions implementing Bresenham's algorithm for lines and circles.

Installation

Add this line to your application's Gemfile:

gem 'bresenham'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bresenham

Usage

require 'bresenham'
# x_start, y_start, x_end, y_end
line_points_set = Bresenham::Line::coordinates(0, 0, 3, 10)

# x_origin, y_origin, radius
circle_points_set = Bresenham::Circle::coordinates(0, 0, 10)