Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. ParametricPlot[{{Cos[t] (2 + 7 Cos[2 t] - Cos[4 t])/8, Sin[t]^3 (3 - 2 Cos[2 t])/4},
  2. 3/2 {1, Cos[t]} Sin[t]/(1 + Cos[t]^2)}, {t, 0, 2 Pi},
  3. Axes -> None, PlotRangePadding -> 0.1,
  4. Background -> ColorData["Legacy", "Antique"], PlotStyle -> Black,
  5. PlotPoints -> 500, MaxRecursion -> 0] /. Line[pts_] :>
  6. (With[{thick = (Abs@
  7. Sin[Mod[ArcTan @@ Subtract @@ # + 3/4 Pi,
  8. 2 Pi]])}, {PointSize[thick*0.035 + RandomReal[.007]],
  9. Thickness[thick*.031 + 0.004], Line[#], Point[First[#]]}] & /@
  10. Partition[pts, 2, 1])
  11.  
  12. p1 = ParametricPlot[{Cos[phi], Sin[phi]}, {phi, 0, 2 Pi}];
  13. p1 /. Line[pts_] :>
  14. ({Thickness[(Abs@Sin[Mod[ArcTan @@ Subtract @@ #, 2 Pi]])*0.02], Line[#]} & /@
  15. Partition[pts, 2, 1])
  16.  
  17. infty = ParametricPlot[{2 Cos[1/2 t], Sin[t]}, {t, 0, 4 Pi}]
  18.  
  19. Manipulate[
  20. Show[infty /.
  21. Line[pts_] :> ({Thickness[(Abs@Sin[
  22. Mod[ArcTan @@ Subtract @@ # + direction, 2 Pi]])*
  23. maxThickness + baseThickness], Line[#]} & /@
  24. Partition[pts, 2, 1]),
  25. PlotRange -> {{-3, 3}, {-2, 2}}, AspectRatio -> Automatic,
  26. Axes -> False],
  27. {direction, 0, 2 Pi},
  28. {{baseThickness, 0.005}, 0, 0.02},
  29. {{maxThickness, 1/50.}, 1/100., 1/30.}
  30. ]
  31.  
  32. text = First[First[ImportString[ExportString[Style["L",
  33. FontFamily -> "Poetica"], "PDF"], "PDF"]]];
  34.  
  35. Graphics[{Gray, Translate[text, .5 {1, 1}], Red, text}, Frame -> True]
  36.  
  37. lst = Module[{l = Cases[text, FilledCurve[a__] :> {EdgeForm[Black], Darker[Red],
  38. FilledCurve[a]}, Infinity]}, Table[Graphics[{l /. {x_Real, y_Real} :>
  39. {x 6 Cos[x/12 + t], y 6 Sin[x/12 + t]}}, Frame -> False, PlotRange -> All,
  40. ImageSize -> {400, 400}], {t, 0, 2 [Pi], .1}]];
  41.  
  42. Export["L.gif", lst]
  43.  
  44. ParametricPlot[{
  45. (* modified hypotrochoid *)
  46. {Cos[t] (2 + 7 Cos[2 t] - Cos[4 t])/8, Sin[t]^3 (3 - 2 Cos[2 t])/4},
  47. (* lemniscate of Bernoulli *)
  48. 3/2 {1, Cos[t]} Sin[t]/(1 + Cos[t]^2)},
  49. {t, 0, 2 Pi}, Axes -> None, Background -> ColorData["Legacy", "Mint"],
  50. PlotStyle -> Directive[ColorData["Legacy", "OliveDrab"],
  51. AbsoluteThickness[3]]
  52. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement