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 represented
by the two points (Row1,Column1) and
(Row2,Column2).
The coordinates of the projected point are returned in RowProj
and ColProj.
Parameters
Row (input_control)
|
point.y(-array) -> real / integer
|
|
Row coordinate of the point. |
Column (input_control)
|
point.x(-array) -> real / integer
|
|
Column coordinate of the point. |
Row1 (input_control)
|
point.y(-array) -> real / integer
|
|
Row coordinate of the first point on the line. |
Column1 (input_control)
|
point.x(-array) -> real / integer
|
|
Column coordinate of the first point on the line. |
Row2 (input_control)
|
point.y(-array) -> real / integer
|
|
Row coordinate of the second point on the line. |
Column2 (input_control)
|
point.x(-array) -> real / integer
|
|
Column coordinate of the second point on the line. |
RowProj (output_control)
|
number(-array) -> real
|
|
Row coordinate of the projected point. |
ColProj (output_control)
|
number(-array) -> real
|
|
Column coordinate of the projected point |
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
Foundation
Copyright © 1996-2008 MVTec Software GmbH