Add the function for mapping a light color intensity against the position of a LED.
[case_light.git] / doc / intensity_mapping.jl
1 ### A Pluto.jl notebook ###
2 # v0.12.21
3
4 using Markdown
5 using InteractiveUtils
6
7 # This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
8 macro bind(def, element)
9     quote
10         local el = $(esc(element))
11         global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : missing
12         el
13     end
14 end
15
16 # ╔═╡ 3358d5e0-8e06-11eb-07d6-dd032cc37026
17 begin
18         using LinearAlgebra, Statistics, Plots, PlutoUI, Images, FileIO
19         default(label = false, minorgrid = true)
20         gr()
21 end
22
23 # ╔═╡ 2d091510-8e06-11eb-024c-ad66088d8267
24 html"<style>main { max-width: 100%; margin-right: 0; }</style>"
25
26 # ╔═╡ 6f577550-8e07-11eb-3050-59d41656090a
27 @bind reset Button("Reset to default values")
28
29 # ╔═╡ dd277270-8e06-11eb-028d-6572609606a0
30 let
31         reset
32         md"a: $(@bind a Slider(0:0.01:1; default = 0.5, show_value = true))"
33 end
34
35 # ╔═╡ 4911f142-8e07-11eb-22bd-8f4afc63d60b
36 let
37         reset
38         md"b: $(@bind b Slider(0:0.01:1; default = 0.5, show_value = true))"
39 end
40
41 # ╔═╡ 3abb8d50-8e06-11eb-3403-99d035b3fefb
42 let
43         xₜ(t) = 3*a*t*(1-t)^2 + 3*t^2*(1-t) + t^3
44         yₜ(t) = (3-3*b)*t^2 * (1-t) + t^3
45         plot(xₜ, yₜ, 0, 1, aspect_ratio = 1)
46 end
47
48 # ╔═╡ Cell order:
49 # ╟─2d091510-8e06-11eb-024c-ad66088d8267
50 # ╟─3358d5e0-8e06-11eb-07d6-dd032cc37026
51 # ╟─dd277270-8e06-11eb-028d-6572609606a0
52 # ╟─4911f142-8e07-11eb-22bd-8f4afc63d60b
53 # ╟─6f577550-8e07-11eb-3050-59d41656090a
54 # ╠═3abb8d50-8e06-11eb-3403-99d035b3fefb