Tag Info

New answers tagged

2

This seems to do the right thing: VectorPlot[(-efield), {x, -10, 10}, {y, -10, 10}, AspectRatio -> Automatic, VectorScale -> {Automatic, Automatic, 1/#5^2 &}] (although you might want to twiddle the scaling parameter). Notice that the scaling function is a function of five parameters, of which the norm of the gradient is the last, hence #5.


1

(* equation for your vector*) lin[a_, vec_, pt_] := a vec + pt (* Param eq. for the surface of a triangle *) c[s_, t_, v_] := v[[1]] (1 - t) s + v[[2]] t s + v[[3]] (1 - s) (*which triangle and the parameters*) s1 = NSolve[{lin[a, vec, pt] == c[s, t, #], 0 < s < 1, 0 < t < 1}, {a, s, t}] & /@ triangles (* {{}, {{a -> -1.42384, s -> ...


2

You get meaningful output by multiplying the tiny values of poljez0 with some large number and limiting the Z-PlotRange: Graphics3D[{Darker@Blue, Arrowheads[0.02], MapThread[Arrow[{#1, #2}] &, {tockez0, poljez0*10^12 + tockez0}]}, PlotRange -> Automatic, BoxRatios -> {1, 1, 1}, Axes -> True, AxesLabel -> {x, y, z}, FaceGrids -> ...


2

If I understood you correctly you can use ListDensityPlot: pointsz0 = ToExpression@Import@"http://pastebin.com/raw.php?i=VQfP0HgB"; table = ToExpression@Import@"http://pastebin.com/raw.php?i=7g4QNPPw"; ListDensityPlot[Append[pointsz0[[#, ;; 2]], table[[#]]] & /@ Range@Length@table]


2

I think your original idea of using Graphics3D was the right idea. To get output from Graphics3D that looks good, you need to scale up the z-axis. I did that with the option BoxRatios and got the following. Graphics3D[{Arrowheads[Small], MapThread[Arrow[{#1, #2}] &, {points, points + vectors}]}, BoxRatios -> {1, 1, 1.25}, Axes -> True, ...


3

Consider also: Flatten @ Array[{#2, #, 1} &, {2, 2}, 0] {0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1} This is faster than Table, if applicable: n = 2200; Table[{x, y, 1}, {y, 0, n}, {x, 0, n}] // Flatten // Length // Timing Array[{#2, #, 1} &, {n, n} + 1, 0] // Flatten // Length // Timing {1.435209, 14533203} {0.280802, 14533203}


5

Table[{x, y, 1}, {y, 0, 1, 1}, {x, 0, 1, 1}] // Flatten gives {0,0,1,1,0,1,0,1,1,1,1,1}



Top 50 recent answers are included