#algorithm #circle #graphics #rasterization #bresenham

midpoint_circle

Rust implementation of the midpoint circle algorithm

1 unstable release

0.1.0 Jun 22, 2022

#7 in #bresenham

MIT/Apache

4KB

midpoint_circle

A Rust implementation of the midpoint circle algorithm.

Quickstart

Add midpoint_circle to your dependencies:

[dependencies]
midpoint_circle = "0.1"

This crate provides one method, midpoint_circle, that works with all of the native signed integer types. Additionally, through the use of the num crate, you can easily define your own integers to use (if you need that for some odd reason).

use midpoint_circle::midpoint_circle;

// Generate a circle of radius 5 around (0, 0).
let points: Vec<(i32, i32)> = midpoint_circle((0, 0), 5);

assert!(points.len() != 0);

Dependencies

~470KB