pmndrs / maath

🪶 Math helpers for the rest of us
https://maath.pmnd.rs
835 stars 18 forks source link

[Q&A] What's this line doing in damp() #34

Closed hatsumatsu closed 1 year ago

hatsumatsu commented 1 year ago

I'm currently trying to wrap my head around your smooth-damp implementation and wonder (VSCode wonders, too) what this line is doing:

https://github.com/pmndrs/maath/blob/aee0940b350e96ff98ad8d3f9b37dbff8c572e22/packages/maath/src/easing.ts#L73

haven't seen this x > y === 0 > z pattern, yet.

maybe @drcmda could shed some light? 🙏

hatsumatsu commented 1 year ago

Nevermind, just realised that it's more clear when adding parenthesis. So it's basically checking of both statements are either true or false at the same time...