Find point at distance d perpendicular to endpoint A of given line segment AB
I would use the angles, get the slope of the line as follows: $$ \theta = \arctan\frac{y_B-y_A}{x_B-x_A} $$ Then the coordinates of $A_2$ would be $$ x_{A_2} = x_A+d \cos(90+\theta) \\ y_{A_2} = y_A+d \sin(90+\theta) $$