min max coordinate of cells , given cell length in c#
Please see attached picture to better understand my question
i have a matrix of cells of [JXI] , cell is开发者_StackOverflow中文版 square in shape with length "a"
my question is .. is there a way to use FOR loop to assign MIN,MAX coordinate to each cell taking origin (0,0) at one corner
Thanks
image http://img199.imageshack.us/img199/3544/pixelv.png
i was trying following code but no success
int a ;
a = 1;
for (int J=1; J<=5; J++)
{
for (int I = 1; I <= 5; I++)
{
double Xmin = ((I - 1)*a );
double Ymin = ((J - 1) * a);
double Xmax = (I * a );
double Ymax = (J * a);
}
}
Your code is ok. Just decide what you should do with max and min values.
精彩评论