Advertisement
Matthen

Rolling a Parabola

Sep 8th, 2015
1,213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. x0 = -10;
  2. integral[xt_] := (1/2 xt Sqrt[1 + 4 xt^2] + 1/4 ArcSinh[2 xt]);
  3. s[x_] := integral[x] - 0 integral[x0];
  4. transform[t_, p_] :=
  5. RotationMatrix[-ArcTan[2 t]]. (p - {t, t^2}) + { s[t], 0};
  6. frame[t_, t2_, t3_] := Module[{tt = 2 Tanh[(t + 2)] + 2 Tanh[(t - 2)]},
  7. (Show[
  8. Graphics[
  9. {
  10. PointSize[Medium],
  11. Point[transform[tt, {0, 1/4}]],
  12. {
  13. Table[
  14. {
  15. Opacity[0.5],
  16. ColorData["RedBlueTones"][Abs[xt]],
  17. Line[{
  18. transform[tt, {xt, 100}],
  19. transform[tt, {xt, Max[3 - 6 t2, xt^2]}]
  20. }],
  21. If[3 - 6 t2 < xt^2,
  22. Line[{
  23. transform[tt, {xt, xt^2}],
  24.  
  25. transform[
  26. tt, {xt, xt^2}] - (6 t2 - 3 + xt^2) Normalize[
  27. transform[tt, {xt, xt^2}] - transform[tt, {0, 1/4}]]
  28. }],
  29. {}]
  30. }
  31. , {xt, -1, 1, 0.05}]
  32. },
  33. {Thick, Line[{{-100, 0}, {100, 0}}]}
  34. }
  35. , PlotRange -> {{-2, 2}, {0, 3}}, ImagePadding -> 10],
  36. ParametricPlot[transform[tt, {x, x^2}], {x, -10, 10},
  37. PlotStyle -> Directive[Thick, Darker@Blue]],
  38. ParametricPlot[{
  39. transform[tt, {0, 1/4}]
  40. (*,{tt,Cosh[4tt]/4}*)
  41. }, {tt, -4.001, Min[tt, t3]},
  42. PlotStyle -> Darker@Red]
  43. ])
  44. ];
  45. Manipulate[
  46. frame[t, t2, t3],
  47. {{t, 0}, -4, 4},
  48. {{t2, 0}, -2, 0.54444},
  49. {{t3, 0}, -4, 4}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement