Given two points(blue) A(1,1) and B(3,3) I need to calculate the coordinates of two new points(orange) which are in an right angle to line AB and a certain distance from point A.
So far, I've calculated the angel to X-axis (45°) with Arctan(1/1).
I calculated the coordinates of the new points as follows:
X = (sin(45° + 90°) * Distance) + X Y = (sin(45° + 270°) * Distance) + Y
However, this is wrong. How would I calculate the coordinates of the points shown in organge?

Refer to the graph:
$\hspace{2cm}$
$$\begin{cases}x_1=1-d\cos{45^\circ}=1-\frac{d}{\sqrt{2}} \\ y_1=1+d\sin{45^\circ}=1+\frac{d}{\sqrt{2}}\end{cases}$$ Similarly, can you find the coordinates of the second orange point?