projection_pl ( : : Row, Column, Row1, Column1, Row2, Column2 : RowProj, ColProj )
Calculate the projection of a point onto a line.
The operator projection_pl calculates the projection of a point
(Row,Column) onto a line which is represent
by the start point (Row1,Column1) and the
end point (Row2,Column2).
RowProj is the row of the projection point and ColProj
is the column of the projection point.
Parameters
Row (input_control)
|
point.y(-array) -> real / integer
|
|
Row of the point. |
Column (input_control)
|
point.x(-array) -> real / integer
|
|
Column of the point. |
Row1 (input_control)
|
point.y(-array) -> real / integer
|
|
Row of the first point of the line. |
Column1 (input_control)
|
point.x(-array) -> real / integer
|
|
Column of the first point of the line. |
Row2 (input_control)
|
point.y(-array) -> real / integer
|
|
Row of the second point of the line. |
Column2 (input_control)
|
point.x(-array) -> real / integer
|
|
Column of the second point of the line. |
RowProj (output_control)
|
number(-array) -> real
|
|
Row of the projection |
ColProj (output_control)
|
number(-array) -> real
|
|
Column of the projection |
Example
dev_set_color ('black')
RowLine1 := 400
ColLine1 := 200
RowLine2 := 240
ColLine2 := 400
Rows := 300
Columns := 50
disp_line (WindowHandle, RowLine1, ColLine1, RowLine2, ColLine2)
n := 0
for Rows := 40 to 200 by 4
dev_set_color ('red')
disp_circle (WindowHandle, Rows+n, Columns, 2)
projection_pl (Rows+n, Columns, RowLine1, ColLine1, RowLine2, ColLine2,
RowProj, ColProj)
dev_set_color ('blue')
disp_line (WindowHandle, RowProj-2, ColProj, RowProj+2, ColProj)
disp_line (WindowHandle, RowProj, ColProj-2, RowProj, ColProj+2)
n := n+8
endfor
Result
projection_pl returns 2 (H_MSG_TRUE).
Parallelization Information
projection_pl is reentrant and processed without parallelization.
Module
Basic operators
Copyright © 1996-2005 MVTec Software GmbH