Owning Palette: Computational Geometry VIs
Requires: Full Development System
Computes the centroid of a polygon.
If either input contains NaN or Inf, the VI returns NaN to Centroid X and Centroid Y, and it also returns an error. If the polygon degenerates to a line, the VI returns NaN to Centroid X and Centroid Y without an error.
Add to the block diagram | Find on the palette |
X specifies the x-coordinates of the vertices of the polygon. The length of X must be greater than or equal to 3. | |
Y specifies the y-coordinates of the vertices of the polygon. The length of Y must equal the length of X. | |
Centroid X returns the x-coordinate of the centroid. | |
Centroid Y returns the y-coordinate of the centroid. | |
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster. |
The centroid of a polygon is the arithmetic mean of all vertices in the polygon. Any line through the centroid divides the polygon with equal area.