angle between lines

angle between lines

Anonymous
Not applicable
160 Views
2 Replies
Message 1 of 3

angle between lines

Anonymous
Not applicable
I am trying to find the angle between 2 lines. If I could pick one line,
then the other, and have it return the angle between the two. (They share
an endpoint). Any help would be appreciated.

I am writing a door insertion utility.
--
----------------------------------------
Robert B. Brown
Lead Visualization Specialist
----------------------------------------
Autometric Inc.
http://www.autometric.com
0 Likes
161 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
This is untested (I'm typing it into this message for the first time), but
should give you a start.

I'll assume that you have references to the two line objects already, that
you want the acute angle, and that the lines are 2-D.

Public Function AngleBetweenLines (byref objLine1 As AcadLine, byref
objLine2 As AcadLine) As Single
Dim sngAngle As Single
sngAngle = Abs(objLine1.Angle - objLine2.Angle)
If sngAngle > 180 then
sngAngle = 360 - sngAngle
End If
AngleBetweenLines = sngAngle
End Function

--Bill

Robert Brown wrote in message
<8F0C8A534rbrownautometriccom@167.216.240.240>...
>I am trying to find the angle between 2 lines. If I could pick one line,
>then the other, and have it return the angle between the two. (They share
>an endpoint). Any help would be appreciated.
>
>I am writing a door insertion utility.
>--
>----------------------------------------
>Robert B. Brown
>Lead Visualization Specialist
>----------------------------------------
>Autometric Inc.
>http://www.autometric.com
0 Likes
Message 3 of 3

Anonymous
Not applicable
Bil,,

I think that this will work, but I am having some bizarre units problems.
What I really want to do is determine the angle based on 3 points, but this
method will probably work, I didn't think about the simpl solution that you
presented here.

Thanks,
Rob

bdaly@millerlegg.com (Bill Daly) wrote in :

>This is untested (I'm typing it into this message for the first time), but
>should give you a start.
>
>I'll assume that you have references to the two line objects already, that
>you want the acute angle, and that the lines are 2-D.
>
>Public Function AngleBetweenLines (byref objLine1 As AcadLine, byref
>objLine2 As AcadLine) As Single
> Dim sngAngle As Single
> sngAngle = Abs(objLine1.Angle - objLine2.Angle)
> If sngAngle > 180 then
> sngAngle = 360 - sngAngle
> End If
> AngleBetweenLines = sngAngle
>End Function
>
> --Bill
>
>Robert Brown wrote in message
><8F0C8A534rbrownautometriccom@167.216.240.240>...
>>I am trying to find the angle between 2 lines. If I could pick one line,
>>then the other, and have it return the angle between the two. (They share
>>an endpoint). Any help would be appreciated.
>>
>>I am writing a door insertion utility.
>>--
>>----------------------------------------
>>Robert B. Brown
>>Lead Visualization Specialist
>>----------------------------------------
>>Autometric Inc.
>>http://www.autometric.com
>
>

--
----------------------------------------
Robert B. Brown
Lead Visualization Specialist
----------------------------------------
Autometric Inc.
http://www.autometric.com
0 Likes