Calculate the angle between one line and the vertical axis.
The operator angle_lx calculates the angle between one line and the abscissa. 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. Rotating the vector counter clockwise onto the abscissa (center of rotation is the intersection point of the abscissa) yields the angle. The result depends of the order of the points on line. The parameter Angle returns the angle in radians, ranging from -pi <= Angle <= pi.
|
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) |
number(-array) -> real |
| Angle between the line and the abscissa [rad]. | |
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
angle_lx returns 2 (H_MSG_TRUE).
angle_lx is reentrant and processed without parallelization.
Foundation