What is the algorithm for slope direction line Indicator ?

Reason: