FC_CircleThroughThreePoints2D

 

FC_CircleThroughThreePoints2D - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates a circle in the 2-dimensional space which passes through three specified points.

Description

Three points which must not be located on a straight line are specified in the 2-dimensional space. This function calculates the center and radius of the circle which passes through these three points.

Interface

Input

Data type

Description

i_stPoint1

ST_Vector2D

Point 1 which the circle is to pass through

i_stPoint2

ST_Vector2D

Point 2 which the circle is to pass through

i_stPoint3

ST_Vector2D

Point 3 which the circle is to pass through

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

Return Value

Data type

Description

ST_Circle2D

Calculated circle which passes through the three specified points

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

PointsCollinear

20

The points are located on a straight line.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The circle has been calculated successfully.

PointsCollinear

Enumeration name:

PointsCollinear

Enumeration value:

20

Description:

The points are located on a straight line.

Issue

Cause

Solution

-

The three points i_stPoint1, i_stPoint2 and i_stPoint3 are located on a straight line.

The three points i_stPoint1, i_stPoint2 and i_stPoint3 must not be located on a straight line.