1.已知点与直线 求垂足
点(X,Y)
线(BeginX,BeginY,EndX,EndY)
projection_pl (X, Y, BeginX, BeginY, EndX, EndX, 垂足X, 垂足Y)
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
dev_set_color ('red')
pointR:=100
pointC:=100
LineR1:=200
LineC1:=200
LineR2:=200
LineC2:=400
gen_cross_contour_xld (Cross, pointR, pointC, 6, 0.785398)
gen_contour_polygon_xld (Contour33, [LineR1,LineR2], [LineC1,LineC2])
projection_pl (pointR,pointC ,LineR1 , LineC1, LineR2, LineC2, RowProj, ColProj)
dev_set_color ('white')
gen_cross_contour_xld (Cross1, RowProj, ColProj, 6, 0.785398)
gen_parallel_contour_xld (Contours, ParallelContours, Mode, Distance)
Contours: 输入的原始 XLD 轮廓。
ParallelContours: 输出的平行 XLD 轮廓。
Mode: 生成平行轮廓的模式。
Distance: 平行轮廓与原始轮廓之间的距离。
set_tposition (WindowHandle, 50, 180)
write_string (WindowHandle, 'Contour')
gen_contour_polygon_xld (Contour, [100,500], [200,200])
dev_set_color ('green')
set_tposition (WindowHandle, 50, 240)
write_string (WindowHandle, 'ParallelContours')
gen_parallel_contour_xld (Contour, ParallelContours, 'regression_normal', -80)
dev_set_color ('red')
gen_contour_polygon_xld (Contour1, [500,100], [200,200])
set_tposition (WindowHandle, 50, 80)
dev_set_color ('yellow')
write_string (WindowHandle, 'ParallelContours1')
gen_parallel_contour_xld (Contour1, ParallelContours1, 'regression_normal', -80)
dev_clear_window ()
dev_set_color ('red')
set_tposition (WindowHandle, 120, 50)
write_string (WindowHandle, 'Contour2')
gen_contour_polygon_xld (Contour2, [100,400], [100,400])
dev_set_color ('green')
set_tposition (WindowHandle, 50, 250)
write_string (WindowHandle, 'ParallelContours2')
gen_parallel_contour_xld (Contour2, ParallelContours2, 'regression_normal', -80)
dev_clear_window ()
dev_set_color ('red')
set_tposition (WindowHandle, 120, 50)
write_string (WindowHandle, 'Contour3')
gen_contour_polygon_xld (Contour3, [100,300,100], [100,300,500])
dev_set_color ('green')
set_tposition (WindowHandle, 50, 250)
write_string (WindowHandle, 'ParallelContours2')
gen_parallel_contour_xld (Contour3, ParallelContours3, 'regression_normal', -80)