Dot geometry can be used to characterize or sense the angle between the two vectors is calculated, and the vector b is projected on a direction vector, having the formula:
Substantially the same as a · b> 0 direction, the angle between 0 ° to 90 °
a · b = 0 orthogonal, perpendicular to each other
Substantially opposite a · b <0 direction, an angle between 90 ° to 180 °
//矩阵乘法 #include <bits/stdc++.h> using namespace std; #define N 100 int a[N][N],b[N][N],c[N][N]; int main() { int m,s,n; scanf("%d%d%d",&m,&s,&n); for(int i =1;i<=n;i++){ for(int j =1;j<=s;j++){ scanf("%d",&a[i][j]); } } for(int i =1;i<=s;i++){ for(int j =1;j<=n;j++){ scanf("%d",&b[i][j]); } } for(int i=1;i<=m;i++){ for(int j =1;j<=n;j++){ for(int k =1;k<=s;k++){ c[i][j]+=a[i][k]*b[k][j]; } } } for(int i =1;i<=m;i++){ for(int j=1;j<=n;j++){ printf("%d ",c[i][j]); } printf("\n"); } return 0; }
Determinant N rows and N columns
Cross product of geometric meaning:
In the three-dimensional geometry, vector a and vector b is a vector cross product result, more familiar, it is called the normal vector, the vector perpendicular to the plane of vectors a and b thereof.
In the 3D image learning, the cross product is useful, with the through cross product of two vectors, to generate a third vertical a, b of the normal vector to construct X, Y, Z coordinate system.
In two-dimensional space, there is another cross product is a geometrical meaning: aXb equal to the parallel quadrilateral vector a and vector b constituting the area.