HALCON Reference Manual 10.0.2
Table of Contents / Tools / Geometry ClassesClassesClasses | | | Operators

angle_lxangle_lxangle_lxAngleLxAngleLx (Operator)

Name

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

Signature

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

Herror angle_lx(double Row1, double Column1, double Row2, double Column2, double* Angle)

Herror T_angle_lx(const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2, Htuple* Angle)

Herror angle_lx(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, double* Angle)

Herror angle_lx(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* Angle)

void HOperatorSetX.AngleLx(
[in] VARIANT Row1, [in] VARIANT Column1, [in] VARIANT Row2, [in] VARIANT Column2, [out] VARIANT* Angle)

VARIANT HMiscX.AngleLx(
[in] VARIANT Row1, [in] VARIANT Column1, [in] VARIANT Row2, [in] VARIANT Column2)

static void HOperatorSet.AngleLx(HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple angle)

static HTuple HMisc.AngleLx(HTuple row1, HTuple column1, HTuple row2, HTuple column2)

static double HMisc.AngleLx(double row1, double column1, double row2, double column2)

Description

The operator angle_lxangle_lxangle_lxAngleLxAngleLx calculates the angle between one line and the horizontal axis. As input the coordinates of two points on the line (Row1Row1Row1Row1row1,Column1Column1Column1Column1column1, Row2Row2Row2Row2row2,Column2Column2Column2Column2column2) are expected. The calculation is performed as follows: We interprete the line as a vector with starting point Row1Row1Row1Row1row1,Column1Column1Column1Column1column1 and end point Row2Row2Row2Row2row2,Column2Column2Column2Column2column2. 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 AngleAngleAngleAngleangle returns the angle in radians, ranging from -pi <= AngleAngleAngleAngleangle <= pi.

Parallelization

Parameters

Row1Row1Row1Row1row1 (input_control)  point.y(-array) HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate the first point of the line.

Column1Column1Column1Column1column1 (input_control)  point.x(-array) HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the first point of the line.

Row2Row2Row2Row2row2 (input_control)  point.y(-array) HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Row coordinate of the second point of the line.

Column2Column2Column2Column2column2 (input_control)  point.x(-array) HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Column coordinate of the second point of the line.

AngleAngleAngleAngleangle (output_control)  real(-array) HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

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_lxangle_lxangle_lxAngleLxAngleLx returns 2 (H_MSG_TRUE).

Alternatives

angle_llangle_llangle_llAngleLlAngleLl

Module

Foundation


Table of Contents / Tools / Geometry ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH