- 积分
- 4177
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-6-27
- 最后登录
- 1970-1-1
|
发表于 2012-1-24 12:27:24
|
显示全部楼层
我以前用VB写过的,忘记了这个是不是最终的版本,楼主可以参考下。当时我就是把每个象限的画出来,然后用三角函数。呵呵。
- temp2(st_nn,3)=mid(read_line(i),20,6) 'U
- temp2(st_nn,4)=mid(read_line(i),26,6) 'V
- if temp2(st_nn,3)<0 and temp2(st_nn,4)<0 then '第1象限
- deg=cint(atn(temp2(st_nn,3)/temp2(st_nn,4))*180/3.1415926)
- end if
- if temp2(st_nn,3)<=0 and temp2(st_nn,4)>0 then '第2象限
- deg= 180-cint(atn(abs(temp2(st_nn,3))/abs(temp2(st_nn,4)) )*180/3.1415926)
- end if
- if temp2(st_nn,3)>0 and temp2(st_nn,4)>=0 then '第3象限
- deg=270-cint(atn(abs(temp2(st_nn,4))/abs(temp2(st_nn,3)) )*180/3.1415926)
- end if
- if temp2(st_nn,3)>0 and temp2(st_nn,4)<0 then '第4象限
- deg=cint(atn(abs(temp2(st_nn,4))/abs(temp2(st_nn,3)) )*180/3.1415926)+270
- end if
复制代码
|
|