Question: I have a gameboard grid which is 20 rows high and 10 columns wide with the origin (0,0) being in the top left hand corner.
I have a tetrimino in play, which is composed of four blocks.
I have the x,y location of each block relative to the top left hand corner origin.
I also have the position of the pivot, the point around which I wish to rotate which is relative to the top left hand corner origin.

Each block has an integer position in a gameboard square and thus the pivot has a fractional position inbetween blocks e.g (10.5,10.5)

My question is: Which formula can I use to rotate each block around the pivot?

I have already looked at existing similar questions and answers but could not find an answer that I could get to work.

Help would be much appreciated.

Answer: 
[The standard Tetris rotation logic is called Super Rotation System.](http://tetris.wikia.com/wiki/SRS) SRS is suited to high-level Tetris play, allowing for many variations on wall kicks and t-spins.

> 
> All tetrominoes exist inside a bounding square and rotate about the center of this square unless obstructed. Tetrominoes of width 3 (J, L, S, T, Z) are placed in the top two rows of the bounding square and (for J, L, and T) with the flat side down. I is placed in the top middle row.
> 
> 
> All tetrominoes spawn in 2 usually hidden rows at the top of the playfield. They are placed in the center of these rows, rounding to the left.
> Once a tetromino lands, it does not lock until the lock delay expires. The lock delay behavior, called Infinity by the Tetris Company, resets the lock delay whenever the tetromino is moved or rotated. Hard drop is generally mapped to up, which has no lock delay.
> 
> 
> 

![Tetrominos in their rotation bounding boxes.](https://i.stack.imgur.com/JLRFu.png)

[There is another common variant called ARS, which was used in Arika's *Tetris: The Grand Master* games.](http://tetris.wikia.com/wiki/ARS)
You could rotate all square rings (a-through-h by 2 positions, A-through-P by 4 positions, and so on) around that pivot block:

```

ABCDE    MNOPA
PabcF    LghaB
Oh.dG -> Kf.bC
NgfeH    JedcD
MLKJI    IHGFE

```