1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
//! This crate implements Elliptical Fourier Descriptor (EFD) and its related functions.
//!
//! Simple usage of resampling circle:
//!
//! ```
//! use efd::Efd;
//! use ndarray::{stack, Array1, Axis};
//! use std::f64::consts::TAU;
//!
//! const N: usize = 10;
//! let circle = stack![
//! Axis(1),
//! Array1::linspace(0., TAU, N).mapv(f64::cos),
//! Array1::linspace(0., TAU, N).mapv(f64::sin)
//! ];
//! # assert_eq!(circle.shape(), &[10, 2]);
//! let curve = circle
//! .axis_iter(Axis(0))
//! .map(|c| [c[0], c[1]])
//! .collect::<Vec<_>>();
//! let new_curve = Efd::from_curve(&curve, None).generate(20);
//! # assert_eq!(new_curve.len(), 20);
//! ```
#![warn(missing_docs)]
pub use crate::efd::*;
mod efd;
pub mod tests;