Use standard formula for calculating hwrotation

Change-Id: I12efbce4a8107a1058921e5ec4cb4b6e0ef072ab