实施抛体运动 [英] Implementing Projectile Motion

查看:87
本文介绍了实施抛体运动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经打进来源互联网,已经发现了很多有用的信息,但他们试图告诉我怎么解决一个对象有什么角度是在到达y位置的数学网站。不过,我试图运行模拟,并没有发现可实施的代码来模拟一个抛物线任何固体方程。可那些与物理学的一些知识帮助我在这?

I've scored the internet for sources and have found a lot of useful information, but they are math sites trying to tell me how to solve what angle an object has to be at to reach y location. However, I'm trying to run a simulation, and haven't found any solid equations that can be implemented to code to simulate a parabolic curve. Can those with some knowledge of physics help me on this?

推荐答案

虽然本尼的回答是不错的,特别是它的通用性,可以解决你的问题正是,而不是使用有限的集成步骤。你想要的公式为:

While Benny's answer is good, especially in its generality, you can solve your problem exactly rather than using finite integration steps. The equation you want is:

s = u*t + 0.5*a*t^2;

查找这里哪里这个来自一个解释。

下面s是位移,U是初始速度,是加速度t是时间。这个方程是仅1维的,但可以很容易地用于您的问题。所有你需要做的是你弹的运动拆分为两个部分:平行一到你的加速度和一个垂直的。如果我们让Sx的描述在x方向上的位移和Sy在y方向上的位移,我们得到:

Here s is the displacement, u is the initial speed, a is the acceleration and t is time. This equation is only 1 dimensional, but can be easily used for your problem. All you need to do is split the motion of your projectile into two components: one parallel to your acceleration and one perpendicular. If we let Sx describe the displacement in the x direction and Sy the displacement in the y direction we get:

Sx = Ux*t + 0.5*Ax*t; 
Sy = Uy*t + 0.5*Ay*t;

现在在特定示例斧是0作为唯一的加速度是由于重力作用,它是在Y方向,即好哦= -g。负来自事实重力将在相反的方向上的物体的原始运动行事。 UX和UY来自简单的三角函数:

Now in your particular example Ax is 0 as the only acceleration is due to gravity, which is in the y direction, ie Ay = -g. The minus comes from the fact that gravity will be acting in the opposite direction to the original motion of the object. Ux and Uy come from simple trigonometry:

Ux = U*cos(angle);
Uy = U*sin(angle);



把所有这一切一起你会得到两个方程描述了抛射在启动后会在时间t ,相对于它的起始位置:

Putting this all together you get two equations describing where the projectile will be at a time t after being launched, relative to its starting position:

Sx = U*cos(angle)*t;
Sy = U*sin(angle)*t - 0.5*g*t^2;

这篇关于实施抛体运动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆