Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Geometry 2D Normalizations » NormalizeSegmentOrientation_ByCoordinate

NormalizeSegmentOrientation_ByCoordinate


Changes orientation of the given segment according to coordinates along selected axis.

Name Type Description
inSegment Segment2D
inAxis Axis An axis relative to which coordinates are compared
outSegment Segment2D A segment in which the first point will have smaller coordinate along the selected axis

Description

This operation changes the orientation of the inSegment segment according to the coordinates of the input segment's vertices. The first point in the outSegment will have smaller coordinate along selected axis.

Examples

Let's consider two cases with the same input segment, but different inAxis. The coordinates of the segment are as follows:
inSegment.Point1.X201,000
inSegment.Point1.Y100,000
inSegment.Point2.X100,000
inSegment.Point2.Y199,000
  1. Let's assume the inAxis to be X axis.

    The coordinates along X axis are 201 and 100. Obviously, 100 is smaller than 201, so the resulting segment will have reversed vertices. The coordinates will be as follows:
    inSegment.Point2.X100,000
    inSegment.Point2.Y199,000
    inSegment.Point1.X201,000
    inSegment.Point1.Y100,000
  2. Now, let's assume the inAxis to be Y axis.

    The coordinates along Y axis are 100 and 199. As in the previous case, 100 is smaller than 199, so the resulting segment will have the same coordinates as inSegment.

Complexity Level

This filter is available on Basic Complexity Level.

Filter Group

This filter is member of NormalizeSegment filter group.

See Also