Operators

# angle_ll (Operator)

## Name

angle_ll — Calculate the angle between two lines.

## Signature

angle_ll( : : RowA1, ColumnA1, RowA2, ColumnA2, RowB1, ColumnB1, RowB2, ColumnB2 : Angle)

## Description

The operator angle_ll calculates the angle between two lines. As input the coordinates of to points on the first line (RowA1,ColumnA1, RowA2,ColumnA2) and on the second line (RowB1,ColumnB1, RowB2,ColumnB2) are expected. The calculation is performed as follows: We interpret the lines as vectors with starting points RowA1,ColumnA1 and RowB1,ColumnB1 and end points RowA2,ColumnA2 and RowB2,ColumnB2, respectively. Rotating the vector A counter clockwise onto the vector B (the center of rotation is the intersection point of the two lines) yields the angle. The result depends on the order of the points and on the order of the lines. 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

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

Row coordinate of the first point of the first line.

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

Column coordinate of the first point of the first line.

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

Row coordinate of the second point of the first line.

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

Column coordinate of the second point of the first line.

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

Row coordinate of the first point of the second line.

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

Column coordinate of the first point of the second line.

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

Row coordinate of the second point of the second line.

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

Column coordinate of the second point of the second line.

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

## Example (HDevelop)

```RowA1 := 255
ColumnA1 := 10
RowA2 := 255
ColumnA2 := 501
disp_line (WindowHandle, RowA1, ColumnA1, RowA2, ColumnA2)
RowB1 := 255
ColumnB1 := 255
for i := 1 to 360 by 1
RowB2 := 255 + sin(rad(i)) * 200
ColumnB2 := 255 + cos(rad(i)) * 200
disp_line (WindowHandle, RowB1, ColumnB1, RowB2, ColumnB2)
angle_ll (RowA1, ColumnA1, RowA2, ColumnA2, \
RowB1, ColumnB1, RowB2, ColumnB2, Angle)
endfor
```

## Result

angle_ll returns 2 (H_MSG_TRUE).

## Module

Foundation

 Operators