FC_DistancePointFromLine3D

 

FC_DistancePointFromLine3D - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates the distance of a point from a straight line in a 3-dimensional space.

Description

This calculates the distance of the point i_stPoint from the straight line i_stLine. In addition, the perpendicular of the point onto the straight line is calculated.

Interface

Input

Data type

Description

i_stPoint

ST_Vector3D

Point

i_stLine

ST_Line3D

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_lrDistance

LREAL

Calculated distance of the point i_stPoint from the straight line i_stLine.

q_lrParameter

LREAL

Parameter of the perpendicular iq_stPerpendicular in the general parameter representation of the straight line i_stLine (see ST_Line3D).

q_stPerpendicular

ST_Vector3D

Perpendicular of the point i_stPoint onto the straight line i_stLine.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

DefinitionLine

31

The definition of Line is not correct.

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 distance has been calculated successfully.