Operators

# angle_lx (Operator)

## Name

angle_lx — Calculate the angle between one line and the horizontal axis.

## Signature

angle_lx( : : Row1, Column1, Row2, Column2 : Angle)

## Description

The operator angle_lx calculates the angle between one line and the horizontal axis. As input the coordinates of two points on the line (Row1,Column1, Row2,Column2) are expected. The calculation is performed as follows: We interprete the line as a vector with starting point Row1,Column1 and end point Row2,Column2. The starting point is on the horizontal axis and defines the center of rotation in the following consideration. If the end point is above the horizontal axis, the angle (with positive sign) results from the rotation of the horizontal axis in counter clockwise direction onto the vector. If the end point is below the horizontal axis, the angle (with negative sign) results from the rotation of the horizontal axis in clockwise direction onto the vector. The result depends on the order of the two points defining the line. The parameter Angle returns the angle in radians, ranging from -pi <= Angle < pi.

## Parallelization

• Multithreading type: reentrant (runs in parallel with non-exclusive operators).
• Processed without parallelization.

## Parameters

Row1 (input_control)  point.y(-array) (real / integer)

Row coordinate the first point of the line.

Column1 (input_control)  point.x(-array) (real / integer)

Column coordinate of the first point of the line.

Row2 (input_control)  point.y(-array) (real / integer)

Row coordinate of the second point of the line.

Column2 (input_control)  point.x(-array) (real / integer)

Column coordinate of the second point of the line.

Angle (output_control)  real(-array) (real)

Angle between the line and the horizontal axis [rad].

## Example (HDevelop)

```RowX1 := 255
ColumnX1 := 10
RowX2 := 255
ColumnX2 := 501
disp_line (WindowHandle, RowX1, ColumnX1, RowX2, ColumnX2)
Row1 := 255
Column1 := 255
for i := 1 to 360 by 1
Row2 := 255 + sin(rad(i)) * 200
Column2 := 255 + cos(rad(i)) * 200
disp_line (WindowHandle, Row1, Column1, Row2, Column2)
angle_lx (Row1, Column1, Row2, Column2, Angle)
endfor
```

## Result

angle_lx returns 2 (H_MSG_TRUE).

## Module

Foundation

 Operators