| Table of Contents / Tools / Geometry | Operators |
angle_lx — Calculate the angle between one line and the horizontal axis.
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. Rotating the vector counter clockwise onto the horizontal axis (center of rotation is the intersection point of the horizontal axis) yields the angle. 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.
Row coordinate the first point of the line.
Column coordinate of the first point of the line.
Row coordinate of the second point of the line.
Column coordinate of the second point of the line.
Angle between the line and the horizontal axis [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).
Foundation
| Table of Contents / Tools / Geometry | Operators |
| HALCON Reference Manual 10.0.2 | Copyright © 1996-2011 MVTec Software GmbH |