Crates.io | midpoint_circle |
lib.rs | midpoint_circle |
version | 0.1.0 |
source | src |
created_at | 2022-06-22 18:23:25.871793 |
updated_at | 2022-06-22 18:23:25.871793 |
description | Rust implementation of the midpoint circle algorithm. |
homepage | |
repository | |
max_upload_size | |
id | 611056 |
size | 3,371 |
A Rust implementation of the midpoint circle algorithm.
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);