FC_AngleBetweenVectors3D

 

FC_AngleBetweenVectors3D - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculating the angle between two vectors in the 3-dimensional space.

Description

A smaller angle between the vectors is calculated in angular degrees. The result always is a value between 0° and 180°. If the length of a vector is 0, an error is issued.

Interface

Input

Data type

Description

i_stV1

ST_Vector3D

Vector for the first ray of the angle

i_stV2

ST_Vector3D

Vector for the second ray of the angle

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

LREAL

Angle between the vectors i_stV1 and i_stV2 (Unit: degrees)

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The angle has been calculated successfully.