Replace degree orientation with radian. Degree cause severe problems at the intersection of 0 and 360 degrees when smoothing angles with a filter. It will be -PI to 0 to PI instead of 0 to 360. Alternatively change to -180 to 0 to 180.