How can i rotate this parallelogram 90 degrees like on the picture?

This is what i want to achieve.


Can anyone give me right directions please?

Hi and welcome to the forum.

Unfortunately, you have not provided us enough context to help. Where are you trying to do this? Where are you stuck? What have you tried? What code have you written?

Thanks for reply. So here s the function that rotates my figure to the right:

void RotateRight()
{
int w = nE.x - NWest().x;
int h = nE.y - sW.y;
sW.x = nE.x - h * 2;
sW.y =change;
nW.x = sW.x;
nW.y = sW.y + w ;
nE.x = sW.x + h;
nE.y = nW.y - change;
sE.x = sW.x + h;
}

I know its not quite right because i get wrong original figure when i rotate it three times.
Here is a screenshot of the wrong original figure i get:

3a

I know this is easy to do but sorry im really bad at this.