I am trying to create a smooth, piecewisely continuous and differentiable curve by using Mathematica's Floor
function, which is as in:
p = ParametricPlot[{(1/4 π (1 + 2 t - 2 Floor[t])) -
Cos[(1/4 π (1 + 2 t - 2 Floor[t]))] Sin[(1/
4 π (1 + 2 t - 2 Floor[t]))] +
Floor[t/π] (Pi/2 + 1),
2 - Cos[(1/4 π (1 + 2 t - 2 Floor[t]))]^2}, {t, 0, 3 Pi},
ImageSize -> Large, PlotStyle -> Blue,
PlotRange -> {{0, 3 Pi}, {1.5, 2.2}}, Frame -> {True, True, False, False}];
p1 = ParametricPlot[{1/
4 (π + 2 π t - 2 Cos[π (-t + Floor[t])] -
2 π Floor[t] + 2 (2 + π) Floor[t/π]),
1/2 (3 + Sin[π (t - Floor[t])])}, {t, 0, 2 Pi},
ImageSize -> Large, PlotStyle -> Green,
PlotRange -> {{0, 3 Pi}, {1.5, 2.2}}, Frame ->{True, True, False, False}];
GraphicsGrid[{{p1}, {p}}]
It is very strange that the obtained curve always has a horizontal tail at the right side, whenever how the x
range is set.
Is it because of the Floor
function I am using or any other reason? How can I remove the unexpected horizontal tails?