F_VN_LineIntersectionPointAndAngle

F_VN_LineIntersectionPointAndAngle 1:

Computes the intersection point and angle between two lines (returns S_FALSE if the provided lines are parallel).

Syntax

Definition:

FUNCTION F_VN_LineIntersectionPointAndAngle : HRESULT
VAR_IN_OUT
    aLine1          : TcVnVector4_LREAL;
    aLine2          : TcVnVector4_LREAL;
    aIntersecPoint  : TcVnPoint2_REAL;
    fAngle          : REAL;
END_VAR
VAR_INPUT
    bAngleInDegrees : BOOL;
    hrPrev          : HRESULT;
END_VAR

F_VN_LineIntersectionPointAndAngle 2: Inputs

Name

Type

Description

bAngleInDegrees

BOOL

If TRUE, fAngle is in degrees. If FALSE, fAngle is in radians.

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_LineIntersectionPointAndAngle 3: In/Outputs

Name

Type

Description

aLine1

TcVnVector4_LREAL

First line. The first and second element describe the x and y component of a vector collinear to the line. The third and fourth element describe the x and y component of a point on the line.

aLine2

TcVnVector4_LREAL

Second line. The first and second element describe the x and y component of a vector collinear to the line. The third and fourth element describe the x and y component of a point on the line.

aIntersecPoint

TcVnPoint2_REAL

Returns the intersection point of aLine1 and aLine2.

fAngle

REAL

Returns the intersection angle of aLine1 and aLine2.

F_VN_LineIntersectionPointAndAngle 4: Return value

HRESULT

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision