查看单个帖子
旧 2009-04-21, 10:27 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 如何求向量的角度

如何求向量的角度
www.dimcax.com
如何求向量的角度
,
有2个方向相反的向量,采用如下方求与x轴的角度:
vector2d v1 = new vector2d(0,1);
vector2d v2 = new vector2d(0, -1);
double a1 = v1.getangleto(vector2d.xaxis);
double a2 = v2.getangleto(vector2d.xaxis);
所得结果,2个角度相等。不知其中原因,请指教!
看看帮助:returns the angle between this vector and the vector vector in the range [0, pi].
谢谢回答!原来vector2d有angle属性的。
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)