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.
Mod
? $\endgroup$