Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
空の色を計算してみた/calculate-sky-color
Search
kohei.okamoto
August 13, 2021
Science
0
61
空の色を計算してみた/calculate-sky-color
kohei.okamoto
August 13, 2021
Tweet
Share
More Decks by kohei.okamoto
See All by kohei.okamoto
四則演算を理解する/four-arithmetic-operations
koheiokamoto
0
250
ハムスターの回し車の騒音問題に挑んだ話/hamster-LT
koheiokamoto
0
63
俺のオブジェクト指向/20200626LT
koheiokamoto
1
710
経験者がいない状態で、戦略的DDDを現場でやってみた話/ OOC2020
koheiokamoto
7
3.6k
Other Decks in Science
See All in Science
Machine Learning for Materials (Lecture 2)
aronwalsh
0
710
Machine Learning for Materials (Lecture 9)
aronwalsh
0
200
統計的因果探索の方法
sshimizu2006
1
1.1k
Snowflake上でRを使う: RStudioセットアップとShinyアプリケーションのデプロイ
ktatsuya
0
390
小杉考司(専修大学)
kosugitti
2
550
ほたるのひかり/RayTracingCamp10
kugimasa
0
140
20分で分かる Human-in-the-Loop 機械学習におけるアノテーションとヒューマンコンピューターインタラクションの真髄
hurutoriya
4
2.2k
JSol'Ex : traitement d'images solaires en Java
melix
0
100
Science of Scienceおよび科学計量学に関する研究論文の俯瞰可視化_ポスター版
hayataka88
0
120
Machine Learning for Materials (Lecture 8)
aronwalsh
0
410
Snowflakeによる統合バイオインフォマティクス
ktatsuya
0
470
第61回コンピュータビジョン勉強会「BioCLIP: A Vision Foundation Model for the Tree of Life」
x_ttyszk
1
1.5k
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Intergalactic Javascript Robots from Outer Space
tanoku
268
27k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Testing 201, or: Great Expectations
jmmastey
38
7k
A Philosophy of Restraint
colly
203
16k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Typedesign – Prime Four
hannesfritz
39
2.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
Designing for Performance
lara
604
68k
Statistics for Hackers
jakevdp
796
220k
Transcript
ՆٳΈͷࣗ༝ݚڀ ۭͷ৭ΛܭࢉͰٻΊͯΈΔ 2021/08/13 Ԭຊᕣฏ
ࣗݾհɿԬຊ ᕣฏ • ࠇഎܠͷεϥΠυॳઓͰυΩυΩͯ͠·͢ • େֶԽֶͬͯ·ͨ͠ • લ৬ۚ༥ܥͷγεςϜ࡞ͬͯ·ͨ͠ • ࠓOESͷWebνʔϜͰ։ൃ͍ͯ͠·͢
• goͬͨ͜ͱͳ͍ίϯϓϨοΫεͩͬͨͷͰɺࠓճ͡ΊͯgoΛ ৮ͬͯΈ·ͨ͠ (ͱ͍͍ͭͭɺ͓తʹશવίʔυॻ͍ͯ·ͤΜw)
None
;ͱؾʹͳͬͨ ۭͷ৭ͬͯԿ৭ͩΖ͏ɾɾɾʁ
ͦͦɺۭͬͯͳΜͰݟ͑Δͷʁ • ۭؾத͍͍ͩͨૉͱࢎૉ͔ΒͰ͖͍ͯ·͢ɻ • ૉͱࢎૉ͕ଠཅͷޫΛࢄཚ͠·͢ɻ • ͦͷࢄཚͷΈΛϨΠϦʔࢄཚͱ͍͍·͢ɻ
ͦͦɺۭͬͯͳΜͰݟ͑Δͷʁ • ۭؾத͍͍ͩͨૉͱࢎૉ͔ΒͰ͖͍ͯ·͢ɻ • ૉͱࢎૉ͕ଠཅͷޫΛࢄཚ͠·͢ɻ • ͦͷࢄཚͷΈΛϨΠϦʔࢄཚͱ͍͍·͢ɻ • ͳͷͰɺۭؾ͕ͳ͍ͱۭࠇ͍Ͱ͢ɻ
ࢄཚʹ͍Ζ͍Ζ (ͪΐͬͱઢ) • ϨΠϦʔࢄཚ • ޫͷΑΓࡉཻ͔͍ࢠʹର͢Δࢄཚ • ࠓճͬͪ͜ • ϛʔࢄཚ
• ޫͷΑΓେཻ͖͍ࢠʹର͢Δࢄཚ • લํͷࢄཚͷґଘੑ͕গͳ͍ɻͷͰɺશ෦ͷޫ͕ࢄཚ͞ΕͯӢ ന͘Έ͑·͢ɻ
ࠓճͷΞϓϩʔν 1. ଠཅޫͷR / G / BͷޫͷॏͶ߹Θͤͱͯۙ͠ࣅ͢Δɻ 2. R /
G / BͦΕͧΕࢄཚ͞ΕΔޫͷ૬ରΛܭࢉ͢Δ 3. RGBʹ্هͰٻΊͨ૬ରΛೖྗ͢Δ 4. ্هͱ୯ͷޫΛݟൺ͍͍ͯͩͨͷΛٻΊͯΈΔ
ࠓճͷΞϓϩʔν 1. ଠཅޫͷR / G / BͷޫͷॏͶ߹Θͤͱͯۙ͠ࣅ͢Δɻ 2. R /
G / BͦΕͧΕࢄཚ͞ΕΔޫͷ૬ରΛܭࢉ͢Δ 3. RGBʹ্هͰٻΊͨ૬ରΛೖྗ͢Δ 4. ্هͱ୯ͷޫΛݟൺ͍͍ͯͩͨͷΛٻΊͯΈΔ
RGB͍͍ͩͨ 6 : 7 : 8͘Β͍ɾɾɾʁ ग़యɿhttps://www.fondriest.com/environmental-measurements/
ࠓճͷΞϓϩʔν 1. ଠཅޫͷR / G / BͷޫͷॏͶ߹Θͤͱͯۙ͠ࣅ͢Δɻ 2. R /
G / BͦΕͧΕࢄཚ͞ΕΔޫͷ૬ରΛܭࢉ͢Δ 3. RGBʹ্هͰٻΊͨ૬ରΛೖྗ͢Δ 4. ্هͱ୯ͷޫΛݟൺ͍͍ͯͩͨͷΛٻΊͯΈΔ
I = kN(n − 1)2 λ4 ϨΠϦʔࢄཚʹΑΔࢄཚڧ k : ൺྫఆɺN
: ࢠɺn : ۶ંɺЕ:
ࠓճ૬ର͕΄͍͠ͷͰɺదʹఆΛ͔͚ͨ type Light struct { Wavelength in t Intensity in
t } func scatteredLight(light Light) Light { return Light{light.Wavelength, light.Intensity << 40 / (light.Wavelength * light.Wavelength * light.Wavelength * light.Wavelength) } }
͜Μͳײ͡Ͱग़ྗͯ͠RGBΛऔಘ red := Light{700, 6 } green := Light{546, 7
} blue := Light{436, 8 } fmt.Println("sky color!!" ) fmt.Println("red: ", scatteredLight(red) ) fmt.Println("green: ", scatteredLight(green) ) fmt.Println("blue: ", scatteredLight(blue))
͜Μͳײ͡Ͱग़ྗͯ͠RGBΛऔಘ red := Light{700, 6 } green := Light{546, 7
} blue := Light{436, 8 } fmt.Println("sky color!!" ) fmt.Println("red: ", scatteredLight(red) ) fmt.Println("green: ", scatteredLight(green) ) fmt.Println("blue: ", scatteredLight(blue))
ࠓճͷΞϓϩʔν 1. ଠཅޫͷR / G / BͷޫͷॏͶ߹Θͤͱͯۙ͠ࣅ͢Δɻ 2. R /
G / BͦΕͧΕࢄཚ͞ΕΔޫͷ૬ରΛܭࢉ͢Δ 3. RGBʹ্هͰٻΊͨ૬ରΛೖྗ͢Δ 4. ্هͱ୯ͷޫΛݟൺ͍͍ͯͩͨͷΛٻΊͯΈΔ
#1B56F3
ࠓճͷΞϓϩʔν 1. ଠཅޫͷR / G / BͷޫͷॏͶ߹Θͤͱͯۙ͠ࣅ͢Δɻ 2. R /
G / BͦΕͧΕࢄཚ͞ΕΔޫͷ૬ରΛܭࢉ͢Δ 3. RGBʹ্هͰٻΊͨ૬ରΛೖྗ͢Δ 4. ্هͱ୯ͷޫΛݟൺ͍͍ͯͩͨͷΛٻΊͯΈΔ
430nm #3D00FF #1B56F3 440nm #0000FF 450nm #0046FF 460nm #007BFF
430nm #3D00FF 440nm #0000FF 450nm #0046FF 460nm #007BFF ͍͍ͩͨ͜Ε͘Β͍ #1B56F3
450nm #0046FF ͍͍ͩͨ͜Ε͘Β͍ #1B56F3
ۭ৭ #89BDDE 450nm #0046FF ͍͍ͩͨ͜Ε͘Β͍ #1B56F3
·ͱΊ • ݁ߏࡶʹܭࢉͯͦ͠ΕͬΆ͍ײ͡ͷ৭ಋग़Ͱ͖ͯײಈɻ • #1B56F3ɺ͍͍ͩͨ450nm • ্ۭͷۭͷ৭݁ߏͦΕͬΆ͍৭ʹͳͬͯΔͷͰɻ • ͪͳΈʹνϦͳͲ͕ଟ͍բΜͰനͬΆ͘ͳΓ·͢ɻ •
͍ͭͰʹ(?) goͷνϡʔτϦΞϧ͜ΕΛػʹͰ͖ͯΑ͔ͬͨɻ #1B56F3