Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

matjul / iax0583

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 0fedfb4d authored 6 years ago by matjul's avatar matjul
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

Upload New File

parent 470dcad1 master
Show whitespace changes
Inline Side-by-side
Showing with 48 additions and 0 deletions
  • lab5task2.c
lab5task2.c 0 → 100644
View file @ 0fedfb4d
#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;
}
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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