# Rotating a grid system

**URL:** <https://forum.kirupa.com/t/rotating-a-grid-system/288783>\
**Category:** flash\
**Created:** [May 20, 2009, 9:50pm UTC](https://forum.kirupa.com/t/rotating-a-grid-system/288783 "2009-05-20T21:50:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wrgood](https://avatars.discourse-cdn.com/v4/letter/w/a6a055/32.png) [@wrgood](https://forum.kirupa.com/u/wrgood)\
**Post date:** [May 20, 2009, 9:50pm UTC](https://forum.kirupa.com/t/rotating-a-grid-system/288783/1 "2009-05-20T21:50:05Z")

</div>

[FONT=Arial]So ive been struggling with this one for a while, and i have been searching everywhere for an answer, and have had no such luck yet, so maybe someone can save my day for me!

If i have a grid system like this:

[/FONT]

```auto

1 2 3 4 5
6 7 8 9 a
b c d e f
g h i j k
l m n o p

```

if i rotate that grid 90 degress, it would then look like this

```auto

l g b 6 1
m h c 7 2
n i d 8 3
o j e 9 4
p k f a 5

```

now, before the rotate, if we pick any point we know the co-ords of, i want to try to find the co-ords after the rotation using some sort of math or function

ex:

we know the co-ords of 7 before the rotate are 2,2 and we can look at the grid after the rotate and find out the the co-ords are gunna be 4,2.

Is there any sort of mathamatical formula for this that im somehow nut understanding?

Any help is much apreciated
