Stop rounding the result of the arctangent
Used atan2 method instead of atan to properly calculate gradient direction
Added a button and function to show the direction map of the gradient
Fixed bug with negative degrees
Finally correct gradient calculation