Skip to content

How to calculate the distance the mouse will move? #5

Description

@xxapp

Sorry to bother you, because this is not an issue exactly.

I'm learning from the source code, but I can't understand this sentence:

let x = position.x + 100 * Math.pow(1 + velocity.x, 2) * sign(velocity.x);

I think 100 * (1+velocity.x)^2 mey be a formula to calculate the displacement, but I can't describe where the 100 and 1 come from.

Could you please help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions