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

Implement Angle::lerp #432

Merged
merged 2 commits into from May 3, 2020
Merged

Implement Angle::lerp #432

merged 2 commits into from May 3, 2020

Conversation

@nical
Copy link
Collaborator

nical commented May 3, 2020

Implement linear interpolation between two angles using the shortest angle.

@nical
Copy link
Collaborator Author

nical commented May 3, 2020

r? @kvark

@kvark
kvark approved these changes May 3, 2020
let max = T::PI() * two;
let d = (to.radians - self.radians) % max;

Angle::radians(two * d % max - d)

This comment has been minimized.

@kvark

kvark May 3, 2020

Member

haven't seen this before. Looks reasonable!

@nical
Copy link
Collaborator Author

nical commented May 3, 2020

@bors-servo r=kvark

@bors-servo
Copy link
Contributor

bors-servo commented May 3, 2020

📌 Commit a7dac06 has been approved by kvark

@bors-servo
Copy link
Contributor

bors-servo commented May 3, 2020

Testing commit a7dac06 with merge f61586a...

@bors-servo
Copy link
Contributor

bors-servo commented May 3, 2020

☀️ Test successful - checks-travis
Approved by: kvark
Pushing f61586a to master...

@bors-servo bors-servo merged commit f61586a into servo:master May 3, 2020
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
@nical nical deleted the nical:angle branch May 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.