搞懂Halcon的弧形角度和 与X轴角度

 一. 搞懂定义

1.Halcon 弧形   

        关键参数是起始角度和终点角度    范围可选(0~6.28)   或者是(0~-6.28),   还有就是方向order:  positive是逆时针转,   negative是顺时针。

2.直线与X轴夹角

        定义:绕着起始点 转到  x轴的角度(x轴可由   起始点 及其右边的点构成)   , 范围包括  0~3.14   -3.14~0。

二. 直线和X轴夹角代码测试

观察直线与轴夹角 ,可以用以下代码

dev_close_window ()
dev_open_window (0, 0, 512, 512, 'white', WindowID)
RowA1 := 255
ColumnA1 := 10

RowA2 := 255
ColumnA2 := 501

dev_set_color ('red')

disp_line (WindowID, RowA1, ColumnA1, RowA2, ColumnA2)
dev_set_color ('black')

AngleTuple:=[]
RadTuple:=[]
RowB1 := 255
ColumnB1 := 255
for i := 1 to 360 by 5    //角度转为弧度
    RowB2 := 255 + sin(rad(i)) * 200       
    ColumnB2 := 255 + cos(rad(i)) * 200   //x是cos   y是sin
    disp_line (WindowID, RowB1, ColumnB1, RowB2, ColumnB2)
    angle_lx (RowB1, 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值