Реферат: Трехмерная графика Теория

}

Matrix& Matrix :: operator *= ( const Matrix& A )

{

Matrix res = *this;

int j;

for ( int i = 0; i < 4; i++ )

for ( j = 0; j < 4; j++ ) {

double sum = 0;

for ( int k = 0; k < 4; k++ )

sum += res.x [i][k] * A.x [k][j];

x [i][j] = sum;

}

return *this;

}

Matrix operator + ( const Matrix& A, const Matrix& B )

{

Matrix res;

int j;

for ( int i = 0; i < 4; i++ )

for ( j = 0; j < 4; j++ )

res.x [i][j] = A.x [i][j] + B.x [i][j];

return res;

}

Matrix operator - ( const Matrix& A, const Matrix& B )

{

Matrix res;

int j;

for ( int i = 0; i < 4; i++ )

for ( j = 0; j < 4; j++ )

К-во Просмотров: 1937
Бесплатно скачать Реферат: Трехмерная графика Теория