midpoint_circle

Crates.iomidpoint_circle
lib.rsmidpoint_circle
version0.1.0
sourcesrc
created_at2022-06-22 18:23:25.871793
updated_at2022-06-22 18:23:25.871793
descriptionRust implementation of the midpoint circle algorithm.
homepage
repository
max_upload_size
id611056
size3,371
_iPhoenix_ (Legend-of-iPhoenix)

documentation

README

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);
Commit count: 0

cargo fmt