I have two points (red points represented on the image below), they form a line that is described by a specific formula (y = mx + n), I need to determine the coordinates of 4 other points (blue points) that are places on the two sides of the red segment and on the perpendicular lines that pass through the red points. The blue points are placed at equal distance from the red segment and this distance is known. My problem is to determine the positions of these 4 blue points if I know the position of red points (x1, y1, x2, y2) and the distance from the red segment. How can I do this?
P.S. This question will help me to solve a problem in determining some coordinates that I will use in the interaction between mouse and a drawing surface in a application environment (I asked it here: https://stackoverflow.com/questions/11485316/ispointinpath-for-stroked-lines-and-polylines)