向量之间的角度360度

时间:2019-04-12 08:32:41

标签: c# qvector3d

我想以360度计算vector3d与其他vector3d之间的角度

我已经使用vector3d.AngleBetween进行了尝试,但结果为180度

//Create a new 3d vector from average points
Vector3D vector1 = new Vector3D(averageX, averageY, 0);

//Create reference vector
Vector3D vector2 = new Vector3D(averageX-100, averageY, 0);
Vector3D vectorResult1 = new Vector3D();

vectorResult1 = vector2 - vector1;                       

//Other vector to all points in layer
foreach (XYZ d1 in coord)
 {                                
   Vector3D vector3 = new Vector3D(d1.X, d1.Y, d1.Z);
   Vector3D vectorResult2 = new Vector3D();

   vectorResult2 = vector3-vector1;

   //Define a rotation

   double angleBetween = Vector3D.AngleBetween(vectorResult2, vectorResult1);
 }

1 个答案:

答案 0 :(得分:0)

看看the documentation,您会发现符号角没有延伸到3-D空间中,因此返回0到180度之间的角度。。在备注中。