Fix cubic Bézier interpolation.
This commit is contained in:
parent
3ab98420c8
commit
ea29e08836
@ -1,6 +1,13 @@
|
|||||||
|
# 2.0.1
|
||||||
|
|
||||||
|
> Tue Sep 24th 2019
|
||||||
|
|
||||||
|
- Fix the cubic Bézier curve interpolation. The “output” tangent is now taken by mirroring the
|
||||||
|
next key’s tangent around its control point.
|
||||||
|
|
||||||
# 2.0.0
|
# 2.0.0
|
||||||
|
|
||||||
> Mon Sep 24th 2019
|
> Mon Sep 23rd 2019
|
||||||
|
|
||||||
## Major changes
|
## Major changes
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "splines"
|
name = "splines"
|
||||||
version = "2.0.0"
|
version = "2.0.1"
|
||||||
license = "BSD-3-Clause"
|
license = "BSD-3-Clause"
|
||||||
authors = ["Dimitri Sabadie <dimitri.sabadie@gmail.com>"]
|
authors = ["Dimitri Sabadie <dimitri.sabadie@gmail.com>"]
|
||||||
description = "Spline interpolation made easy"
|
description = "Spline interpolation made easy"
|
||||||
|
@ -240,7 +240,10 @@ where V: Linear<T>,
|
|||||||
let one_t_3 = one_t_2 * one_t;
|
let one_t_3 = one_t_2 * one_t;
|
||||||
let three = T::one() + T::one() + T::one();
|
let three = T::one() + T::one() + T::one();
|
||||||
|
|
||||||
a.outer_mul(one_t_3) + u.outer_mul(three * one_t_2 * t) + v.outer_mul(three * one_t * t * t) + b.outer_mul(t * t * t)
|
// mirror the “output” tangent based on the next key “input” tangent
|
||||||
|
let v_ = b + b - v;
|
||||||
|
|
||||||
|
a.outer_mul(one_t_3) + u.outer_mul(three * one_t_2 * t) + v_.outer_mul(three * one_t * t * t) + b.outer_mul(t * t * t)
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! impl_interpolate_simple {
|
macro_rules! impl_interpolate_simple {
|
||||||
|
Loading…
Reference in New Issue
Block a user