The torque method for exchange coupling in magnetic trilayers