-
Notifications
You must be signed in to change notification settings - Fork 99
polylineCentroid
David Legland edited this page Feb 28, 2022
·
1 revision
Computes the centroid of a curve defined by a series of points.
PT = polylineCentroid(POINTS);
Computes center of mass of a polyline defined by POINTS
. POINTS
is a
N-by-D array of double, representing a set of N points in a
D-dimensional space.
PT = polylineCentroid(PTX, PTY);
PT = polylineCentroid(PTX, PTY, PTZ);
Specifies points as separate column vectors
PT = polylineCentroid(..., TYPE);
Specifies if the last point is connected to the first one. TYPE
can be
either 'closed' or 'open'.
poly = [0 0;10 0;10 10;20 10];
polylineCentroid(poly)
Result:
ans =
[10 5]