New answers tagged

0

You can use Animate. Fix the parameter by slider and run it by play. Play, Pause and Reset v = 2; (*velocity and length of arrow*) Animate[Graphics[{{Red, Arrowheads[.03], Arrow[{{d, 1}, {d, 1} + v {Cos[x], Sin[x]}}]}, {Black, Disk[{Abs[d + v t Cos[x]], 1 + v t Sin[x]}, .6]}, {Line[{{-0.3, 0}, {-0.3, 12}}]}}, PlotRange -> {{-1, 20}, {0, 15}}], {x, ...


6

Here's something you can start with, rinit = 6; rfactor = 0.05; rstep = .025; npoints = Floor[(rinit - rfactor rinit)/rstep]; imglist = Table[ With[{r = rinit - n rstep}, Graphics[{Thickness[.03], Circle[#, rfactor r]} & /@ CirclePoints[{0, -r + 2 (rinit - npoints rstep)}, {r, 2 π/npoints n}, 40.], ImageSize -> ...


3

For anything but the simplest of graphics objects, always avoid Animate and use ListAnimate instead. The difference is that ListAnimate works on a pre-defined list of images to create an animation. All the rendering is done beforehand. With Animate, it attempts to do the rendering on the fly, when you are moving the slider. So this will make the ...


13

Here is an approach based on direct construction of Image3D from ImageData. The basic idea is taken from the subsection "Volume Creation" of the section "Scope" on the Documentation page for Image3D, some other ideas are from the answer by Kuba: moon = Import[ "https://upload.wikimedia.org/wikipedia/commons/f/f0/Full_Moon_as_Seen_From_Denmark.jpg"]; ...


1

I've always wished the moon was more habitable. Starting from the OPs picture: moon = ColorConvert[ Import["https://upload.wikimedia.org/wikipedia/commons/f/f0/Full_\ Moon_as_Seen_From_Denmark.jpg"], "Grayscale"]; ReliefPlot[ImageData[moon], ColorFunction -> "GreenBrownTerrain"]


14

moon = Import[ "https://upload.wikimedia.org/wikipedia/commons/f/f0/Full_Moon_as_\ Seen_From_Denmark.jpg"] Here are two ways to get something like that: with Texture or with ColorFunction Texture: pic = ImageCrop @ ImageResize[ColorConvert[moon, "Grayscale"], Scaled@.3] Worse quality than is possible with this image but I had to make it smaller ...


8

So I can't seem to find a nice plottable form for the normal modes of an elastic sphere, if you can please let me know. This talks about the vector spherical harmonics, and people often show sketches of the displacements involved in the fundamental and overtones for the spheroidal and toroidal modes, but I don't find plottable equation forms for them (or I ...


0

As explained in the comment. The sol yields {y[t]->...}. This argument will be evaluated in Plot but not with Point. If the aim is just to see bounce on vertical line you just have to take first part of sol (e.g First[sol]. If you want to plot y v time he is one of many ways: sol = y[t] /. First@NDSolve[{y''[t] == -9.81, y[0] == 5, y'[0] == 0, ...


40

I'd like to expand on Quantum_Oli's answer to give an intuitive explanation for what's happening, because there's a neat geometric interpretation. At one point in the animation it looks like there is a circle of colored dots moving about the center, this is a special case of so called hypocycloids known as Cardano circles. A hypocyloid is a curve generated ...


51

Edit: Added the reversal and some refinements ω = 1; posP[t_, φ_] := Sin[ω t + φ] {Cos[φ], Sin[φ]} posL[φ_] := {-#, #} &@{Cos[φ], Sin[φ]} Animate[ Graphics[{PointSize[0.02], Table[{Black, Line[posL[π i]], Hue[i], Point[posP[t, π i]]}, {i, 0, 1, 1/(3π-Abs[9.43-t])}] }, PlotRange -> {{-1.5, 1.5}, {-1.5, 1.5}} ], {t, 0, 6π, 0.2} ]


10

Here is one way: noIn[y_, x_] = y; noIn[Indeterminate, x_] = Round[x]; transIn[x_] = noIn[(1 + Erf[2 ArcTanh[2 x - 1]])/2, x]; transOut[x_] = noIn[(1 - Erf[2 ArcTanh[2 x - 1]])/2, x]; SeedRandom[15] f[x_, y_] = RandomReal[{-1, 1}, 4].Sin[RandomReal[{-2, 2}, {4, 4}].{1, x, y, x^(4/3)}]/3; r[t_] = {1/2 + Sin[t] + t^(3/2) - (t/2)^2, Sin[t] - t^2 + (2 t/3)^5 - ...



Top 50 recent answers are included