Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phkarl
/
IAX0583
This project
Loading...
Sign in
Toggle navigation
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
51b9829e
authored
Oct 01, 2018
by
phkarl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
37708be2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
Lab5PracticeTask2.c
Lab5PracticeTask2.c
0 → 100644
View file @
51b9829e
#include <stdio.h>
#include <math.h>
int
main
(){
int
matrix
[
4
][
3
]
=
{
{
1
,
4
,
6
},
{
2
,
-
3
,
1
},
{
3
,
5
,
0
},
{
3
,
1
,
-
3
}
};
double
angles
[
6
];
int
i
;
int
j
;
int
n
;
int
q
;
int
p
;
int
dot
;
int
lenSq1
;
int
lenSq2
;
double
angle
;
for
(
i
=
0
;
i
<
6
;
i
++
){
for
(
j
=
0
;
j
<
4
;
j
++
){
for
(
n
=
0
;
n
<
4
;
n
++
){
if
(
n
!=
j
){
int
x1
=
matrix
[
j
][
0
];
int
y1
=
matrix
[
j
][
1
];
int
z1
=
matrix
[
j
][
2
];
int
x2
=
matrix
[
n
][
0
];
int
y2
=
matrix
[
n
][
1
];
int
z2
=
matrix
[
n
][
2
];
dot
=
x1
*
x2
+
y1
*
y2
+
z1
*
z2
;
lenSq1
=
x1
*
x1
+
y1
*
y1
+
z1
*
z1
;
lenSq2
=
x2
*
x2
+
y2
*
y2
+
z2
*
z2
;
angle
=
acos
(
dot
/
sqrt
(
lenSq1
*
lenSq2
));
angles
[
i
]
=
angle
*
(
180
.
0
/
3
.
14159265
);
for
(
q
=
0
;
q
<
3
;
q
++
){
printf
(
"%d "
,
matrix
[
j
][
q
]);
}
printf
(
" "
);
for
(
p
=
0
;
p
<
3
;
p
++
){
printf
(
"%d "
,
matrix
[
n
][
p
]);
}
printf
(
" "
);
printf
(
"%f
\n
"
,
angles
[
i
]);
}
}
}
}
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment