几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】odgevector3d and angleto (http://www.dimcax.com/hust/showthread.php?t=17686)

yang686526 2009-05-06 08:40 PM

【转帖】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.


所有的时间均为北京时间。 现在的时间是 09:39 AM.