Learn the high number of students, will learn the outer product of the vector, but also know that it has a use, you can find triangular area.
• Geometrical meaning of the outer product: The parallelogram area of α and β spanned
• By the method of Triangle area can be generalized to the convex polygon area, from a fixed point, to the other points of the auxiliary line, so it is divided into a number of triangles, the use of the formula to find the area of each triangle can be added. Code implementation: But this method has limitations, only to find the area of convex polygons, for concave polygon seems to be no. Here again to provide a concave and convex are suitable for the method, but I also do not understand, if the great God saw, I would like to enlighten, now thanked. double Area (int n)//Calculate polygon size, bump polygon can be {int i; double s; s = p[0].y * (p[n-1].x-p[1].x); for (i=1; i<n) ; i++) S+=p[i].y * (p[i-1].x-p[(i+1)%n].x) if (s<0) s=s* (-1.0); return 1.0*S/2; • Come here, this is the first time to write this, if there is a mistake please understand, give the proposal.
The method of calculating polygon area