查看单个帖子
旧 2009-05-06, 08:40 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】odgevector3d and angleto

odgevector3d and angleto
odgevector3d and angleto
maybe, i am wrong, but i believe
odgevector3d v(0, 1, 0);
v.angleto(odgevector3d::kxaxis, odgevector3d::kzaxis);
should return pi / 2, but it returns 3 * pi / 2
v.angleto(odgevector3d::kxaxis)
returns, as estimated, pi / 2.
(with version 1.14)
woho

it must return 3*pi/2 in this case.
and it returns it.
from odgevector3d.h:
code:
/**
description:
returns the *angle* to the specified vector.

arguments:
vect (i) any 3d vector.
remarks:
if refvector is not specified:
o returns a value in the range [0.0 .. odapi].
o this function is commutative.

if refvector is specified:
o returns a value in the range [0.0 .. oda2pi].
o if (refvector.dotproduct(crossproduct(vect)) >= 0.0, the return value is angleto(vect).
o if (refvector.dotproduct(crossproduct(vect)) < 0.0, the return value is oda2pi - angleto(vect)
*/
sincerely yours,
george udov

i met the same issue. the reference documentation of dwgdirect reports
quote:
remarks
if refvector is not specified:
returns a value in the range [0.0 .. oda2pi].
this function is commutative.
if refvector is specified:
returns a value in the range [0.0 .. oda2pi].
if (refvector.dotproduct(crossproduct(vect)) >= 0.0, the return value is angleto(vect).
if (refvector.dotproduct(crossproduct(vect)) < 0.0, the return value is oda2pi - angleto(vect)
there's a typo indeed, autocad measures angles considering not only their sides, but their extensions too.

mirkopontrelli, this is a misprint in documentation, that is already corrected.
sincerely yours,
george udov
yep, i am gonna download it at once.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)