From 5f57f5689bf92e0b02b1cb90af6814f5fcbca434 Mon Sep 17 00:00:00 2001 From: Greg Burri Date: Fri, 26 Mar 2021 09:02:07 +0100 Subject: [PATCH 1/1] Add the function for mapping a light color intensity against the position of a LED. --- doc/intensity_mapping.jl | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 doc/intensity_mapping.jl diff --git a/doc/intensity_mapping.jl b/doc/intensity_mapping.jl new file mode 100644 index 0000000..3fe42cf --- /dev/null +++ b/doc/intensity_mapping.jl @@ -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"" + +# ╔═╡ 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 -- 2.43.0