I can't belive it's this simple. Changing the slider of 'normal dir' dhanges the direction of the black line. Pressing space bar toggles wether the seccond point follows the mouse pointer (x2 and y2). This calculates how far the point is from the black line as shown by the cyan line from the seccond point.