[ARX]向量angleTo用法

(Owed by: 春夜喜雨 http://blog.csdn.net/chunyexiyu 转载请标明来源)

 

ARX中,向量angleTo用的比较普遍,用于求两个向量间的夹角(弧度)

 

a. 其中对于二维向量,返回两个向量间的<=PI的夹角角度

AcGeVector2d::angleTo(const AcGeVector2d& vec) const;

Returns the angle between this vector and the vector vec in the range [0, Pi].

 

b.对于三维向量,单个参数的函数,返回的是两个向量确定面上的<=PI的夹角角度。

(两个向量,可以确定一个面,向量1+原点+向量2 三点确定一个面)

AcGeVector3d::angleTo( const AcGeVector3d& vec) const;

Returns the angle between this vector and the vector vec in the range [0, Pi].

 

a.       对于三维向量,有refVec参考向量参数的函数,返回的也是两个向量确定面上的夹角,不同的是,refVec朝向量形成面的上边时,取逆时针角度,否则取顺时针角度,取值范围是[0, 2PI]。

(向量1+原点+向量2三点确定一个面)

AcGeVector3d::angleTo(const AcGeVector3d& vec,const AcGeVector3d& refVec) const;

Returns the angle between this vector and the vector vec in the range [0, 2 x Pi].

If (refVec.dotProduct(crossProduct(vec)) >= 0.0), then the return value coincides with the return value of the function angleTo(vec). Otherwise the return value is 2 x Pi minus the return value of the function angleTo(vec).

 

你可能感兴趣的:(AutoCAD二次开发,ARX)