-
生成垂线
gen_image_const (Image, 'byte', 1000, 1000)
********************生成一条直线************************
Row1:=100
Col1:=500
Row2:=500
Col2:=100
gen_region_line (Line, Row1, Col1, Row2, Col2)
*计算该直线的角度
line_orientation (Row1, Col1, Row2, Col2,Phi)
*计算该直线的中点
RowM:=(Row1+Row2)/2
ColM:=(Col1+Col2)/2
*********************生成垂线*************************
*垂线长度
LineLength:=200(不精确)
*起点
RowStart := RowM-cos(Phi)*LineLength
ColStart := ColM-sin(Phi)*LineLength
*终点
RowEnd := RowM+cos(Phi)*LineLength
ColEnd := ColM+sin(Phi)*LineLength
gen_region_line (Line1, RowStart, ColStart, RowEnd, ColEnd)
-
生成延长线
gen_image_const (Image, 'byte', 1000, 1000)
********************生成一条直线************************
Row1:=100
Col1:=500
Row2:=500
Col2:=100
gen_region_line (Line, Row1, Col1, Row2, Col2)
*获取该直线的位置信息
line_position (Row1, Col1, Row2, Col2, RowCenter, ColCenter, Length, Phi)
*********************生成延长线***********************
*延长线长度(不精确)
LineLength:=200
*起点
RowStart := RowCenter-cos(Phi+1.5708)*LineLength
ColStart := ColCenter-sin(Phi+1.5708)*LineLength
*终点
RowEnd := RowCenter-cos(Phi-1.5708)*LineLength
ColEnd := ColCenter-sin(Phi-1.5708)*LineLength
gen_region_line (Line2, RowStart, ColStart, RowEnd, ColEnd)