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

feat: adding three new rate_functions based on the SmoothStep function #3361

Merged
merged 1 commit into from Sep 9, 2023

Conversation

uwezi
Copy link
Contributor

@uwezi uwezi commented Sep 7, 2023

The SmoothStep functions have the added benefits of zero derivatives at the endpoints. Since these are simple polynomials with a maximum of 4 terms the necessary calculations are fast and require few resources.
https://en.wikipedia.org/wiki/Smoothstep

Motivation and Explanation: Why and how do your changes improve the library?

The current rate function smooth has non-zero derivatives at the endpoints, because it is a truncate logistics function. This can lead to unexpected jumps in the very first and last frames of an animation.

Further Information and Comments

Reviewer Checklist

  • The PR title is descriptive enough for the changelog, and the PR is labeled correctly
  • If applicable: newly added non-private functions and classes have a docstring including a short summary and a PARAMETERS section
  • If applicable: newly added functions and classes are tested

…n. These have the added benefits of zero derivatives at the endpoints.
Copy link
Collaborator

@MrDiver MrDiver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@MrDiver MrDiver added the new feature Enhancement specifically adding a new feature (feature request should be used for issues instead) label Sep 9, 2023
@MrDiver MrDiver merged commit bff2ea4 into ManimCommunity:main Sep 9, 2023
21 checks passed
@uwezi uwezi deleted the smoothstep branch September 10, 2023 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Enhancement specifically adding a new feature (feature request should be used for issues instead)
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants