# Calculating acceleration or velocity of a point on a rigid body?

I have a rigid body simulation involving a solid body.

It is a simple simulation with a box shape on a plane. The plane is slid out from under the box so it falls due to gravity.

Due to friction with the plane, the body doesn't fall straight but falls head first.

Is it possible to obtain the time varying acceleration vector of any one vertex?

• Hi and welcome to Blender.SE! Could you please give more information, so that I can give a better answer? – Daniel says Reinstate Monica Aug 8 '13 at 12:25
• @DantheMan Thank you! Yeah I have submitted a more verbose explanation. – bob Aug 8 '13 at 13:54
• Thanks for the info. I figured out how to calculate the velocity, but I'm not sure on the acceleration. – Daniel says Reinstate Monica Aug 8 '13 at 18:39

## 1 Answer

In rigid body simulations, external forces create two different kinds of effects on an object: linear acceleration and angular acceleration. Linear acceleration is how fast an object is moving incrementally, and angular acceleration is how fast an object is spinning incrementally.

To obtain the net external force on a single vertex or edge doesn't really make sense, because a vertex or edge doesn't have any volume and therefore doesn't have any mass. In the equation F=ma (Newton's second law of motion), solving for a, a=F/m, since a vertex or edge doesn't have any mass, the acceleration due to the force would be undefined, because you're dividing by 0. Forces have to be applied to masses. Therefore, when a rigid body is affected by a force, the force is applied throughout the entire mass, producing a linear and maybe angular acceleration.

To get the velocity vector, you need to use cross multiply the angular velocity with the vectorial distance of the vertex from the center of mass, and then add that to the linear velocity. (More info)

In script, it should look something like this:

v = object.getLinearVelocity(False)
omega = object.getAngularVelocity(False)
r = Vector((1,1,-1)) # offset of vertex (or point) from center of mass.

v_net = v + omega.cross(r)


Make sure you import the Vector class from mathutils

• In case the Linear and AgularAcceleration is provided by the API, then is is the same as in the answere (only with the acceleration getters). In case the API provides GetTorque and GetForce, the acceleration can be calculated by adding r.cross(GetTorque / TotalMomentOFInercia) and GetForce / TotalMass. – Róbert László Páli Sep 9 '13 at 20:22