how to calculate a negative acceleration?

后端 未结 15 1760
既然无缘
既然无缘 2021-02-08 12:11

I\'m implementing the scrolling behaviour of a touch screen UI but I\'m too tired in the moment to wrap my mind around some supposedly trivial piece of math:

y (         


        
15条回答
  •  不知归路
    2021-02-08 12:30

    I have tried this, which works (in Ruby). Not sure if the math is sound but the output looks right, meaning that you get faster as you get towards the center:

    velocity=100;
    (100.downto(0)).each { |distance_from_black_hole |  velocity=velocity+9.8/distance_from_black_hole; puts velocity; }
    

提交回复
热议问题