0.000 0.0000.500 1.0000.500 1.000
Prerequisite Knowledge:
1.1 accumulation and center of gravity
The set plane has n discrete data points (xi, yi) (i = 1, 2,., n), which
The polygon center of gravity g (. x1,. Y1) is:
This is the simplest and most intuitive way to find polygons. Can directly utilize discrete numbers
The X-and y-coordinates of a stronghold can be a graphical center of gravity. But the flaw is that there is no discrete
Data points around the graphics to do any processing and analysis, precision is not enough.
1.2 algorithm one: In speaking of the algorithm, we must first understand the following theorems.
Theorem 1 The vertex coordinates of the known triangle A1A2A3 ai (xi, yi) (i = 1, 2, 3). Its center of gravity coordinates are:
XG = (x1+x2+x3)/3; YG = (y1+y2+y3)/3;
Theorem 2 The vertex coordinates of the known triangle A1A2A3 ai (xi, yi) (i = 1, 2, 3). The area of the triangle is:
S = ((x2-x1) * (y3-y1)-(x3-x1) * (Y2-Y1))/2;
A1A2A3 boundary form Counterclockwise loop when Take +, clockwise time to take-.
In addition, in the process of solving, it is not necessary to consider whether the input order of points is clockwise or counterclockwise, and the division is offset.
Principle: Divide the polygon into N small area, each small area area is Ōi, the center of gravity is GI (. xi,. Yi), using the plane thin plate center of gravity formula to change the integral
into cumulative and:
The general center of gravity formula for the polygon around discrete data points can be obtained by the principle and mathematical theorem presented above: any n-sided a1a2 with the AI (xi, yi) (i = 1, 2,., n) as the vertex. An, dividing it into N-2 triangles (1). The center of gravity for each triangle is GI (. xi,. Yi), with an area of Ōi. Then the center of gravity coordinates g (. x2,. y2) of the polygon are:
Figure 1 Polygon decomposition