Crates.io | piecewise-linear |
lib.rs | piecewise-linear |
version | 0.2.0 |
source | src |
created_at | 2019-08-18 15:26:15.300399 |
updated_at | 2023-09-19 03:31:27.83187 |
description | A library for manipulating piecewise linear functions |
homepage | https://mattx.github.io/piecewise-linear/ |
repository | https://github.com/MattX/piecewise-linear |
max_upload_size | |
id | 157888 |
size | 47,384 |
Documentation, view on GitHub.
This crate is beta quality, please report any issues you encounter.
This crate provides utilities to manipulate continuous piecewise linear functions. These are functions whose graph is made up of straight-line sections:
It uses geo for geometric primitives and types.
let f = PiecewiseLinearFunction::try_from(vec![(0., 0.), (1., 1.), (2., 1.5)]).unwrap();
assert_eq!(f.y_at_x(1.25), Some(1.125));
Various convenience features are also implemented. See the documentation for more details. Pull requests for other features are very welcome!
Feel free to open issues and pull requests! Documentation improvements are appreciated. Please fully document new public features and provide a unit testing suite for any new code.
Licensed under the Apache-2.0 license. See the LICENSE file for details.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.