fix gradient hysteresis for the negative number axis
add distance function between point and plane