选择两条线并计算它们之间的角度 [英] select two line and calculate angel between them
本文介绍了选择两条线并计算它们之间的角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
对于我的项目,我首先需要两条SELECTABLE行.然后是他们在vb.net上的天使
Pleaseee帮帮我
,我可以将autocad或coreldraw工具箱控件导入到我的项目表单中吗?那就是其中著名的角度尺寸.
for my project i need two SELECTABLE line at first & then the angel of them in vb.net
pleaseee help me
,can i import autocad or coreldraw toolbox controls to my project form?thats the famous angular dimension in them
推荐答案
尝试以下链接:
C#的矢量类型
或检查以下代码:
VB.Net代码:
Try the following link :
A Vector Type for C#
Or Check following Code :
VB.Net Code :
Public Shared Function ON_3dVectorAngle(ByVal v0 As On3dVector, ByVal v1 As On3dVector) _
As Double
' Unitize the input vectors
v0.Unitize()
v1.Unitize()
Dim dot As Double = OnUtil.ON_DotProduct(v0, v1)
' Force the dot product of the two input vectors to
' fall within the domain for inverse cosine, which
' is -1 <= x <= 1. This will prevent runtime
' "domain error" math exceptions.
If (dot < -1.0) Then dot = -1.0
If (dot > 1.0) Then dot = 1.0
Return System.Math.Acos(dot)
End Function
C#代码:
public static double ON_3dVectorAngle(On3dVector v0, On3dVector v1)
{
// Unitize the input vectors
v0.Unitize();
v1.Unitize();
double dot = OnUtil.ON_DotProduct(v0, v1);
// Force the dot product of the two input vectors to
// fall within the domain for inverse cosine, which
// is -1 <= x <= 1. This will prevent runtime
// "domain error" math exceptions.
dot = (dot < -1.0 ? -1.0 : (dot > 1.0 ? 1.0 : dot));
return System.Math.Acos(dot);
}
这篇关于选择两条线并计算它们之间的角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文