Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easeBezier #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

easeBezier #29

wants to merge 1 commit into from

Conversation

Fil
Copy link
Member

@Fil Fil commented Jul 22, 2020

todo:

  • tests
  • document

closes #3

demo: https://observablehq.com/d/51cd89b1a3f17913

speed/accuracy tests https://observablehq.com/d/e7d4fef33e304f2b

with In, Out and InOut for symmetry with the others

closes #3
@Fil Fil added the feature label Jul 24, 2020
@Fil
Copy link
Member Author

Fil commented Aug 7, 2020

I'd love a review @enjalot ; in particular I'm making grandiose claims about having a shorter and more accurate code than the reference implementation so I must be wrong somehow :)

@enjalot
Copy link

enjalot commented Aug 9, 2020

I took a look and compared the reference implementation. It seems they do extra work to a) provide an initial guess and b) switch to binary subdivision if the derivative is too close to 0.
I noticed your implementation removes those as the optimization for initial guess is unnecessary and it would seem that there isn't a reasonable input to the easing function that would result in a divergent solution.

I'll admit that I can't remember enough numerical analysis to determine if you COULD have an input that would diverge, especially in the bounds of whats considered a "reasonable" easing function.

I found your implementation to be easier to read than the reference as well.

@Fil
Copy link
Member Author

Fil commented Aug 9, 2020

I also have a trick to avoid divergence in
https://github.com/d3/d3-ease/pull/29/files#diff-98bd2b6dedcb4fda72304031dbf8d928R24
"when we're moving too fast, slow down".

I've used this trick a lot in the 2D Newton-Raphson solver in d3-geo.

@enjalot
Copy link

enjalot commented Aug 11, 2020 via email

Base automatically changed from two to master August 23, 2020 14:05
@codethief
Copy link

codethief commented Jan 28, 2021

Hi there, this is very cool – I've been looking for an implementation for a Bézier-based easing function! Any news as to when this will be merged into master? :)

@Fil
Copy link
Member Author

Fil commented Feb 1, 2021

Thanks! Yes, we should make a new push for all the outstanding features that have been waiting in pull-requests—some of them might be merged, others made available as notebooks or independent libraries. In the meantime it helps if someone plays with them, finds bugs, gives them real-world use cases, etc.

In the case of this particular PR, I still need to complete it with documentation and unit tests.

@Fil Fil mentioned this pull request Apr 27, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

Cubic Bézier easing?
3 participants