I am not so worried about how to interpret how to draw the triangles, but I have been trying to find how to find the indices for triangle knowing only the sides, and incenter of the triangle.
Some sample triangle inputs:
Side 1: 20
Side 2: 30
Side 3: 40
about x=100, y=400
Side 1: 20
Side 2: 40
Side 3: 50
about x=300, y=400
Myself, and a couple of other people, have been wracking our brains for the past 4 hours to no avail, so, any hint would be greatly appreciated.
What you first need to figure out is the positions of each corner. As you have the length of each side you could use the law of cosines…
…to get the angle between side 1 (a) and side 2 (b):
The positions of the triangle corners are:
After this you have a triangle originating from the wrong place as you want them to be drawn in the center of the triangle. Calculating that center of an triangle could be done in different ways, but here is one really simple one:
You could then translate that point to the point of your choice!
Here is some code that does what you want:
Example usage: