Advertisement
Matthen

Gravity Field Vis

Apr 17th, 2013
586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. n = 6;
  2. ms = RandomReal[{0, 0.1}, n];
  3. ps = RandomReal[{0, 1}, {n, 2}];
  4. resolution = 50;
  5. V[x_, y_] :=
  6. Sum[(-ms[[i]] ({x, y} - ps[[i]]))/(
  7. ms[[i]]/100 + Norm[({x, y} - ps[[i]])]^2), {i, n}];
  8. LineIntegralConvolutionPlot[{V[x, y], {"noise", resolution,
  9. resolution}}, {x, 0, 1}, {y, 0, 1}, ColorFunction -> "ArmyColors",
  10. LightingAngle -> 0, LineIntegralConvolutionScale -> 3,
  11. Frame -> False, ImageSize -> resolution]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement