Back to FabImage Library Lite websiteYou are here:
Start »
Geometry 2D »
Geometry 2D Features »
SegmentOrientation
Header: |
FIL.h
|
Namespace: |
fil |
Computes the orientation of a segment.
Syntax
void fil::SegmentOrientation
(
const fil::Segment2D& inSegment,
fil::AngleRange::Type inAngleRange,
float& outOrientationAngle
)
Parameters
|
Name |
Type |
Default |
Description |
 |
inSegment |
const Segment2D& |
|
|
 |
inAngleRange |
AngleRange::Type |
_0_180 |
Switches between 0-90, 0-180 or 0-360 degrees |
 |
outOrientationAngle |
float& |
|
|
Description
Note that because of inaccuracies of floating-point arithmetic, some geometric operations (including this one) may lead to unpredictable results for degenerated cases. In this filter such a case occurs when an empty segment is given on input.
Examples
SegmentOrientation performed on a segment with parameters: X1 = 50, Y1 = 50, X2 = 300, Y2 = 300 and inAngleRange set to _0_180.
outOrientationAngle returns 45.