- #1

- 75

- 3

## Main Question or Discussion Point

Hi friends.

I'm trying to define five 6 by 6 matrices with C code. I need to multiply them than. Those matrices are different from each other. Each matrix has fixed elements but some elements of that matrices depends on other mathematical operations.

For example imagine I have a matrix which is 6 by 6 and its elements are

M(1,1) = cos α

M(1,2) = ρ (sin α)

M(1,3) = 0

M(1,4) = 0

M(1,5) = 0

M(1,6) = ρ (1-cos α)

M(2,1) = (-sin α) /ρ

M(2,2) = cos α

M(2,3) = 0

M(2,4) = 0

M(2,5) = 0

M(2,6) = sin α

M(3,1) = 0

M(3,2) = 0

M(3,3) = 1

M(3,4) = ρ.α

M(3,5) = 0

M(3,6) = 0

M(4,1) = 0

M(4,2) = 0

M(4,3) = 0

M(4,4) = 1

M(4,5) = 0

M(4,6) = 0

M(5,1) = sin α

M(5,2) = ρ (1-cos α)

M(5,3) = 0

M(5,4) = 0

M(5,5) = 1

M(5,6) = ρ (α- sin α)

M(6,1) = 0

M(6,2) = 0

M(6,3) = 0

M(6,4) = 0

M(6,5) = 0

M(6,6) = 1

In here ρ and α are calculated by other mathematical operations.

For example ;

ρ=p/(b*0.2998)

The program will ask to the user about p and b, than calculate ρ and put that value to the matrix. All five matrices have some elements like that. They need to be defined like that and multiplied to obtain a final matrix.

Can anybody help me ?

I'm trying to define five 6 by 6 matrices with C code. I need to multiply them than. Those matrices are different from each other. Each matrix has fixed elements but some elements of that matrices depends on other mathematical operations.

For example imagine I have a matrix which is 6 by 6 and its elements are

M(1,1) = cos α

M(1,2) = ρ (sin α)

M(1,3) = 0

M(1,4) = 0

M(1,5) = 0

M(1,6) = ρ (1-cos α)

M(2,1) = (-sin α) /ρ

M(2,2) = cos α

M(2,3) = 0

M(2,4) = 0

M(2,5) = 0

M(2,6) = sin α

M(3,1) = 0

M(3,2) = 0

M(3,3) = 1

M(3,4) = ρ.α

M(3,5) = 0

M(3,6) = 0

M(4,1) = 0

M(4,2) = 0

M(4,3) = 0

M(4,4) = 1

M(4,5) = 0

M(4,6) = 0

M(5,1) = sin α

M(5,2) = ρ (1-cos α)

M(5,3) = 0

M(5,4) = 0

M(5,5) = 1

M(5,6) = ρ (α- sin α)

M(6,1) = 0

M(6,2) = 0

M(6,3) = 0

M(6,4) = 0

M(6,5) = 0

M(6,6) = 1

In here ρ and α are calculated by other mathematical operations.

For example ;

ρ=p/(b*0.2998)

The program will ask to the user about p and b, than calculate ρ and put that value to the matrix. All five matrices have some elements like that. They need to be defined like that and multiplied to obtain a final matrix.

Can anybody help me ?

Last edited: