angle_ll angle_ll AngleLl AngleLl angle_ll (Operator)
Name
angle_ll angle_ll AngleLl AngleLl angle_ll
— Calculate the angle between two lines.
Signature
Herror angle_ll (double RowA1 , double ColumnA1 , double RowA2 , double ColumnA2 , double RowB1 , double ColumnB1 , double RowB2 , double ColumnB2 , double* Angle )
Herror T_angle_ll (const Htuple RowA1 , const Htuple ColumnA1 , const Htuple RowA2 , const Htuple ColumnA2 , const Htuple RowB1 , const Htuple ColumnB1 , const Htuple RowB2 , const Htuple ColumnB2 , Htuple* Angle )
void AngleLl (const HTuple& RowA1 , const HTuple& ColumnA1 , const HTuple& RowA2 , const HTuple& ColumnA2 , const HTuple& RowB1 , const HTuple& ColumnB1 , const HTuple& RowB2 , const HTuple& ColumnB2 , HTuple* Angle )
static HTuple HMisc ::AngleLl (const HTuple& RowA1 , const HTuple& ColumnA1 , const HTuple& RowA2 , const HTuple& ColumnA2 , const HTuple& RowB1 , const HTuple& ColumnB1 , const HTuple& RowB2 , const HTuple& ColumnB2 )
static double HMisc ::AngleLl (double RowA1 , double ColumnA1 , double RowA2 , double ColumnA2 , double RowB1 , double ColumnB1 , double RowB2 , double ColumnB2 )
static void HOperatorSet .AngleLl (HTuple rowA1 , HTuple columnA1 , HTuple rowA2 , HTuple columnA2 , HTuple rowB1 , HTuple columnB1 , HTuple rowB2 , HTuple columnB2 , out HTuple angle )
static HTuple HMisc .AngleLl (HTuple rowA1 , HTuple columnA1 , HTuple rowA2 , HTuple columnA2 , HTuple rowB1 , HTuple columnB1 , HTuple rowB2 , HTuple columnB2 )
static double HMisc .AngleLl (double rowA1 , double columnA1 , double rowA2 , double columnA2 , double rowB1 , double columnB1 , double rowB2 , double columnB2 )
def angle_ll (row_a1 : MaybeSequence[Union[float, int]], column_a1 : MaybeSequence[Union[float, int]], row_a2 : MaybeSequence[Union[float, int]], column_a2 : MaybeSequence[Union[float, int]], row_b1 : MaybeSequence[Union[float, int]], column_b1 : MaybeSequence[Union[float, int]], row_b2 : MaybeSequence[Union[float, int]], column_b2 : MaybeSequence[Union[float, int]]) -> Sequence[float]
def angle_ll_s (row_a1 : MaybeSequence[Union[float, int]], column_a1 : MaybeSequence[Union[float, int]], row_a2 : MaybeSequence[Union[float, int]], column_a2 : MaybeSequence[Union[float, int]], row_b1 : MaybeSequence[Union[float, int]], column_b1 : MaybeSequence[Union[float, int]], row_b2 : MaybeSequence[Union[float, int]], column_b2 : MaybeSequence[Union[float, int]]) -> float
Description
The operator angle_ll angle_ll AngleLl AngleLl angle_ll
calculates the angle between two lines.
As input the coordinates of two points on the first line
(RowA1 RowA1 RowA1 rowA1 row_a1
,ColumnA1 ColumnA1 ColumnA1 columnA1 column_a1
,
RowA2 RowA2 RowA2 rowA2 row_a2
,ColumnA2 ColumnA2 ColumnA2 columnA2 column_a2
) and on the second line
(RowB1 RowB1 RowB1 rowB1 row_b1
,ColumnB1 ColumnB1 ColumnB1 columnB1 column_b1
,
RowB2 RowB2 RowB2 rowB2 row_b2
,ColumnB2 ColumnB2 ColumnB2 columnB2 column_b2
) are expected.
The calculation is performed as follows: We interpret the lines
as vectors with starting points
RowA1 RowA1 RowA1 rowA1 row_a1
,ColumnA1 ColumnA1 ColumnA1 columnA1 column_a1
and
RowB1 RowB1 RowB1 rowB1 row_b1
,ColumnB1 ColumnB1 ColumnB1 columnB1 column_b1
and end points
RowA2 RowA2 RowA2 rowA2 row_a2
,ColumnA2 ColumnA2 ColumnA2 columnA2 column_a2
and
RowB2 RowB2 RowB2 rowB2 row_b2
,ColumnB2 ColumnB2 ColumnB2 columnB2 column_b2
, 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 Angle Angle angle angle
returns the angle in radians,
ranging from
.
Parameter Broadcasting
This operator supports parameter broadcasting.
This means that each parameter can be given as a tuple of length
1 or N .
Parameters with tuple length 1 will be repeated internally
such that the number of computed angles is always N .
Execution Information
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
Multithreading scope: global (may be called from any thread).
Automatically parallelized on internal data level.
Parameters
RowA1 RowA1 RowA1 rowA1 row_a1
(input_control) point.y(-array) →
HTuple MaybeSequence[Union[float, int]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the first point of the first line.
ColumnA1 ColumnA1 ColumnA1 columnA1 column_a1
(input_control) point.x(-array) →
HTuple MaybeSequence[Union[float, int]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the first point of the first
line.
RowA2 RowA2 RowA2 rowA2 row_a2
(input_control) point.y(-array) →
HTuple MaybeSequence[Union[float, int]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the second point of the first line.
ColumnA2 ColumnA2 ColumnA2 columnA2 column_a2
(input_control) point.x(-array) →
HTuple MaybeSequence[Union[float, int]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the second point of the first
line.
RowB1 RowB1 RowB1 rowB1 row_b1
(input_control) point.y(-array) →
HTuple MaybeSequence[Union[float, int]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the first point of the second line.
ColumnB1 ColumnB1 ColumnB1 columnB1 column_b1
(input_control) point.x(-array) →
HTuple MaybeSequence[Union[float, int]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the first point of the second
line.
RowB2 RowB2 RowB2 rowB2 row_b2
(input_control) point.y(-array) →
HTuple MaybeSequence[Union[float, int]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Row coordinate of the second point of the second line.
ColumnB2 ColumnB2 ColumnB2 columnB2 column_b2
(input_control) point.x(-array) →
HTuple MaybeSequence[Union[float, int]] HTuple Htuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Column coordinate of the second point of the second
line.
Angle Angle Angle angle angle
(output_control) angle.rad(-array) →
HTuple Sequence[float] HTuple Htuple (real) (double ) (double ) (double )
Angle between the lines [rad].
Example (HDevelop)
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
RowA1 := 255
ColumnA1 := 10
RowA2 := 255
ColumnA2 := 501
gen_contour_polygon_xld (Contour, [RowA1,RowA2], [ColumnA1,ColumnA2])
RowB1 := 255
ColumnB1 := 255
for I := 5 to 360 by 5
RowB2 := 255 - sin(rad(I)) * 200
ColumnB2 := 255 + cos(rad(I)) * 200
gen_contour_polygon_xld (Contour, [RowB1,RowB2], [ColumnB1,ColumnB2])
angle_ll (RowA1, ColumnA1, RowA2, ColumnA2,\
RowB1, ColumnB1, RowB2, ColumnB2, Angle)
AngleDeg := deg(Angle)
endfor
Result
angle_ll angle_ll AngleLl AngleLl angle_ll
returns 2 (
H_MSG_TRUE )
.
Alternatives
angle_lx angle_lx AngleLx AngleLx angle_lx
Module
Foundation