Diagram:
You have 3 points: A, B, C and there are 2 lines: AB and AC that form an angle in the triangle. Then the bisector line of those 2 lines goes through A. I want the slope of that bisector. I don't need to know the equation of the line.
The coordinates of the 3 points are
- Ax, Ay
- Bx, By
- Cx, Cy
I found a solution but it's really overcomplicated and slow : slope = tan((atan(a)+atan(b))/2)
Atan is inverse tangens. "a" and "b" are the slopes of line AB and AC.
I'd like a solution that only uses the coordinates because that's way less computationally expensive and would suit my application better. Is this possible? I'm okay with some difficult functions but 2 "tans" and 1 "tan" seems excessive.
Best Answer
Guys I think I figured it out while trying to sleep.
After waking up I'll see if this works and if it ends up being simpler and more performant than the current wacky solution. I think I got it, right?
EDIT: Ok it works. Here's the formule:
slope = (|AB|y ||AC|| + |AC|y ||AB|| )/(|AB|x ||AC|| + |AC|x ||AB||)