Skip to content

Commit

Permalink
doc: basic example
Browse files Browse the repository at this point in the history
  • Loading branch information
miRoox committed Nov 21, 2020
1 parent 4b423a5 commit b8f8897
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,26 @@ To use some light field data types, you need to add [Unitful.jl](https://painter
```julia
Pkg.add("Unitful")
```

## Basic Examples

Draw a cross hole and its diffraction pattern:

```@example
using OpticalPropagation
using Unitful
using Plots
cross = MonoLightField2D(
[Int((abs(x)<10 && abs(y)<50) || (abs(x)<50 && abs(y)<10)) for y in -200:199, x in -200:199],
wavelength=632.8u"nm",
size=(1u"mm",1u"mm")
)
patt = angularspectrum(cross, 1u"cm")
plot(
plot(cross, size=(420,400)),
plot(patt, size=(420,400)),
size=(840,400)
)
```

0 comments on commit b8f8897

Please sign in to comment.