Back to Aurora Vision Library website

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

NormalizeSegmentOrientation_ByCoordinate


Header: AVL.h
Namespace: avl
Module: FoundationLite

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

Syntax

C++
C#
 
void avl::NormalizeSegmentOrientation_ByCoordinate
(
	const avl::Segment2D& inSegment,
	const avl::Axis::Type inAxis,
	avl::Segment2D& outSegment
)

Parameters

Name Type Default Description
Input value inSegment const Segment2D&
Input value inAxis const Axis::Type X An axis relative to which coordinates are compared
Output value 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.

See Also