File:Caustics.gif

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Caustics.gif(576 × 356 pixels, file size: 13.69 MB, MIME type: image/gif, looped, 210 frames, 21 s)

Captions

Captions

Refraction from a non-flat surface creates regions of high intensity, where many rays cross, known as caustics.

Summary[edit]

Description
English: When light is refracted from a non-flat surface, it simply happens that there are regions where more rays are passing through, creating very bright spots (or lines) called "caustics".
Date
Source https://twitter.com/j_bertolotti/status/1229743952594640897
Author Jacopo Bertolotti
Permission
(Reusing this file)
https://twitter.com/j_bertolotti/status/1030470604418428929

Mathematica 12.0 code[edit]

n = 2; (*Refractive index of the bottom medium*)
z = 5; (*The bottom of the plot is at zero. This set how high you want to plot*)

h[x_] := 1 + 0.03 Cos[x] + 0.1 Sin[2.1 x] + 0.11 Sin[2.8 x]; (*profile of the refractive medium*)
dh[x_] :=  Evaluate[D[h[x], x]]; (*Derivative of the profile (that locally determines how Snell law works*)
R[x_] := x + (z - h[x]) dh[x] (n Sqrt[1 - (n^2 - 1) dh[x]^2] - 1)/(1 - (n^2 - 1) dh[x]^2); (*Where the ray ends up*)
Show[
 Plot[h[x], {x, 0, 2 \[Pi]}, Background -> Black, PlotStyle -> {Gray}, Filling -> Axis, PlotRange -> {0, z}, Axes -> False, FillingStyle -> Gray],
 Graphics[{
   Yellow, Thick, Opacity[0.1], Table[{Line[{{y, 0}, {y, h[y]}}], Line[{{y, h[y]}, If[Im[R[y]] == 0, {R[y], z}, {y, h[y]}]}]}, {y, 0, 2 \[Pi], 0.02}]
   }]
 , ImageSize -> Large
 ] (*Plot of the caustics*)

(*Generate the animation*)
listy =  RandomSample@Table[y, {y, 0, 2 \[Pi], 0.015}]; (*Randomize the order the rays appear*)
dim =  Dimensions[listy][[1]];
p1 = Table[
  Show[
   Plot[h[x], {x, 0, 2 \[Pi]}, Background -> Black, PlotStyle -> {Gray}, Filling -> Axis, PlotRange -> {0, z},  Axes -> False, FillingStyle -> Gray],
   Graphics[{
     Yellow, Thick, Opacity[0.15], Table[{Line[{{y, 0}, {y, h[y]}}], Line[{{y, h[y]}, If[Im[R[y]] == 0, {R[y], z}, {y, h[y]}]}]}, {y, listy[[1 ;; k]]}]
     }]
   , ImageSize -> Large ]
  , {k, 1, dim, 2}]; (*Plot every two frames, otherwise the animation is too heavy*)
ListAnimate[p1]

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current09:33, 19 February 2020Thumbnail for version as of 09:33, 19 February 2020576 × 356 (13.69 MB)Berto (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata