### Angle bisectors calculation

Hi people,
I'm trying to calculate the angle bisectors for different types of triangles by drawing one triangle per click (for every three clicks on the map the triangle will be regenerated with new coordinates)

In addition an exemplaric quad will be generated, which represents a gradient of one edge to show what I want to achieve. (glitchy; wrong angle calculations?)

The idea is to set the quad[2] and quad[3] positions at a distance of 30 pixels from the edges quad[0] and quad[1] along the corresponding angle bisectors inside of the triangle.

The problem now is, that I don't know how to do it correctly. I've got some calculations, but in most cases it doesn't draw the inner corners of the quad at the right positions.

I know that I've to use some conditions for the many cases (what do the look like) that can occur, but how to formulate the cases and which formulas to fill in? Many thanks in advance for any hints?

Last edited on
> I'm trying to calculate the angle bisectors
¿where?

> for every three clicks on the map the triangle will be regenerated with new coordinates
¿is that relevant to your problem? ¿can't you just hardcode the triangle coordinates?
¿do I have to input the vertex in cw or ccw order?

> to show what I want to achieve
¿what do you want to achieve?

> I know that I've to use some conditions for the many cases (what do the look like) that can occur,
¿what special cases?

You started too big.
Get three points, define one (and only one) angle, get one point that lies on the bisection and draw a line from it to the vertex.
Later add the other two angles.
Later draw quads (or better, draw triangles so don't have to worry about vertex order)
Angle bisector calculation --> angle1,2,3 (term angle is misleading: angle=anglebisector)

I've found the solution and there are at least 12 different "cases" and if all are handled correctly, it doesn't matter if you draw it in cw or ccw order.

In the conditions I'm comparing the VertexArray x positions and the slopes of the edges and the only difference in the anglebisector (nr. 1 and nr. 2) formulas is the addition/subtraction of PI or 2*PI or removing it from the formula depending on the case. If someone wants to see the source code, I can upload it when I complete and bugfix it.
Last edited on
Topic archived. No new replies allowed.