Commit 0fedfb4d by matjul

Upload New File

parent 470dcad1
Showing with 48 additions and 0 deletions
#include <math.h>
#include <stdio.h>
int main (){
int matrix[4][3] = {
{1, 4, 6},
{2, -3, 1},
{3, 5, 0},
{3, 1, -3}
};
float lenght[4] = {0};
int i, j;
for(i = 0; i < 4; i++){
for(j = 0; j < 3; j++){
lenght[i] += (pow(matrix[i][j], 2));
}
}
float angles[6] = {0};
float smth[6] = {0};
float anything[6] = {0};
int k = 0;
int t = 0;
for(i = 0; i < 4; i++){
for(j = 0; j < i; j++){
smth[t] = sqrt(lenght[i] * lenght[j]);
for(k = 0; k < 3; k++){
anything[t] += matrix[i][k] * matrix[j][k];
}
t++;
}
}
for(i = 0; i < 6; i++){
angles[i] = acos(anything[i] / smth[i]);
}
for(i = 0; i < 6; i++){
printf("%f\n", angles[i]);
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment