Finding a function that connects 3 points on a graph in the shortest path.

algebra-precalculusfunctionsinterpolation

I have $3$ points on a $2$d graph. Say, $(X_1, Y_1)$, $(X_2, Y_2)$, $(X_3, Y_3)$. I want to find a function which is sum of several modulus functions which can achieve this .

For example,

  1. $(-1,1)$, $(0,0)$, $(1,1)$.
    The function connecting these points in shortest path is $|x|$ or modulus of $x$.

  2. $(0,2)$, $(1,4)$, $(1.25,5)$.
    The function connecting these three points in shortest path is
    $$
    |x| + |x-1| + |2x+1|.
    $$

Find the series sum of modulus function that joins $(X_1, Y_1)$, $(X_2, Y_2)$, $(X_3, Y_3)$.

Best Answer

First hint: We have a piecewise function defined by 2 line segments. Then, there exists a (unique) way to express this as the sum or difference of 2 modulus expressions. This gives us the desired result.

Further Hint: $\max (a, b) = \frac{ |a+b| + |a-b| } { 2}$.
Find a similar formula for $ \min (a, b)$.

Related Question