Add the function for mapping a light color intensity against the position of a LED. master
authorGreg Burri <greg.burri@gmail.com>
Fri, 26 Mar 2021 08:02:07 +0000 (09:02 +0100)
committerGreg Burri <greg.burri@gmail.com>
Fri, 26 Mar 2021 08:02:07 +0000 (09:02 +0100)
doc/intensity_mapping.jl [new file with mode: 0644]

diff --git a/doc/intensity_mapping.jl b/doc/intensity_mapping.jl
new file mode 100644 (file)
index 0000000..3fe42cf
--- /dev/null
@@ -0,0 +1,54 @@
+### A Pluto.jl notebook ###
+# v0.12.21
+
+using Markdown
+using InteractiveUtils
+
+# 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).
+macro bind(def, element)
+    quote
+        local el = $(esc(element))
+        global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : missing
+        el
+    end
+end
+
+# ╔═╡ 3358d5e0-8e06-11eb-07d6-dd032cc37026
+begin
+       using LinearAlgebra, Statistics, Plots, PlutoUI, Images, FileIO
+       default(label = false, minorgrid = true)
+       gr()
+end
+
+# ╔═╡ 2d091510-8e06-11eb-024c-ad66088d8267
+html"<style>main { max-width: 100%; margin-right: 0; }</style>"
+
+# ╔═╡ 6f577550-8e07-11eb-3050-59d41656090a
+@bind reset Button("Reset to default values")
+
+# ╔═╡ dd277270-8e06-11eb-028d-6572609606a0
+let
+       reset
+       md"a: $(@bind a Slider(0:0.01:1; default = 0.5, show_value = true))"
+end
+
+# ╔═╡ 4911f142-8e07-11eb-22bd-8f4afc63d60b
+let
+       reset
+       md"b: $(@bind b Slider(0:0.01:1; default = 0.5, show_value = true))"
+end
+
+# ╔═╡ 3abb8d50-8e06-11eb-3403-99d035b3fefb
+let
+       xₜ(t) = 3*a*t*(1-t)^2 + 3*t^2*(1-t) + t^3
+       yₜ(t) = (3-3*b)*t^2 * (1-t) + t^3
+       plot(xₜ, yₜ, 0, 1, aspect_ratio = 1)
+end
+
+# ╔═╡ Cell order:
+# ╟─2d091510-8e06-11eb-024c-ad66088d8267
+# ╟─3358d5e0-8e06-11eb-07d6-dd032cc37026
+# ╟─dd277270-8e06-11eb-028d-6572609606a0
+# ╟─4911f142-8e07-11eb-22bd-8f4afc63d60b
+# ╟─6f577550-8e07-11eb-3050-59d41656090a
+# ╠═3abb8d50-8e06-11eb-3403-99d035b3fefb