Given the coordinates of a triangle's vertexes, I'm trying to find its Fermat point programmatically. In one step of the algorithm that I'm trying to implement, I have to draw equilateral triangles on the sides of the original triangle. Here's a picture.
When constructing my equilateral triangles, I have the coordinates of two vertexes and I have to find the coordinates of the third one. The problem is, it's not unique - there are two possible solutions.
Now, if I were doing this manually, I could easily see which one was right and eliminate the other one, but I don't know how to express the fact that the new triangle has to be on the outer side of the original triangle mathematically.
Is there a more precise way to express "on the outer side"? I need something that I'll be able to express programmatically.
You guys gave me some great suggestions, but I came up with something which is, in my opinion, simpler:
There are two possible solutions for the third point. We can calculate the distance between them and the third vertex of the original triangle. Whichever point has the greater distance from the third vertex is the point that we're looking for.