Implement curvature function in Bezier math library (#725)

* bezier curvature

* change comment

Co-authored-by: Jackie Chen <jackiechen73>
This commit is contained in:
Jackie Chen
2022-07-29 21:58:16 -04:00
committed by GitHub
co-authored by Jackie Chen
parent b4070f9c90
commit 18871e5bbf
4 changed files with 53 additions and 1 deletions
@@ -166,4 +166,8 @@ impl WasmBezier {
let bezier_points: Vec<Vec<Point>> = self.0.offset(distance).into_iter().map(bezier_to_points).collect();
to_js_value(bezier_points)
}
pub fn curvature(&self, t: f64) -> f64 {
self.0.curvature(t)
}
}