开发者

min max coordinate of cells , given cell length in c#

开发者 https://www.devze.com 2022-12-27 14:21 出处:网络
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\"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消