Tag Info

New answers tagged

6

As with many things in Mathematica there are a great many ways to perform such a simple operation. Which one you choose can depend on what you are comfortable with and what performance level you require. I shall list several that come to mind. Some options have already been provided in other answer; I shall include them here for completeness. A small ...


3

If it is known that all the elements are Real, the solution becomes pretty straightforward: l1/.{x_Real}:>{x,0} bigList/.{x_Real}:>{x,0} More general solution is to Replace at level {-2}: Replace[l1, {x_} :> {x, 0}, {-2}] The same can be achieved by Joining the array with itself multiplied by zero: Join[l1, 0*l1, 3] Or more generally ...


5

The first aim can be accomplished tersely: {#,0}&@@@l1 The 'bigList': {#, 0} & @@@ # & /@ bigList As well as replacement rules. More complex nesting would require more complex approaches.


6

Acting on the simple list you gave l1 = {{-1.34266}, {-0.278541}, {1.37156}} is simple: newlist= l1 /. {x_} :> {x, 0} Now, let's work on the actual list. I'll call it bigList bigList = { {{-1.342}, {-0.28}, {1.372}}, {{-1.34266}, {-0.278541},{1.37156}}, {{-1.34459}, {-0.274215}, {1.37026}}, {{-1.34769}, {-0.267169}, {1.36807}}, {{-1.35177}, ...


2

Also fix BoxRatios, PlotRange... 1-way: PerformanceGoal -> "Quality": Animate[SphericalPlot3D[Sin[(3/z)*x], x, y, PlotStyle -> Opacity[0.7], PerformanceGoal -> "Quality", BoxRatios -> 1, PlotRange -> 1], {z, 1, 5}] 2-way: specify explicitly options that set the quality: Animate[SphericalPlot3D[Sin[(3/z)*x], x, y, PlotStyle -> ...


15

Let's get a black torus: torus = First@ParametricPlot3D[{Cos[u] (3 + Cos[t]), Sin[u] (3 + Cos[t]), Sin[t]}, {u, 0, 2 Pi}, {t, 0, 2 Pi}, PlotStyle -> Black, Mesh -> None, PlotPoints -> 10] and now, this is a way to go: DynamicModule[{d1 = 0, d2 = 0}, Column[{ Graphics3D[{ ...


3

Keep Manipulate, but use Animator type for one of the sliders and control AppearanceElements to make it look whatever you need: Manipulate[ {x, y}, {x, 0, 1, Animator, AppearanceElements -> "ProgressSlider"}, {y, 0, 1}]


2

Manipulate[ y1[t_, r_] := y[t, r, 2]; y2[t_, r_] := y[t, r, 0.1]; y3[t_, r_] := y[t, r, -0.01]; If[s == 20, s = 0]; Plot[{y1[t, r], y2[t, r], y3[t, r], 0, 1}, {t, 0, 20}, Frame -> True, Axes -> False, PlotRangePadding -> {{.1, 2}, {.1, .1}}, Epilog -> { PointSize[0.02], Red, Point[{{s, y1[s, r]}, {s, y2[s, r]}, {s, y3[s, ...



Top 50 recent answers are included