# Diagonal acces of a grid Element?

**URL:** <https://forum.kirupa.com/t/diagonal-acces-of-a-grid-element/239061>\
**Category:** Uncategorized\
**Created:** [September 18, 2007, 1:20pm UTC](https://forum.kirupa.com/t/diagonal-acces-of-a-grid-element/239061 "2007-09-18T13:20:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manga](https://avatars.discourse-cdn.com/v4/letter/m/6bbea6/32.png) [@manga](https://forum.kirupa.com/u/manga)\
**Post date:** [September 18, 2007, 1:20pm UTC](https://forum.kirupa.com/t/diagonal-acces-of-a-grid-element/239061/1 "2007-09-18T13:20:48Z")

</div>

hey all,

i hope to find a math formula to acces grid MATRIX elements diagonaly!

so lets say i have a grid of mc:  
(the numbers are the id’s)

10,12,13,14,15  
16,17,18,19,20  
21,22,23,24,25  
26,27,28,29,30  
31,32,33,34,35

so acces diagonaly from leftdown to rigthup i would have this:

10,16,12,21,17,13,26,22,18,14,31,27.23,19,15,32,28,24,20,33,29,25,34,30,35

HOW CAN I DO THIS? ☹

i need a formula when i decide to have a grid 100 x 100 it wil work to…

any help?
