Yukterez

Raytracer (All in One, Minkowski)

Jul 29th, 2019 (edited)
168
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (* |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| *)
  2. (* > raytracing.yukterez.net | 07.04.2018 - 09.09.2020 | Version 20 | Simon Tyran, Vienna *)
  3. (* |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| *)
  4.  
  5. Pause[1] (* Minkowski Koordinaten *)
  6.  
  7. wp = MachinePrecision;
  8. mt0 = Automatic;
  9. mt1 = {"StiffnessSwitching", Method-> {"ExplicitRungeKutta", Automatic}};
  10. mta = mt0; (* mt0 for speed, mt1 for accuracy *)
  11.  
  12. kernels = 6; (* Parallelisierung *)
  13. grain = 5; (* Subparallelisierung auf kernels*grain Streifen *)
  14. rsp = "Nearest"; (* Resampling *)
  15.  
  16. breite = 60; (* Zielabmessungen in Pixeln *)
  17. hoehe = 30; (* Höhe sollte ein ganzzahliges Vielfaches von kernels*grain sein *)
  18. zoom = 1; (* doppelter Zoom ergibt halben Sichtwinkel *)
  19.  
  20. LaunchKernels[kernels]
  21. wp = MachinePrecision; (* Genauigkeit *)
  22.  
  23. pic1 = Import["http://www.yukterez.net/mw/2/flip70.png"]; (* Hintergrundpanorama laden *)
  24. pic2 = Import["http://www.yukterez.net/mw/2/worldmap.png"]; (* Sphärenoberfläche laden *)
  25. pic3 = Import["http://www.yukterez.net/mw/akkretionsscheibe.jpg"];(* Scheibentextur laden *)
  26. pic4 = Import["http://www.yukterez.net/mw/disk.png"]; (* Scheibengeometrie laden *)
  27. pic7 = Import["http://www.yukterez.net/mw/2/bw.png"]; (* Checkerboard laden *)
  28.  
  29. (* |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| *)
  30. (* 1) Startbedingungen und Position des Beobachters ||||||||||||||||||||||||||||||||||||| *)
  31. (* |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| *)
  32.  
  33. r0 = 10; (* Radialkoordinate des Beobachters *)
  34. R0 = 500; (* Radius des umspannenden Kugelschalenpanoramas *)
  35. R1 = 1+1/(5 Sqrt[2]); (* Sphäre *)
  36. si = 1.6367824; (* Akkretionsscheibe Innenradius *)
  37. sr = 7; (* Akkretionsscheibe Außenradius *)
  38. θ0 = 70 π/180; (* Breitengrad *)
  39. φ0 = 0; (* Längengrad *)
  40. t0 = 0; (* Eigenzeit des Beobachters *)
  41.  
  42. tmax =-3 R0; (* zeitlicher Integrationsbereich *)
  43.  
  44. vr = 0; (* Radiale Geschwindigkeit des Beobachters *)
  45. vϑ = 0; (* Polare Geschwindigkeit des Beobachters *)
  46. vφ = 0; (* Azimutale Geschwindigkeit des Beobachters *)
  47.  
  48. vL = Sqrt[vr^2+vϑ^2+vφ^2];
  49.  
  50. hvs = 0; (* ArcSin[vφ/vL] *) (* horizontaler Versatz in Radianten *)
  51. vvs = 0; (* ArcSin[vϑ/vL] *) (* vertikaler Versatz in Radianten *)
  52.  
  53. fpt[{x_, y_}] := {If[y<0, x+1, x], If[y<0, -y, y]}
  54.  
  55. pcr1 = ParallelTable[
  56. ImageTransformation[pic1, fpt, DataRange->{{-1, 1}, {0, 1}},
  57. PlotRange->{{-1, 1}, {-1+(x-1)/kernels, -1+x/kernels}}, Padding->"Periodic"],
  58. {x, 1, 2 kernels}];
  59. pct1 = ImageAssemble[Table[{pcr1[[x]]}, {x, 2 kernels, 1, -1}]];
  60.  
  61. pcr2 = ParallelTable[
  62. ImageTransformation[pic2, fpt, DataRange->{{-1, 1}, {0, 1}},
  63. PlotRange->{{-1, 1}, {-1+(x-1)/kernels, -1+x/kernels}}, Padding->"Periodic"],
  64. {x, 1, 2 kernels}];
  65. pct2 = ImageAssemble[Table[{pcr2[[x]]}, {x, 2 kernels, 1, -1}]];
  66.  
  67. pcr3 = ParallelTable[
  68. ImageTransformation[pic7, fpt, DataRange->{{-1, 1}, {0, 1}},
  69. PlotRange->{{-1, 1}, {-1+(x-1)/kernels, -1+x/kernels}}, Resampling->rsp, Padding->"Periodic"],
  70. {x, 1, 2 kernels}];
  71. pct3 = ImageAssemble[Table[{pcr3[[x]]}, {x, 2 kernels, 1, -1}]];
  72.  
  73. a = 0; ℧ = 0; v0 = 1; q = 0; st = 0.1; vϑ = 0;
  74.  
  75. vθ =-vϑ;
  76. θs = π/2;
  77. θi =-θ0+π;
  78. θ1 = θi;
  79.  
  80. dφv[rt_, tt_] := 0;
  81. shf[rt_, δt_, δr_, δθ_, δφ_] := 1;
  82. ωφ = -vφ Csc[θ1]/r0;
  83. ωθ = -vϑ/r0;
  84.  
  85. gtt = -1;
  86. grr = +1;
  87. gθθ = +r0^2;
  88. gφφ = +r0^2 Sin[θ1]^2;
  89. gtφ = +0;
  90.  
  91. ς = 1;
  92. j[v_] := Sqrt[1-v^2];
  93. nq[x_] := If[NumericQ[x], If[Element[x, Reals], x, 0], 0];
  94.  
  95. U = {-vr, +vθ, +vφ};
  96. γ = 1/Sqrt[1-Norm[U]^2];
  97.  
  98. Xyz[{x_, y_, z_}, α_] := {x Cos[α]-y Sin[α], x Sin[α]+y Cos[α], z};
  99. xYz[{x_, y_, z_}, β_] := {x Cos[β]+z Sin[β], y, z Cos[β]-x Sin[β]};
  100. xyZ[{x_, y_, z_}, ψ_] := {x, y Cos[ψ]-z Sin[ψ], y Sin[ψ]+z Cos[ψ]};
  101.  
  102. raytracer[{Ф_, ϑ_}] :=
  103.  
  104. Quiet[Module[{DGL, sol, εj, pθi, pr0, Q, k, V, W, vw,
  105. vr0i, vθ0i, vφ0i, vr0n, vθ0n, vφ0n, vr0a, vθia, vφ0a, vt0a,
  106. t10, r10, Θ10, Φ10, t, r, θ, φ, τ,
  107. т, т0, т1, т2, т3, т4, т5,
  108. plunge, plunge0, plunge1, plunge2, plunge3,
  109. plunge4, plunge5, plunge6, plunge7,
  110. dθ0, dφ0, δφ0, δθ0, δr0, δt0, tt0, rt0, θt0, φt0,
  111. dθ1, dφ1, δφ1, δθ1, δr1, δt1, tt1, rt1, θt1, φt1,
  112. dθ2, dφ2, δφ2, δθ2, δr2, δt2, tt2, rt2, θt2, φt2,
  113. dθ3, dφ3, δφ3, δθ3, δr3, δt3, tt3, rt3, θt3, φt3,
  114. dθ4, dφ4, δφ4, δθ4, δr4, δt4, tt4, rt4, θt4, φt4,
  115. dθ5, dφ5, δφ5, δθ5, δr5, δt5, tt5, rt5, θt5, φt5,
  116. dθ6, dφ6, δφ6, δθ6, δr6, δt6, tt6, rt6, θt6, φt6,
  117. X, Y, Z, ξ, stepsize, laststep, mtl, ft, fτ, varb,
  118. ft0s, ft1s, ft2s, ft3s, ft4s,
  119. ft0v, ft1v, ft2v, ft3v, ft4v, ft5v,
  120. ft0f, ft1f, ft2f, ft3f, ft4f,
  121. ft5h, ft5b, ft5f},
  122.  
  123. vw=xyZ[Xyz[{0, 1, 0}, ϑ], Ф+π/2];
  124. (* Übersetzung des Einfallswinkels in den lokalen Tetrad *)
  125. vr0a = vw[[3]];
  126. vφ0a = vw[[2]];
  127. vθia = vw[[1]];
  128. (* Betrag *)
  129. vt0a = Sqrt[vr0a^2+vφ0a^2+vθia^2];
  130. (* Normierung *)
  131. vr0n = vr0a/vt0a;
  132. vφ0n = vφ0a/vt0a;
  133. vθ0n = vθia/vt0a;
  134. (* Relativistische Geschwindigkeitsaddition *)
  135. V={vr0n, vθ0n, vφ0n};
  136. W=(U+V+γ/(1+γ)(U\[Cross](U\[Cross]V)))/(1+U.V);
  137. (* Aberration *)
  138. vr0i = W[[1]];
  139. vθ0i = W[[2]];
  140. vφ0i = W[[3]];
  141.  
  142. DGL = { (* Kerr Newman Bewegungsgleichungen *)
  143.  
  144. t''[τ] == 0,
  145. t'[0] == 1,
  146. t[0] == 0,
  147.  
  148. r''[τ] == r[τ](θ'[τ]^2+Sin[θ[τ]]^2 φ'[τ]^2),
  149. r'[0] == vr0i,
  150. r[0] == r0,
  151.  
  152. θ''[τ] == Sin[θ[τ]] Cos[θ[τ]] φ'[τ]^2-2 θ'[τ] r'[τ]/r[τ],
  153. θ'[0] == vθ0i/r0,
  154. θ[0] == θi,
  155.  
  156. φ''[τ] == -2 φ'[τ] (r'[τ]+r[τ] θ'[τ] Cot[θ[τ]])/r[τ],
  157. φ'[0] == vφ0i Csc[θ1]/r0,
  158. φ[0] == φ0,
  159.  
  160. WhenEvent[Mod[θ[τ], π] == π/2.0 && r[τ]>si && r[τ]<sr &&
  161. NumericQ[plunge0] == False,
  162. (plunge0=τ) &&
  163. (tt0=t[τ]) && (rt0=r[τ]) && (θt0=θ[τ]) && (φt0=φ[τ]) &&
  164. (δt0=t'[τ]) && (δr0=r'[τ]) && (δθ0=θ'[τ]) && (δφ0=φ'[τ])],
  165.  
  166. WhenEvent[Mod[θ[τ], π] == π/2.0 && r[τ]>si && r[τ]<sr && Re[θ'[τ]]>0 &&
  167. NumericQ[plunge1] == False,
  168. (plunge1=τ) &&
  169. (tt1=t[τ]) && (rt1=r[τ]) && (θt1=θ[τ]) && (φt1=φ[τ]) &&
  170. (δt1=t'[τ]) && (δr1=r'[τ]) && (δθ1=θ'[τ]) && (δφ1=φ'[τ])],
  171.  
  172. WhenEvent[Mod[θ[τ], π] == π/2.0 && r[τ]>si && r[τ]<sr && Re[θ'[τ]]<0 &&
  173. NumericQ[plunge2] == False,
  174. (plunge2=τ) &&
  175. (tt2=t[τ]) && (rt2=r[τ]) && (θt2=θ[τ]) && (φt2=φ[τ]) &&
  176. (δt2=t'[τ]) && (δr2=r'[τ]) && (δθ2=θ'[τ]) && (δφ2=φ'[τ])],
  177.  
  178. WhenEvent[Mod[θ[τ], π] == π/2.0 && r[τ]>si && r[τ]<sr && Re[θ'[τ]]>0 &&
  179. τ < plunge1-0.05 &&
  180. NumericQ[plunge3]==False && NumericQ[plunge1] == True,
  181. (plunge3=τ) &&
  182. (tt3=t[τ]) && (rt3=r[τ]) && (θt3=θ[τ]) && (φt3=φ[τ]) &&
  183. (δt3=t'[τ]) && (δr3=r'[τ]) && (δθ3=θ'[τ]) && (δφ3=φ'[τ])],
  184.  
  185. WhenEvent[Mod[θ[τ], π] == π/2.0 && r[τ]>si && r[τ]<sr && Re[θ'[τ]]<0 &&
  186. τ < plunge2-0.05 &&
  187. NumericQ[plunge4] == False && NumericQ[plunge2] == True,
  188. (plunge4=τ) &&
  189. (tt4=t[τ]) && (rt4=r[τ]) && (θt4=θ[τ]) && (φt4=φ[τ]) &&
  190. (δt4=t'[τ]) && (δr4=r'[τ]) && (δθ4=θ'[τ]) && (δφ4=φ'[τ])],
  191.  
  192. WhenEvent[Abs[r[τ]] == N@R1 &&
  193. NumericQ[plunge5] == False,
  194. (plunge5=τ) && (tt5=t[τ]) && (rt5=r[τ]) && (θt5=θ[τ]) && (φt5=φ[τ]);
  195. If[r0>R1, "StopIntegration"]],
  196.  
  197. WhenEvent[Abs[r[τ]] == R0||r[τ]>R0 &&
  198. NumericQ[plunge6] == False,
  199. (plunge6=τ) &&
  200. (tt6=t[τ]) && (rt6=r[τ]) && (θt6=θ[τ]) && (φt6=φ[τ]);
  201. "StopIntegration"]
  202.  
  203. };
  204. (* Integrator *)
  205. sol = TimeConstrained[NDSolve[DGL, {t, r, θ, φ}, {τ, 0, tmax},
  206. WorkingPrecision-> wp,
  207. Method-> mta,
  208. MaxSteps-> Infinity,
  209. StepMonitor :> (laststep=plunge7; plunge7=τ;
  210. stepsize=plunge7-laststep;), Method->{"EventLocator",
  211. "Event" :> (If[stepsize<1*^-4, 0, 1])}
  212. ], 10];
  213.  
  214. ft0s=If[NumericQ[plunge0], If[rt0>sr, {π, sr},
  215. If[rt0<si, {π, sr}, {φt0+(tt0+r0) ωφ, rt0}]], {π, sr}];
  216. ft1s=If[NumericQ[plunge1], If[rt1>sr, {π, sr},
  217. If[rt1<si, {π, sr}, {φt1+(tt1+r0) ωφ, rt1}]], {π, sr}];
  218. ft2s=If[NumericQ[plunge2], If[rt2>sr, {π, sr},
  219. If[rt2<si, {π, sr}, {φt2+(tt2+r0) ωφ, rt2}]], {π, sr}];
  220. ft3s=If[NumericQ[plunge3], If[rt3>sr, {π, sr},
  221. If[rt3<si, {π, sr}, {φt3+(tt3+r0) ωφ, rt3}]], {π, sr}];
  222. ft4s=If[NumericQ[plunge4], If[rt4>sr, {π, sr},
  223. If[rt4<si, {π, sr}, {φt4+(tt4+r0) ωφ, rt4}]], {π, sr}];
  224.  
  225. ft0v=If[NumericQ[plunge0], If[rt0>sr, {0, 0},
  226. If[rt0<si, {0, 0}, {-dφv[rt0, tt0+t0], 0}]], {0, 0}];
  227. ft1v=If[NumericQ[plunge1], If[rt1>sr, {0, 0},
  228. If[rt1<si, {0, 0}, {-dφv[rt1, tt1+t0], 0}]], {0, 0}];
  229. ft2v=If[NumericQ[plunge2], If[rt2>sr, {0, 0},
  230. If[rt2<si, {0, 0}, {-dφv[rt2, tt2+t0], 0}]], {0, 0}];
  231. ft3v=If[NumericQ[plunge3], If[rt3>sr, {0, 0},
  232. If[rt3<si, {0, 0}, {-dφv[rt3, tt3+t0], 0}]], {0, 0}];
  233. ft4v=If[NumericQ[plunge4], If[rt4>sr, {0, 0},
  234. If[rt4<si, {0, 0}, {-dφv[rt4, tt4+t0], 0}]], {0, 0}];
  235.  
  236. ft0f=If[NumericQ[plunge0], If[rt0>sr, {0, 0},
  237. If[rt0<si, {0, 0}, {0, Min[2, shf[rt0, δt0, δr0, δθ0, δφ0]]}]], {0, 0}];
  238. ft1f=If[NumericQ[plunge1], If[rt1>sr, {0, 0},
  239. If[rt1<si, {0, 0}, {0, Min[2, shf[rt1, δt1, δr1, δθ1, δφ1]]}]], {0, 0}];
  240. ft2f=If[NumericQ[plunge2], If[rt2>sr, {0, 0},
  241. If[rt2<si, {0, 0}, {0, Min[2, shf[rt2, δt2, δr2, δθ2, δφ2]]}]], {0, 0}];
  242. ft3f=If[NumericQ[plunge3], If[rt3>sr, {0, 0},
  243. If[rt3<si, {0, 0}, {0, Min[2, shf[rt3, δt3, δr3, δθ3, δφ3]]}]], {0, 0}];
  244. ft4f=If[NumericQ[plunge4], If[rt4>sr, {0, 0},
  245. If[rt4<si, {0, 0}, {0, Min[2, shf[rt4, δt4, δr4, δθ4, δφ4]]}]], {0, 0}];
  246.  
  247. ft5h=If[NumericQ[plunge5], {φt5-π, θt5+π/2}, {0, -π/2}];
  248. ft5b=If[NumericQ[plunge6], If[rt6<If[Element[R1, Reals], R1, 0], {0, -π/2},
  249. If[rt6>4 R0, {0, -π/2}, {φt6-π, θt6+π/2}]], {0, -π/2}];
  250.  
  251. {
  252. ft0s, ft1s, ft2s, ft3s, ft4s,
  253. ft0s+ft0v, ft1s+ft1v, ft2s+ft2v, ft3s+ft3v, ft4s+ft4v,
  254. ft0f, ft1f, ft2f, ft3f, ft4f,
  255. ft5h, ft5b
  256. }]];
  257.  
  258. mem : raytrace[{Ф_, ϑ_}] := mem = Quiet[Re[raytracer[{Ф, ϑ}]]];
  259.  
  260. ray01[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[01]];
  261. ray02[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[02]];
  262. ray03[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[03]];
  263. ray04[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[04]];
  264. ray05[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[05]];
  265.  
  266. ray06[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[06]];
  267. ray07[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[07]];
  268. ray08[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[08]];
  269. ray09[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[09]];
  270. ray10[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[10]];
  271.  
  272. ray11[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[11]];
  273. ray12[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[12]];
  274. ray13[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[13]];
  275. ray14[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[14]];
  276. ray15[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[15]];
  277.  
  278. ray16[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[16]];
  279. ray17[{Ф_, ϑ_}] := raytrace[{Ф, ϑ}][[17]];
  280.  
  281. width1 = ImageDimensions[pic1][[1]]; height1 = ImageDimensions[pic1][[2]];
  282. width2 = ImageDimensions[pic2][[1]]; height2 = ImageDimensions[pic2][[2]];
  283. width3 = ImageDimensions[pic3][[1]]; height3 = ImageDimensions[pic3][[2]];
  284. width4 = ImageDimensions[pic4][[1]]; height4 = ImageDimensions[pic4][[2]];
  285. width5 = ImageDimensions[pic7][[1]]; height5 = ImageDimensions[pic7][[2]];
  286.  
  287. hzoom = If[breite>2 hoehe, 1/zoom, 1/zoom/2/hoehe*breite];
  288. vzoom = If[breite>2 hoehe, 1/zoom*2 hoehe/breite, 1/zoom];
  289.  
  290. "Geschätzte Rechenzeit" -> 1.2 (AbsoluteTiming[Do[raytracer[{
  291. RandomReal[{-π, π}]/zoom, RandomReal[{-π/2, π/2}]/zoom
  292. }], {ü, 1, 50}]][[1]])/50*hoehe*breite/kernels/60 "Minuten"
  293.  
  294. FOV->{360.0 hzoom "degree", 180.0 vzoom "degree"}
  295.  
  296. img = ParallelTable[{
  297.  
  298. (* 1 Hintergrundpanorama *)
  299. ImageTransformation[pct1, ray17, {breite, Ceiling[hoehe/kernels/grain]},
  300. DataRange->{
  301. {-π, π-2π/width1},
  302. {-π/2, 3π/2}
  303. },
  304. PlotRange->{
  305. {-π+hvs/hzoom, π+hvs/hzoom} hzoom,
  306. {-π/2+x+vvs/vzoom, -π/2+x+vvs/vzoom+π/kernels/grain} vzoom
  307. },
  308. Resampling->rsp, Padding->"Periodic"],
  309.  
  310. (* 2 Sphäre *)
  311. ImageTransformation[pct2, ray16, {breite, Ceiling[hoehe/kernels/grain]},
  312. DataRange->{
  313. {-π, π-2π/width2},
  314. {-π/2, 3π/2}
  315. },
  316. PlotRange->{
  317. {-π+hvs/hzoom, π+hvs/hzoom} hzoom,
  318. {-π/2+x+vvs/vzoom, -π/2+x+π/kernels/grain+vvs/vzoom} vzoom
  319. },
  320. Resampling->rsp, Padding->"Periodic"],
  321.  
  322. (* 3 Scheibe Textur *)
  323. ImageTransformation[pic3, ray01, {breite, Ceiling[hoehe/kernels/grain]},
  324. DataRange->{
  325. {0, 2π-2π/width3},
  326. {si, sr+(sr-si)/height3}
  327. },
  328. PlotRange->{
  329. {-π+hvs/hzoom, π+hvs/hzoom} hzoom,
  330. {-π/2+vvs/vzoom+x, -π/2+vvs/vzoom+x+π/kernels/grain} vzoom
  331. },
  332. Resampling->rsp, Padding->"Periodic"],
  333.  
  334. (* 4 Scheibe Geometrie *)
  335. ImageTransformation[pic4, ray01, {breite, Ceiling[hoehe/kernels/grain]},
  336. DataRange->{
  337. {0, 2π-2π/width4},
  338. {si, sr}
  339. },
  340. PlotRange->{
  341. {-π+hvs/hzoom, π+hvs/hzoom} hzoom,
  342. {-π/2+vvs/vzoom+x, -π/2+vvs/vzoom+x+π/kernels/grain} vzoom
  343. },
  344. Resampling->rsp, Padding->"Periodic"],
  345.  
  346. (* 5 Hintergrundpanorama *)
  347. ImageTransformation[pct3, ray17, {breite, Ceiling[hoehe/kernels/grain]},
  348. DataRange->{
  349. {-π, π-2π/width5},
  350. {-π/2, 3π/2}
  351. },
  352. PlotRange->{
  353. {-π+hvs/hzoom, π+hvs/hzoom} hzoom,
  354. {-π/2+x+vvs/vzoom, -π/2+x+vvs/vzoom+π/kernels/grain} vzoom
  355. },
  356. Resampling->rsp, Padding->"Periodic"],
  357.  
  358. (* 6 Sphäre *)
  359. ImageTransformation[pct3, ray16, {breite, Ceiling[hoehe/kernels/grain]},
  360. DataRange->{
  361. {-π, π-2π/width5},
  362. {-π/2, 3π/2}
  363. },
  364. PlotRange->{
  365. {-π+hvs/hzoom, π+hvs/hzoom} hzoom,
  366. {-π/2+x+vvs/vzoom, -π/2+x+π/kernels/grain+vvs/vzoom} vzoom
  367. },
  368. Resampling->rsp, Padding->"Periodic"],
  369.  
  370. (* 7 Scheibe Textur komplett *)
  371. ImageTransformation[pic7, ray01, {breite, Ceiling[hoehe/kernels/grain]},
  372. DataRange->{
  373. {0, 2π-2π/width5},
  374. {si, sr+(sr-si)/height5}
  375. },
  376. PlotRange->{
  377. {-π+hvs/hzoom, π+hvs/hzoom} hzoom,
  378. {-π/2+vvs/vzoom+x, -π/2+vvs/vzoom+x+π/kernels/grain} vzoom
  379. },
  380. Resampling->rsp, Padding->"Periodic"]
  381.  
  382. }, {x, 0, π-π/kernels/grain, π/kernels/grain}];
  383.  
  384. image[num_] := ImageAssemble[Table[{img[[x, num]]}, {x, kernels grain, 1, -1}]];
  385. fi[x_] := ColorNegate[x];
  386.  
  387. Grid[{Table[image[n], {n, 1, 7, 1}]}]
  388.  
  389. Quit[]
RAW Paste Data