some useful function to calculate main stress and computed stress in the mechanics of materials