ClassesClassesClassesClasses | | | | Operators

area_center_points_xldarea_center_points_xldAreaCenterPointsXldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld (Operator)

Name

area_center_points_xldarea_center_points_xldAreaCenterPointsXldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld — Area and center of gravity (centroid) of contours and polygons treated as point clouds.

Signature

area_center_points_xld(XLD : : : Area, Row, Column)

Herror area_center_points_xld(const Hobject XLD, double* Area, double* Row, double* Column)

Herror T_area_center_points_xld(const Hobject XLD, Htuple* Area, Htuple* Row, Htuple* Column)

Herror area_center_points_xld(Hobject XLD, double* Area, double* Row, double* Column)

Herror area_center_points_xld(Hobject XLD, HTuple* Area, HTuple* Row, HTuple* Column)

double HXLD::AreaCenterPointsXld(double* Row, double* Column) const

HTuple HXLDArray::AreaCenterPointsXld(HTuple* Row, HTuple* Column) const

void AreaCenterPointsXld(const HObject& XLD, HTuple* Area, HTuple* Row, HTuple* Column)

HTuple HXLD::AreaCenterPointsXld(HTuple* Row, HTuple* Column) const

double HXLD::AreaCenterPointsXld(double* Row, double* Column) const

void HOperatorSetX.AreaCenterPointsXld(
[in] IHUntypedObjectX* XLD, [out] VARIANT* Area, [out] VARIANT* Row, [out] VARIANT* Column)

VARIANT HXLDX.AreaCenterPointsXld(
[out] VARIANT* Row, [out] VARIANT* Column)

VARIANT HXLDContX.AreaCenterPointsXld(
[out] VARIANT* Row, [out] VARIANT* Column)

VARIANT HXLDPolyX.AreaCenterPointsXld(
[out] VARIANT* Row, [out] VARIANT* Column)

VARIANT HXLDParaX.AreaCenterPointsXld(
[out] VARIANT* Row, [out] VARIANT* Column)

VARIANT HXLDModParaX.AreaCenterPointsXld(
[out] VARIANT* Row, [out] VARIANT* Column)

VARIANT HXLDExtParaX.AreaCenterPointsXld(
[out] VARIANT* Row, [out] VARIANT* Column)

static void HOperatorSet.AreaCenterPointsXld(HObject XLD, out HTuple area, out HTuple row, out HTuple column)

HTuple HXLD.AreaCenterPointsXld(out HTuple row, out HTuple column)

double HXLD.AreaCenterPointsXld(out double row, out double column)

Description

area_center_points_xldarea_center_points_xldAreaCenterPointsXldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld calculates the area and center of gravity (centroid) of the point clouds given by contours or polygons XLDXLDXLDXLDXLDXLD (i.e., the order of the points in the contour or polygon is not taken into account). The area corresponds to the number of points in the point cloud. The centroid is given by the arithmetic mean of all points. If the contour or polygon is closed (end point = start point), the end point of the contour or polygon is not taken into account to avoid that it receives twice the weight of the other points.

area_center_points_xldarea_center_points_xldAreaCenterPointsXldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld should be used if the contour XLDXLDXLDXLDXLDXLD intersects itself or if it is not possible to close the contour using a line from end to start point without self-intersection, because in this case area_center_xldarea_center_xldAreaCenterXldarea_center_xldAreaCenterXldAreaCenterXld does not produce useful results. To test whether the contours or polygons intersect themselves, test_self_intersection_xldtest_self_intersection_xldTestSelfIntersectionXldtest_self_intersection_xldTestSelfIntersectionXldTestSelfIntersectionXld can be used.

If more than one contour or polygon is passed, the results are stored in tuples in the same order as the respective contours or polygons in XLDXLDXLDXLDXLDXLD.

Attention

Even if the contour or polygon XLDXLDXLDXLDXLDXLD is not intersecting itself, the result of area_center_points_xldarea_center_points_xldAreaCenterPointsXldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld significantly differs from the result of area_center_xldarea_center_xldAreaCenterXldarea_center_xldAreaCenterXldAreaCenterXld as it is calculated from the point cloud and not from the enclosed region.

Parallelization

Parameters

XLDXLDXLDXLDXLDXLD (input_object)  xld(-array) objectHXLDHXLDHXLDHXLDXHobject

Point clouds to be examined in form of contours or polygons.

AreaAreaAreaAreaAreaarea (output_control)  real(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Area of the point cloud.

RowRowRowRowRowrow (output_control)  point.y(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Row coordinate of the centroid.

ColumnColumnColumnColumnColumncolumn (output_control)  point.x(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Column coordinate of the centroid.

Complexity

Let n be the number of points of the contour or polygon. Then the run time is O(n).

Result

area_center_points_xldarea_center_points_xldAreaCenterPointsXldarea_center_points_xldAreaCenterPointsXldAreaCenterPointsXld returns 2 (H_MSG_TRUE) if the input is not empty. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld, smooth_contours_xldsmooth_contours_xldSmoothContoursXldsmooth_contours_xldSmoothContoursXldSmoothContoursXld, gen_polygons_xldgen_polygons_xldGenPolygonsXldgen_polygons_xldGenPolygonsXldGenPolygonsXld

Alternatives

area_center_xldarea_center_xldAreaCenterXldarea_center_xldAreaCenterXldAreaCenterXld

See also

moments_points_xldmoments_points_xldMomentsPointsXldmoments_points_xldMomentsPointsXldMomentsPointsXld, moments_any_points_xldmoments_any_points_xldMomentsAnyPointsXldmoments_any_points_xldMomentsAnyPointsXldMomentsAnyPointsXld, area_centerarea_centerAreaCenterarea_centerAreaCenterAreaCenter, moments_region_2ndmoments_region_2ndMomentsRegion2ndmoments_region_2ndMomentsRegion2ndMomentsRegion2nd

Module

Foundation


ClassesClassesClassesClasses | | | | Operators