Skip to content

gen_circle_sectorGenCircleSectorGenCircleSectorgen_circle_sectorgen_circle_sector🔗

Short description🔗

gen_circle_sectorGenCircleSectorGenCircleSectorgen_circle_sectorgen_circle_sector — Create a circle sector.

Signature🔗

gen_circle_sector( out region CircleSector, coordinates.y Row, coordinates.x Column, number Radius, angle.rad StartAngle, angle.rad EndAngle )void GenCircleSector( HObject* CircleSector, const HTuple& Row, const HTuple& Column, const HTuple& Radius, const HTuple& StartAngle, const HTuple& EndAngle )static void HOperatorSet.GenCircleSector( out HObject circleSector, HTuple row, HTuple column, HTuple radius, HTuple startAngle, HTuple endAngle )def gen_circle_sector( row: MaybeSequence[Union[int, float]], column: MaybeSequence[Union[int, float]], radius: MaybeSequence[Union[int, float]], start_angle: MaybeSequence[Union[int, float]], end_angle: MaybeSequence[Union[int, float]] ) -> HObject

Herror gen_circle_sector( Hobject* CircleSector, double Row, double Column, double Radius, double StartAngle, double EndAngle )

Herror T_gen_circle_sector( Hobject* CircleSector, const Htuple Row, const Htuple Column, const Htuple Radius, const Htuple StartAngle, const Htuple EndAngle )

void HRegion::HRegion( const HTuple& Row, const HTuple& Column, const HTuple& Radius, const HTuple& StartAngle, const HTuple& EndAngle )

void HRegion::HRegion( double Row, double Column, double Radius, double StartAngle, double EndAngle )

public HRegion( HTuple row, HTuple column, HTuple radius, HTuple startAngle, HTuple endAngle )

public HRegion( double row, double column, double radius, double startAngle, double endAngle )

void HRegion::GenCircleSector( const HTuple& Row, const HTuple& Column, const HTuple& Radius, const HTuple& StartAngle, const HTuple& EndAngle )

void HRegion::GenCircleSector( double Row, double Column, double Radius, double StartAngle, double EndAngle )

void HRegion.GenCircleSector( HTuple row, HTuple column, HTuple radius, HTuple startAngle, HTuple endAngle )

void HRegion.GenCircleSector( double row, double column, double radius, double startAngle, double endAngle )

Description🔗

The operator gen_circle_sectorGenCircleSector generates one or more circles sectors described by the center, Radiusradiusradius, StartAnglestartAnglestart_angle and EndAngleendAngleend_angle. If several circle sectors shall be generated the coordinates must be passed in the form of tuples.

gen_circle_sectorGenCircleSector only creates symmetric circle sectors with respect to the center of coordinates. To achieve this, the radius is internally rounded down to a multiple of 0.5. If an integer number is specified for the radius (i.e., 1, 2, 3, …) an even diameter is obtained, and hence the circle can only be symmetric with respect to a center with coordinates that have a fractional part of 0.5. Consequently, internally the coordinates of the center are adapted to the closest coordinates that have a fractional part of 0.5. Here, integer coordinates are rounded down to the next smaller values with a fractional part of 0.5. For odd diameters (i.e., radius = 1.5, 2.5, 3.5, …), the circle can only be symmetric with respect to a center with integer coordinates. Hence, internally the coordinates of the center are rounded to the nearest integer coordinates. It should be noted that the above algorithm may lead to the fact that circles with an even diameter are not contained in circles with the next larger odd diameter, even if the coordinates specified in Rowrowrow and Columncolumncolumn are identical. The angles are given in radians in mathematically positive direction. See the examples illustrated in the figure below. Note, 'rad(360)'"rad(360)" is equivalent to 00. As a consequence a sector with StartAnglestartAnglestart_angle = 00 and EndAngleendAngleend_angle = 'rad(360)'"rad(360)" results in an empty region.

Illustration of different possible angle combinations.

If the circle extends beyond the image edge it is clipped to the current image format if the value of the system flag 'clip_region'"clip_region" is set to 'true'"true" (set_systemSetSystem).

Parameter Broadcasting🔗

This operator supports parameter broadcasting. This means that each parameter can be given as a tuple of length 1 or N. Parameters with tuple length 1 will be repeated internally such that the number of created items is always N.

Execution information🔗

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

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

  • Processed without parallelization.

Parameters🔗

CircleSectorcircleSectorcircle_sector (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Generated circle sector.

Rowrowrow (input_control) coordinates.y(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Line index of center.

Default: 200.0200.0
Suggested values: 0.0, 10.0, 50.0, 100.0, 200.0, 300.00.0, 10.0, 50.0, 100.0, 200.0, 300.0
Value range: Row (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Columncolumncolumn (input_control) coordinates.x(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Column index of center.

Default: 200.0200.0
Suggested values: 0.0, 10.0, 50.0, 100.0, 200.0, 300.00.0, 10.0, 50.0, 100.0, 200.0, 300.0
Value range: Column (lin)
Minimum increment: 1.0
Recommended increment: 10.0

Radiusradiusradius (input_control) number(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Radius of circle.

Default: 100.5100.5
Suggested values: 1.0, 1.5, 2.0, 2.5, 3, 3.5, 4, 4.5, 5.5, 6.5, 7.5, 9.5, 11.5, 15.5, 20.5, 25.5, 31.5, 50.51.0, 1.5, 2.0, 2.5, 3, 3.5, 4, 4.5, 5.5, 6.5, 7.5, 9.5, 11.5, 15.5, 20.5, 25.5, 31.5, 50.5
Value range: Radius (lin)
Minimum increment: 1.0
Recommended increment: 10.0
Restriction: Radius > 0.0

StartAnglestartAnglestart_angle (input_control) angle.rad(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

Start angle of the circle sector.

Default: 0.00.0
Suggested values: 0.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.283180.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.28318
Value range: 0 ≤ StartAngle ≤ 6.28318 (lin)

EndAngleendAngleend_angle (input_control) angle.rad(-array) → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[int, float]]Htuple (double / Hlong)

End angle of the circle sector.

Default: 3.141593.14159
Suggested values: 0.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.283180.0, 0.785398, 1.5708, 2.35619, 3.14159, 3.92699, 4.71239, 5.49779, 6.28318
Value range: 0 ≤ EndAngle ≤ 6.28318 (lin)

Example🔗

(HDevelop)

read_image(Image,'fabrik')
gen_circle_sector(CircleSector,300.0,200.0,150.5,0,rad(120))
reduce_domain(Image,CircleSector,Mask)
dev_clear_window ()
dev_display (Mask)

Complexity🔗

Runtime complexity: \(O(\textrm{Radius} * 2)\)

Storage complexity (byte): \(O(\textrm{Radius} * 8)\)

Result🔗

If the parameter values are correct, the operator gen_circle_sectorGenCircleSector returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised. The clipping according to the current image format is set via the operator set_system('clip_region',<'true'/'false'>). If an empty region is created by clipping (the circle is completely outside of the image format) the operator set_system('store_empty_region',<'true'/'false'>) determines whether the empty region is put out.

Combinations with other operators🔗

Combinations

Possible successors

paint_regionPaintRegion, reduce_domainReduceDomain

Alternatives

gen_ellipseGenEllipse, gen_ellipse_sectorGenEllipseSector, gen_region_polygon_filledGenRegionPolygonFilled, gen_region_pointsGenRegionPoints, gen_region_runsGenRegionRuns, draw_circleDrawCircle

See also

disp_circleDispCircle, disp_regionDispRegion, set_shapeSetShape, smallest_circleSmallestCircle, reduce_domainReduceDomain

Module🔗

Foundation