I'm trying to build a 2D physics engine (rigid body dynamics simulation) in C#. So far I have simulated boxes (squares) of different sizes which are fixed in position but can rotate around their centroids (centre of mass) when a force is applied to them. This is the Box.ApplyForce()
method that is called when a force is applied:
public void ApplyForce(double x, double y, Vector force)
{
//angular acceleration = torque(angular force) / moment of inertia
Force tempForce = new Force(x, y, force.X, force.Y);
forceList.Add(tempForce);
Vector displacement = new Vector(x, y);
double torque = displacement.X * tempForce.yForce - displacement.Y * tempForce.xForce;
double momentOfInertia = (mass*(size*size*2))/12;
angularAcceleration += torque / momentOfInertia;
}
Now this seems to be working correctly so far, but I now need to include translational acceleration in my simulation so my question is: what happens when you apply force to the edge (or any non-centre-of-mass point) of the object? Will the translational acceleration be the same as if it were applied to the centre of mass?