The diagram is misleading. The black line on the right side is pointing to the wrong vertex of the red triangle. Instead the diagram should look like this (see attached image below). Notice how the black line on the right is pointing at point D which is the result of rotating point A. What's going on is a 90 degree rotation in the clockwise direction. This is using the algebraic rule (x,y) ---> (y,-x). For instance, point A = (-3,1) maps to (1,3). You swap the x and y coordinates and then change the sign of -3 to +3 which is just 3.