Tag Info

New answers tagged

5

There are some place which can be optimized in your animation. When I see this right, then your function Outer[(-Mod[#1, #2]/#2) &, # + k, #] & is similar to Outer[(-Mod[#1+k, #2]/#2) &, #, #] & but the latter has the big advantage, that the calculation of your Outer does not rely on k. It is even better than that, because now we can ...


4

The fastest way to plot large data in my experience is Image, as I do here: Animate[Prime[Range[400]] // Outer[(-Mod[#1, #2]/#2) &, # + k, #] & // Column@{Style[k, Large], Colorize[Image[Transpose@Rescale@#, ImageSize -> 600], ColorFunction -> "LakeColors"]} &, {k, 1, 1000, 1}, AnimationRate -> 1]


5

f[x_] := Abs@Sin@x/(x x + x + 1) a[t_] := NIntegrate[f[x], {x, t, t + 2 Pi}] tabA = Table[{t, a[t]}, {t, -3 Pi, 3 Pi, 6 Pi/100}]; opc = Sequence[ImageSize -> 400, Ticks -> {Array[- 4 Pi + # Pi &, 6], Automatic}]; Animate[Column[{ Show[Plot[f[x], {x, -3Pi, 3Pi}, AspectRatio->1/4, Evaluate@opc, PlotRange->{{-3 Pi, 3 Pi}, All}], ...


2

It took me few minutes to figure what it is doing. But here is a Manipulate. I did not know the code is there and did not look at original one yet. I am sure it is done better than my attempt here: Manipulate[ tick; If[state == "RUN", tick = Not[tick]; a = a + 0.1; If[a > 4 Pi, state = "RESET"; a = -4 Pi; cArea = {} ] ]; ...


0

BE HAPPY!! The easiest code is: a:= Show[PolarPlot[Cos[2 \[Theta]], {\[Theta], 0, t}], PlotRange -> {{-1, 1}, {-1, 1}}] b= ParallelTable[a, {t, 0.001, 2 Pi, (2 Pi - 0.001)/100}]; Export["4-leaved-rose.gif",b ] and the result is:


5

To realize the constant-speed drawing, you'll need to re-parameterize the equation to use the arc-length parameter: $$ \mathrm{d}s = \left\| \frac{\mathrm{d}\,\boldsymbol{\mathrm{r}}(\theta)}{\mathrm{d}\theta}\right\|\mathrm{d}\theta $$ r = Cos[2 θ] {Cos[θ], Sin[θ]} reParaEq = θ'[s] == 1/FullSimplify[Sqrt[#.#] &@D[r, θ] /. θ -> θ[s]] θFunc = ...


2

Manipulate[ tick; If[n < (m - 1), n++; tick = Not[tick]]; Pause[pause]; Show[ Graphics[{ {Red, Disk[bob[[n]], .2]}, line, {Red, Thick, Arrow[{bob[[n]], bob[[n + 1]]}]}, }, Axes -> True, ImagePadding -> 5, ImageSize -> 400, PlotRange -> {{-1, 10}, {0, 10}}], bobl ], Button["run", n = 0; tick = Not[tick]], ...


2

data = Table[{x, {Sin[x], x Cos[x]}}, {x, 0, Pi, Pi/10}]; i = Interpolation[data, InterpolationOrder -> 2]; frames = Table[ ParametricPlot[i[t], {t, 0, maxt}, AspectRatio -> 1, Axes -> None, ImageSize -> 400, AspectRatio -> 1, PlotRange -> {{0, 1.2}, {-3, 1}}, Frame -> True], {maxt, 0.2, Pi, 0.05}]; Or data = ...


7

rose = Table[PolarPlot[Cos[x i], {i, 0, Pi}, PlotRange -> 1], {x, 0, 10, .1}]; Followed by: Export["rose.gif", rose] Which gives you the following beautiful animation: You can change the final number of petals by changing the number 10. You can change the speed of the animation by maing the increments smaller than .1.


1

Using ManToGif by Vitaliy Kaurov ManToGif[man_, name_String, step_Integer] := Export[name <> ".gif", Import[Export[name <> Which[$OperatingSystem == "MacOSX", ".mov", $OperatingSystem == "Windows", ".avi"], man], "ImageList"][[1 ;; -1 ;; step]]]; Now write SetDirectory[NotebookDirectory[]]; r = 1; backgroundAxes ...


8

Clear["Global`*"] f[x_, \[Theta]_] = RotationTransform[\[Theta], {1, 0, 1}, {5 Pi, 0, 5 Pi}][{x, 0, -((10 Pi)/6) Sin[x] + 5 Pi}][[{1, 3}]]; p1 = ParametricPlot[{x, x}, {x, -10 Pi, 10 Pi}, PlotRange -> {{-10 Pi, 10 Pi}, {-10 Pi, 10 Pi}, {-10 Pi, 10 Pi}}, ImageSize -> 300, Axes -> True]; n = 7; g[a_] := Evaluate[ t^(1/n) (5 a ...


5

Here's a start, the 2nd transformation is tricky for me. data = Table[{i, 0.1 Sin[100 i] + 0.7, 0}, {i, 0, 1, 0.01}]; gr = Graphics3D[{Thick, Red, Line@data}, Boxed -> False]; Manipulate[Graphics3D[ {If[t < 0.1 Pi, {Dashed, Blue, Line[{{0, 0, 0}, {1, 1, 0}}]}, {}], Arrow[{{0.5, 0, 0}, {0.5, 1, 0}}], Arrow[{{0, 0.5, 0}, {1, 0.5, 0}}], ...


1

This works for me. V 10.01 on windows SetDirectory[NotebookDirectory[]]; m = Manipulate[ Plot[phi[x, t, c], {x, 0, 20}, PlotRange -> {0, 3}], {t, 0, 4}, {c, 0, 5}, AutorunSequencing -> {1, 2}, Initialization :> ( x0 = 0; phi[x_, t_, c_] := (c/2)*(Sech[0.5*Sqrt[c]*(x - x0 - c*t)]^2); ) ] and in new cell, just type ...


2

I don't know how much you have worked with POVRay, but there is no need to generate thousands of individual pov files. For animations you can use the built-in clock function. Include in the graphics primitives exported by Mathematica a dependence on the clock, and let POVRay do the work for you. The following is a very simple example of POVRay code which ...


4

I would be happy if I could get Mathematica to prefix each POV-Ray export (which Mathematica supports, by the way) with a preamble in which I specify camera, lighting, etc. But unfortunately I don't know to what extent it's possible to customize Mathematica's export facilities. Use ExportString for obtaining the output file as a String inside of ...


3

Perhaps this is your aim: tsv = ImportString["0,000000000E0 1,237909063E1 3,333333333E-2 1,237909063E1 6,666666667E-2 1,237909063E1 1,000000000E-1 1,240163557E1 1,333333333E-1 1,267077663E1 1,666666667E-1 1,309703315E1 2,000000000E-1 1,363531527E1 2,333333333E-1 1,390445633E1 2,666666667E-1 1,448782832E1 3,000000000E-1 ...



Top 50 recent answers are included