Calculation of torque on an object