# Is this simulation following real physics?

I am trying to simulate a game in Box2D(Physics engine). The game that I am trying to simulate is very simple and can be found here: http://www.makaimedia.com/#/speartoss

What I want to know is that, is the spear in that game following real physics principles? In other words, if I went out and threw a spear, will it behave like the spear in this game? Specifically, I am taking about the rotation of the spear. In the game, the spearhead is point up first half of the trajectory and as soon as it hits the vertex, the spear head starts point down.

I am simulating a spear in Box2d physics engine. The density of the spear is 15x more than the density of the handle. I set an angle (between 0, 90 degrees) and give it a linear velocity like this:

    b2Vec2 force;
force.Set(cos(angle) * 22.0f , sin(angle) * 22.0f);
_spearBody->SetLinearVelocity(force);


What happens is, the spearhead never points downwards. It stays at the exact same angle throughout the trajectory. Is this more realistic or the physics in speartoss game?

Thanks.

• It is real physics in outer space where there is no gravity. On earth acceleration due to gravity causes projectile motion. – Anubhav Goel May 5 '16 at 12:56

It is following a very incidental "special case" of physics.

The spear can be represented as a rigid body with a center of mass. When you impart purely linear velocity, the spear's center of mass will travel according to projectile motion. There is no reason for the spear to change it's orientation.

For the spear to change it's orientation, a rotational force, or torque, is required. For the simulation you linked to be accomplished in a natural manner, the thrower would have to impart a specific "twist" with his wrist at the time of release, just enough so that the rotational velocity corresponds exactly to the orientation of the spear's linear velocity.

In reality, the simulation probably just changes the orientation at every step to align with the velocity vector. This is quite common.

EDIT:

I should note that this "special case" is actually very natural during a real human throw. The rotational velocity at release comes from the way you rotate your forearm during the throw. Humans have a natural intuition about physics like that, same as playing sports.

• Hey. Thanks for the reply. Applying angular velocity to the body makes it behave the way I wanted. Do you know what I should set the angular velocity to so the spearhead stays pointing upwards for first half of trajectory and then starts point down the second half (just like in the game)? Thanks again. – RungaHaDeMangoes Jul 5 '11 at 21:42
• Well I'm not ALL to familiar with Box2D, but there might be some sort of way you can directly set the angle at each step of the simulation, in which case you can just make it the same angle as the velocity vector. If you want to do the proper way, however, you'll also have problems with the spearhead being 15x as dense as the spear body. You'll probably want to make it uniform density, thus putting the center of mass at the center of the rod. As for the mathematics of initial angular velocity <=> initial linear velocity I'll have to work it out and put it in an edit. – cemulate Jul 6 '11 at 6:05
• Actually, I'm going to have to post a new question. After looking at the math, I'm not sure that there IS a way for the spear to naturally align perfectly with the velocity vector. I don't think it's achievable in a fair simulation. I'll post my own question about this later; now I'm curious. – cemulate Jul 6 '11 at 7:14

It may be 5 years on from the original question, but it's a shame to have only a single accepted answer, which is just plain wrong.

Though it's true, that the human body has a "natural intuition for physics", this is only within a pretty wide margin of error (which gets narrower with practice in spear-throwing).

It is not a flick of the wrist, which makes the spear point along its velocity vector throughout the arc of its flight. If that were the case, the spear would rotate with uniform angular velocity as it flies, but parabolic motion is not a rotation of the velocity vector with constant angular velocity (although a ballistic trajectory is quite close to it).

Therefore there must be a torque acting on the spear throughout its flight. As noted in the OP (if I read it correctly), the spearhead is much heavier than the shaft. Therefore the center of mass is way in front. However, the center of drag is way behind, roughly in the middle of the shaft. Air resistance causes the spear to align with the velocity vector.

The air resistance can be approximately modeled as a force that acts on the center of the shaft in the opposing direction to velocity, probably proportional to the sine of the angle between velocity and spear orientation, plus a small constant factor to account for residual drag when the spear is flying head on.