FC_CommonPointOfTwoLines2D - General Information
Type: |
Function |
Available as of: |
V1.0.3.0 |
Versions: |
Current version |
Calculates the intersection of two straight lines in the 2-dimensional space.
This function calculates the intersections of two straight lines in the 2-dimensional space. The function also takes into account cases of parallel or coinciding straight lines. The following parameter representation is used for the straight lines:
Line1(Parameter1) = i_stLine1.stPoint1 + Parameter1 * (i_stLine1.stPoint2 - i_stLine1.stPoint1)
Line2(Parameter2) = i_stLine2.stPoint1 + Parameter2 * (i_stLine2.stPoint2 - i_stLine2.stPoint1)
Output |
Data type |
Description |
---|---|---|
q_etDiag |
General library-independent statement on the diagnostic. A value not equal to ET_Diag.Ok corresponds to an diagnostic message. |
|
q_etDiagExt |
POU-specific output on the diagnostic. q_etDiag = ET_Diag.Ok -> Status message q_etDiag <> ET_Diag.Ok -> Diagnostic message |
|
q_diNumberOfCommonPoints |
DINT |
Number of intersections Possible values: 0: There is no intersection, the straight lines are parallel and do not coincide. 1: There is exactly one intersection. 99: The straight lines coincide, i.e. there is an infinite number of intersections. |
q_stCommonPoint |
Intersection of the straight line, if q_diNumberOfCommonPoints = 1. |
|
q_lrParameterLine1 |
LREAL |
Parameter of the intersection q_stCommonPoint in the above parameter representation of the straight line 1 (only if q_diNumberOfCommonPoints = 1) |
q_lrParameterLine2 |
LREAL |
Parameter of the intersection q_stCommonPoint in the above parameter representation of the straight line 2 (only if q_diNumberOfCommonPoints = 1) |
q_etDiag |
q_etDiagExt |
Enumeration value |
Description |
---|---|---|---|
OK |
0 |
Ok |
|
InputParameterInvalid |
32 |
The definition of Line1 is not correct. |
|
InputParameterInvalid |
33 |
The definition of Line2 is not correct. |
Enumeration name: |
DefinitionLine1 |
Enumeration value: |
32 |
Description: |
The definition of Line1 is not correct. |
Issue |
Cause |
Solution |
---|---|---|
- |
At the inputs i_stLine1.stPoint1 and i_stLine1.stPoint2, the same point has been transferred. |
The distance between the points stPoint1 and stPoint2 which define the straight line i_stLine1 must be at least Gc_lrZeroTolerance. |
Enumeration name: |
DefinitionLine2 |
Enumeration value: |
33 |
Description: |
The definition of Line2 is not correct. |
Issue |
Cause |
Solution |
---|---|---|
- |
At the inputs i_stLine2.stPoint1 and i_stLine2.stPoint2, the same point has been transferred. |
The distance between the points stPoint1 and stPoint2 which define the straight line i_stLine2 must be at least Gc_lrZeroTolerance. |
Enumeration name: |
Ok |
Enumeration value: |
0 |
Description: |
Ok |
The intersection has been calculated successfully.