デジタル数字の作り方
スライダーn=1~10、点C、数値ratioを所与として、以下の数式は、nに対応するデジタル数字を返す。
RemoveUndefined(Zip(If(γ, β, ?), β, {Translate(Rotate(Dilate(Polygon(Zip(C + α ratio, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, C), 90°, C), (-9, 9) ratio), Translate(Rotate(Dilate(Polygon(Zip(C + α ratio, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, C), 90°, C), (-9, -9) ratio), Translate(Dilate(Polygon(Zip(C + α ratio, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, C), (0, 18) ratio), Dilate(Polygon(Zip(C + α ratio, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, C), Translate(Dilate(Polygon(Zip(C + α ratio, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, C), (0, -18) ratio), Translate(Rotate(Dilate(Polygon(Zip(C + α ratio, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, C), 90°, C), (9, 9) ratio), Translate(Rotate(Dilate(Polygon(Zip(C + α ratio, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, C), 90°, C), (9, -9) ratio)}, γ, Element(Zip(Zip(IsDefined(IndexOf(δ, ε)), δ, {1, 2, 3, 4, 5, 6, 7}), ε, {{6, 7}, {2, 3, 4, 5, 6}, {3, 4, 5, 6, 7}, {1, 4, 6, 7}, {1, 3, 4, 5, 7}, {1, 2, 3, 4, 5, 7}, {3, 6, 7}, {1, 2, 3, 4, 5, 6, 7}, {1, 3, 4, 5, 6, 7}, {1, 2, 3, 5, 6, 7}}), n)))
サンプル
整数number, 点A, 数値ratioを所与として、以下の数式は、numberに対応するデジタル数字を描画する。やや重いのが欠点。
Zip(RemoveUndefined(Zip(If(γ, β, ?), β, {Translate(Rotate(Dilate(Polygon(Zip(λ + α ratio 0.02, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, λ), 90°, λ), (-9, 9) ratio 0.02), Translate(Rotate(Dilate(Polygon(Zip(λ + α ratio 0.02, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, λ), 90°, λ), (-9, -9) ratio 0.02), Translate(Dilate(Polygon(Zip(λ + α ratio 0.02, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, λ), (0, 18) ratio 0.02), Dilate(Polygon(Zip(λ + α ratio 0.02, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, λ), Translate(Dilate(Polygon(Zip(λ + α ratio 0.02, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, λ), (0, -18) ratio 0.02), Translate(Rotate(Dilate(Polygon(Zip(λ + α ratio 0.02, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, λ), 90°, λ), (9, 9) ratio 0.02), Translate(Rotate(Dilate(Polygon(Zip(λ + α ratio 0.02, α, {(-9, 0), (-7, -2), (7, -2), (9, 0), (7, 2), (-7, 2)})), 0.9, λ), 90°, λ), (9, -9) ratio 0.02)}, γ, Element(Zip(Zip(IsDefined(IndexOf(δ, ε)), δ, {1, 2, 3, 4, 5, 6, 7}), ε, {{6, 7}, {2, 3, 4, 5, 6}, {3, 4, 5, 6, 7}, {1, 4, 6, 7}, {1, 3, 4, 5, 7}, {1, 2, 3, 4, 5, 7}, {3, 6, 7}, {1, 2, 3, 4, 5, 6, 7}, {1, 3, 4, 5, 6, 7}, {1, 2, 3, 5, 6, 7}}), κ))), κ, Zip(IndexOf(η, {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}), η, Reverse(Sequence(Take(Text(number), ζ, ζ), ζ, 1, Length(Text(number))))), λ, Sequence(A + θ (-18, 0) ratio 0.03, θ, 0, Length(Text(number)) - 1))