Skip to content

length_xldLengthXldLengthXldlength_xldlength_xld🔗

Short description🔗

length_xldLengthXldLengthXldlength_xldlength_xld — Length of contours or polygons.

Signature🔗

length_xld( xld XLD, out real Length )void LengthXld( const HObject& XLD, HTuple* Length )static void HOperatorSet.LengthXld( HObject XLD, out HTuple length )def length_xld( xld: HObject ) -> Sequence[float]

def length_xld_s( xld: HObject ) -> floatHerror length_xld( const Hobject XLD, double* Length )

Herror T_length_xld( const Hobject XLD, Htuple* Length )

HTuple HXLD::LengthXld( ) const

HTuple HXLD.LengthXld( )

Description🔗

length_xldLengthXld calculates the length of the contours or polygons XLDXLDxld. The length is calculated as the sum of the Euclidean distances of successive points on the contour or polygon. 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 XLDXLDxld.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

Parameters🔗

XLDXLDxld (input_object) xld(-array) → objectHObjectHXLDHObjectHobject

Contours or polygons to be examined.

Lengthlengthlength (output_control) real(-array) → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Length of the contour or polygon.

Assertion: Length >= 0

Complexity🔗

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

Result🔗

length_xldLengthXld 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>:). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

gen_contours_skeleton_xldGenContoursSkeletonXld, smooth_contours_xldSmoothContoursXld, gen_polygons_xldGenPolygonsXld

See also

area_center_xldAreaCenterXld, moments_any_xldMomentsAnyXld, moments_xldMomentsXld, contlengthContlength

Module🔗

Foundation