Matrice patratica

1.Diagonala principala:

a)pe diagonala-a[i][j] , i=j , i=1,n; j=1,n;

a[i][i] , i=1,n;

b)deasupra diagonalei-a[i][j] , i=1,n; j=1,n;

a[i][j], i=1,n-1; j=i+1,n;

c)sub diagonala-a[i][j] , i>j , i=1,n; j=1,n;

a[i][j] , i=2,n; j=1,i-1;

2.Diagonala secundara:

a)pe diagonala-a[i][j] , i+j=n+1; i=1,n; j=1,n;

j=n+1-i;

b)deasupra diagonalei-a[i][j] , i+j<n+1; i=1,n; j=1,n;

j<n+1-i;

i=1,n; j=1,n-i;

c)sub diagonala-a[i][j] , i+j>n+1; i=1,n; j=1,n;

j<n+1-i;

i=2,n; j=n+2-i,n;

3. Zone

a) Zona Sudica-i>j, i+j>n+1

b) Zona Nordica-i<j, i+j<n+1

c) Zona Estica-i<j, i+j>n+1

d) Zona Vestica-i>j, i+j<n+1

4. Simetrii

a) Diagonala principală

for(i=1;i<=n-1&&OK==1;++i)

for(j=i+1;j<=n&&OK==1;++j)

if(a[i][j]!=a[j][i]) OK=0;

b) Diagonala secundara

for(i=1;i<=n-1&&OK==1;++i)

for(j=i+1;j<=n-i&&OK==1;++j)

if(a[i][j]!=a[n+1-j][n+1-i]) OK=0;

c) Axa Ox

if(a[i][j]!=a[n+1-i][j]) OK=0;

d) Axa Oy

if(a[i][j]!=a[i][n+1-j])OK=0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s