The safety factor is multiplied by the shear stress, which is then used to calculate the hardness. The hardening depth is then defined using this value.