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

Adding CoefficientCombineRule of GeometricMean #685

Open
teenangst opened this issue Jul 16, 2024 · 0 comments
Open

Adding CoefficientCombineRule of GeometricMean #685

teenangst opened this issue Jul 16, 2024 · 0 comments

Comments

@teenangst
Copy link

Average is good but, for an object with 0.1 and 0.9 you'd expect it to be on the lower end while with Average you get 0.5, with GeometricMean you get sqrt(0.1 * 0.9)=0.3

It feels more realistic. If the values are equal the result is the same, so 0.8 and 0.8 is 0.8. If one of the objects is perfectly inelastic the result is 0 as you are multiplying by 0 inside the square root; with Average, colliding with something perfectly inelastic would still result in a bounce but it's perfectly inelastic and shouldn't.

I tried to fork and make the changes but had trouble with the Cargo.toml, it's been a while since I've done Rust, so I couldn't see if doing (coeff1 * coeff2).sqrt() would work as the coefficients are crate::math::Reals and I'm obviously not making a pull request with untested code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant