Is there any algorithm by which one can calculate the fermat's point for a set of 3 points in a triangle? a fermat's point is such a point that the sum of distances of the vertices of the triangle to this point is minimum. I came across several mathematical proofs regarding this ,but can't get an algo for actually calculating it programmatically for given 3 points. Can someone please help on this? Thanks.
-
3The construction described at http://en.wikipedia.org/wiki/Fermat_point seems like a straightforward algorithm to me. – Ted Aug 28 '11 at 06:04
-
programmatically?? – pranay Aug 28 '11 at 15:24
-
1What's the difficulty with implementing that construction programmatically? – Ted Aug 28 '11 at 19:14
2 Answers
If the angle at A is 120 degrees or more, $a^2 \geq b^2 + bc + c^2$ and the Fermat point is at A. Check this for B and C, as well.
When all angles are less than 120 degrees, the Fermat point is number 13 in the list of triangle centers here:
http://faculty.evansville.edu/ck6/encyclopedia/ETC.html
where you can find barycentric coordinates of that point as a function of the sides of the triangle. Given barycentric coordinates for any point its Cartesian coordinates can be calculated from the Cartesian coordinates of the vertices of the triangle.
- 35,436
-
i tried calculating the catesian co-ordinates but not getting the correct result:
Y= ((U+V+W)/3.0+(ax*cy)-(cx*ay)+(bx*ay)-(ax*by)+(cx*by)-(bx*cy))/((2*(bx-cx)));`X= ((U-V-W)/3.0+(cx*by)-(bx*ay)-(ax*cy)+(cx*ay)-(bx*ay)+(ax*by))/((2*(by-cy)));`where U,V,W are the barycenters and a,b,c are the cartesian co-ordinates of vertices.
– pranay Aug 31 '11 at 13:07 -
1If A,B,C are Cartestian coordinates of the vertices and barycentric coordinates are (p,q,r) then the Cartesian coordinates of the point are (pA+qB+rC)/(p+q+r). Usually the barycoordinates are normalized so p+q+r = 1. The "+" means addition of vectors. At the Encyc.Triangle Centers web site they sometimes list trilinear coordinates and not barycentric, but there is an explanation (a formula) at the top of the page on how to convert the two. – zyx Aug 31 '11 at 17:13
-
Here after 9 years. I had the same question but never found an answer on the web so I decided to compute the Fermat-Torricelli point barycentric coordinates myself.
Let $A,B,C$ be the angles of the triangle and $\alpha=A+\frac{\pi}{3},\beta=B+\frac{\pi}{3},\gamma=C+\frac{\pi}{3}$. The formula is:
$\overrightarrow{PT}=(\sin\alpha \sin\beta \sin C+\sin\alpha \sin\gamma \sin B+\sin\beta \sin\gamma \sin A)^{-1}(\sin\beta \sin\gamma \sin A\cdot\overrightarrow{PA}+\sin\alpha \sin\gamma \sin B \cdot \overrightarrow{PB} +\sin\alpha \sin\beta \sin C \cdot \overrightarrow{PC})$
So the ratio of the barycentric coordinates is : $(\sin\beta \sin\gamma \sin A:\sin\alpha \sin\gamma \sin B:\sin\alpha \sin\beta \sin C)$.
I hope that you see the symmetry.
I made a GeoGebra program that computes the point using the formula and, to check its validity, I've added the lines that intersect to the point. The notations are a bit different than here.
I hope that for those who are searching it now, this will be useful.
- 23,332
- 717
-
2FYI: The Encyclopedia of Triangle Centers for $X(13)$ gives the trilinear coords of the FT Pt as, in your notation, $\csc\alpha:\csc\beta:\csc\gamma$. Converting to barycentric coords is a matter of multiplying the components by the respective sides of the triangle: $$\frac{a}{\sin\alpha}:\frac{b}{\sin\beta}:\frac{c}{\sin\gamma}$$ Dividing these by the triangle's circumdiameter, and invoking the Law of Sines, gives $$\frac{\sin A}{\sin\alpha}:\frac{\sin B}{\sin\beta}:\frac{\sin C}{\sin\gamma}$$ which is consistent with your answer. – Blue Jul 22 '21 at 13:12
-
1@Blue You are right if we divide everything by $sin\alpha sin\beta sin\gamma$ we get that ratio which is more elegant. Btw, the Napoleon point has a similar formula but instead of $\frac{\pi}{3}$ we have $\frac{\pi}{6}$. I didn't check that encyclopedia but it might be a good place to check my results. – Neox Jul 22 '21 at 13:18
-
1@Neox Section 7.3 of the following handout can also be useful: https://www.geometryexplorer.xyz/pdfs/Barycentric%20Coordinates.pdf – krazy-8 Jul 22 '21 at 13:29