Bisecting angles

Bisecting angles

john.uhden
Mentor Mentor
1,346 Views
4 Replies
Message 1 of 5

Bisecting angles

john.uhden
Mentor
Mentor

Just curious.

 

How would you bisect 2 angles (in radians) into one angular direction (in radians).

 

I ask because I am adding a feature for labeling either the lower left or lower right corner of a polyline.  As it is now, I determine the correct "corner" and add or subract a little X and Y to hope the text falls in a legible location.  But sometimes it runs into a side of the polyline.  I could check using intersectwith but there isn't a big budget for this task, so looking at the results it struck me that I should "aim" for the best location and stick with what it gives me.  If the draftspeople don't like it they can move it (though we are trying to reduce their labor in order to increase production).  The polylines are always closed, and some have bulged segments.

John F. Uhden

0 Likes
Accepted solutions (1)
1,347 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant

>This< is how I do it.  It works between any two straight things, including two line segments of the same Polyline.

Kent Cooper, AIA
0 Likes
Message 3 of 5

john.uhden
Mentor
Mentor
Accepted solution

Thank you kindly, Kent.

 

That's pretty much what I am doing, using the firstderiv just before and just after the vertex.

But simply averaging the angles can throw you off 180° if one angle is  just under (* 2 pi) and the other is between 0 and pi.

 

Since I know that all my polylines are CW ('cause I made them that way), I can figure the direction of the internal bisector by subtracting half the deflection from the forward angle.  Well, actually I am adding half the deflection because the deflection is always negative in a CW polyline.

 

Anyway, it's working.  But I feel much more comfortable thanks to your input.

John F. Uhden

0 Likes
Message 4 of 5

Kent1Cooper
Consultant
Consultant

@john.uhden wrote:

.... simply averaging the angles can throw you off 180° ....


Yes -- in the case of my linked routine, it draws an XLINE, so that doesn't matter.

Kent Cooper, AIA
0 Likes
Message 5 of 5

john.uhden
Mentor
Mentor

@Kent1Cooper wrote, "Yes -- in the case of my linked routine, it draws an XLINE, so that doesn't matter."

 

Well that matters to me, so I figured it out.  Again, thank you very much.

John F. Uhden

0 Likes