Slope of the bisector given 3 points

geometryprogrammingslope

Diagram:

Diagram of the 3 points

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.

  1. Convert AB and AC into unit vectors. (Cheap operation?)
  2. Add the 2 vectors together to find point D. The shape is now a rhombus. All diagonals bisect the 4 angles of a rhombus. Cheap operation.
  3. Calculate slope of AD to get the slope of the bisector. Cheap again.
  4. Profit?

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||)

Related Question