implemented calculating the rotation of markers