milenkorz

20190510_01

May 10th, 2019
131
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. coordinates = Get@"https://pastebin.com/raw/0t1MBAgX";
  2.  
  3. scaleX = 1.418*10^-2;
  4. scaleZ = 1.425*10^-2;
  5.  
  6. {lX, lZ} = {1600, 1200};
  7.  
  8. kX = 2*Pi/(lX*scaleX)*(Range[lX] - lX/2) // N;
  9. kZ = 2*Pi/(lZ*scaleZ)*(Range[lZ] - lZ/2) // N;
  10.  
  11. cx = Flatten[coordinates[[All, 1]]];
  12. cy = Flatten[coordinates[[All, 2]]];
  13.  
  14. rX = Flatten@Outer[Differences[{##}] &, cx, cx];
  15. rZ = Flatten@Outer[Differences[{##}] &, cy, cy];
  16.  
  17. nP = Length[coordinates];
  18.  
  19. s = Array[0 &, {lZ, lX}];
  20.  
  21. Do[
  22. Do[
  23. s[[j, i]] = 1/nP*Total[Cos[kX[[i]]*rX + kZ[[j]]*rZ]]
  24. , {i, 1, lX}
  25. ]
  26. , {j, 1, lZ}
  27. ]; // AbsoluteTiming
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×