Ad
  • Custom User Avatar

    This is a weird way to represent friction, and the description does not do a good job of explaining it.

    Friction, or drag, must always have a sign opposite to velocity ( otherwise, it'd be speed - velocity is speed in a direction ), and must always be smaller than it, physically. If friction can somehow be bigger than negative velocity ( impact with a heavier object? ), (a) it's no longer friction and (b) yes, it can reverse velocity.

    If it's supposed to model cumulative friction over time, the model also breaks down - friction at any moment can still never be bigger than negative velocity, so can never sum to more than negative velocity.

    Or maybe you just need a different model to explain what you want us to calculate, because this one doesn't work.

    Backstories are nice, but they should be somewhat believable.

  • Custom User Avatar

    velocity will always be one number, negative or positive, as will friction.

    Friction can be negative?

  • Custom User Avatar

    expected 1.8000000000000003 to deeply equal 1.8

    The test cases should allow for floating point inaccuracies instead of using strict comparisons, see the docs here.