Commit 4eba19ff authored by KTKadyshev's avatar KTKadyshev
Browse files

Add new file

parent ae7dbe8f
#include <stdio.h>
#include <math.h>
int main()
{
int a[3][1],b[3][1];
float skalar, modulea, moduleb;
a[0][0]=2;a[1][0]=-1;a[2][0]=0;
b[0][0]=1;b[1][0]=3;b[2][0]=-1;
skalar=a[0][0]*b[0][0]+a[1][0]*b[1][0]+a[2][0]*b[2][0];
modulea=sqrt(a[0][0]*a[0][0]+a[1][0]*a[1][0]+a[2][0]*a[2][0]);
moduleb=sqrt(b[0][0]*b[0][0]+b[1][0]*b[1][0]+b[2][0]*b[2][0]);
float cosalpha =skalar/(modulea*moduleb);
printf("косинус между векторами a и b = %f", cosalpha);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment