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](http://upload.wikimedia.org/wikipedia/commons/thumb/1/15/Fermat_Point.svg/350px-Fermat_Point.svg.png).

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.