Herror ::intersection_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,
double *Row,
double *Column,
long *IsParallel
)
Herror ::intersection_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 *Row,
HTuple *Column,
HTuple *IsParallel
)
Calculate the intersection point of two lines.
The operator ::intersection_ll calculates the intersection point
of two lines. As input the columns and rows of the lines
(RowA1,ColumnA1,
RowA2,ColumnA2) and
(RowB1,ColumnB1,
RowB2,ColumnB2) are expected.
The parameters Row and Column return the
result of the calculation.
If the lines are parallel IsParallel is 1 else 0.
In addition the values of Row and Column
are undefined.
Attention
If the lines are parallel the values of Row and
Column are undefined.
Parameters
RowA1 (input_control)
|
point.y(-array) -> HTuple.double / long
|
|
Row of the first point of the first line. |
ColumnA1 (input_control)
|
point.x(-array) -> HTuple.double / long
|
|
Column of the first point of the first line. |
RowA2 (input_control)
|
point.y(-array) -> HTuple.double / long
|
|
Row of the second point of the first line. |
ColumnA2 (input_control)
|
point.x(-array) -> HTuple.double / long
|
|
Column of the second point of the first line. |
RowB1 (input_control)
|
point.y(-array) -> HTuple.double / long
|
|
Row of the first point of the second line. |
ColumnB1 (input_control)
|
point.x(-array) -> HTuple.double / long
|
|
Column of the first point of the second line. |
RowB2 (input_control)
|
point.y(-array) -> HTuple.double / long
|
|
Row of the second point of the second line. |
ColumnB2 (input_control)
|
point.x(-array) -> HTuple.double / long
|
|
Column of the second point of the second line. |
Row (output_control)
|
point.y(-array) -> (HTuple.) double *
|
|
Row of the intersection point |
Column (output_control)
|
point.x(-array) -> (HTuple.) double *
|
|
Column of the intersection point |
IsParallel (output_control)
|
number(-array) -> (HTuple.) long *
|
|
Are the two lines parallel? |
Example
create_tuple(&rowA1, 1);
set_i(rowA1, 8, 0);
create_tuple(&columnA1, 1);
set_i(columnA1, 7, 0);
create_tuple(&rowA2, 1);
set_i(rowA2, 15, 0);
create_tuple(&columnA2, 1);
set_i(columnA2, 11, 0);
create_tuple(&RowB1, 1);
set_i(RowB1, 2, 0);
create_tuple(&ColumnB1, 1);
set_i(ColumnB1, 4, 0);
create_tuple(&RowB2, 1);
set_i(RowB2, 6, 0);
create_tuple(&ColumnB2, 1);
set_i(ColumnB2, 10, 0);
T_intersection_ll(rowA1,columnA1,rowA2,columnA2,RowB1,ColumnB1,RowB2,ColumnB2,
&row_i,&column_i,¶llel);
aa_min = get_d(row_i,0);
aa_max = get_d(column_i,0);
Result
::intersection_ll returns H_MSG_TRUE.
Module
Basic operators
Copyright © 1996-2002 MVTec Software GmbH