测试效果
处理步骤解析
1.首先定义一条直线
RowA1 := 255
ColumnA1 := 10
RowA2 := 255
ColumnA2 := 501
dev_set_color ('black')
disp_line (WindowID, RowA1, ColumnA1, RowA2, ColumnA2)
2.再定义一个点
RowB1 := 255
ColumnB1 := 255
3.进行一个360次的循环,得到另外一条线,计算两条线之间的夹角
for i := 1 to 360 by 1
RowB2 := 255 + sin(rad(i)) * 200
ColumnB2 := 255 + cos(rad(i)) * 200
disp_line (WindowID, RowB1, ColumnB1, RowB2, ColumnB2)
angle_ll (RowA1, ColumnA1, RowA2, ColumnA2, RowB1, ColumnB1, RowB2, ColumnB2, Angle)
endfor
测试代码
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'white', WindowID)
RowA1 := 255
ColumnA1 := 10
RowA2 := 255
ColumnA2 := 501
dev_set_color ('black')
disp_line (WindowID, RowA1, ColumnA1, RowA2, ColumnA2)
RowB1 := 255
ColumnB1 := 255
for i := 1 to 360 by 1
RowB2 := 255 + sin(rad(i)) * 200
ColumnB2 := 255 + cos(rad(i)) * 200
disp_line (WindowID, RowB1, ColumnB1, RowB2, ColumnB2)
angle_ll (RowA1, ColumnA1, RowA2, ColumnA2, RowB1, ColumnB1, RowB2, ColumnB2, Angle)
endfor