12,761,216 members (30,718 online)
Rate this:
See more:
hi,for my project i need two SELECTABLE line at first & then the angel of them in vb.net
,can i import autocad or coreldraw toolbox controls to my project form?thats the famous angular dimension in them
Posted 30-Nov-11 0:51am
Member 8420085 30-Nov-11 6:36am

First thank alot,but how can i draw a line which i can select it later?

Rate this:

## Solution 1

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# Code :
```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);
}```

Top Experts
Last 24hrsThis month
 Graeme_Grant 170 Peter Leow 105 OriginalGriff 85 Karthik Bangalore 80 ppolymorphe 80
 OriginalGriff 4,642 Peter Leow 3,394 ppolymorphe 2,793 Karthik Bangalore 2,714 Graeme_Grant 2,576

Web02 | 2.8.170217.1 | Last Updated 30 Nov 2011