Esempio n. 1
0
 public double nhanchap1(int x, int y, matransothuc matna)
 {
     int m = matna.Sohang, n = matna.Socot;
     int p = m / 2 + m % 2;
     int q = n / 2 + n % 2;
     int i, j;
     double tg = 0;
     for (i = 0; i < m; ++i)
         for (j = 0; j < n; ++j)
             if (hople(x + i - p, y + j - q))
                 tg += data[x + i - p, y + j - q] * matna.data[i, j];
     return tg;
 }
Esempio n. 2
0
 public matrannguyen loctrungbinh()
 {
     matransothuc matna = new matransothuc(3, 3);
     int i, j;
     for (i = 0; i < 3; ++i)
         for (j = 0; j < 3; ++j) matna.data[i, j] = 1;
     matna.data[1, 1] = 0;
     matrannguyen ketqua = this.nhanchap(matna);
     ketqua.chia(8);
     return ketqua;
 }
Esempio n. 3
0
 public matrannguyen nhanchap(matransothuc matna)
 {
     int m = sohang, n = socot, i, j;
     matrannguyen ketqua = new matrannguyen(m, n);
     for (i = 0; i < m; ++i)
         for (j = 0; j < n; ++j)
             ketqua.data[i, j] = (int)nhanchap1(i, j, matna);
     return ketqua;
 }
Esempio n. 4
0
        public matrannguyen gabor()
        {
            // ma tran he so cho huong 0 rad
            matransothuc s1 = new matransothuc(11, 11);
            s1.data[0, 0] = -0.20961; s1.data[0, 1] = -0.27769; s1.data[0, 2] = -0.34559; s1.data[0, 3] = -0.40404; s1.data[0, 4] = -0.44375; s1.data[0, 5] = -0.45783; s1.data[0, 6] = -0.44375; s1.data[0, 7] = -0.40404; s1.data[0, 8] = -0.34559; s1.data[0, 9] = -0.27769; s1.data[0, 10] = -0.20961;
            s1.data[1, 0] = -0.22466; s1.data[1, 1] = -0.29762; s1.data[1, 2] = -0.37039; s1.data[1, 3] = -0.43304; s1.data[1, 4] = -0.47560; s1.data[1, 5] = -0.49069; s1.data[1, 6] = -0.47560; s1.data[1, 7] = -0.43304; s1.data[1, 8] = -0.37039; s1.data[1, 9] = -0.29762; s1.data[1, 10] = -0.22466;
            s1.data[2, 0] = -0.10679; s1.data[2, 1] = -0.14148; s1.data[2, 2] = -0.17607; s1.data[2, 3] = -0.20585; s1.data[2, 4] = -0.22608; s1.data[2, 5] = -0.23326; s1.data[2, 6] = -0.22608; s1.data[2, 7] = -0.20585; s1.data[2, 8] = -0.17607; s1.data[2, 9] = -0.14148; s1.data[2, 10] = -0.10679;
            s1.data[3, 0] = 0.12485; s1.data[3, 1] = 0.16540; s1.data[3, 2] = 0.20585; s1.data[3, 3] = 0.24066; s1.data[3, 4] = 0.26432; s1.data[3, 5] = 0.27271; s1.data[3, 6] = 0.26432; s1.data[3, 7] = 0.24066; s1.data[3, 8] = 0.20585; s1.data[3, 9] = 0.16540; s1.data[3, 10] = 0.12485;
            s1.data[4, 0] = 0.35900; s1.data[4, 1] = 0.47560; s1.data[4, 2] = 0.59189; s1.data[4, 3] = 0.69199; s1.data[4, 4] = 0.76000; s1.data[4, 5] = 0.78413; s1.data[4, 6] = 0.76000; s1.data[4, 7] = 0.69199; s1.data[4, 8] = 0.59189; s1.data[4, 9] = 0.47560; s1.data[4, 10] = 0.35900;
            s1.data[5, 0] = 0.45783; s1.data[5, 1] = 0.60653; s1.data[5, 2] = 0.75484; s1.data[5, 3] = 0.88250; s1.data[5, 4] = 0.96923; s1.data[5, 5] = 1.00000; s1.data[5, 6] = 0.96923; s1.data[5, 7] = 0.88250; s1.data[5, 8] = 0.75484; s1.data[5, 9] = 0.60653; s1.data[5, 10] = 0.45783;
            s1.data[6, 0] = 0.35900; s1.data[6, 1] = 0.47560; s1.data[6, 2] = 0.59189; s1.data[6, 3] = 0.69199; s1.data[6, 4] = 0.76000; s1.data[6, 5] = 0.78413; s1.data[6, 6] = 0.76000; s1.data[6, 7] = 0.69199; s1.data[6, 8] = 0.59189; s1.data[6, 9] = 0.47560; s1.data[6, 10] = 0.35900;
            s1.data[7, 0] = 0.12485; s1.data[7, 1] = 0.16540; s1.data[7, 2] = 0.20585; s1.data[7, 3] = 0.24066; s1.data[7, 4] = 0.26432; s1.data[7, 5] = 0.27271; s1.data[7, 6] = 0.26432; s1.data[7, 7] = 0.24066; s1.data[7, 8] = 0.20585; s1.data[7, 9] = 0.16540; s1.data[7, 10] = 0.12485;
            s1.data[8, 0] = -0.10679; s1.data[8, 1] = -0.14148; s1.data[8, 2] = -0.17607; s1.data[8, 3] = -0.20585; s1.data[8, 4] = -0.22608; s1.data[8, 5] = -0.23326; s1.data[8, 6] = -0.22608; s1.data[8, 7] = -0.20585; s1.data[8, 8] = -0.17607; s1.data[8, 9] = -0.14148; s1.data[8, 10] = -0.10679;
            s1.data[9, 0] = -0.22466; s1.data[9, 1] = -0.29762; s1.data[9, 2] = -0.37039; s1.data[9, 3] = -0.43304; s1.data[9, 4] = -0.47560; s1.data[9, 5] = -0.49069; s1.data[9, 6] = -0.47560; s1.data[9, 7] = -0.43304; s1.data[9, 8] = -0.37039; s1.data[9, 9] = -0.29762; s1.data[9, 10] = -0.22466;
            s1.data[10, 0] = -0.20961; s1.data[10, 1] = -0.27769; s1.data[10, 2] = -0.34559; s1.data[10, 3] = -0.40404; s1.data[10, 4] = -0.44375; s1.data[10, 5] = -0.45783; s1.data[10, 6] = -0.44375; s1.data[10, 7] = -0.40404; s1.data[10, 8] = -0.34559; s1.data[10, 9] = -0.27769; s1.data[10, 10] = -0.20961;

            // ma tran he so cho huong pi/8 rad
            matransothuc s2 = new matransothuc(11, 11);

            s2.data[0, 0] = -0.02705; s2.data[0, 1] = -0.10038; s2.data[0, 2] = -0.19807; s2.data[0, 3] = -0.30375; s2.data[0, 4] = -0.39369; s2.data[0, 5] = -0.44480; s2.data[0, 6] = -0.44375; s2.data[0, 7] = -0.39229; s2.data[0, 8] = -0.30619; s2.data[0, 9] = -0.20282; s2.data[0, 10] = -0.11968;
            s2.data[1, 0] = 0.12105; s2.data[1, 1] = 0.07691; s2.data[1, 2] = -0.01365; s2.data[1, 3] = -0.14291; s2.data[1, 4] = -0.28735; s2.data[1, 5] = -0.41395; s2.data[1, 6] = -0.49199; s2.data[1, 7] = -0.50485; s2.data[1, 8] = -0.45562; s2.data[1, 9] = -0.36417; s2.data[1, 10] = -0.25761;
            s2.data[2, 0] = 0.29655; s2.data[2, 1] = 0.32558; s2.data[2, 2] = 0.29814; s2.data[2, 3] = 0.20355; s2.data[2, 4] = 0.05100; s2.data[2, 5] = -0.12821; s2.data[2, 6] = -0.29238; s2.data[2, 7] = -0.40397; s2.data[2, 8] = -0.44348; s2.data[2, 9] = -0.41455; s2.data[2, 10] = -0.33885;
            s2.data[3, 0] = 0.40369; s2.data[3, 1] = 0.52468; s2.data[3, 2] = 0.60280; s2.data[3, 3] = 0.60553; s2.data[3, 4] = 0.51782; s2.data[3, 5] = 0.35162; s2.data[3, 6] = 0.14418; s2.data[3, 7] = -0.05531; s2.data[3, 8] = -0.20418; s2.data[3, 9] = -0.28067; s2.data[3, 10] = -0.28770;
            s2.data[4, 0] = 0.36071; s2.data[4, 1] = 0.54565; s2.data[4, 2] = 0.72437; s2.data[4, 3] = 0.85111; s2.data[4, 4] = 0.88562; s2.data[4, 5] = 0.81047; s2.data[4, 6] = 0.64024; s2.data[4, 7] = 0.41712; s2.data[4, 8] = 0.19441; s2.data[4, 9] = 0.01676; s2.data[4, 10] = -0.09334;
            s2.data[5, 0] = 0.16495; s2.data[5, 1] = 0.34697; s2.data[5, 2] = 0.56682; s2.data[5, 3] = 0.78241; s2.data[5, 4] = 0.94135; s2.data[5, 5] = 1.00000; s2.data[5, 6] = 0.94135; s2.data[5, 7] = 0.78241; s2.data[5, 8] = 0.56682; s2.data[5, 9] = 0.34697; s2.data[5, 10] = 0.16495;
            s2.data[6, 0] = -0.09334; s2.data[6, 1] = 0.01676; s2.data[6, 2] = 0.19441; s2.data[6, 3] = 0.41712; s2.data[6, 4] = 0.64024; s2.data[6, 5] = 0.81047; s2.data[6, 6] = 0.88562; s2.data[6, 7] = 0.85111; s2.data[6, 8] = 0.72437; s2.data[6, 9] = 0.54565; s2.data[6, 10] = 0.36071;
            s2.data[7, 0] = -0.28770; s2.data[7, 1] = -0.28067; s2.data[7, 2] = -0.20418; s2.data[7, 3] = -0.05531; s2.data[7, 4] = 0.14418; s2.data[7, 5] = 0.35162; s2.data[7, 6] = 0.51782; s2.data[7, 7] = 0.60553; s2.data[7, 8] = 0.60280; s2.data[7, 9] = 0.52468; s2.data[7, 10] = 0.40369;
            s2.data[8, 0] = -0.33885; s2.data[8, 1] = -0.41455; s2.data[8, 2] = -0.44348; s2.data[8, 3] = -0.40397; s2.data[8, 4] = -0.29238; s2.data[8, 5] = -0.12821; s2.data[8, 6] = 0.05100; s2.data[8, 7] = 0.20355; s2.data[8, 8] = 0.29814; s2.data[8, 9] = 0.32558; s2.data[8, 10] = 0.29655;
            s2.data[9, 0] = -0.25761; s2.data[9, 1] = -0.36417; s2.data[9, 2] = -0.45562; s2.data[9, 3] = -0.50485; s2.data[9, 4] = -0.49199; s2.data[9, 5] = -0.41395; s2.data[9, 6] = -0.28735; s2.data[9, 7] = -0.14291; s2.data[9, 8] = -0.01365; s2.data[9, 9] = 0.07691; s2.data[9, 10] = 0.12105;
            s2.data[10, 0] = -0.11968; s2.data[10, 1] = -0.20828; s2.data[10, 2] = -0.30619; s2.data[10, 3] = -0.39229; s2.data[10, 4] = -0.44375; s2.data[10, 5] = -0.44480; s2.data[10, 6] = -0.39369; s2.data[10, 7] = -0.30375; s2.data[10, 8] = -0.19807; s2.data[10, 9] = -0.10038; s2.data[10, 10] = -0.02705;

            // ma tran he so cho huong 2pi/8 rad
            matransothuc s3 = new matransothuc(11, 11);
            s3.data[0, 0] = 0.20961; s3.data[0, 1] = 0.25073; s3.data[0, 2] = 0.21790; s3.data[0, 3] = 0.09523; s3.data[0, 4] = -0.09092; s3.data[0, 5] = -0.27731; s3.data[0, 6] = -0.39445; s3.data[0, 7] = -0.40384; s3.data[0, 8] = -0.31657; s3.data[0, 9] = -0.18181; s3.data[0, 10] = -0.05581;
            s3.data[1, 0] = 0.25073; s3.data[1, 1] = 0.36788; s3.data[1, 2] = 0.41339; s3.data[1, 3] = 0.33749; s3.data[1, 4] = 0.13856; s3.data[1, 5] = -0.12428; s3.data[1, 6] = -0.35607; s3.data[1, 7] = -0.47579; s3.data[1, 8] = -0.45761; s3.data[1, 9] = -0.33699; s3.data[1, 10] = -0.18181;
            s3.data[2, 0] = 0.21790; s3.data[2, 1] = 0.41339; s3.data[2, 2] = 0.56978; s3.data[2, 3] = 0.60147; s3.data[2, 4] = 0.46130; s3.data[2, 5] = 0.17791; s3.data[2, 6] = -0.14990; s3.data[2, 7] = -0.40348; s3.data[2, 8] = -0.50648; s3.data[2, 9] = -0.45761; s3.data[2, 10] = -0.31657;
            s3.data[3, 0] = 0.09523; s3.data[3, 1] = 0.33749; s3.data[3, 2] = 0.60147; s3.data[3, 3] = 0.77880; s3.data[3, 4] = 0.77231; s3.data[3, 5] = 0.55643; s3.data[3, 6] = 0.20160; s3.data[3, 7] = -0.15957; s3.data[3, 8] = -0.40348; s3.data[3, 9] = -0.47579; s3.data[3, 10] = -0.40384;
            s3.data[4, 0] = -0.09092; s3.data[4, 1] = 0.13856; s3.data[4, 2] = 0.46130; s3.data[4, 3] = 0.77231; s3.data[4, 4] = 0.93941; s3.data[4, 5] = 0.87514; s3.data[4, 6] = 0.59232; s3.data[4, 7] = 0.20160; s3.data[4, 8] = -0.14990; s3.data[4, 9] = -0.35607; s3.data[4, 10] = -0.39445;
            s3.data[5, 0] = -0.27731; s3.data[5, 1] = -0.12428; s3.data[5, 2] = 0.17791; s3.data[5, 3] = 0.55643; s3.data[5, 4] = 0.87514; s3.data[5, 5] = 1.00000; s3.data[5, 6] = 0.87514; s3.data[5, 7] = 0.55643; s3.data[5, 8] = 0.17791; s3.data[5, 9] = -0.12428; s3.data[5, 10] = -0.27731;
            s3.data[6, 0] = -0.39445; s3.data[6, 1] = -0.35607; s3.data[6, 2] = -0.14990; s3.data[6, 3] = 0.20160; s3.data[6, 4] = 0.59232; s3.data[6, 5] = 0.87514; s3.data[6, 6] = 0.93941; s3.data[6, 7] = 0.77231; s3.data[6, 8] = 0.46130; s3.data[6, 9] = 0.13856; s3.data[6, 10] = -0.09092;
            s3.data[7, 0] = -0.40384; s3.data[7, 1] = -0.47579; s3.data[7, 2] = -0.40348; s3.data[7, 3] = -0.15957; s3.data[7, 4] = 0.20160; s3.data[7, 5] = 0.55643; s3.data[7, 6] = 0.77231; s3.data[7, 7] = 0.77880; s3.data[7, 8] = 0.60147; s3.data[7, 9] = 0.33749; s3.data[7, 10] = 0.09523;
            s3.data[8, 0] = -0.31657; s3.data[8, 1] = -0.45761; s3.data[8, 2] = -0.50648; s3.data[8, 3] = -0.40348; s3.data[8, 4] = -0.14990; s3.data[8, 5] = 0.17791; s3.data[8, 6] = 0.46130; s3.data[8, 7] = 0.60147; s3.data[8, 8] = 0.56978; s3.data[8, 9] = 0.41339; s3.data[8, 10] = 0.21790;
            s3.data[9, 0] = -0.18181; s3.data[9, 1] = -0.33699; s3.data[9, 2] = -0.45761; s3.data[9, 3] = -0.47579; s3.data[9, 4] = -0.35607; s3.data[9, 5] = -0.12428; s3.data[9, 6] = 0.13856; s3.data[9, 7] = 0.33749; s3.data[9, 8] = 0.41339; s3.data[9, 9] = 0.36788; s3.data[9, 10] = 0.25073;
            s3.data[10, 0] = -0.05581; s3.data[10, 1] = -0.18181; s3.data[10, 2] = -0.31657; s3.data[10, 3] = -0.40348; s3.data[10, 4] = -0.39445; s3.data[10, 5] = -0.27731; s3.data[10, 6] = -0.09092; s3.data[10, 7] = 0.09523; s3.data[10, 8] = 0.21790; s3.data[10, 9] = 0.25073; s3.data[10, 10] = 0.20961;

            // ma tran he so cho huong 3pi/8 rad
            matransothuc s4 = new matransothuc(11, 11);
            s4.data[0, 0] = -0.02705; s4.data[0, 1] = 0.12105; s4.data[0, 2] = 0.29655; s4.data[0, 3] = 0.40369; s4.data[0, 4] = 0.36071; s4.data[0, 5] = 0.16495; s4.data[0, 6] = -0.09334; s4.data[0, 7] = -0.28770; s4.data[0, 8] = -0.33885; s4.data[0, 9] = -0.25761; s4.data[0, 10] = -0.11968;
            s4.data[1, 0] = -0.10038; s4.data[1, 1] = 0.07691; s4.data[1, 2] = 0.32558; s4.data[1, 3] = 0.52468; s4.data[1, 4] = 0.54565; s4.data[1, 5] = 0.34697; s4.data[1, 6] = 0.01676; s4.data[1, 7] = -0.28067; s4.data[1, 8] = -0.41455; s4.data[1, 9] = -0.36417; s4.data[1, 10] = -0.20828;
            s4.data[2, 0] = -0.19807; s4.data[2, 1] = -0.01365; s4.data[2, 2] = 0.29814; s4.data[2, 3] = 0.60280; s4.data[2, 4] = 0.72437; s4.data[2, 5] = 0.56682; s4.data[2, 6] = 0.19441; s4.data[2, 7] = -0.20418; s4.data[2, 8] = -0.44348; s4.data[2, 9] = -0.45562; s4.data[2, 10] = -0.30619;
            s4.data[3, 0] = -0.30375; s4.data[3, 1] = -0.14291; s4.data[3, 2] = 0.20335; s4.data[3, 3] = 0.60553; s4.data[3, 4] = 0.85111; s4.data[3, 5] = 0.78241; s4.data[3, 6] = 0.41712; s4.data[3, 7] = -0.05531; s4.data[3, 8] = -0.40397; s4.data[3, 9] = -0.50485; s4.data[3, 10] = -0.39229;
            s4.data[4, 0] = -0.39369; s4.data[4, 1] = -0.28735; s4.data[4, 2] = 0.05100; s4.data[4, 3] = 0.51782; s4.data[4, 4] = 0.88562; s4.data[4, 5] = 0.94135; s4.data[4, 6] = 0.64024; s4.data[4, 7] = 0.14418; s4.data[4, 8] = -0.29238; s4.data[4, 9] = -0.49199; s4.data[4, 10] = -0.44375;
            s4.data[5, 0] = -0.44480; s4.data[5, 1] = -0.41395; s4.data[5, 2] = -0.12821; s4.data[5, 3] = 0.35162; s4.data[5, 4] = 0.81047; s4.data[5, 5] = 1.00000; s4.data[5, 6] = 0.81047; s4.data[5, 7] = 0.35162; s4.data[5, 8] = -0.12821; s4.data[5, 9] = -0.41395; s4.data[5, 10] = -0.44480;
            s4.data[6, 0] = -0.44375; s4.data[6, 1] = -0.49199; s4.data[6, 2] = -0.29238; s4.data[6, 3] = 0.14418; s4.data[6, 4] = 0.64024; s4.data[6, 5] = 0.94135; s4.data[6, 6] = 0.88562; s4.data[6, 7] = 0.51782; s4.data[6, 8] = 0.05100; s4.data[6, 9] = -0.28735; s4.data[6, 10] = -0.39369;
            s4.data[7, 0] = -0.39229; s4.data[7, 1] = -0.50485; s4.data[7, 2] = -0.40397; s4.data[7, 3] = -0.05531; s4.data[7, 4] = 0.41712; s4.data[7, 5] = 0.78241; s4.data[7, 6] = 0.85111; s4.data[7, 7] = 0.60553; s4.data[7, 8] = 0.20335; s4.data[7, 9] = -0.14291; s4.data[7, 10] = -0.30375;
            s4.data[8, 0] = -0.30619; s4.data[8, 1] = -0.45562; s4.data[8, 2] = -0.44348; s4.data[8, 3] = -0.20418; s4.data[8, 4] = 0.19441; s4.data[8, 5] = 0.56682; s4.data[8, 6] = 0.72437; s4.data[8, 7] = 0.60280; s4.data[8, 8] = 0.29814; s4.data[8, 9] = -0.01365; s4.data[8, 10] = -0.19807;
            s4.data[9, 0] = -0.20828; s4.data[9, 1] = -0.36417; s4.data[9, 2] = -0.41455; s4.data[9, 3] = -0.28067; s4.data[9, 4] = 0.01676; s4.data[9, 5] = 0.34697; s4.data[9, 6] = 0.54565; s4.data[9, 7] = 0.52468; s4.data[9, 8] = 0.32558; s4.data[9, 9] = 0.07691; s4.data[9, 10] = -0.10038;
            s4.data[10, 0] = -0.11968; s4.data[10, 1] = -0.25761; s4.data[10, 2] = -0.33885; s4.data[10, 3] = -0.28770; s4.data[10, 4] = -0.09334; s4.data[10, 5] = 0.16495; s4.data[10, 6] = 0.36071; s4.data[10, 7] = 0.40369; s4.data[10, 8] = 0.29655; s4.data[10, 9] = 0.12105; s4.data[10, 10] = -0.02705;

            // ma tran he so cho huong 4pi/8 rad
            matransothuc s5 = new matransothuc(11, 11);
            s5.data[0, 0] = -0.20961; s5.data[0, 1] = -0.22466; s5.data[0, 2] = -0.10679; s5.data[0, 3] = 0.12485; s5.data[0, 4] = 0.35900; s5.data[0, 5] = 0.45783; s5.data[0, 6] = 0.35900; s5.data[0, 7] = 0.12485; s5.data[0, 8] = -0.10679; s5.data[0, 9] = -0.22466; s5.data[0, 10] = -0.20961;
            s5.data[1, 0] = -0.27769; s5.data[1, 1] = -0.29762; s5.data[1, 2] = -0.14148; s5.data[1, 3] = 0.16540; s5.data[1, 4] = 0.47560; s5.data[1, 5] = 0.60653; s5.data[1, 6] = 0.47560; s5.data[1, 7] = 0.16540; s5.data[1, 8] = -0.14148; s5.data[1, 9] = -0.29762; s5.data[1, 10] = -0.27769;
            s5.data[2, 0] = -0.34559; s5.data[2, 1] = -0.37039; s5.data[2, 2] = -0.17607; s5.data[2, 3] = 0.20585; s5.data[2, 4] = 0.59189; s5.data[2, 5] = 0.75484; s5.data[2, 6] = 0.59189; s5.data[2, 7] = 0.20585; s5.data[2, 8] = -0.17607; s5.data[2, 9] = -0.37039; s5.data[2, 10] = -0.34559;
            s5.data[3, 0] = -0.40404; s5.data[3, 1] = -0.43304; s5.data[3, 2] = -0.20585; s5.data[3, 3] = 0.24066; s5.data[3, 4] = 0.69199; s5.data[3, 5] = 0.88250; s5.data[3, 6] = 0.69199; s5.data[3, 7] = 0.24066; s5.data[3, 8] = -0.20585; s5.data[3, 9] = -0.43304; s5.data[3, 10] = -0.40404;
            s5.data[4, 0] = -0.44375; s5.data[4, 1] = -0.47560; s5.data[4, 2] = -0.22608; s5.data[4, 3] = 0.26432; s5.data[4, 4] = 0.76000; s5.data[4, 5] = 0.96923; s5.data[4, 6] = 0.76000; s5.data[4, 7] = 0.26432; s5.data[4, 8] = -0.22608; s5.data[4, 9] = -0.47560; s5.data[4, 10] = -0.44375;
            s5.data[5, 0] = -0.45783; s5.data[5, 1] = -0.49069; s5.data[5, 2] = -0.23326; s5.data[5, 3] = 0.27271; s5.data[5, 4] = 0.78413; s5.data[5, 5] = 1.00000; s5.data[5, 6] = 0.78413; s5.data[5, 7] = 0.27271; s5.data[5, 8] = -0.23326; s5.data[5, 9] = -0.49069; s5.data[5, 10] = -0.45783;
            s5.data[6, 0] = -0.44375; s5.data[6, 1] = -0.47560; s5.data[6, 2] = -0.22608; s5.data[6, 3] = 0.26432; s5.data[6, 4] = 0.76000; s5.data[6, 5] = 0.96923; s5.data[6, 6] = 0.76000; s5.data[6, 7] = 0.26432; s5.data[6, 8] = -0.22608; s5.data[6, 9] = -0.47560; s5.data[6, 10] = -0.44375;
            s5.data[7, 0] = -0.40404; s5.data[7, 1] = -0.43304; s5.data[7, 2] = -0.20585; s5.data[7, 3] = 0.24066; s5.data[7, 4] = 0.69199; s5.data[7, 5] = 0.88250; s5.data[7, 6] = 0.69199; s5.data[7, 7] = 0.24066; s5.data[7, 8] = -0.20585; s5.data[7, 9] = -0.43304; s5.data[7, 10] = -0.40404;
            s5.data[8, 0] = -0.34559; s5.data[8, 1] = -0.37039; s5.data[8, 2] = -0.17607; s5.data[8, 3] = 0.20585; s5.data[8, 4] = 0.59189; s5.data[8, 5] = 0.75484; s5.data[8, 6] = 0.59189; s5.data[8, 7] = 0.20585; s5.data[8, 8] = -0.17607; s5.data[8, 9] = -0.37039; s5.data[8, 10] = -0.34559;
            s5.data[9, 0] = -0.27769; s5.data[9, 1] = -0.29762; s5.data[9, 2] = -0.14148; s5.data[9, 3] = 0.16540; s5.data[9, 4] = 0.47560; s5.data[9, 5] = 0.60653; s5.data[9, 6] = 0.47560; s5.data[9, 7] = 0.16540; s5.data[9, 8] = -0.14148; s5.data[9, 9] = -0.29762; s5.data[9, 10] = -0.27769;
            s5.data[10, 0] = -0.20961; s5.data[10, 1] = -0.22466; s5.data[10, 2] = -0.10679; s5.data[10, 3] = 0.12485; s5.data[10, 4] = 0.35900; s5.data[10, 5] = 0.45783; s5.data[10, 6] = 0.35900; s5.data[10, 7] = 0.12485; s5.data[10, 8] = -0.10679; s5.data[10, 9] = 0.22466; s5.data[10, 10] = -0.20961;

            // ma tran he so cho huong 5pi/8 rad
            matransothuc s6 = new matransothuc(11, 11);
            s6.data[0, 0] = -0.11968; s6.data[0, 1] = -0.25761; s6.data[0, 2] = -0.33885; s6.data[0, 3] = -0.28770; s6.data[0, 4] = -0.09334; s6.data[0, 5] = 0.16495; s6.data[0, 6] = 0.36071; s6.data[0, 7] = 0.40369; s6.data[0, 8] = 0.29655; s6.data[0, 9] = 0.12105; s6.data[0, 10] = -0.02705;
            s6.data[1, 0] = -0.20828; s6.data[1, 1] = -0.36417; s6.data[1, 2] = -0.41455; s6.data[1, 3] = -0.28067; s6.data[1, 4] = 0.01676; s6.data[1, 5] = 0.34697; s6.data[1, 6] = 0.54565; s6.data[1, 7] = 0.52468; s6.data[1, 8] = 0.32558; s6.data[1, 9] = 0.07691; s6.data[1, 10] = -0.10038;
            s6.data[2, 0] = -0.30619; s6.data[2, 1] = -0.45562; s6.data[2, 2] = -0.44348; s6.data[2, 3] = -0.20418; s6.data[2, 4] = 0.19441; s6.data[2, 5] = 0.56682; s6.data[2, 6] = 0.72437; s6.data[2, 7] = 0.60280; s6.data[2, 8] = 0.29814; s6.data[2, 9] = -0.01365; s6.data[2, 10] = -0.19807;
            s6.data[3, 0] = -0.39229; s6.data[3, 1] = -0.50485; s6.data[3, 2] = -0.40397; s6.data[3, 3] = -0.05531; s6.data[3, 4] = 0.41712; s6.data[3, 5] = 0.78241; s6.data[3, 6] = 0.85111; s6.data[3, 7] = 0.60553; s6.data[3, 8] = 0.20335; s6.data[3, 9] = -0.14291; s6.data[3, 10] = -0.30375;
            s6.data[4, 0] = -0.44375; s6.data[4, 1] = -0.49199; s6.data[4, 2] = -0.29238; s6.data[4, 3] = 0.14418; s6.data[4, 4] = 0.64024; s6.data[4, 5] = 0.94135; s6.data[4, 6] = 0.88562; s6.data[4, 7] = 0.51782; s6.data[4, 8] = 0.05100; s6.data[4, 9] = -0.28735; s6.data[4, 10] = -0.39369;
            s6.data[5, 0] = -0.44480; s6.data[5, 1] = -0.41395; s6.data[5, 2] = -0.12821; s6.data[5, 3] = 0.35162; s6.data[5, 4] = 0.81047; s6.data[5, 5] = 1.00000; s6.data[5, 6] = 0.81047; s6.data[5, 7] = 0.35162; s6.data[5, 8] = -0.12821; s6.data[5, 9] = -0.41395; s6.data[5, 10] = -0.44480;
            s6.data[6, 0] = -0.39369; s6.data[6, 1] = -0.28735; s6.data[6, 2] = 0.05100; s6.data[6, 3] = 0.51782; s6.data[6, 4] = 0.88562; s6.data[6, 5] = 0.94135; s6.data[6, 6] = 0.64024; s6.data[6, 7] = 0.14418; s6.data[6, 8] = -0.29238; s6.data[6, 9] = -0.49199; s6.data[6, 10] = -0.44375;
            s6.data[7, 0] = -0.30375; s6.data[7, 1] = -0.14291; s6.data[7, 2] = 0.20335; s6.data[7, 3] = 0.60553; s6.data[7, 4] = 0.85111; s6.data[7, 5] = 0.78241; s6.data[7, 6] = 0.41712; s6.data[7, 7] = -0.05531; s6.data[7, 8] = -0.40397; s6.data[7, 9] = -0.50485; s6.data[7, 10] = -0.39229;
            s6.data[8, 0] = -0.19807; s6.data[8, 1] = -0.01365; s6.data[8, 2] = 0.29814; s6.data[8, 3] = 0.60280; s6.data[8, 4] = 0.72437; s6.data[8, 5] = 0.56682; s6.data[8, 6] = 0.19441; s6.data[8, 7] = -0.20418; s6.data[8, 8] = -0.44348; s6.data[8, 9] = -0.45562; s6.data[8, 10] = -0.30619;
            s6.data[9, 0] = -0.10083; s6.data[9, 1] = 0.07691; s6.data[9, 2] = 0.32558; s6.data[9, 3] = 0.52468; s6.data[9, 4] = 0.54565; s6.data[9, 5] = 0.34697; s6.data[9, 6] = 0.01676; s6.data[9, 7] = -0.28067; s6.data[9, 8] = -0.41455; s6.data[9, 9] = -0.36417; s6.data[9, 10] = -0.20828;
            s6.data[10, 0] = -0.02705; s6.data[10, 1] = 0.012105; s6.data[10, 2] = 0.29655; s6.data[10, 3] = 0.40369; s6.data[10, 4] = 0.36071; s6.data[10, 5] = 0.16495; s6.data[10, 6] = -0.09334; s6.data[10, 7] = -0.28770; s6.data[10, 8] = -0.33885; s6.data[10, 9] = -0.25761; s6.data[10, 10] = -0.11968;

            // ma tran he so cho huong 6pi/8 rad
            matransothuc s7 = new matransothuc(11, 11);
            s7.data[0, 0] = -0.05581; s7.data[0, 1] = -0.18181; s7.data[0, 2] = -0.31657; s7.data[0, 3] = -0.40384; s7.data[0, 4] = -0.39445; s7.data[0, 5] = -0.27731; s7.data[0, 6] = -0.09092; s7.data[0, 7] = 0.09523; s7.data[0, 8] = 0.21790; s7.data[0, 9] = 0.25073; s7.data[0, 10] = 0.20961;
            s7.data[1, 0] = -0.18181; s7.data[1, 1] = -0.33699; s7.data[1, 2] = -0.45761; s7.data[1, 3] = -0.47579; s7.data[1, 4] = -0.35607; s7.data[1, 5] = -0.12428; s7.data[1, 6] = 0.13856; s7.data[1, 7] = 0.33749; s7.data[1, 8] = 0.41339; s7.data[1, 9] = 0.36788; s7.data[1, 10] = 0.25073;
            s7.data[2, 0] = -0.31657; s7.data[2, 1] = -0.45761; s7.data[2, 2] = -0.50648; s7.data[2, 3] = -0.40348; s7.data[2, 4] = -0.14990; s7.data[2, 5] = 0.17791; s7.data[2, 6] = 0.46130; s7.data[2, 7] = 0.60147; s7.data[2, 8] = 0.56978; s7.data[2, 9] = 0.41339; s7.data[2, 10] = 0.21790;
            s7.data[3, 0] = -0.40384; s7.data[3, 1] = -0.47579; s7.data[3, 2] = -0.40348; s7.data[3, 3] = -0.15957; s7.data[3, 4] = 0.20160; s7.data[3, 5] = 0.55643; s7.data[3, 6] = 0.77231; s7.data[3, 7] = 0.77880; s7.data[3, 8] = 0.60147; s7.data[3, 9] = 0.33749; s7.data[3, 10] = 0.09523;
            s7.data[4, 0] = -0.39445; s7.data[4, 1] = -0.35607; s7.data[4, 2] = -0.14990; s7.data[4, 3] = 0.20160; s7.data[4, 4] = 0.59232; s7.data[4, 5] = 0.87514; s7.data[4, 6] = 0.93941; s7.data[4, 7] = 0.77231; s7.data[4, 8] = 0.46130; s7.data[4, 9] = 0.13856; s7.data[4, 10] = -0.09092;
            s7.data[5, 0] = -0.27731; s7.data[5, 1] = -0.12428; s7.data[5, 2] = 0.17791; s7.data[5, 3] = 0.55643; s7.data[5, 4] = 0.87514; s7.data[5, 5] = 1.00000; s7.data[5, 6] = 0.87514; s7.data[5, 7] = 0.55643; s7.data[5, 8] = 0.17791; s7.data[5, 9] = -0.12428; s7.data[5, 10] = -0.27731;
            s7.data[6, 0] = -0.09092; s7.data[6, 1] = 0.13856; s7.data[6, 2] = 0.46130; s7.data[6, 3] = 0.77231; s7.data[6, 4] = 0.93941; s7.data[6, 5] = 0.87514; s7.data[6, 6] = 0.59232; s7.data[6, 7] = 0.20160; s7.data[6, 8] = -0.14990; s7.data[6, 9] = -0.35607; s7.data[6, 10] = -0.39445;
            s7.data[7, 0] = 0.09523; s7.data[7, 1] = 0.33749; s7.data[7, 2] = 0.60147; s7.data[7, 3] = 0.77880; s7.data[7, 4] = 0.77231; s7.data[7, 5] = 0.55643; s7.data[7, 6] = 0.20160; s7.data[7, 7] = -0.15957; s7.data[7, 8] = -0.40348; s7.data[7, 9] = -0.47579; s7.data[7, 10] = -0.40384;
            s7.data[8, 0] = 0.21790; s7.data[8, 1] = 0.41339; s7.data[8, 2] = 0.56978; s7.data[8, 3] = 0.60147; s7.data[8, 4] = 0.46130; s7.data[8, 5] = 0.17791; s7.data[8, 6] = -0.14990; s7.data[8, 7] = -0.40348; s7.data[8, 8] = -0.50648; s7.data[8, 9] = -0.45761; s7.data[8, 10] = -0.31657;
            s7.data[9, 0] = 0.25073; s7.data[9, 1] = 0.36788; s7.data[9, 2] = 0.41339; s7.data[9, 3] = 0.33749; s7.data[9, 4] = 0.13856; s7.data[9, 5] = -0.12428; s7.data[9, 6] = -0.35607; s7.data[9, 7] = -0.47579; s7.data[9, 8] = -0.45761; s7.data[9, 9] = -0.33699; s7.data[9, 10] = -0.18181;
            s7.data[10, 0] = 0.20961; s7.data[10, 1] = 0.25073; s7.data[10, 2] = 0.21790; s7.data[10, 3] = 0.09523; s7.data[10, 4] = -0.09092; s7.data[10, 5] = -0.27731; s7.data[10, 6] = -0.39445; s7.data[10, 7] = 0.40384; s7.data[10, 8] = -0.31657; s7.data[10, 9] = -0.18181; s7.data[10, 10] = -0.05581;

            // ma tran he so cho huong 7pi/8 rad
            matransothuc s8 = new matransothuc(11, 11);
            s8.data[0, 0] = -0.11968; s8.data[0, 1] = -0.20828; s8.data[0, 2] = -0.30619; s8.data[0, 3] = -0.39229; s8.data[0, 4] = -0.44375; s8.data[0, 5] = -0.44480; s8.data[0, 6] = -0.39369; s8.data[0, 7] = -0.30375; s8.data[0, 8] = -0.19807; s8.data[0, 9] = -0.10083; s8.data[0, 10] = -0.02705;
            s8.data[1, 0] = -0.25761; s8.data[1, 1] = -0.36417; s8.data[1, 2] = -0.45562; s8.data[1, 3] = -0.50485; s8.data[1, 4] = -0.49199; s8.data[1, 5] = -0.41395; s8.data[1, 6] = -0.28735; s8.data[1, 7] = -0.14291; s8.data[1, 8] = -0.01365; s8.data[1, 9] = 0.07691; s8.data[1, 10] = 0.012105;
            s8.data[2, 0] = -0.33885; s8.data[2, 1] = -0.41455; s8.data[2, 2] = -0.44348; s8.data[2, 3] = -0.40397; s8.data[2, 4] = -0.29238; s8.data[2, 5] = -0.12821; s8.data[2, 6] = 0.05100; s8.data[2, 7] = 0.20335; s8.data[2, 8] = 0.29814; s8.data[2, 9] = 0.32558; s8.data[2, 10] = 0.29655;
            s8.data[3, 0] = -0.28770; s8.data[3, 1] = -0.28067; s8.data[3, 2] = -0.20418; s8.data[3, 3] = -0.05531; s8.data[3, 4] = 0.14418; s8.data[3, 5] = 0.35162; s8.data[3, 6] = 0.51782; s8.data[3, 7] = 0.60553; s8.data[3, 8] = 0.60280; s8.data[3, 9] = 0.52468; s8.data[3, 10] = 0.40369;
            s8.data[4, 0] = -0.09334; s8.data[4, 1] = 0.01676; s8.data[4, 2] = 0.19441; s8.data[4, 3] = 0.41712; s8.data[4, 4] = 0.64024; s8.data[4, 5] = 0.81047; s8.data[4, 6] = 0.88562; s8.data[4, 7] = 0.85111; s8.data[4, 8] = 0.72437; s8.data[4, 9] = 0.54565; s8.data[4, 10] = 0.36071;
            s8.data[5, 0] = 0.16495; s8.data[5, 1] = 0.34697; s8.data[5, 2] = 0.56682; s8.data[5, 3] = 0.78241; s8.data[5, 4] = 0.94135; s8.data[5, 5] = 1.00000; s8.data[5, 6] = 0.94135; s8.data[5, 7] = 0.78241; s8.data[5, 8] = 0.56682; s8.data[5, 9] = 0.34697; s8.data[5, 10] = 0.16495;
            s8.data[6, 0] = 0.36071; s8.data[6, 1] = 0.54565; s8.data[6, 2] = 0.72437; s8.data[6, 3] = 0.85111; s8.data[6, 4] = 0.88562; s8.data[6, 5] = 0.81047; s8.data[6, 6] = 0.64024; s8.data[6, 7] = 0.41712; s8.data[6, 8] = 0.19441; s8.data[6, 9] = 0.01676; s8.data[6, 10] = -0.09334;
            s8.data[7, 0] = 0.40369; s8.data[7, 1] = 0.52468; s8.data[7, 2] = 0.60280; s8.data[7, 3] = 0.60553; s8.data[7, 4] = 0.51782; s8.data[7, 5] = 0.35162; s8.data[7, 6] = 0.14418; s8.data[7, 7] = -0.05531; s8.data[7, 8] = -0.20418; s8.data[7, 9] = -0.28067; s8.data[7, 10] = -0.28770;
            s8.data[8, 0] = 0.29655; s8.data[8, 1] = 0.32558; s8.data[8, 2] = 0.29814; s8.data[8, 3] = 0.20335; s8.data[8, 4] = 0.05100; s8.data[8, 5] = -0.12821; s8.data[8, 6] = -0.29238; s8.data[8, 7] = -0.40397; s8.data[8, 8] = -0.44348; s8.data[8, 9] = -0.41455; s8.data[8, 10] = -0.33885;
            s8.data[9, 0] = 0.12105; s8.data[9, 1] = 0.07691; s8.data[9, 2] = -0.01365; s8.data[9, 3] = -0.14291; s8.data[9, 4] = -0.28735; s8.data[9, 5] = -0.41395; s8.data[9, 6] = -0.49199; s8.data[9, 7] = -0.50485; s8.data[9, 8] = -0.45562; s8.data[9, 9] = -0.36417; s8.data[9, 10] = -0.25761;
            s8.data[10, 0] = -0.02705; s8.data[10, 1] = -0.10038; s8.data[10, 2] = -0.19807; s8.data[10, 3] = -0.30375; s8.data[10, 4] = -0.39369; s8.data[10, 5] = -0.44480; s8.data[10, 6] = -0.44375; s8.data[10, 7] = -0.39229; s8.data[10, 8] = -0.30619; s8.data[10, 9] = -0.20828; s8.data[10, 10] = -0.11968;

            matrannguyen gb = new matrannguyen(sohang, socot);
            matrannguyen g = new matrannguyen(sohang, socot);
            matrannguyen g1 = phanvung();
            g = mthuongmn(16);
            for (int i = 0; i < sohang; ++i)

                for (int j = 0; j < socot; ++j)
                {
                    if (g1.data[i, j] != 255)
                    {
                        int t;
                        t = huongmt(i, j);
                        if (g.data[i, j] == 0) gb.data[i, j] = (int)nhanchap1(i, j, s1);
                        if (g.data[i, j] == 1) gb.data[i, j] = (int)nhanchap1(i, j, s2);
                        if (g.data[i, j] == 2) gb.data[i, j] = (int)nhanchap1(i, j, s3);
                        if (g.data[i, j] == 3) gb.data[i, j] = (int)nhanchap1(i, j, s4);
                        if (g.data[i, j] == 4) gb.data[i, j] = (int)nhanchap1(i, j, s5);
                        if (g.data[i, j] == 5) gb.data[i, j] = (int)nhanchap1(i, j, s6);
                        if (g.data[i, j] == 6) gb.data[i, j] = (int)nhanchap1(i, j, s7);
                        if (g.data[i, j] == 7) gb.data[i, j] = (int)nhanchap1(i, j, s8);

                        gb.data[i, j] = (int)gb.data[i, j] / 20;
                        if (gb.data[i, j] < 0) gb.data[i, j] = 0;
                        if (gb.data[i, j] > 255) gb.data[i, j] = 255;
                    }
                    else gb.data[i, j] = 255;
                }
            return gb;
        }