New answers tagged

2

Another way maybe use RegionPlot3D. Here we calculate the normal of surface and then perturbate the surface along the normal to create a thick surface. r = 2 Pi; f = Sin[x] Cos[y] + Sin[y] Cos[z] + Sin[z] Cos[x]; normal = Grad[f, {x, y, z}]; norm = normal^2 // Total // Evaluate; model = RegionPlot3D[ x^2 + y^2 + z^2 <= r^2 && f^2 <= 0.01 ...


2

First remove the Box and Axes r=2 Pi; model = ContourPlot3D[Sin[x] Cos[y] + Sin[y] Cos[z] + Sin[z] Cos[x] == 0, {x, -r,r}, {y, -r, r}, {z, -r, r},RegionFunction -> ({x, y, z} \[Function] x^2 + y^2 + z^2 <= r^2),Mesh -> None,PlotTheme -> "ThickSurface",Method -> {"Extrusion" -> .3} , Axes -> False, Boxed -> False] ...


5

The roots can be represented directly and exactly with Root objects; there is no need to invoke Solve or NSolve explicitly. For a given tuple t we can list them with F[t_] := Array[Root[#^Range[0, 11].t &, #] &, 11] or, more generally for arbitrary polynomial degree, F[t_] := With[{n = Length[t] - 1}, Array[Root[#^Range[0, n].t &, #] &, n]]...


4

I thought I'd seen this before! In-fact you can do all of this and plot it in under 128 characters: Graphics[{PointSize[Tiny],Point@Flatten[((ReIm[z]/.#)&/@NSolve[z^Range[0,11].#==0,z])&/@Tuples[{-1,1},12],1]}] The credit goes to Yuncong Ma's Honorable Mention Entry from the 2012 one-liner competition. The terse syntax is explained in the video ...


5

An example of what the comments are talking about (OP's code takes 25-26 sec. versus 0.32 sec. below): nn = 10^6; pp = 0; (* points generated so far *) sumAR = 0; sumAR2 = 0; aratio = 1.; (* area proportion estimate *) While[pp < nn, yy = h*(1. - Sqrt[RandomReal[1, (nn - pp)/aratio // Ceiling]]); xx = RandomReal[1, (nn - pp)/aratio // ...


Top 50 recent answers are included