Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
2D に 2 つのポイントがあります
//Point1 has velocity vX = 100; vY = 50; posX = 300; posY = 100; //Point2 has velocity vX = -20; vY = 80; posX = -800; posY = 1000;
さらに、これら 2 つの点の中間に直接配置された点があります。この中間点の速度を計算するにはどうすればよいですか?
それがvXとvYであるかを決定することによって。
そのxとyは
x = (-800 - 20 * t + 300 + 100 * t) / 2 y = (1000 + 80 * t + 100 + 50 * t) / 2
簡素化する
x = -250 + 40 * t y = 550 + 65 * t
つまり、vXは40で、vyは65です。私の友人のPythagorasは、ここでの速度は1ティックあたりsqrt((40 * 40) + (65 * 65))約76ユニットであると言っています。
sqrt((40 * 40) + (65 * 65))