# How to find a parametric equation of uniform motion?

requirement:

1.The trajectory of the parametric equation is a closed polygon. 2.Try not to use trigonometric functions and Mod.Only Abs is allowed.

For example, the three vertices of a triangle are:{0, 0}, {200, 0}, {0, 200}. I tried to solve the triangle trajectory parameter equation, but I failed.Here's the code:

f[t_] := a* Abs[b*t + c] - d*Abs[t + e] + ff*t + g
f2[t_] := a2*Abs[t + b2] - c2*Abs[d2*t + e2] + ff2*t + g2
sol = Solve[
f[0] == 0 && f2[0] == 0 && f[600/(400 + 200 \[Sqrt]2)] == 200 &&
f2[600/(400 + 200 \[Sqrt]2)] == 0 &&
f[(3 (200 + 200 \[Sqrt]2))/(400 + 200 \[Sqrt]2)] == 0 &&
f2[(3 (200 + 200 \[Sqrt]2))/(400 + 200 \[Sqrt]2)] == 200 &&
f[3] == 0 && f2[3] == 0 && f[300/(400 + 200 \[Sqrt]2)] == 100 &&
f2[300/(400 + 200 \[Sqrt]2)] == 0 &&
f[(3 (200 + 100 \[Sqrt]2))/(400 + 200 \[Sqrt]2)] == 100 &&
f2[(3 (200 + 100 \[Sqrt]2))/(400 + 200 \[Sqrt]2)] == 100 &&
f[(3 (300 + 200 \[Sqrt]2))/(400 + 200 \[Sqrt]2)] == 0 &&
f2[(3 (300 + 200 \[Sqrt]2))/(400 + 200 \[Sqrt]2)] == 100, {a, b, c,
d, e, ff, g, a2, b2, c2, d2, e2, ff2, g2}, Reals](*0<=t<=3*)


I think there may be a mistake in the equations.A possible correct answer:

{100 (((Sqrt[2] + 1) Abs[Sqrt[2] - (Sqrt[2] + 2) t + 1])/(Sqrt[2] +
2) - (2 Sqrt[2] + 3) Abs[t + 1/Sqrt[2] - 1] + (Sqrt[2] + 2) t),
100 ((3 Sqrt[2] + 4) Abs[
t + 1/Sqrt[2] - 1] - (2 Sqrt[2] +
3) (Abs[Sqrt[2] - (Sqrt[2] + 2) t + 1] + 2 t - 2))/(Sqrt[2] +
2)}(*0<=t<=1*)


Related post.

• Is this a homework problem? Why the restriction on Trigonometric functions and Mod? Nov 27, 2022 at 4:07
• @CATrevillian It may increase the difficulty of the question.
– miss
Nov 27, 2022 at 4:14

First define triangle as an interpolation function depending on the arclength

p = {{0, 0}, {200, 0}, {0, 200},{0,0}} ; (* points*)
sp = Join[{0}, Accumulate@Map[Norm, Rest[p] - Most[p]]]
ip = Interpolation[MapThread[{#2, #1 } &, {p, sp} ],InterpolationOrder -> 1]


the parametric solution you are looking for is ip[v t]!

ParametricPlot[ip[(400 + 200 Sqrt[2]) t], {t, 0, 1}]



Piecewise gives a explicit solution

pcw[s_] := Piecewise[{
{p[[1]] (200 - s)/200 + p[[2]] s /200, 0 <= s < 200},
{p[[2]] (200 + 200 Sqrt[2] - s )/( 200 Sqrt[2]) +p[[3]] (s - 200   )/(200 Sqrt[2]) , 200 <= s < 200 + 200 Sqrt[2]},
{p[[3]] (400 + 200 Sqrt[2] - s )/200  +p[[4]] (s - (200 + 200 Sqrt[2]) )/200  , 200 + 200 Sqrt[2] <= s <= 400 + 200 Sqrt[2]}
}]

pcw[(400 + 200 Sqrt[2]) t]


$$\begin{cases} \left\{\left(400+200 \sqrt{2}\right) t,0\right\} & 0\leq \left(400+200 \sqrt{2}\right) t<200 \\ \left\{\frac{-\left(\left(400+200 \sqrt{2}\right) t\right)+200 \sqrt{2}+200}{\sqrt{2}},\frac{\left(400+200 \sqrt{2}\right) t-200}{\sqrt{2}}\right\} & 200\leq \left(400+200 \sqrt{2}\right) t<200+200 \sqrt{2} \\ \left\{0,-\left(\left(400+200 \sqrt{2}\right) t\right)+200 \sqrt{2}+400\right\} & 200+200 \sqrt{2}\leq \left(400+200 \sqrt{2}\right) t\leq 400+200 \sqrt{2} \end{cases}$$

• Assume v = (400 + 200 Sqrt[2])/3. It seems to be an incomplete numerical solution. Piecewise function needs to be added. The problem can be found by drawing the image of the interpolation function with ParametricPlot. But it does move at a uniform speed.
– miss
Nov 27, 2022 at 13:56
• @fcwyq See my modified answer! Nov 27, 2022 at 15:58
• A Good Interpolation method. But I prefer explicit analytic expressions: {x[t],y[t]}.
– miss
Nov 27, 2022 at 16:42
• Change Interpolation to Piecewise: In both cases you have explicit parametric solutions! Nov 27, 2022 at 17:57
• Yes, but I need an analytic expression. For example: x[t] = a*Cos[t], y[t] = a*Sin[t].
– miss
Nov 28, 2022 at 5:30

The following code was originally written by @flc:

pts = Transpose[{{0, 0}, {200, 0}, {0, 200}, {0, 0}}];
c = Prepend[#/Last@# &@Accumulate@Abs@Differences@# &[{1, I} . pts],
0];
f = FullSimplify[
RealAbs[t - c] .
LinearSolve[Abs@Outer[Subtract, #, #] &@c, Transpose@pts]]
ParametricPlot[f, {t, 0, 1}]
Plot[Evaluate@Norm@D[f, t], {t, 0, 1}]


We obtained the second different correct answer:

{100 ((2 + Sqrt[2]) RealAbs[
t] - (3 + 2 Sqrt[2]) RealAbs[-1 + 1/Sqrt[2] + t] +
RealAbs[1 + Sqrt[2] - (2 + Sqrt[2]) t]/Sqrt[2]),
100 ((2 + Sqrt[2]) RealAbs[-1 + t] + (1 + Sqrt[2]) RealAbs[-1 + 1/
Sqrt[2] + t] -
1/2 (2 + Sqrt[2]) RealAbs[1 + Sqrt[2] - (2 + Sqrt[2]) t])}


The 2 function images is congruent within the definition domain [0,1], but not identical outside the definition domain [0,1].