Seems like a quick and easy question but I haven't been able to find exactly what I'm looking for so:
How to calculate a unit length vector that is pointing along the line which is exactly 50% of the angle of two connected line segments?
A picture speaks a thousands words (that are also better than my explanation!)
So basically I want to calculate the blue unit vector given the two red line segments (which are actually 3 points and are therefore guaranteed to be connected)
The red segments are of arbitrary length, and the result doesn't have to be a unit it would just be easier for me.
It would also be handy to have a way to force the resultant vector to point in a certain direction (relative to the input segments), this isn't essential as I think I can work this one out - as the input line segments ultimately form an n-gon.
Any examples would be ideal in C++ please, but other languages welcome.
Many thanks for any pointers.