Fixed atan -> tan Bug in CalculateSlope. Right tanget integrated but not separated.