Weighted Fermat Point (rotation + scaling lemma)

technique

To minimize w1PA+w2PB+w3PCw_1 \cdot PA + w_2 \cdot PB + w_3 \cdot PC, factor out w1w_1, then apply a spiral similarity at CC — rotate by θ\theta and scale by k=w2/w1k = w_2/w_1 — sending BBB \to B''. This converts PA+kPB+w3PC|PA| + k|PB| + w_3|PC| into the polyline APPBA \to P \to P'' \to B''. The rotation angle θ\theta is the angle opposite w3w_3 in the "weight triangle" (w1,w2,w3)(w_1, w_2, w_3).

Weighted Fermat point — the Fermat-point generalization when each of the three distances carries its own weight. Spiral similarity stitches the three legs into one polyline; the triangle inequality closes it out.

Universal form

minP(w1PA+w2PB+w3PC),w1,w2,w3>0\min_P\,\big(\, w_1 \cdot |PA| + w_2 \cdot |PB| + w_3 \cdot |PC| \,\big), \quad w_1, w_2, w_3 > 0

Notation: w1w_1 attached to AA, w2w_2 to BB, w3w_3 to CC (matching the rotation construction below).

Classical model

  • Moving point PP: anywhere in the plane
  • Fixed points A,B,CA, B, C: three fixed points with positive weights w1,w2,w3w_1, w_2, w_3 respectively
  • Key constraint: the "weight triangle" (w1,w2,w3)(w_1, w_2, w_3) must satisfy the triangle inequality wiwj<wk<wi+wj|w_i - w_j| < w_k < w_i + w_j (so the rotation angle θ\theta exists); otherwise the optimal PP falls at some vertex (boundary solution)
  • Equal-weight special case: w1=w2=w3w_1 = w_2 = w_3 degenerates to Fermat point

Three fixed points A, B, C and a moving point P; the goal is to minimize the sum of three weighted distances w_1·|PA|, w_2·|PB|, w_3·|PC|

When to use

  • Minimizing f(P)=w1PA+w2PB+w3PCf(P) = w_1 \cdot PA + w_2 \cdot PB + w_3 \cdot PC (three legs, each with its own weight)
  • The equal-weight special case w1=w2=w3w_1 = w_2 = w_3 degenerates to Fermat point (the classical Fermat-Torricelli point)
  • Physics / engineering setting: three cities with different demands need a shared transfer hub; the "general delivers water" problem upgraded with speed coefficients

The core move

Apply a spiral similarity (rotation + scaling) at the vertex with weight w3w_3 — that is, at CC. The three legs splice into a single polyline, and the shortest polyline is a straight segment — which gives the minimum.

The rotation angle θ\theta equals the angle opposite w3w_3 in the "weight triangle" with side lengths (w1,w2,w3)(w_1, w_2, w_3).

Centered at C, a spiral similarity (rotate θ + scale k) sends B and P to B'' and P''. The polyline A → P → P'' → B'' has length equal to f(P), so it is at least the chord |AB''|

Construction

Let A,B,CA, B, C be the three fixed points with corresponding weights w1w_1 (on AA), w2w_2 (on BB), w3w_3 (on CC). First factor w1w_1 out of f(P)f(P) and normalize w1=1w_1 = 1, setting k=w2/w1=w2k = w_2 / w_1 = w_2 (so that below the polyline length equals f(P)f(P) directly, PA|PA| no longer carries a coefficient, and PB|PB|, PC|PC| are absorbed cleanly by the spiral similarity).

The core picture after normalization: the original three legs |PA|, k·|PB|, w_3·|PC| match the polyline legs |AP| + |PP''| + |P''B''| one-for-one; from here on we work in the normalized notation k(=w_2), w_3

  1. Compute the rotation angle: cosθ=1+k2w322k\cos\theta = \dfrac{1 + k^2 - w_3^2}{2k} (equivalently, 1+k22kcosθ=w321 + k^2 - 2k\cos\theta = w_3^2, which is the law of cosines). The choice of θ\theta is not arbitrary — see the "Why it works" section: to make PP=w3PC|P''P| = w_3 \cdot |PC|, apply the law of cosines to PCP\triangle PCP'' and solve.

    The weight triangle (w_1, w_2, w_3): the angle opposite side w_3 is the rotation angle θ

  2. Apply the spiral similarity (centered at CC, easier to see as two steps):

    • 2a Rotate by θ\theta: BBB \to B', PPP \to P'. Properties: CB=CB|CB'| = |CB|, BCB=θ\angle BCB' = \theta, BP=BP|B'P'| = |BP| (rotations preserve lengths).
    • 2b Scale by kk: BBB' \to B'', PPP' \to P''. Properties: CB=kCB|CB''| = k \cdot |CB|, BP=kBP|B''P''| = k \cdot |BP| (uniform scaling).

    Together, BB'' and PP'' are the spiral-similarity images (with CB=kCB|CB''| = k \cdot |CB|, BCB=θ\angle BCB'' = \theta).

    Construction of the spiral similarity: rotation angle θ + scaling factor k

  3. The three legs splice exactly into the polyline APPBA \to P \to P'' \to B'':

    • AP=w1PA|AP| = w_1 \cdot |PA| (with w1=1w_1 = 1 after normalization, this leg is just PA|PA|).
    • PP=w3PC|PP''| = w_3 \cdot |PC| (law of cosines in PCP\triangle PCP'': PP=CP1+k22kcosθ=w3CP|PP''| = |CP|\sqrt{1 + k^2 - 2k\cos\theta} = w_3 \cdot |CP|).
    • PB=kPB=w2PB|P''B''| = k \cdot |PB| = w_2 \cdot |PB| (scaling factor k=w2k = w_2).

    So the polyline length =AP+PP+PB=f(P)= |AP| + |PP''| + |P''B''| = f(P) exactly.

  4. Straighten: the shortest polyline equals AB|AB''|, with equality when A,P,P,BA, P, P'', B'' are collinear.

  5. Locate PP: PP is the intersection of line ABAB'' with the relevant arc / line (worked out from the collinearity condition).

Closed-form minimum

Since θ\theta is determined directly by the weights (w1,w2,w3)(w_1, w_2, w_3), the minimum AB|AB''| can also be computed without finding PP — combine the law of cosines on ACB\triangle ACB'' with the law of cosines in the weight triangle 2w1w2cosθ=w12+w22w322 w_1 w_2 \cos\theta = w_1^2 + w_2^2 - w_3^2 and simplify, yielding a closed form involving only "weights + ABC\triangle ABC":

(minf)2=12 ⁣[(w22+w32w12)a2+(w12+w32w22)b2+(w12+w22w32)c2]+8SSw.\bigl(\min f\bigr)^2 = \tfrac{1}{2}\!\left[(w_2^2+w_3^2-w_1^2)\,a^2 + (w_1^2+w_3^2-w_2^2)\,b^2 + (w_1^2+w_2^2-w_3^2)\,c^2\right] + 8\,S_{\triangle}\,S_w.

Notation: a=BC,b=CA,c=ABa = |BC|, b = |CA|, c = |AB| (standard opposite-side notation — aa opposite vertex AA, etc.); SS_{\triangle} is the area of ABC\triangle ABC; SwS_w is the area of the weight triangle (w1,w2,w3)(w_1, w_2, w_3) (Heron: 16Sw2=2(w12w22+w22w32+w32w12)(w14+w24+w34)16\,S_w^2 = 2(w_1^2 w_2^2 + w_2^2 w_3^2 + w_3^2 w_1^2) - (w_1^4 + w_2^4 + w_3^4)). Each of the three weight coefficients has the form "sum of squares of the other two weights, minus the square of this side's weight" — exactly 2wjwkcos(the angle at that vertex)2 w_j w_k \cos(\text{the angle at that vertex}) in the weight triangle.

Sanity check (Fermat point, w1=w2=w3=1w_1 = w_2 = w_3 = 1): all three weight coefficients are 11, Sw=3/4S_w = \sqrt{3}/4, and the formula gives

(minf)2=a2+b2+c22+23S,(\min f)^2 = \tfrac{a^2 + b^2 + c^2}{2} + 2\sqrt{3}\,S_{\triangle},

i.e. the classical closed form for the Fermat-Torricelli minimum.

Applicability: the weight triangle (w1,w2,w3)(w_1, w_2, w_3) must satisfy the triangle inequality (so θ\theta exists), and the optimal PP must lie inside ABC\triangle ABC; otherwise the minimum is attained at a vertex (boundary solution), and you must compare the three vertex values of ff directly.

Why it works

Rotations preserve angles and scalings preserve ratios; together, a spiral similarity sends BCP\triangle BCP to BCP\triangle B''CP'' so that BP=kBP|B''P''| = k \cdot |BP|, and it converts the leg "PP to CC" into the leg "PP to PP''" — whose length is exactly w3PCw_3 \cdot |PC| by our choice of θ\theta (via the law of cosines). The three legs with different weights are thereby translated into three consecutive segments of one polyline (AP|AP| stays in place because w1=1w_1 = 1); the rest is just "polyline \geq straight segment".

Zooming in on △PCP'': from C, two sides of lengths |CP| and k·|CP| with included angle θ; the law of cosines gives |P''P| = w_3·|CP|

Recap of the law of cosines: in any XYZ\triangle XYZ with side lengths a=YZ,b=XZ,c=XYa = |YZ|, b = |XZ|, c = |XY|, the angle Z\angle Z opposite side cc satisfies

c2=a2+b22abcosZ.c^2 = a^2 + b^2 - 2ab\cos\angle Z.

Two triangles of the same shape side by side: on the left, \triangle XYZ with (a, b, c, \angle Z); on the right, the weight triangle with (1, k, w_3, \theta). The pairings c \leftrightarrow w_3 are both the side opposite the focal angle

Where the Step 1 formula comes from: plug the three sides of the weight triangle (w1,w2,w3)(w_1, w_2, w_3) — after normalization (1,k,w3)(1, k, w_3) with k=w2k = w_2 — into the law of cosines. The angle opposite w3w_3 is θ\theta, so

w32=1+k22kcosθ    cosθ=1+k2w322k.w_3^2 = 1 + k^2 - 2k\cos\theta \;\Longrightarrow\; \cos\theta = \frac{1 + k^2 - w_3^2}{2k}.

Step 3's PP=w3CP|P''P| = w_3 \cdot |CP| is the same idea: in PCP\triangle PCP'', the sides CP|CP| and CP=kCP|CP''| = k \cdot |CP| emanate from CC with included angle PCP=θ\angle PCP'' = \theta. Law of cosines again:

PP2=CP2+(kCP)22CPkCPcosθ=CP2(1+k22kcosθ)=CP2w32.|P''P|^2 = |CP|^2 + (k|CP|)^2 - 2 \cdot |CP| \cdot k|CP| \cdot \cos\theta = |CP|^2 (1 + k^2 - 2k\cos\theta) = |CP|^2 \cdot w_3^2.

So PP=w3CP|P''P| = w_3 \cdot |CP|and that equality is exactly what θ\theta was chosen to enforce.

Geometric intuition: "In the weight triangle (w1,w2,w3)(w_1, w_2, w_3), the angle opposite w3w_3 is the rotation angle." (1,1,1)θ=60°(1, 1, 1) \Rightarrow \theta = 60° (the classical Fermat point) (1,1,2)θ=90°(1, 1, \sqrt{2}) \Rightarrow \theta = 90° (the isoceles right-angled weight triangle) (3,4,5)θ=90°(3, 4, 5) \Rightarrow \theta = 90° (the right angle is opposite the hypotenuse)

Three special weight cases and their rotation angles: (1,1,1) → 60°, (1,1,√2) → 90°, (3,4,5) → 90°

Worked examples

  • The classical Fermat point: w1=w2=w3=1w_1 = w_2 = w_3 = 1, rotate by 60°60° to build an equilateral triangle — the optimal PP sees all three sides at 120°120°.
  • Weights (1,1,2)(1, 1, \sqrt{2}): minimize PA+PB+2PC|PA| + |PB| + \sqrt{2} \cdot |PC|. After factoring out w1=1w_1 = 1, the spiral similarity sends BB to BB'' with θ=90°\theta = 90°, k=1k = 1; the problem reduces to AB|AB''|.
  • Weights (3,4,5)(3, 4, 5): rotate by 90°90° — the weight triangle is the 3453{-}4{-}5 right triangle.

Variants / generalizations

  • Special-angle weight triangles: when (w1,w2,w3)(w_1, w_2, w_3) corresponds to special angles such as 30609030{-}60{-}90 or 45459045{-}45{-}90, the rotation angle is immediate and the polyline construction is easy.
  • Degenerate case: if the weight-triangle inequality w1w2<w3<w1+w2|w_1 - w_2| < w_3 < w_1 + w_2 fails, the minimum is attained at one of the vertices (a "boundary solution"), and the spiral-similarity trick no longer applies.
  • Dimension-reduction: for the single-leg weighted variant, see Hu-Bu-Gui (Different-Speed Minimum, sin-Angle Method); for the two-leg equal-weight variant, see General Drinking Horse (axial-symmetry shortest path).
  • Naming note: this lemma is known in Chinese olympiad circles as the "weighted Fermat-point rotation method"; in the English literature it appears as the weighted rotation lemma or under names like Tellier's construction / spiral similarity. It is not a named theorem but the standard lemma for the weighted Fermat-Torricelli problem — re-derive it on the fly with the law of cosines rather than citing it.