simple-bezier-easing
A Rust library for calculating cubic Bézier curves using De Casteljau's algorithm, with error handling and binary subdivision support for finding curve parameters. This library is ideal for applications like animations, easing functions, and graphics rendering.
Features
- Cubic Bézier Curves: Easily calculate Bézier curves with customizable control points.
- De Casteljau's Algorithm: Accurate and efficient curve evaluation.
- Error Handling: Handles invalid control points gracefully.
- Binary Subdivision: Finds parameters for given
xvalues with high precision.
Installation
To add this library to your project, include it in your Cargo.toml file:
[]
= "0.1.0"
Example Usage
use bezier;
Error Handling
The library returns an error for invalid control points, for example:
let invalid_bez = bezier; // Invalid control point
assert!;
License
This project is licensed under the MIT License. See the LICENSE file for more details.