FC_CommonPointsOfCircleAndLine2D

 

FC_CommonPointsOfCircleAndLine2D - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates the intersections of a circle and a straight line in the 2-dimensional space.

Description

This calculates the intersections of the circle i_stCircle and the straight line i_stLine.

Interface

Input

Data type

Description

i_stCircle

ST_Circle2D

circle

i_stLine

ST_Line2D

Straight

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an diagnostic message.

q_etDiagExt

ET_DiagExt

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 common points Possible values:

2: There are two intersections (the straight line is a secant). This includes the case of a tangent (in such a case the following holds: q_astCommonPoints[1] = q_astCommonPoints[2]).

0: There are no intersections (the straight line is a passant).

q_astCommonPoints

ARRAY [1..2] OF ST_Vector2D

Intersections of i_stCircle and i_stLine (if q_diNumberOfCommonPoints = 2)

q_lrParameterLine1

LREAL

Parameters of q_astCommonPoint[1] in the default parameter representation of the straight line i_stLine (see ST_Line2D).

q_lrParameterLine2

LREAL

Parameters of q_astCommonPoint[2] in the default parameter representation of the straight line i_stLine (see ST_Line2D).

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

DefinitionLine

31

The definition of Line is not correct.

InputParameterInvalid

RadiusRangeCircle

26

The radius of the circle is outside the valid range.

DefinitionLine

Enumeration name:

DefinitionLine

Enumeration value:

31

Description:

The definition of Line is not correct.

Issue

Cause

Solution

-

At the inputs i_stLine.stPoint1 and i_stLine.stPoint2, the same point has been transferred.

The distance between the points stPoint1 and stPoint2 which define the straight line i_stLine must be at least Gc_lrZeroTolerance.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The intersections have been calculated successfully.

RadiusRangeCircle

Enumeration name:

RadiusRangeCircle

Enumeration value:

26

Description:

The radius of the circle is outside the valid range.

Issue

Cause

Solution

-

At the input i_stCircle.lrRadius, a number <= 0 has been transferred.

The radius of the circle must be greater than zero.