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

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.


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)
number(-array) -> real
Angle between the line and the abscissa [rad].


Example
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).


Parallelization Information

angle_lx is reentrant and processed without parallelization.


Alternatives

angle_ll


Module

Foundation


Up: Tools/Geometry    Top: HALCON Operators
Copyright © 1996-2008 MVTec Software GmbH